From e7ba176b47db2ed53f258a6b4fe9d9fc6fa437a9 Mon Sep 17 00:00:00 2001 From: Haavard Skinnemoen Date: Wed, 10 Oct 2007 14:58:29 +0200 Subject: [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 --- arch/avr32/kernel/traps.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'arch/avr32/kernel/traps.c') 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 #include #include +#include #include #include #include @@ -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) -- cgit v1.2.3