Changeset 05ae7081 in mainline
- Timestamp:
- 2007-11-16T16:24:05Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9cc0d7c
- Parents:
- 454889c
- Files:
-
- 2 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/Makefile.inc
r454889c r05ae7081 100 100 arch/$(ARCH)/src/trap/exception.c \ 101 101 arch/$(ARCH)/src/trap/interrupt.c \ 102 arch/$(ARCH)/src/trap/syscall.c \103 102 arch/$(ARCH)/src/ddi/ddi.c \ 104 103 arch/$(ARCH)/src/drivers/tick.c \ -
kernel/arch/sparc64/include/stack.h
r454889c r05ae7081 47 47 48 48 /** 49 * Six extended words for first six arguments. 50 */ 51 #define STACK_ARG_SAVE_AREA_SIZE (6 * STACK_ITEM_SIZE) 52 53 /** 49 54 * By convention, the actual top of the stack is %sp + STACK_BIAS. 50 55 */ 51 56 #define STACK_BIAS 2047 57 58 /* 59 * Offsets of arguments on stack. 60 */ 61 #define STACK_ARG0 0 62 #define STACK_ARG1 8 63 #define STACK_ARG2 16 64 #define STACK_ARG3 24 65 #define STACK_ARG4 32 66 #define STACK_ARG5 40 67 #define STACK_ARG6 48 52 68 53 69 #endif -
kernel/arch/sparc64/include/trap/syscall.h
r454889c r05ae7081 46 46 47 47 .macro TRAP_INSTRUCTION n 48 mov TT_TRAP_INSTRUCTION(\n), %g249 sethi %hi(syscall), %g150 48 ba trap_instruction_handler 51 or %g1, %lo(syscall), %g149 mov TT_TRAP_INSTRUCTION(\n) - TT_TRAP_INSTRUCTION(0), %g2 52 50 .endm 53 51 -
kernel/arch/sparc64/include/trap/trap_table.h
r454889c r05ae7081 78 78 79 79 /* 80 * The following needs to be in sync with the 81 * definition of the istate structure. 80 * The following needs to be in sync with the definition of the istate 81 * structure. The one STACK_ITEM_SIZE is counted for space holding the 7th 82 * argument to syscall_handler (i.e. syscall number) and the other 83 * STACK_ITEM_SIZE is counted because of the required alignment. 82 84 */ 83 #define PREEMPTIBLE_HANDLER_STACK_FRAME_SIZE (STACK_WINDOW_SAVE_AREA_SIZE+(12*8)) 84 #define SAVED_TSTATE -(1*8) 85 #define SAVED_TPC -(2*8) 86 #define SAVED_TNPC -(3*8) /* <-- istate_t begins here */ 87 #define SAVED_Y -(4*8) 88 #define SAVED_I0 -(5*8) 89 #define SAVED_I1 -(6*8) 90 #define SAVED_I2 -(7*8) 91 #define SAVED_I3 -(8*8) 92 #define SAVED_I4 -(9*8) 93 #define SAVED_I5 -(10*8) 94 #define SAVED_I6 -(11*8) 95 #define SAVED_I7 -(12*8) 85 #define PREEMPTIBLE_HANDLER_STACK_FRAME_SIZE \ 86 (STACK_WINDOW_SAVE_AREA_SIZE + STACK_ARG_SAVE_AREA_SIZE + \ 87 (2 * STACK_ITEM_SIZE) + (12 * 8)) 88 #define SAVED_TSTATE -(1 * 8) 89 #define SAVED_TPC -(2 * 8) 90 #define SAVED_TNPC -(3 * 8) /* <-- istate_t begins here */ 91 #define SAVED_Y -(4 * 8) 92 #define SAVED_I0 -(5 * 8) 93 #define SAVED_I1 -(6 * 8) 94 #define SAVED_I2 -(7 * 8) 95 #define SAVED_I3 -(8 * 8) 96 #define SAVED_I4 -(9 * 8) 97 #define SAVED_I5 -(10 * 8) 98 #define SAVED_I6 -(11 * 8) 99 #define SAVED_I7 -(12 * 8) 96 100 97 101 .macro PREEMPTIBLE_HANDLER f -
kernel/arch/sparc64/src/trap/trap_table.S
r454889c r05ae7081 644 644 * 645 645 * Input registers: 646 * %g1 Address of function to call .646 * %g1 Address of function to call if this is not a syscall. 647 647 * %g2 First argument for the function. 648 648 * %g6 Pre-set as kernel stack base if trap from userspace. … … 698 698 * Copy arguments for the syscall to the new window. 699 699 */ 700 mov %i0, %o2 701 mov %i1, %o3 702 mov %i2, %o4 703 mov %i3, %o5 700 mov %i0, %o0 701 mov %i1, %o1 702 mov %i2, %o2 703 mov %i3, %o3 704 mov %i4, %o4 705 mov %i5, %o5 704 706 .endif 705 707 … … 741 743 */ 742 744 mov %g1, %l0 745 .if NOT(\is_syscall) 743 746 mov %g2, %o0 747 .else 748 ! store the syscall number on the stack as 7th argument 749 stx %g2, [%sp + STACK_WINDOW_SAVE_AREA_SIZE + STACK_BIAS + STACK_ARG6] 750 .endif 744 751 745 752 /* … … 768 775 SAVE_GLOBALS 769 776 777 .if NOT(\is_syscall) 770 778 /* 771 779 * Call the higher-level handler and pass istate as second parameter. … … 773 781 call %l0 774 782 add %sp, PREEMPTIBLE_HANDLER_STACK_FRAME_SIZE + STACK_BIAS + SAVED_TNPC, %o1 775 776 .if \is_syscall 777 /* 778 * Copy the value returned by the syscall. 779 */ 780 mov %o0, %i0 783 .else 784 /* 785 * Call the higher-level syscall handler. 786 */ 787 call syscall_handler 788 nop 789 mov %o0, %i0 ! copy the value returned by the syscall 781 790 .endif 782 791 -
uspace/lib/libc/arch/sparc64/include/syscall.h
r454889c r05ae7081 40 40 41 41 static inline sysarg_t 42 __syscall(const sysarg_t p1, const sysarg_t p2, const sysarg_t p3, const sysarg_t p4, const syscall_t id) 42 __syscall(const sysarg_t p1, const sysarg_t p2, const sysarg_t p3, 43 const sysarg_t p4, const sysarg_t p5, const sysarg_t p6, const syscall_t id) 43 44 { 44 45 register uint64_t a1 asm("o0") = p1; … … 46 47 register uint64_t a3 asm("o2") = p3; 47 48 register uint64_t a4 asm("o3") = p4; 49 register uint64_t a5 asm("o4") = p5; 50 register uint64_t a6 asm("o5") = p6; 48 51 49 52 asm volatile ( 50 "ta % 5\n"53 "ta %7\n" 51 54 : "=r" (a1) 52 : "r" (a1), "r" (a2), "r" (a3), "r" (a4), "i" (id) 55 : "r" (a1), "r" (a2), "r" (a3), "r" (a4), "r" (a5), "r" (a6), 56 "i" (id) 53 57 : "memory" 54 58 );
Note:
See TracChangeset
for help on using the changeset viewer.