Commit f2325ece authored by Roman Zippel's avatar Roman Zippel Committed by Linus Torvalds

[PATCH] m68k: fix show_registers()

Move some of the prints in die_if_kernel() to show_registers() and call that
instead of show_stack(), so show_registers() prints now similiar info as other
archs.  Clean up the function a little.
Signed-off-by: default avatarRoman Zippel <zippel@linux-m68k.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 742636f5
...@@ -927,12 +927,26 @@ void show_trace(unsigned long *stack) ...@@ -927,12 +927,26 @@ void show_trace(unsigned long *stack)
void show_registers(struct pt_regs *regs) void show_registers(struct pt_regs *regs)
{ {
struct frame *fp = (struct frame *)regs; struct frame *fp = (struct frame *)regs;
mm_segment_t old_fs = get_fs();
u16 c, *cp;
unsigned long addr; unsigned long addr;
int i; int i;
print_modules();
printk("PC: [<%08lx>]",regs->pc);
print_symbol(" %s", regs->pc);
printk("\nSR: %04x SP: %p a2: %08lx\n",
regs->sr, regs, regs->a2);
printk("d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n",
regs->d0, regs->d1, regs->d2, regs->d3);
printk("d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n",
regs->d4, regs->d5, regs->a0, regs->a1);
printk("Process %s (pid: %d, task=%p)\n",
current->comm, current->pid, current);
addr = (unsigned long)&fp->un; addr = (unsigned long)&fp->un;
printk("Frame format=%X ", fp->ptregs.format); printk("Frame format=%X ", regs->format);
switch (fp->ptregs.format) { switch (regs->format) {
case 0x2: case 0x2:
printk("instr addr=%08lx\n", fp->un.fmt2.iaddr); printk("instr addr=%08lx\n", fp->un.fmt2.iaddr);
addr += sizeof(fp->un.fmt2); addr += sizeof(fp->un.fmt2);
...@@ -984,9 +998,17 @@ void show_registers(struct pt_regs *regs) ...@@ -984,9 +998,17 @@ void show_registers(struct pt_regs *regs)
} }
show_stack(NULL, (unsigned long *)addr); show_stack(NULL, (unsigned long *)addr);
printk("Code: "); printk("Code:");
for (i = 0; i < 10; i++) set_fs(KERNEL_DS);
printk("%04x ", 0xffff & ((short *) fp->ptregs.pc)[i]); cp = (u16 *)regs->pc;
for (i = -8; i < 16; i++) {
if (get_user(c, cp + i) && i >= 0) {
printk(" Bad PC value.");
break;
}
printk(i ? " %04x" : " <%04x>", c);
}
set_fs(old_fs);
printk ("\n"); printk ("\n");
} }
...@@ -1190,19 +1212,7 @@ void die_if_kernel (char *str, struct pt_regs *fp, int nr) ...@@ -1190,19 +1212,7 @@ void die_if_kernel (char *str, struct pt_regs *fp, int nr)
console_verbose(); console_verbose();
printk("%s: %08x\n",str,nr); printk("%s: %08x\n",str,nr);
print_modules(); show_registers(fp);
printk("PC: [<%08lx>]",fp->pc);
print_symbol(" %s\n", fp->pc);
printk("\nSR: %04x SP: %p a2: %08lx\n",
fp->sr, fp, fp->a2);
printk("d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n",
fp->d0, fp->d1, fp->d2, fp->d3);
printk("d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n",
fp->d4, fp->d5, fp->a0, fp->a1);
printk("Process %s (pid: %d, stackpage=%08lx)\n",
current->comm, current->pid, PAGE_SIZE+(unsigned long)current);
show_stack(NULL, (unsigned long *)fp);
do_exit(SIGSEGV); do_exit(SIGSEGV);
} }
......
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