summaryrefslogtreecommitdiffstats
path: root/arch/avr32/kernel/traps.c
diff options
context:
space:
mode:
authorHaavard Skinnemoen <hskinnemoen@atmel.com>2007-10-10 14:58:29 +0200
committerHaavard Skinnemoen <hskinnemoen@atmel.com>2008-01-25 08:31:43 +0100
commite7ba176b47db2ed53f258a6b4fe9d9fc6fa437a9 (patch)
treebeb9ffab7da0c24f11c04b6eb4ca29b23b1dd07b /arch/avr32/kernel/traps.c
parentf6135d12db4bed3b992052020f1c50d749cd8dc6 (diff)
downloadlinux-e7ba176b47db2ed53f258a6b4fe9d9fc6fa437a9.tar.gz
linux-e7ba176b47db2ed53f258a6b4fe9d9fc6fa437a9.tar.bz2
linux-e7ba176b47db2ed53f258a6b4fe9d9fc6fa437a9.zip
[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.c21
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 @@
#include <linux/bug.h>
#include <linux/init.h>
#include <linux/kallsyms.h>
+#include <linux/kdebug.h>
#include <linux/module.h>
#include <linux/notifier.h>
#include <linux/sched.h>
@@ -107,9 +108,23 @@ void _exception(long signr, struct pt_regs *regs, int code,
asmlinkage void do_nmi(unsigned long ecr, struct pt_regs *regs)
{
- printk(KERN_ALERT "Got Non-Maskable Interrupt, dumping regs\n");
- show_regs_log_lvl(regs, KERN_ALERT);
- show_stack_log_lvl(current, regs->sp, regs, KERN_ALERT);
+ int ret;
+
+ nmi_enter();
+
+ ret = notify_die(DIE_NMI, "NMI", regs, 0, ecr, SIGINT);
+ switch (ret) {
+ case NOTIFY_OK:
+ case NOTIFY_STOP:
+ return;
+ case NOTIFY_BAD:
+ die("Fatal Non-Maskable Interrupt", regs, SIGINT);
+ default:
+ break;
+ }
+
+ printk(KERN_ALERT "Got NMI, but nobody cared. Disabling...\n");
+ nmi_disable();
}
asmlinkage void do_critical_exception(unsigned long ecr, struct pt_regs *regs)