ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[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 "asm/page.h"
10 #include "asm/processor.h"
11 #include "sysrq.h"
12 #include "user_util.h"
13
14 void show_trace(unsigned long * stack)
15 {
16         int i;
17         unsigned long addr;
18
19         if (!stack)
20                 stack = (unsigned long*) &stack;
21
22         printk("Call Trace: ");
23         i = 1;
24         while (((long) stack & (THREAD_SIZE-1)) != 0) {
25                 addr = *stack++;
26                 if (kernel_text_address(addr)) {
27                         if (i && ((i % 6) == 0))
28                                 printk("\n   ");
29                         printk("[<%08lx>] ", addr);
30                         i++;
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 /*
48  * Overrides for Emacs so that we follow Linus's tabbing style.
49  * Emacs will notice this stuff at the end of the file and automatically
50  * adjust the settings for this buffer only.  This must remain at the end
51  * of the file.
52  * ---------------------------------------------------------------------------
53  * Local variables:
54  * c-file-style: "linux"
55  * End:
56  */