Changes in / [7c8e1e1:3500f75] in mainline
- Location:
- kernel/arch/sparc64
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/include/asm.h
r7c8e1e1 r3500f75 446 446 extern void asm_delay_loop(const uint32_t usec); 447 447 448 extern uint64_t read_from_ag_g6(void);449 448 extern uint64_t read_from_ag_g7(void); 450 449 extern void write_to_ag_g6(uint64_t val); -
kernel/arch/sparc64/include/trap/trap_table.h
r7c8e1e1 r3500f75 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 istate46 * structure. The one STACK_ITEM_SIZE is counted for space holding the 7th47 * argument to syscall_handler (i.e. syscall number) and the other48 * 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 66 44 #ifndef __ASM__ 67 45 … … 99 77 .endm 100 78 79 /* 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. 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 a %xcc,preemptible_handler103 b preemptible_handler 104 104 or %g1, %lo(\f), %g1 105 105 .endm -
kernel/arch/sparc64/src/debug/stacktrace.c
r7c8e1e1 r3500f75 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 #endif46 47 #define FRAME_OFFSET_FP_PREV 1448 #define FRAME_OFFSET_RA 1549 50 extern void alloc_window_and_flush(void);51 52 39 bool kernel_frame_pointer_validate(uintptr_t fp) 53 40 { 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; 41 return false; 68 42 } 69 43 70 44 bool kernel_frame_pointer_prev(uintptr_t fp, uintptr_t *prev) 71 45 { 72 uint64_t *stack = (void *) fp; 73 alloc_window_and_flush(); 74 *prev = stack[FRAME_OFFSET_FP_PREV] + STACK_BIAS; 75 return true; 46 return false; 76 47 } 77 48 78 49 bool kernel_return_address_get(uintptr_t fp, uintptr_t *ra) 79 50 { 80 uint64_t *stack = (void *) fp; 81 alloc_window_and_flush(); 82 *ra = stack[FRAME_OFFSET_RA]; 83 return true; 51 return false; 84 52 } 85 53 -
kernel/arch/sparc64/src/debug/stacktrace_asm.S
r7c8e1e1 r3500f75 27 27 # 28 28 29 #include <arch/stack.h>30 31 29 .text 32 30 33 31 .global frame_pointer_get 34 32 .global program_counter_get 35 .global alloc_window_and_flush36 33 37 34 frame_pointer_get: 38 # Add the stack bias to %sp to get the actual address.39 35 retl 40 add %sp, STACK_BIAS, %o036 nop 41 37 42 38 program_counter_get: 43 39 retl 44 mov %o7, %o040 nop 45 41 46 alloc_window_and_flush:47 save %sp, -(STACK_WINDOW_SAVE_AREA_SIZE+STACK_ARG_SAVE_AREA_SIZE), %sp48 # Flush all other windows to memory so that we can read their contents.49 flushw50 ret51 restore52 -
kernel/arch/sparc64/src/sun4u/asm.S
r7c8e1e1 r3500f75 67 67 WRITE_ALTERNATE_REGISTER %g6, PSTATE_IG_BIT 68 68 69 .global read_from_ag_g670 read_from_ag_g6:71 READ_ALTERNATE_REGISTER %g6, PSTATE_AG_BIT72 73 69 .global read_from_ag_g7 74 70 read_from_ag_g7: -
kernel/arch/sparc64/src/sun4v/start.S
r7c8e1e1 r3500f75 219 219 ! on APs skip executing the following code 220 220 cmp %l7, 0 221 be %xcc,1f221 be 1f 222 222 nop 223 223 … … 260 260 261 261 0: 262 ba %xcc,0b262 ba 0b 263 263 nop 264 264 … … 295 295 /* Not reached. */ 296 296 0: 297 ba %xcc,0b297 ba 0b 298 298 nop 299 299 … … 314 314 before_ap_boots: 315 315 setx 0x80400000, %g0, %o0 316 ba %xcc,kernel_image_start316 ba kernel_image_start 317 317 nop 318 318 -
kernel/arch/sparc64/src/trap/sun4v/trap_table.S
r7c8e1e1 r3500f75 71 71 .org trap_table + TT_INSTRUCTION_ACCESS_MMU_MISS*ENTRY_SIZE 72 72 .global instruction_access_mmu_miss_handler_tl0 73 ba %xcc,fast_instruction_access_mmu_miss_handler_tl073 ba 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 %xcc,fast_data_access_mmu_miss_handler_tl0189 ba 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 %xcc,trap_instruction_handler396 ba 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 %xcc,fast_instruction_access_mmu_miss_handler_tl0416 ba 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 %xcc,fast_data_access_mmu_miss_handler_tl1500 ba fast_data_access_mmu_miss_handler_tl1 501 501 nop 502 502 … … 787 787 be 1f 788 788 nop 789 0: ba %xcc, 0b! this is for debugging, if we ever get here789 0: ba 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 %xcc,5b984 ba 5b 985 985 inc %g4 986 986 … … 1066 1066 1067 1067 PREEMPTIBLE_HANDLER_KERNEL 1068 ba %xcc,101f1068 ba 101f 1069 1069 nop 1070 1070
Note:
See TracChangeset
for help on using the changeset viewer.