Changes in / [3500f75:7c8e1e1] in mainline
- Location:
- kernel/arch/sparc64
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/include/asm.h
r3500f75 r7c8e1e1 446 446 extern void asm_delay_loop(const uint32_t usec); 447 447 448 extern uint64_t read_from_ag_g6(void); 448 449 extern uint64_t read_from_ag_g7(void); 449 450 extern void write_to_ag_g6(uint64_t val); -
kernel/arch/sparc64/include/trap/trap_table.h
r3500f75 r7c8e1e1 42 42 #define TRAP_TABLE_SIZE (TRAP_TABLE_ENTRY_COUNT * TRAP_TABLE_ENTRY_SIZE) 43 43 44 /* 45 * The following needs to be in sync with the definition of the istate 46 * structure. The one STACK_ITEM_SIZE is counted for space holding the 7th 47 * argument to syscall_handler (i.e. syscall number) and the other 48 * STACK_ITEM_SIZE is counted because of the required alignment. 49 */ 50 #define PREEMPTIBLE_HANDLER_STACK_FRAME_SIZE \ 51 (STACK_WINDOW_SAVE_AREA_SIZE + STACK_ARG_SAVE_AREA_SIZE + \ 52 (2 * STACK_ITEM_SIZE) + (12 * 8)) 53 #define SAVED_TSTATE -(1 * 8) 54 #define SAVED_TPC -(2 * 8) 55 #define SAVED_TNPC -(3 * 8) /* <-- istate_t begins here */ 56 #define SAVED_Y -(4 * 8) 57 #define SAVED_I0 -(5 * 8) 58 #define SAVED_I1 -(6 * 8) 59 #define SAVED_I2 -(7 * 8) 60 #define SAVED_I3 -(8 * 8) 61 #define SAVED_I4 -(9 * 8) 62 #define SAVED_I5 -(10 * 8) 63 #define SAVED_I6 -(11 * 8) 64 #define SAVED_I7 -(12 * 8) 65 44 66 #ifndef __ASM__ 45 67 … … 77 99 .endm 78 100 79 /*80 * The following needs to be in sync with the definition of the istate81 * structure. The one STACK_ITEM_SIZE is counted for space holding the 7th82 * argument to syscall_handler (i.e. syscall number) and the other83 * STACK_ITEM_SIZE is counted because of the required alignment.84 */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)100 101 101 .macro PREEMPTIBLE_HANDLER f 102 102 sethi %hi(\f), %g1 103 b preemptible_handler103 ba %xcc, preemptible_handler 104 104 or %g1, %lo(\f), %g1 105 105 .endm -
kernel/arch/sparc64/src/debug/stacktrace.c
r3500f75 r7c8e1e1 37 37 #include <typedefs.h> 38 38 39 #include <arch.h> 40 #include <arch/stack.h> 41 #include <arch/trap/trap_table.h> 42 43 #if defined(SUN4V) 44 #include <arch/sun4v/arch.h> 45 #endif 46 47 #define FRAME_OFFSET_FP_PREV 14 48 #define FRAME_OFFSET_RA 15 49 50 extern void alloc_window_and_flush(void); 51 39 52 bool kernel_frame_pointer_validate(uintptr_t fp) 40 53 { 41 return false; 54 uintptr_t kstack; 55 56 #if defined(SUN4U) 57 kstack = read_from_ag_g6(); 58 #elif defined(SUN4V) 59 kstack = asi_u64_read(ASI_SCRATCHPAD, SCRATCHPAD_KSTACK); 60 #endif 61 62 kstack += STACK_BIAS; 63 kstack -= PREEMPTIBLE_HANDLER_STACK_FRAME_SIZE; 64 65 if (THREAD && (fp == kstack)) 66 return false; 67 return fp != 0; 42 68 } 43 69 44 70 bool kernel_frame_pointer_prev(uintptr_t fp, uintptr_t *prev) 45 71 { 46 return false; 72 uint64_t *stack = (void *) fp; 73 alloc_window_and_flush(); 74 *prev = stack[FRAME_OFFSET_FP_PREV] + STACK_BIAS; 75 return true; 47 76 } 48 77 49 78 bool kernel_return_address_get(uintptr_t fp, uintptr_t *ra) 50 79 { 51 return false; 80 uint64_t *stack = (void *) fp; 81 alloc_window_and_flush(); 82 *ra = stack[FRAME_OFFSET_RA]; 83 return true; 52 84 } 53 85 -
kernel/arch/sparc64/src/debug/stacktrace_asm.S
r3500f75 r7c8e1e1 27 27 # 28 28 29 #include <arch/stack.h> 30 29 31 .text 30 32 31 33 .global frame_pointer_get 32 34 .global program_counter_get 35 .global alloc_window_and_flush 33 36 34 37 frame_pointer_get: 38 # Add the stack bias to %sp to get the actual address. 35 39 retl 36 nop40 add %sp, STACK_BIAS, %o0 37 41 38 42 program_counter_get: 39 43 retl 40 nop44 mov %o7, %o0 41 45 46 alloc_window_and_flush: 47 save %sp, -(STACK_WINDOW_SAVE_AREA_SIZE+STACK_ARG_SAVE_AREA_SIZE), %sp 48 # Flush all other windows to memory so that we can read their contents. 49 flushw 50 ret 51 restore 52 -
kernel/arch/sparc64/src/sun4u/asm.S
r3500f75 r7c8e1e1 67 67 WRITE_ALTERNATE_REGISTER %g6, PSTATE_IG_BIT 68 68 69 .global read_from_ag_g6 70 read_from_ag_g6: 71 READ_ALTERNATE_REGISTER %g6, PSTATE_AG_BIT 72 69 73 .global read_from_ag_g7 70 74 read_from_ag_g7: -
kernel/arch/sparc64/src/sun4v/start.S
r3500f75 r7c8e1e1 219 219 ! on APs skip executing the following code 220 220 cmp %l7, 0 221 be 1f221 be %xcc, 1f 222 222 nop 223 223 … … 260 260 261 261 0: 262 ba 0b262 ba %xcc, 0b 263 263 nop 264 264 … … 295 295 /* Not reached. */ 296 296 0: 297 ba 0b297 ba %xcc, 0b 298 298 nop 299 299 … … 314 314 before_ap_boots: 315 315 setx 0x80400000, %g0, %o0 316 ba kernel_image_start316 ba %xcc, kernel_image_start 317 317 nop 318 318 -
kernel/arch/sparc64/src/trap/sun4v/trap_table.S
r3500f75 r7c8e1e1 71 71 .org trap_table + TT_INSTRUCTION_ACCESS_MMU_MISS*ENTRY_SIZE 72 72 .global instruction_access_mmu_miss_handler_tl0 73 ba fast_instruction_access_mmu_miss_handler_tl073 ba %xcc, fast_instruction_access_mmu_miss_handler_tl0 74 74 nop 75 75 … … 187 187 .global data_access_mmu_miss_tl0 188 188 data_access_mmu_miss_tl0: 189 ba fast_data_access_mmu_miss_handler_tl0189 ba %xcc, fast_data_access_mmu_miss_handler_tl0 190 190 nop 191 191 … … 394 394 .global trap_instruction_\cur\()_tl0 395 395 trap_instruction_\cur\()_tl0: 396 ba trap_instruction_handler396 ba %xcc, trap_instruction_handler 397 397 mov \cur, %g2 398 398 .endr … … 414 414 .global instruction_access_mmu_miss_handler_tl1 415 415 wrpr %g0, 1, %tl 416 ba fast_instruction_access_mmu_miss_handler_tl0416 ba %xcc, fast_instruction_access_mmu_miss_handler_tl0 417 417 nop 418 418 … … 498 498 .global data_access_mmu_miss_tl1 499 499 data_access_mmu_miss_tl1: 500 ba fast_data_access_mmu_miss_handler_tl1500 ba %xcc, fast_data_access_mmu_miss_handler_tl1 501 501 nop 502 502 … … 787 787 be 1f 788 788 nop 789 0: ba 0b! this is for debugging, if we ever get here789 0: ba %xcc, 0b ! this is for debugging, if we ever get here 790 790 nop ! it will be easy to find 791 791 … … 982 982 wrpr %g3, 0, %cwp ! switch to the preceeding window 983 983 984 ba 5b984 ba %xcc, 5b 985 985 inc %g4 986 986 … … 1066 1066 1067 1067 PREEMPTIBLE_HANDLER_KERNEL 1068 ba 101f1068 ba %xcc, 101f 1069 1069 nop 1070 1070
Note:
See TracChangeset
for help on using the changeset viewer.