upgrade to linux 2.6.10-1.12_FC2
[linux-2.6.git] / arch / um / kernel / sysrq.c
1 /* 
2  * Copyright (C) 2001 Jeff Dike (jdike@karaya.com)
3  * Licensed under the GPL
4  */
5
6 #include "linux/sched.h"
7 #include "linux/kernel.h"
8 #include "linux/module.h"
9 #include "linux/kallsyms.h"
10 #include "asm/page.h"
11 #include "asm/processor.h"
12 #include "sysrq.h"
13 #include "user_util.h"
14
15 void show_trace(unsigned long * stack)
16 {
17         /* XXX: Copy the CONFIG_FRAME_POINTER stack-walking backtrace from
18          * arch/i386/kernel/traps.c. */
19         unsigned long addr;
20
21         if (!stack)
22                 stack = (unsigned long*) &stack;
23
24         printk("Call Trace: \n");
25         while (((long) stack & (THREAD_SIZE-1)) != 0) {
26                 addr = *stack++;
27                 if (__kernel_text_address(addr)) {
28                         printk(" [<%08lx>]", addr);
29                         print_symbol(" %s", addr);
30                         printk("\n");
31                 }
32         }
33         printk("\n");
34 }
35
36 /*
37  * The architecture-independent dump_stack generator
38  */
39 void dump_stack(void)
40 {
41         unsigned long stack;
42
43         show_trace(&stack);
44 }
45 EXPORT_SYMBOL(dump_stack);
46
47 void show_stack(struct task_struct *task, unsigned long *sp)
48 {
49         show_trace(sp);
50 }