From db81fb8486563573aca023dac30a2d70c46855e8 Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Fri, 2 Sep 2005 10:42:52 +1000 Subject: [PATCH] m68knommu: cleanup showstack() Make show_stack() consistent with other architectures. Put the vector string names in the .rodata section. Patch originally submitted by Philippe De Muyter . Signed-off-by: Greg Ungerer Signed-off-by: Linus Torvalds --- arch/m68knommu/kernel/traps.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'arch') diff --git a/arch/m68knommu/kernel/traps.c b/arch/m68knommu/kernel/traps.c index ad7dc6347f1..5bc06846286 100644 --- a/arch/m68knommu/kernel/traps.c +++ b/arch/m68knommu/kernel/traps.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -38,7 +39,7 @@ #include #include -static char *vec_names[] = { +static char const * const vec_names[] = { "RESET SP", "RESET PC", "BUS ERROR", "ADDRESS ERROR", "ILLEGAL INSTRUCTION", "ZERO DIVIDE", "CHK", "TRAPcc", "PRIVILEGE VIOLATION", "TRACE", "LINE 1010", "LINE 1111", @@ -106,17 +107,20 @@ asmlinkage void buserr_c(struct frame *fp) int kstack_depth_to_print = 48; -void show_stack(struct task_struct *task, unsigned long *esp) +void show_stack(struct task_struct *task, unsigned long *stack) { - unsigned long *stack, *endstack, addr; + unsigned long *endstack, addr; extern char _start, _etext; int i; - if (esp == NULL) - esp = (unsigned long *) &esp; + if (!stack) { + if (task) + stack = (unsigned long *)task->thread.ksp; + else + stack = (unsigned long *)&stack; + } - stack = esp; - addr = (unsigned long) esp; + addr = (unsigned long) stack; endstack = (unsigned long *) PAGE_ALIGN(addr); printk(KERN_EMERG "Stack from %08lx:", (unsigned long)stack); @@ -306,6 +310,8 @@ void dump_stack(void) show_stack(current, &stack); } +EXPORT_SYMBOL(dump_stack); + #ifdef CONFIG_M68KFPU_EMU asmlinkage void fpemu_signal(int signal, int code, void *addr) { -- cgit v1.2.3-18-g5258