Changes in / [439ba77:fd608dc] in mainline
- Location:
- kernel/arch/arm32
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm32/Makefile.inc
r439ba77 rfd608dc 38 38 ATSIGN = % 39 39 40 GCC_CFLAGS += -fno-zero-initialized-in-bss 40 GCC_CFLAGS += -fno-zero-initialized-in-bss -mapcs-frame 41 41 42 42 BITS = 32 -
kernel/arch/arm32/include/context.h
r439ba77 rfd608dc 43 43 #define SP_DELTA (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT)) 44 44 45 #define context_set(c, _pc, stack, size) \ 46 do { \ 47 (c)->pc = (uintptr_t) (_pc); \ 48 (c)->sp = ((uintptr_t) (stack)) + (size) - SP_DELTA; \ 49 (c)->fp = 0; \ 50 } while (0) 51 45 52 #ifndef __ASM__ 46 53 … … 62 69 uint32_t r9; 63 70 uint32_t r10; 64 uint32_t r11;71 uint32_t fp; /* r11 */ 65 72 66 73 ipl_t ipl; -
kernel/arch/arm32/include/exception.h
r439ba77 rfd608dc 102 102 uint32_t r9; 103 103 uint32_t r10; 104 uint32_t r11;104 uint32_t fp; 105 105 uint32_t r12; 106 106 … … 135 135 static inline unative_t istate_get_fp(istate_t *istate) 136 136 { 137 return istate-> r11;137 return istate->fp; 138 138 } 139 139 -
kernel/arch/arm32/src/debug/stacktrace.c
r439ba77 rfd608dc 38 38 #include <typedefs.h> 39 39 40 #define FRAME_OFFSET_FP_PREV -3 41 #define FRAME_OFFSET_RA -1 42 40 43 bool kernel_frame_pointer_validate(uintptr_t fp) 41 44 { 42 return f alse;45 return fp != 0; 43 46 } 44 47 45 48 bool kernel_frame_pointer_prev(uintptr_t fp, uintptr_t *prev) 46 49 { 47 return false; 50 uint32_t *stack = (void *) fp; 51 52 *prev = stack[FRAME_OFFSET_FP_PREV]; 53 return true; 48 54 } 49 55 50 56 bool kernel_return_address_get(uintptr_t fp, uintptr_t *ra) 51 57 { 52 return false; 58 uint32_t *stack = (void *) fp; 59 60 *ra = stack[FRAME_OFFSET_RA]; 61 return true; 53 62 } 54 63 55 64 bool uspace_frame_pointer_validate(uintptr_t fp) 56 65 { 57 return f alse;66 return fp != 0; 58 67 } 59 68 60 69 bool uspace_frame_pointer_prev(uintptr_t fp, uintptr_t *prev) 61 70 { 62 return false; 71 return !copy_from_uspace((void *) prev, 72 (uint32_t *) fp + FRAME_OFFSET_FP_PREV, sizeof(*prev)); 63 73 } 64 74 65 75 bool uspace_return_address_get(uintptr_t fp, uintptr_t *ra) 66 76 { 67 return false; 77 return !copy_from_uspace((void *) ra, (uint32_t *) fp + FRAME_OFFSET_RA, 78 sizeof(*ra)); 68 79 } 69 80 -
kernel/arch/arm32/src/debug/stacktrace_asm.S
r439ba77 rfd608dc 33 33 34 34 frame_pointer_get: 35 mov r0, fp 35 36 mov pc, lr 36 37 37 38 program_counter_get: 39 mov r0, lr 38 40 mov pc, lr -
kernel/arch/arm32/src/exc_handler.S
r439ba77 rfd608dc 123 123 stmfd r13!, {r2} 124 124 2: 125 # Stop stack traces here 126 mov fp, #0 125 127 .endm 126 128 -
kernel/arch/arm32/src/exception.c
r439ba77 rfd608dc 42 42 #include <print.h> 43 43 #include <syscall/syscall.h> 44 #include <stacktrace.h> 44 45 45 46 #ifdef MACHINE_testarm … … 183 184 printf(" r4: %x r5: %x r6: %x r7: %x\n", 184 185 istate->r4, istate->r5, istate->r6, istate->r7); 185 printf(" r8: %x r8: %x r10: %x r11: %x\n",186 istate->r8, istate->r9, istate->r10, istate-> r11);186 printf(" r8: %x r8: %x r10: %x fp: %x\n", 187 istate->r8, istate->r9, istate->r10, istate->fp); 187 188 printf(" r12: %x sp: %x lr: %x spsr: %x\n", 188 189 istate->r12, istate->sp, istate->lr, istate->spsr); 189 190 190 191 printf(" pc: %x\n", istate->pc); 192 193 stack_trace_istate(istate); 191 194 } 192 195 -
kernel/arch/arm32/src/mm/page_fault.c
r439ba77 rfd608dc 181 181 182 182 if (ret == AS_PF_FAULT) { 183 fault_if_from_uspace(istate, "Page fault: %#x.", badvaddr); 183 184 print_istate(istate); 184 185 printf("page fault - pc: %x, va: %x, status: %x(%x), " … … 186 187 access); 187 188 188 fault_if_from_uspace(istate, "Page fault: %#x.", badvaddr);189 189 panic("Page fault."); 190 190 } -
kernel/arch/arm32/src/start.S
r439ba77 rfd608dc 69 69 bl arch_pre_main 70 70 71 # 72 # Create the first stack frame. 73 # 74 mov fp, #0 75 mov ip, sp 76 push {fp, ip, lr, pc} 77 sub fp, ip, #4 78 71 79 bl main_bsp 72 80
Note:
See TracChangeset
for help on using the changeset viewer.