[ALSA] Remove trailing whitespaces from soc/* files
[linux-2.6/verdex.git] / arch / sparc64 / kernel / stacktrace.c
blobc4d15f2762b9e37579b73bc3e11e6219682b65b8
1 #include <linux/sched.h>
2 #include <linux/stacktrace.h>
3 #include <linux/thread_info.h>
4 #include <asm/ptrace.h>
6 void save_stack_trace(struct stack_trace *trace, struct task_struct *task)
8 unsigned long ksp, fp, thread_base;
9 struct thread_info *tp;
11 if (!task)
12 task = current;
13 tp = task_thread_info(task);
14 if (task == current) {
15 flushw_all();
16 __asm__ __volatile__(
17 "mov %%fp, %0"
18 : "=r" (ksp)
20 } else
21 ksp = tp->ksp;
23 fp = ksp + STACK_BIAS;
24 thread_base = (unsigned long) tp;
25 do {
26 struct reg_window *rw;
28 /* Bogus frame pointer? */
29 if (fp < (thread_base + sizeof(struct thread_info)) ||
30 fp >= (thread_base + THREAD_SIZE))
31 break;
33 rw = (struct reg_window *) fp;
34 if (trace->skip > 0)
35 trace->skip--;
36 else
37 trace->entries[trace->nr_entries++] = rw->ins[7];
39 fp = rw->ins[6] + STACK_BIAS;
40 } while (trace->nr_entries < trace->max_entries);