Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset afd0106 in mainline


Ignore:
Timestamp:
2010-01-13T16:47:53Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
1298da25
Parents:
405f759
Message:

Add support for kernel stack traces on arm32.

Location:
kernel/arch/arm32
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/arm32/Makefile.inc

    r405f759 rafd0106  
    3838ATSIGN = %
    3939
    40 GCC_CFLAGS += -fno-zero-initialized-in-bss
     40GCC_CFLAGS += -fno-zero-initialized-in-bss -mapcs-frame
    4141
    4242BITS = 32
  • kernel/arch/arm32/src/debug/stacktrace.c

    r405f759 rafd0106  
    3838#include <typedefs.h>
    3939
     40#define FRAME_OFFSET_FP_PREV    -3
     41#define FRAME_OFFSET_RA         -1
     42
    4043bool kernel_frame_pointer_validate(uintptr_t fp)
    4144{
    42         return false;
     45        return fp != 0;
    4346}
    4447
    4548bool kernel_frame_pointer_prev(uintptr_t fp, uintptr_t *prev)
    4649{
    47         return false;
     50        uint32_t *stack = (void *) fp;
     51
     52        *prev = stack[FRAME_OFFSET_FP_PREV];
     53        return true;
    4854}
    4955
    5056bool kernel_return_address_get(uintptr_t fp, uintptr_t *ra)
    5157{
    52         return false;
     58        uint32_t *stack = (void *) fp;
     59
     60        *ra = stack[FRAME_OFFSET_RA];
     61        return true;
    5362}
    5463
    5564bool uspace_frame_pointer_validate(uintptr_t fp)
    5665{
    57         return false;
     66        return fp != 0;
    5867}
    5968
    6069bool uspace_frame_pointer_prev(uintptr_t fp, uintptr_t *prev)
    6170{
    62         return false;
     71        return !copy_from_uspace((void *) prev,
     72            (uint32_t *) fp + FRAME_OFFSET_FP_PREV, sizeof(*prev));
    6373}
    6474
    6575bool uspace_return_address_get(uintptr_t fp, uintptr_t *ra)
    6676{
    67         return false;
     77        return !copy_from_uspace((void *) ra, (uint32_t *) fp + FRAME_OFFSET_RA,
     78            sizeof(*ra));
    6879}
    6980
  • kernel/arch/arm32/src/debug/stacktrace_asm.S

    r405f759 rafd0106  
    3333
    3434frame_pointer_get:
     35        mov r0, fp
    3536        mov pc, lr
    3637
    3738program_counter_get:
     39        mov r0, lr
    3840        mov pc, lr
Note: See TracChangeset for help on using the changeset viewer.