diff options
| author | <jgarzik@pretzel.yyz.us> | 2005-06-04 00:40:40 -0400 |
|---|---|---|
| committer | Jeff Garzik <jgarzik@pobox.com> | 2005-06-04 00:40:40 -0400 |
| commit | ae20ea8525a80a863f70d332cf47b71bd9f54c1f (patch) | |
| tree | 9d3cedeb65db521a8436b545bd91641549a18d24 /arch/um/kernel/sysrq.c | |
| parent | f497ba735fc9ff4e35a19641143708b3be1c7061 (diff) | |
| parent | 8be3de3fd8469154a2b3e18a4712032dac5b4a53 (diff) | |
Automatic merge of /spare/repo/linux-2.6/.git branch HEAD
Diffstat (limited to 'arch/um/kernel/sysrq.c')
| -rw-r--r-- | arch/um/kernel/sysrq.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/arch/um/kernel/sysrq.c b/arch/um/kernel/sysrq.c index e630438f9e73..f80850091e79 100644 --- a/arch/um/kernel/sysrq.c +++ b/arch/um/kernel/sysrq.c | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | * Licensed under the GPL | 3 | * Licensed under the GPL |
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | #include "linux/config.h" | ||
| 6 | #include "linux/sched.h" | 7 | #include "linux/sched.h" |
| 7 | #include "linux/kernel.h" | 8 | #include "linux/kernel.h" |
| 8 | #include "linux/module.h" | 9 | #include "linux/module.h" |
| @@ -12,14 +13,14 @@ | |||
| 12 | #include "sysrq.h" | 13 | #include "sysrq.h" |
| 13 | #include "user_util.h" | 14 | #include "user_util.h" |
| 14 | 15 | ||
| 15 | void show_trace(unsigned long * stack) | 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) | ||
| 16 | { | 19 | { |
| 17 | /* XXX: Copy the CONFIG_FRAME_POINTER stack-walking backtrace from | ||
| 18 | * arch/i386/kernel/traps.c, and then move this to sys-i386/sysrq.c.*/ | ||
| 19 | unsigned long addr; | 20 | unsigned long addr; |
| 20 | 21 | ||
| 21 | if (!stack) { | 22 | if (!stack) { |
| 22 | stack = (unsigned long*) &stack; | 23 | stack = (unsigned long*) &stack; |
| 23 | WARN_ON(1); | 24 | WARN_ON(1); |
| 24 | } | 25 | } |
| 25 | 26 | ||
| @@ -35,6 +36,7 @@ void show_trace(unsigned long * stack) | |||
| 35 | } | 36 | } |
| 36 | printk("\n"); | 37 | printk("\n"); |
| 37 | } | 38 | } |
| 39 | #endif | ||
| 38 | 40 | ||
| 39 | /* | 41 | /* |
| 40 | * stack dumps generator - this is used by arch-independent code. | 42 | * stack dumps generator - this is used by arch-independent code. |
| @@ -44,7 +46,7 @@ void dump_stack(void) | |||
| 44 | { | 46 | { |
| 45 | unsigned long stack; | 47 | unsigned long stack; |
| 46 | 48 | ||
| 47 | show_trace(&stack); | 49 | show_trace(current, &stack); |
| 48 | } | 50 | } |
| 49 | EXPORT_SYMBOL(dump_stack); | 51 | EXPORT_SYMBOL(dump_stack); |
| 50 | 52 | ||
| @@ -59,7 +61,11 @@ void show_stack(struct task_struct *task, unsigned long *esp) | |||
| 59 | int i; | 61 | int i; |
| 60 | 62 | ||
| 61 | if (esp == NULL) { | 63 | if (esp == NULL) { |
| 62 | if (task != current) { | 64 | if (task != current && task != NULL) { |
| 65 | /* XXX: Isn't this bogus? I.e. isn't this the | ||
| 66 | * *userspace* stack of this task? If not so, use this | ||
| 67 | * even when task == current (as in i386). | ||
| 68 | */ | ||
| 63 | esp = (unsigned long *) KSTK_ESP(task); | 69 | esp = (unsigned long *) KSTK_ESP(task); |
| 64 | /* Which one? No actual difference - just coding style.*/ | 70 | /* Which one? No actual difference - just coding style.*/ |
| 65 | //esp = (unsigned long *) PT_REGS_IP(&task->thread.regs); | 71 | //esp = (unsigned long *) PT_REGS_IP(&task->thread.regs); |
| @@ -77,5 +83,6 @@ void show_stack(struct task_struct *task, unsigned long *esp) | |||
| 77 | printk("%08lx ", *stack++); | 83 | printk("%08lx ", *stack++); |
| 78 | } | 84 | } |
| 79 | 85 | ||
| 80 | show_trace(esp); | 86 | printk("Call Trace: \n"); |
| 87 | show_trace(current, esp); | ||
| 81 | } | 88 | } |
