8 #include <linux/sched.h>
11 #include <linux/module.h>
13 static unsigned long save_context_stack(
struct stack_trace *
trace,
25 if (sp < low || sp > high)
31 trace->entries[trace->nr_entries++] =
addr;
34 if (trace->nr_entries >= trace->max_entries)
40 if (sp <= low || sp > high -
sizeof(*sf))
45 sp = (
unsigned long)(sf + 1);
46 if (sp <= low || sp > high -
sizeof(*regs))
52 trace->entries[trace->nr_entries++] =
addr;
56 if (trace->nr_entries >= trace->max_entries)
65 register unsigned long sp
asm (
"15");
66 unsigned long orig_sp, new_sp;
69 new_sp = save_context_stack(trace, orig_sp,
72 if (new_sp != orig_sp)
74 new_sp = save_context_stack(trace, new_sp,
77 if (new_sp != orig_sp)
79 save_context_stack(trace, new_sp,
92 save_context_stack(trace, sp, low, high, 0);
93 if (trace->nr_entries < trace->max_entries)
94 trace->entries[trace->nr_entries++] =
ULONG_MAX;