]>
git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blob - arch/x86/kernel/unwind_guess.c
1 #include <linux/sched.h>
2 #include <linux/ftrace.h>
3 #include <asm/ptrace.h>
4 #include <asm/bitops.h>
5 #include <asm/stacktrace.h>
6 #include <asm/unwind.h>
8 bool unwind_next_frame(struct unwind_state
*state
)
10 struct stack_info
*info
= &state
->stack_info
;
12 if (unwind_done(state
))
16 for (state
->sp
++; state
->sp
< info
->end
; state
->sp
++)
17 if (__kernel_text_address(*state
->sp
))
20 state
->sp
= info
->next_sp
;
22 } while (!get_stack_info(state
->sp
, state
->task
, info
,
27 EXPORT_SYMBOL_GPL(unwind_next_frame
);
29 void __unwind_start(struct unwind_state
*state
, struct task_struct
*task
,
30 struct pt_regs
*regs
, unsigned long *first_frame
)
32 memset(state
, 0, sizeof(*state
));
35 state
->sp
= first_frame
;
37 get_stack_info(first_frame
, state
->task
, &state
->stack_info
,
40 if (!__kernel_text_address(*first_frame
))
41 unwind_next_frame(state
);
43 EXPORT_SYMBOL_GPL(__unwind_start
);