1 #ifndef _ASM_X86_UNWIND_H
2 #define _ASM_X86_UNWIND_H
4 #include <linux/sched.h>
5 #include <linux/ftrace.h>
6 #include <asm/ptrace.h>
7 #include <asm/stacktrace.h>
10 struct stack_info stack_info;
11 unsigned long stack_mask;
12 struct task_struct *task;
14 #ifdef CONFIG_FRAME_POINTER
21 void __unwind_start(struct unwind_state *state, struct task_struct *task,
22 struct pt_regs *regs, unsigned long *first_frame);
24 bool unwind_next_frame(struct unwind_state *state);
26 unsigned long unwind_get_return_address(struct unwind_state *state);
28 static inline bool unwind_done(struct unwind_state *state)
30 return state->stack_info.type == STACK_TYPE_UNKNOWN;
34 void unwind_start(struct unwind_state *state, struct task_struct *task,
35 struct pt_regs *regs, unsigned long *first_frame)
37 first_frame = first_frame ? : get_stack_pointer(task, regs);
39 __unwind_start(state, task, regs, first_frame);
42 #ifdef CONFIG_FRAME_POINTER
45 unsigned long *unwind_get_return_address_ptr(struct unwind_state *state)
47 if (unwind_done(state))
53 #else /* !CONFIG_FRAME_POINTER */
56 unsigned long *unwind_get_return_address_ptr(struct unwind_state *state)
61 #endif /* CONFIG_FRAME_POINTER */
63 #endif /* _ASM_X86_UNWIND_H */