2024-09-09 08:52:07 +00:00
|
|
|
#ifndef __ASM_STACKTRACE_H
|
|
|
|
#define __ASM_STACKTRACE_H
|
|
|
|
|
2024-09-09 08:57:42 +00:00
|
|
|
#include <asm/ptrace.h>
|
|
|
|
|
2024-09-09 08:52:07 +00:00
|
|
|
struct stackframe {
|
2024-09-09 08:57:42 +00:00
|
|
|
/*
|
|
|
|
* FP member should hold R7 when CONFIG_THUMB2_KERNEL is enabled
|
|
|
|
* and R11 otherwise.
|
|
|
|
*/
|
2024-09-09 08:52:07 +00:00
|
|
|
unsigned long fp;
|
|
|
|
unsigned long sp;
|
|
|
|
unsigned long lr;
|
|
|
|
unsigned long pc;
|
|
|
|
};
|
|
|
|
|
2024-09-09 08:57:42 +00:00
|
|
|
static __always_inline
|
|
|
|
void arm_get_current_stackframe(struct pt_regs *regs, struct stackframe *frame)
|
|
|
|
{
|
|
|
|
frame->fp = frame_pointer(regs);
|
|
|
|
frame->sp = regs->ARM_sp;
|
|
|
|
frame->lr = regs->ARM_lr;
|
|
|
|
frame->pc = regs->ARM_pc;
|
|
|
|
}
|
|
|
|
|
2024-09-09 08:52:07 +00:00
|
|
|
extern int unwind_frame(struct stackframe *frame);
|
|
|
|
extern void walk_stackframe(struct stackframe *frame,
|
|
|
|
int (*fn)(struct stackframe *, void *), void *data);
|
|
|
|
|
|
|
|
#endif /* __ASM_STACKTRACE_H */
|