diff options
author | Haavard Skinnemoen <hskinnemoen@atmel.com> | 2007-10-10 08:58:29 -0400 |
---|---|---|
committer | Haavard Skinnemoen <hskinnemoen@atmel.com> | 2008-01-25 02:31:43 -0500 |
commit | e7ba176b47db2ed53f258a6b4fe9d9fc6fa437a9 (patch) | |
tree | beb9ffab7da0c24f11c04b6eb4ca29b23b1dd07b /arch/avr32/kernel/traps.c | |
parent | f6135d12db4bed3b992052020f1c50d749cd8dc6 (diff) |
[AVR32] NMI debugging
Change the NMI handler to use the die notifier chain to signal anyone
who cares. Add a simple "nmi debugger" which hooks into this chain and
that may dump registers, task state, etc. when it happens.
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Diffstat (limited to 'arch/avr32/kernel/traps.c')
-rw-r--r-- | arch/avr32/kernel/traps.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/arch/avr32/kernel/traps.c b/arch/avr32/kernel/traps.c index 870c075e6314..cf6f686d9b0b 100644 --- a/arch/avr32/kernel/traps.c +++ b/arch/avr32/kernel/traps.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/bug.h> | 9 | #include <linux/bug.h> |
10 | #include <linux/init.h> | 10 | #include <linux/init.h> |
11 | #include <linux/kallsyms.h> | 11 | #include <linux/kallsyms.h> |
12 | #include <linux/kdebug.h> | ||
12 | #include <linux/module.h> | 13 | #include <linux/module.h> |
13 | #include <linux/notifier.h> | 14 | #include <linux/notifier.h> |
14 | #include <linux/sched.h> | 15 | #include <linux/sched.h> |
@@ -107,9 +108,23 @@ void _exception(long signr, struct pt_regs *regs, int code, | |||
107 | 108 | ||
108 | asmlinkage void do_nmi(unsigned long ecr, struct pt_regs *regs) | 109 | asmlinkage void do_nmi(unsigned long ecr, struct pt_regs *regs) |
109 | { | 110 | { |
110 | printk(KERN_ALERT "Got Non-Maskable Interrupt, dumping regs\n"); | 111 | int ret; |
111 | show_regs_log_lvl(regs, KERN_ALERT); | 112 | |
112 | show_stack_log_lvl(current, regs->sp, regs, KERN_ALERT); | 113 | nmi_enter(); |
114 | |||
115 | ret = notify_die(DIE_NMI, "NMI", regs, 0, ecr, SIGINT); | ||
116 | switch (ret) { | ||
117 | case NOTIFY_OK: | ||
118 | case NOTIFY_STOP: | ||
119 | return; | ||
120 | case NOTIFY_BAD: | ||
121 | die("Fatal Non-Maskable Interrupt", regs, SIGINT); | ||
122 | default: | ||
123 | break; | ||
124 | } | ||
125 | |||
126 | printk(KERN_ALERT "Got NMI, but nobody cared. Disabling...\n"); | ||
127 | nmi_disable(); | ||
113 | } | 128 | } |
114 | 129 | ||
115 | asmlinkage void do_critical_exception(unsigned long ecr, struct pt_regs *regs) | 130 | asmlinkage void do_critical_exception(unsigned long ecr, struct pt_regs *regs) |