[PATCH] spufs: fix allocation on 64k pages
[linux-2.6/sactl.git] / arch / um / kernel / sysrq.c
blobb331e970002ffe29c4d8db3d97c0d42a0084e525
1 /*
2 * Copyright (C) 2001 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
6 #include "linux/config.h"
7 #include "linux/sched.h"
8 #include "linux/kernel.h"
9 #include "linux/module.h"
10 #include "linux/kallsyms.h"
11 #include "asm/page.h"
12 #include "asm/processor.h"
13 #include "sysrq.h"
14 #include "user_util.h"
16 /* Catch non-i386 SUBARCH's. */
17 #if !defined(CONFIG_UML_X86) || defined(CONFIG_64BIT)
18 void show_trace(struct task_struct *task, unsigned long * stack)
20 unsigned long addr;
22 if (!stack) {
23 stack = (unsigned long*) &stack;
24 WARN_ON(1);
27 printk("Call Trace: \n");
28 while (((long) stack & (THREAD_SIZE-1)) != 0) {
29 addr = *stack;
30 if (__kernel_text_address(addr)) {
31 printk("%08lx: [<%08lx>]", (unsigned long) stack, addr);
32 print_symbol(" %s", addr);
33 printk("\n");
35 stack++;
37 printk("\n");
39 #endif
42 * stack dumps generator - this is used by arch-independent code.
43 * And this is identical to i386 currently.
45 void dump_stack(void)
47 unsigned long stack;
49 show_trace(current, &stack);
51 EXPORT_SYMBOL(dump_stack);
53 /*Stolen from arch/i386/kernel/traps.c */
54 static int kstack_depth_to_print = 24;
56 /* This recently started being used in arch-independent code too, as in
57 * kernel/sched.c.*/
58 void show_stack(struct task_struct *task, unsigned long *esp)
60 unsigned long *stack;
61 int i;
63 if (esp == NULL) {
64 if (task != current && task != NULL) {
65 esp = (unsigned long *) KSTK_ESP(task);
66 } else {
67 esp = (unsigned long *) &esp;
71 stack = esp;
72 for(i = 0; i < kstack_depth_to_print; i++) {
73 if (kstack_end(stack))
74 break;
75 if (i && ((i % 8) == 0))
76 printk("\n ");
77 printk("%08lx ", *stack++);
80 printk("Call Trace: \n");
81 show_trace(task, esp);