x86: remove ioapic_force
[linux-2.6/mini2440.git] / arch / sparc64 / kernel / stacktrace.c
blob4e21d4a57d3b3f2ea536ed5707d61fbf6bc94181
1 #include <linux/sched.h>
2 #include <linux/stacktrace.h>
3 #include <linux/thread_info.h>
4 #include <linux/module.h>
5 #include <asm/ptrace.h>
6 #include <asm/stacktrace.h>
8 #include "kstack.h"
10 void save_stack_trace(struct stack_trace *trace)
12 struct thread_info *tp = task_thread_info(current);
13 unsigned long ksp, fp;
15 stack_trace_flush();
17 __asm__ __volatile__(
18 "mov %%fp, %0"
19 : "=r" (ksp)
22 fp = ksp + STACK_BIAS;
23 do {
24 struct sparc_stackf *sf;
25 struct pt_regs *regs;
26 unsigned long pc;
28 if (!kstack_valid(tp, fp))
29 break;
31 sf = (struct sparc_stackf *) fp;
32 regs = (struct pt_regs *) (sf + 1);
34 if (kstack_is_trap_frame(tp, regs)) {
35 if (!(regs->tstate & TSTATE_PRIV))
36 break;
37 pc = regs->tpc;
38 fp = regs->u_regs[UREG_I6] + STACK_BIAS;
39 } else {
40 pc = sf->callers_pc;
41 fp = (unsigned long)sf->fp + STACK_BIAS;
44 if (trace->skip > 0)
45 trace->skip--;
46 else
47 trace->entries[trace->nr_entries++] = pc;
48 } while (trace->nr_entries < trace->max_entries);
50 EXPORT_SYMBOL_GPL(save_stack_trace);