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