diff options
author | Roman Zippel <zippel@linux-m68k.org> | 2006-06-25 08:46:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-25 13:00:56 -0400 |
commit | f2325ecebc5b7988fd49968bd3a660fd1594dc84 (patch) | |
tree | e406c6108ae6d4daa4fdf7995636539a9bcb0004 /arch/m68k | |
parent | 742636f5bfd92ad67f4a48f4b7a2ac655797e0f3 (diff) |
[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: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/m68k')
-rw-r--r-- | arch/m68k/kernel/traps.c | 126 |
1 files changed, 68 insertions, 58 deletions
diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c index 837a88709902..9adf378f8f1e 100644 --- a/arch/m68k/kernel/traps.c +++ b/arch/m68k/kernel/traps.c | |||
@@ -927,66 +927,88 @@ void show_trace(unsigned long *stack) | |||
927 | void show_registers(struct pt_regs *regs) | 927 | void show_registers(struct pt_regs *regs) |
928 | { | 928 | { |
929 | struct frame *fp = (struct frame *)regs; | 929 | struct frame *fp = (struct frame *)regs; |
930 | mm_segment_t old_fs = get_fs(); | ||
931 | u16 c, *cp; | ||
930 | unsigned long addr; | 932 | unsigned long addr; |
931 | int i; | 933 | int i; |
932 | 934 | ||
935 | print_modules(); | ||
936 | printk("PC: [<%08lx>]",regs->pc); | ||
937 | print_symbol(" %s", regs->pc); | ||
938 | printk("\nSR: %04x SP: %p a2: %08lx\n", | ||
939 | regs->sr, regs, regs->a2); | ||
940 | printk("d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n", | ||
941 | regs->d0, regs->d1, regs->d2, regs->d3); | ||
942 | printk("d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n", | ||
943 | regs->d4, regs->d5, regs->a0, regs->a1); | ||
944 | |||
945 | printk("Process %s (pid: %d, task=%p)\n", | ||
946 | current->comm, current->pid, current); | ||
933 | addr = (unsigned long)&fp->un; | 947 | addr = (unsigned long)&fp->un; |
934 | printk("Frame format=%X ", fp->ptregs.format); | 948 | printk("Frame format=%X ", regs->format); |
935 | switch (fp->ptregs.format) { | 949 | switch (regs->format) { |
936 | case 0x2: | 950 | case 0x2: |
937 | printk("instr addr=%08lx\n", fp->un.fmt2.iaddr); | 951 | printk("instr addr=%08lx\n", fp->un.fmt2.iaddr); |
938 | addr += sizeof(fp->un.fmt2); | 952 | addr += sizeof(fp->un.fmt2); |
939 | break; | 953 | break; |
940 | case 0x3: | 954 | case 0x3: |
941 | printk("eff addr=%08lx\n", fp->un.fmt3.effaddr); | 955 | printk("eff addr=%08lx\n", fp->un.fmt3.effaddr); |
942 | addr += sizeof(fp->un.fmt3); | 956 | addr += sizeof(fp->un.fmt3); |
943 | break; | 957 | break; |
944 | case 0x4: | 958 | case 0x4: |
945 | printk((CPU_IS_060 ? "fault addr=%08lx fslw=%08lx\n" | 959 | printk((CPU_IS_060 ? "fault addr=%08lx fslw=%08lx\n" |
946 | : "eff addr=%08lx pc=%08lx\n"), | 960 | : "eff addr=%08lx pc=%08lx\n"), |
947 | fp->un.fmt4.effaddr, fp->un.fmt4.pc); | 961 | fp->un.fmt4.effaddr, fp->un.fmt4.pc); |
948 | addr += sizeof(fp->un.fmt4); | 962 | addr += sizeof(fp->un.fmt4); |
949 | break; | 963 | break; |
950 | case 0x7: | 964 | case 0x7: |
951 | printk("eff addr=%08lx ssw=%04x faddr=%08lx\n", | 965 | printk("eff addr=%08lx ssw=%04x faddr=%08lx\n", |
952 | fp->un.fmt7.effaddr, fp->un.fmt7.ssw, fp->un.fmt7.faddr); | 966 | fp->un.fmt7.effaddr, fp->un.fmt7.ssw, fp->un.fmt7.faddr); |
953 | printk("wb 1 stat/addr/data: %04x %08lx %08lx\n", | 967 | printk("wb 1 stat/addr/data: %04x %08lx %08lx\n", |
954 | fp->un.fmt7.wb1s, fp->un.fmt7.wb1a, fp->un.fmt7.wb1dpd0); | 968 | fp->un.fmt7.wb1s, fp->un.fmt7.wb1a, fp->un.fmt7.wb1dpd0); |
955 | printk("wb 2 stat/addr/data: %04x %08lx %08lx\n", | 969 | printk("wb 2 stat/addr/data: %04x %08lx %08lx\n", |
956 | fp->un.fmt7.wb2s, fp->un.fmt7.wb2a, fp->un.fmt7.wb2d); | 970 | fp->un.fmt7.wb2s, fp->un.fmt7.wb2a, fp->un.fmt7.wb2d); |
957 | printk("wb 3 stat/addr/data: %04x %08lx %08lx\n", | 971 | printk("wb 3 stat/addr/data: %04x %08lx %08lx\n", |
958 | fp->un.fmt7.wb3s, fp->un.fmt7.wb3a, fp->un.fmt7.wb3d); | 972 | fp->un.fmt7.wb3s, fp->un.fmt7.wb3a, fp->un.fmt7.wb3d); |
959 | printk("push data: %08lx %08lx %08lx %08lx\n", | 973 | printk("push data: %08lx %08lx %08lx %08lx\n", |
960 | fp->un.fmt7.wb1dpd0, fp->un.fmt7.pd1, fp->un.fmt7.pd2, | 974 | fp->un.fmt7.wb1dpd0, fp->un.fmt7.pd1, fp->un.fmt7.pd2, |
961 | fp->un.fmt7.pd3); | 975 | fp->un.fmt7.pd3); |
962 | addr += sizeof(fp->un.fmt7); | 976 | addr += sizeof(fp->un.fmt7); |
963 | break; | 977 | break; |
964 | case 0x9: | 978 | case 0x9: |
965 | printk("instr addr=%08lx\n", fp->un.fmt9.iaddr); | 979 | printk("instr addr=%08lx\n", fp->un.fmt9.iaddr); |
966 | addr += sizeof(fp->un.fmt9); | 980 | addr += sizeof(fp->un.fmt9); |
967 | break; | 981 | break; |
968 | case 0xa: | 982 | case 0xa: |
969 | printk("ssw=%04x isc=%04x isb=%04x daddr=%08lx dobuf=%08lx\n", | 983 | printk("ssw=%04x isc=%04x isb=%04x daddr=%08lx dobuf=%08lx\n", |
970 | fp->un.fmta.ssw, fp->un.fmta.isc, fp->un.fmta.isb, | 984 | fp->un.fmta.ssw, fp->un.fmta.isc, fp->un.fmta.isb, |
971 | fp->un.fmta.daddr, fp->un.fmta.dobuf); | 985 | fp->un.fmta.daddr, fp->un.fmta.dobuf); |
972 | addr += sizeof(fp->un.fmta); | 986 | addr += sizeof(fp->un.fmta); |
973 | break; | 987 | break; |
974 | case 0xb: | 988 | case 0xb: |
975 | printk("ssw=%04x isc=%04x isb=%04x daddr=%08lx dobuf=%08lx\n", | 989 | printk("ssw=%04x isc=%04x isb=%04x daddr=%08lx dobuf=%08lx\n", |
976 | fp->un.fmtb.ssw, fp->un.fmtb.isc, fp->un.fmtb.isb, | 990 | fp->un.fmtb.ssw, fp->un.fmtb.isc, fp->un.fmtb.isb, |
977 | fp->un.fmtb.daddr, fp->un.fmtb.dobuf); | 991 | fp->un.fmtb.daddr, fp->un.fmtb.dobuf); |
978 | printk("baddr=%08lx dibuf=%08lx ver=%x\n", | 992 | printk("baddr=%08lx dibuf=%08lx ver=%x\n", |
979 | fp->un.fmtb.baddr, fp->un.fmtb.dibuf, fp->un.fmtb.ver); | 993 | fp->un.fmtb.baddr, fp->un.fmtb.dibuf, fp->un.fmtb.ver); |
980 | addr += sizeof(fp->un.fmtb); | 994 | addr += sizeof(fp->un.fmtb); |
981 | break; | 995 | break; |
982 | default: | 996 | default: |
983 | printk("\n"); | 997 | printk("\n"); |
984 | } | 998 | } |
985 | show_stack(NULL, (unsigned long *)addr); | 999 | show_stack(NULL, (unsigned long *)addr); |
986 | 1000 | ||
987 | printk("Code: "); | 1001 | printk("Code:"); |
988 | for (i = 0; i < 10; i++) | 1002 | set_fs(KERNEL_DS); |
989 | printk("%04x ", 0xffff & ((short *) fp->ptregs.pc)[i]); | 1003 | cp = (u16 *)regs->pc; |
1004 | for (i = -8; i < 16; i++) { | ||
1005 | if (get_user(c, cp + i) && i >= 0) { | ||
1006 | printk(" Bad PC value."); | ||
1007 | break; | ||
1008 | } | ||
1009 | printk(i ? " %04x" : " <%04x>", c); | ||
1010 | } | ||
1011 | set_fs(old_fs); | ||
990 | printk ("\n"); | 1012 | printk ("\n"); |
991 | } | 1013 | } |
992 | 1014 | ||
@@ -1190,19 +1212,7 @@ void die_if_kernel (char *str, struct pt_regs *fp, int nr) | |||
1190 | 1212 | ||
1191 | console_verbose(); | 1213 | console_verbose(); |
1192 | printk("%s: %08x\n",str,nr); | 1214 | printk("%s: %08x\n",str,nr); |
1193 | print_modules(); | 1215 | show_registers(fp); |
1194 | printk("PC: [<%08lx>]",fp->pc); | ||
1195 | print_symbol(" %s\n", fp->pc); | ||
1196 | printk("\nSR: %04x SP: %p a2: %08lx\n", | ||
1197 | fp->sr, fp, fp->a2); | ||
1198 | printk("d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n", | ||
1199 | fp->d0, fp->d1, fp->d2, fp->d3); | ||
1200 | printk("d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n", | ||
1201 | fp->d4, fp->d5, fp->a0, fp->a1); | ||
1202 | |||
1203 | printk("Process %s (pid: %d, stackpage=%08lx)\n", | ||
1204 | current->comm, current->pid, PAGE_SIZE+(unsigned long)current); | ||
1205 | show_stack(NULL, (unsigned long *)fp); | ||
1206 | do_exit(SIGSEGV); | 1216 | do_exit(SIGSEGV); |
1207 | } | 1217 | } |
1208 | 1218 | ||