Catalin Marinas | 2d7c11b | 2009-02-11 13:07:53 +0100 | [diff] [blame] | 1 | #ifndef __ASM_STACKTRACE_H |
| 2 | #define __ASM_STACKTRACE_H |
| 3 | |
Nikolay Borisov | 9865f1d | 2014-06-03 19:48:10 +0100 | [diff] [blame] | 4 | #include <asm/ptrace.h> |
| 5 | |
Catalin Marinas | 2d7c11b | 2009-02-11 13:07:53 +0100 | [diff] [blame] | 6 | struct stackframe { |
Nikolay Borisov | 9865f1d | 2014-06-03 19:48:10 +0100 | [diff] [blame] | 7 | /* |
| 8 | * FP member should hold R7 when CONFIG_THUMB2_KERNEL is enabled |
| 9 | * and R11 otherwise. |
| 10 | */ |
Catalin Marinas | 2d7c11b | 2009-02-11 13:07:53 +0100 | [diff] [blame] | 11 | unsigned long fp; |
| 12 | unsigned long sp; |
| 13 | unsigned long lr; |
| 14 | unsigned long pc; |
| 15 | }; |
| 16 | |
Nikolay Borisov | 9865f1d | 2014-06-03 19:48:10 +0100 | [diff] [blame] | 17 | static __always_inline |
| 18 | void arm_get_current_stackframe(struct pt_regs *regs, struct stackframe *frame) |
| 19 | { |
| 20 | frame->fp = frame_pointer(regs); |
| 21 | frame->sp = regs->ARM_sp; |
| 22 | frame->lr = regs->ARM_lr; |
| 23 | frame->pc = regs->ARM_pc; |
| 24 | } |
| 25 | |
Catalin Marinas | 2d7c11b | 2009-02-11 13:07:53 +0100 | [diff] [blame] | 26 | extern int unwind_frame(struct stackframe *frame); |
| 27 | extern void walk_stackframe(struct stackframe *frame, |
| 28 | int (*fn)(struct stackframe *, void *), void *data); |
| 29 | |
| 30 | #endif /* __ASM_STACKTRACE_H */ |