Commit 4ce40a47 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] m68knommu cleanup traps.c (printk and dump_stack)

From: <gerg@snapgear.com>

Add type to all printk calls in m68knommu traps.c.  Also added a modern
dump_stack function.
parent b5a15efc
...@@ -72,15 +72,15 @@ void die_if_kernel(char *str, struct pt_regs *fp, int nr) ...@@ -72,15 +72,15 @@ void die_if_kernel(char *str, struct pt_regs *fp, int nr)
return; return;
console_verbose(); console_verbose();
printk("%s: %08x\n",str,nr); printk(KERN_EMERG "%s: %08x\n",str,nr);
printk("PC: [<%08lx>]\nSR: %04x SP: %p a2: %08lx\n", printk(KERN_EMERG "PC: [<%08lx>]\nSR: %04x SP: %p a2: %08lx\n",
fp->pc, fp->sr, fp, fp->a2); fp->pc, fp->sr, fp, fp->a2);
printk("d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n", printk(KERN_EMERG "d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n",
fp->d0, fp->d1, fp->d2, fp->d3); fp->d0, fp->d1, fp->d2, fp->d3);
printk("d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n", printk(KERN_EMERG "d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n",
fp->d4, fp->d5, fp->a0, fp->a1); fp->d4, fp->d5, fp->a0, fp->a1);
printk("Process %s (pid: %d, stackpage=%08lx)\n", printk(KERN_EMERG "Process %s (pid: %d, stackpage=%08lx)\n",
current->comm, current->pid, PAGE_SIZE+(unsigned long)current); current->comm, current->pid, PAGE_SIZE+(unsigned long)current);
show_stack(NULL, (unsigned long *)fp); show_stack(NULL, (unsigned long *)fp);
do_exit(SIGSEGV); do_exit(SIGSEGV);
...@@ -93,12 +93,12 @@ asmlinkage void buserr_c(struct frame *fp) ...@@ -93,12 +93,12 @@ asmlinkage void buserr_c(struct frame *fp)
current->thread.esp0 = (unsigned long) fp; current->thread.esp0 = (unsigned long) fp;
#if DEBUG #if DEBUG
printk ("*** Bus Error *** Format is %x\n", fp->ptregs.format); printk (KERN_DEBUG "*** Bus Error *** Format is %x\n", fp->ptregs.format);
#endif #endif
die_if_kernel("bad frame format",&fp->ptregs,0); die_if_kernel("bad frame format",&fp->ptregs,0);
#if DEBUG #if DEBUG
printk("Unknown SIGSEGV - 4\n"); printk(KERN_DEBUG "Unknown SIGSEGV - 4\n");
#endif #endif
force_sig(SIGSEGV, current); force_sig(SIGSEGV, current);
} }
...@@ -119,16 +119,16 @@ void show_stack(struct task_struct *task, unsigned long *esp) ...@@ -119,16 +119,16 @@ void show_stack(struct task_struct *task, unsigned long *esp)
addr = (unsigned long) esp; addr = (unsigned long) esp;
endstack = (unsigned long *) PAGE_ALIGN(addr); endstack = (unsigned long *) PAGE_ALIGN(addr);
printk("Stack from %08lx:", (unsigned long)stack); printk(KERN_EMERG "Stack from %08lx:", (unsigned long)stack);
for (i = 0; i < kstack_depth_to_print; i++) { for (i = 0; i < kstack_depth_to_print; i++) {
if (stack + 1 > endstack) if (stack + 1 > endstack)
break; break;
if (i % 8 == 0) if (i % 8 == 0)
printk("\n "); printk(KERN_EMERG "\n ");
printk(" %08lx", *stack++); printk(KERN_EMERG " %08lx", *stack++);
} }
printk("\nCall Trace:"); printk(KERN_EMERG "\nCall Trace:");
i = 0; i = 0;
while (stack + 1 <= endstack) { while (stack + 1 <= endstack) {
addr = *stack++; addr = *stack++;
...@@ -143,26 +143,26 @@ void show_stack(struct task_struct *task, unsigned long *esp) ...@@ -143,26 +143,26 @@ void show_stack(struct task_struct *task, unsigned long *esp)
if (((addr >= (unsigned long) &_start) && if (((addr >= (unsigned long) &_start) &&
(addr <= (unsigned long) &_etext))) { (addr <= (unsigned long) &_etext))) {
if (i % 4 == 0) if (i % 4 == 0)
printk("\n "); printk(KERN_EMERG "\n ");
printk(" [<%08lx>]", addr); printk(KERN_EMERG " [<%08lx>]", addr);
i++; i++;
} }
} }
printk("\n"); printk(KERN_EMERG "\n");
} }
void bad_super_trap(struct frame *fp) void bad_super_trap(struct frame *fp)
{ {
console_verbose(); console_verbose();
if (fp->ptregs.vector < 4*sizeof(vec_names)/sizeof(vec_names[0])) if (fp->ptregs.vector < 4*sizeof(vec_names)/sizeof(vec_names[0]))
printk ("*** %s *** FORMAT=%X\n", printk (KERN_WARNING "*** %s *** FORMAT=%X\n",
vec_names[(fp->ptregs.vector) >> 2], vec_names[(fp->ptregs.vector) >> 2],
fp->ptregs.format); fp->ptregs.format);
else else
printk ("*** Exception %d *** FORMAT=%X\n", printk (KERN_WARNING "*** Exception %d *** FORMAT=%X\n",
(fp->ptregs.vector) >> 2, (fp->ptregs.vector) >> 2,
fp->ptregs.format); fp->ptregs.format);
printk ("Current process id is %d\n", current->pid); printk (KERN_WARNING "Current process id is %d\n", current->pid);
die_if_kernel("BAD KERNEL TRAP", &fp->ptregs, 0); die_if_kernel("BAD KERNEL TRAP", &fp->ptregs, 0);
} }
...@@ -295,9 +295,15 @@ asmlinkage void set_esp0(unsigned long ssp) ...@@ -295,9 +295,15 @@ asmlinkage void set_esp0(unsigned long ssp)
current->thread.esp0 = ssp; current->thread.esp0 = ssp;
} }
void show_trace_task(struct task_struct *tsk)
/*
* The architecture-independent backtrace generator
*/
void dump_stack(void)
{ {
printk("STACK ksp=0x%lx, usp=0x%lx\n", tsk->thread.ksp, tsk->thread.usp); unsigned long stack;
show_stack(current, &stack);
} }
#ifdef CONFIG_M68KFPU_EMU #ifdef CONFIG_M68KFPU_EMU
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment