X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=arch%2Favr32%2Fkernel%2Ftraps.c;h=b835c4c0136882e8320ddde56fe14d98d3f1201c;hb=c82dd5321cf779f1f536ef26b383cbe8c9de7f10;hp=8a7caf8e7b454da39a915426a1d7ea363faf361f;hpb=1212663fba7c5e003e05d24f043d5ed57eb18b24;p=linux-2.6-omap-h63xx.git diff --git a/arch/avr32/kernel/traps.c b/arch/avr32/kernel/traps.c index 8a7caf8e7b4..b835c4c0136 100644 --- a/arch/avr32/kernel/traps.c +++ b/arch/avr32/kernel/traps.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -39,7 +40,7 @@ void NORET_TYPE die(const char *str, struct pt_regs *regs, long err) printk("FRAME_POINTER "); #endif if (current_cpu_data.features & AVR32_FEATURE_OCD) { - unsigned long did = __mfdr(DBGREG_DID); + unsigned long did = ocd_read(DID); printk("chip: 0x%03lx:0x%04lx rev %lu\n", (did >> 1) & 0x7ff, (did >> 12) & 0x7fff, @@ -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) @@ -163,6 +178,7 @@ static int do_cop_absent(u32 insn) return 0; } +#ifdef CONFIG_BUG int is_valid_bugaddr(unsigned long pc) { unsigned short opcode; @@ -174,6 +190,7 @@ int is_valid_bugaddr(unsigned long pc) return opcode == AVR32_BUG_OPCODE; } +#endif asmlinkage void do_illegal_opcode(unsigned long ecr, struct pt_regs *regs) { @@ -182,6 +199,7 @@ asmlinkage void do_illegal_opcode(unsigned long ecr, struct pt_regs *regs) void __user *pc; long code; +#ifdef CONFIG_BUG if (!user_mode(regs) && (ecr == ECR_ILLEGAL_OPCODE)) { enum bug_trap_type type; @@ -196,6 +214,7 @@ asmlinkage void do_illegal_opcode(unsigned long ecr, struct pt_regs *regs) die("Kernel BUG", regs, SIGKILL); } } +#endif local_irq_enable();