[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 <phdm@macqel.be>.

Signed-off-by: Greg Ungerer <gerg@uclinux.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Greg Ungerer
2005-09-02 10:42:52 +10:00
committed by Linus Torvalds
parent 5d052c170e
commit db81fb8486

View File

@@ -21,6 +21,7 @@
#include <linux/signal.h> #include <linux/signal.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/module.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/a.out.h> #include <linux/a.out.h>
#include <linux/user.h> #include <linux/user.h>
@@ -38,7 +39,7 @@
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/siginfo.h> #include <asm/siginfo.h>
static char *vec_names[] = { static char const * const vec_names[] = {
"RESET SP", "RESET PC", "BUS ERROR", "ADDRESS ERROR", "RESET SP", "RESET PC", "BUS ERROR", "ADDRESS ERROR",
"ILLEGAL INSTRUCTION", "ZERO DIVIDE", "CHK", "TRAPcc", "ILLEGAL INSTRUCTION", "ZERO DIVIDE", "CHK", "TRAPcc",
"PRIVILEGE VIOLATION", "TRACE", "LINE 1010", "LINE 1111", "PRIVILEGE VIOLATION", "TRACE", "LINE 1010", "LINE 1111",
@@ -106,17 +107,20 @@ asmlinkage void buserr_c(struct frame *fp)
int kstack_depth_to_print = 48; 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; extern char _start, _etext;
int i; int i;
if (esp == NULL) if (!stack) {
esp = (unsigned long *) &esp; if (task)
stack = (unsigned long *)task->thread.ksp;
else
stack = (unsigned long *)&stack;
}
stack = esp; addr = (unsigned long) stack;
addr = (unsigned long) esp;
endstack = (unsigned long *) PAGE_ALIGN(addr); endstack = (unsigned long *) PAGE_ALIGN(addr);
printk(KERN_EMERG "Stack from %08lx:", (unsigned long)stack); printk(KERN_EMERG "Stack from %08lx:", (unsigned long)stack);
@@ -306,6 +310,8 @@ void dump_stack(void)
show_stack(current, &stack); show_stack(current, &stack);
} }
EXPORT_SYMBOL(dump_stack);
#ifdef CONFIG_M68KFPU_EMU #ifdef CONFIG_M68KFPU_EMU
asmlinkage void fpemu_signal(int signal, int code, void *addr) asmlinkage void fpemu_signal(int signal, int code, void *addr)
{ {