stacktrace.h 703 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef __ASM_STACKTRACE_H
  2. #define __ASM_STACKTRACE_H
  3. #include <asm/ptrace.h>
  4. struct stackframe {
  5. /*
  6. * FP member should hold R7 when CONFIG_THUMB2_KERNEL is enabled
  7. * and R11 otherwise.
  8. */
  9. unsigned long fp;
  10. unsigned long sp;
  11. unsigned long lr;
  12. unsigned long pc;
  13. };
  14. static __always_inline
  15. void arm_get_current_stackframe(struct pt_regs *regs, struct stackframe *frame)
  16. {
  17. frame->fp = frame_pointer(regs);
  18. frame->sp = regs->ARM_sp;
  19. frame->lr = regs->ARM_lr;
  20. frame->pc = regs->ARM_pc;
  21. }
  22. extern int unwind_frame(struct stackframe *frame);
  23. extern void walk_stackframe(struct stackframe *frame,
  24. int (*fn)(struct stackframe *, void *), void *data);
  25. #endif /* __ASM_STACKTRACE_H */