diff options
author | Mikael Starvik <mikael.starvik@axis.com> | 2005-07-27 14:44:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-27 19:25:59 -0400 |
commit | 059163cabc01a15b9e2cf10e5de5b6dc06e0da1f (patch) | |
tree | d053763ad90eeb4a6835d2ff888f2d36428f881c /arch/cris/arch-v10 | |
parent | 05b4c28cba8dc48505322988340307073c353b1e (diff) |
[PATCH] CRIS update: debug
Improvements to crash debug code.
Signed-off-by: Mikael Starvik <starvik@axis.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/cris/arch-v10')
-rw-r--r-- | arch/cris/arch-v10/kernel/traps.c | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/arch/cris/arch-v10/kernel/traps.c b/arch/cris/arch-v10/kernel/traps.c index da491f438a6..34a27ea2052 100644 --- a/arch/cris/arch-v10/kernel/traps.c +++ b/arch/cris/arch-v10/kernel/traps.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: traps.c,v 1.2 2003/07/04 08:27:41 starvik Exp $ | 1 | /* $Id: traps.c,v 1.4 2005/04/24 18:47:55 starvik Exp $ |
2 | * | 2 | * |
3 | * linux/arch/cris/arch-v10/traps.c | 3 | * linux/arch/cris/arch-v10/traps.c |
4 | * | 4 | * |
@@ -16,6 +16,8 @@ | |||
16 | #include <asm/uaccess.h> | 16 | #include <asm/uaccess.h> |
17 | #include <asm/arch/sv_addr_ag.h> | 17 | #include <asm/arch/sv_addr_ag.h> |
18 | 18 | ||
19 | extern int raw_printk(const char *fmt, ...); | ||
20 | |||
19 | void | 21 | void |
20 | show_registers(struct pt_regs * regs) | 22 | show_registers(struct pt_regs * regs) |
21 | { | 23 | { |
@@ -26,18 +28,18 @@ show_registers(struct pt_regs * regs) | |||
26 | register. */ | 28 | register. */ |
27 | unsigned long usp = rdusp(); | 29 | unsigned long usp = rdusp(); |
28 | 30 | ||
29 | printk("IRP: %08lx SRP: %08lx DCCR: %08lx USP: %08lx MOF: %08lx\n", | 31 | raw_printk("IRP: %08lx SRP: %08lx DCCR: %08lx USP: %08lx MOF: %08lx\n", |
30 | regs->irp, regs->srp, regs->dccr, usp, regs->mof ); | 32 | regs->irp, regs->srp, regs->dccr, usp, regs->mof ); |
31 | printk(" r0: %08lx r1: %08lx r2: %08lx r3: %08lx\n", | 33 | raw_printk(" r0: %08lx r1: %08lx r2: %08lx r3: %08lx\n", |
32 | regs->r0, regs->r1, regs->r2, regs->r3); | 34 | regs->r0, regs->r1, regs->r2, regs->r3); |
33 | printk(" r4: %08lx r5: %08lx r6: %08lx r7: %08lx\n", | 35 | raw_printk(" r4: %08lx r5: %08lx r6: %08lx r7: %08lx\n", |
34 | regs->r4, regs->r5, regs->r6, regs->r7); | 36 | regs->r4, regs->r5, regs->r6, regs->r7); |
35 | printk(" r8: %08lx r9: %08lx r10: %08lx r11: %08lx\n", | 37 | raw_printk(" r8: %08lx r9: %08lx r10: %08lx r11: %08lx\n", |
36 | regs->r8, regs->r9, regs->r10, regs->r11); | 38 | regs->r8, regs->r9, regs->r10, regs->r11); |
37 | printk("r12: %08lx r13: %08lx oR10: %08lx\n", | 39 | raw_printk("r12: %08lx r13: %08lx oR10: %08lx sp: %08lx\n", |
38 | regs->r12, regs->r13, regs->orig_r10); | 40 | regs->r12, regs->r13, regs->orig_r10, regs); |
39 | printk("R_MMU_CAUSE: %08lx\n", (unsigned long)*R_MMU_CAUSE); | 41 | raw_printk("R_MMU_CAUSE: %08lx\n", (unsigned long)*R_MMU_CAUSE); |
40 | printk("Process %s (pid: %d, stackpage=%08lx)\n", | 42 | raw_printk("Process %s (pid: %d, stackpage=%08lx)\n", |
41 | current->comm, current->pid, (unsigned long)current); | 43 | current->comm, current->pid, (unsigned long)current); |
42 | 44 | ||
43 | /* | 45 | /* |
@@ -53,7 +55,7 @@ show_registers(struct pt_regs * regs) | |||
53 | if (usp != 0) | 55 | if (usp != 0) |
54 | show_stack (NULL, NULL); | 56 | show_stack (NULL, NULL); |
55 | 57 | ||
56 | printk("\nCode: "); | 58 | raw_printk("\nCode: "); |
57 | if(regs->irp < PAGE_OFFSET) | 59 | if(regs->irp < PAGE_OFFSET) |
58 | goto bad; | 60 | goto bad; |
59 | 61 | ||
@@ -70,16 +72,16 @@ show_registers(struct pt_regs * regs) | |||
70 | unsigned char c; | 72 | unsigned char c; |
71 | if(__get_user(c, &((unsigned char*)regs->irp)[i])) { | 73 | if(__get_user(c, &((unsigned char*)regs->irp)[i])) { |
72 | bad: | 74 | bad: |
73 | printk(" Bad IP value."); | 75 | raw_printk(" Bad IP value."); |
74 | break; | 76 | break; |
75 | } | 77 | } |
76 | 78 | ||
77 | if (i == 0) | 79 | if (i == 0) |
78 | printk("(%02x) ", c); | 80 | raw_printk("(%02x) ", c); |
79 | else | 81 | else |
80 | printk("%02x ", c); | 82 | raw_printk("%02x ", c); |
81 | } | 83 | } |
82 | printk("\n"); | 84 | raw_printk("\n"); |
83 | } | 85 | } |
84 | } | 86 | } |
85 | 87 | ||
@@ -121,7 +123,7 @@ die_if_kernel(const char * str, struct pt_regs * regs, long err) | |||
121 | stop_watchdog(); | 123 | stop_watchdog(); |
122 | #endif | 124 | #endif |
123 | 125 | ||
124 | printk("%s: %04lx\n", str, err & 0xffff); | 126 | raw_printk("%s: %04lx\n", str, err & 0xffff); |
125 | 127 | ||
126 | show_registers(regs); | 128 | show_registers(regs); |
127 | 129 | ||
@@ -130,3 +132,8 @@ die_if_kernel(const char * str, struct pt_regs * regs, long err) | |||
130 | #endif | 132 | #endif |
131 | do_exit(SIGSEGV); | 133 | do_exit(SIGSEGV); |
132 | } | 134 | } |
135 | |||
136 | void arch_enable_nmi(void) | ||
137 | { | ||
138 | asm volatile("setf m"); | ||
139 | } | ||