--- traps.c.orig Tue Oct 7 15:08:43 2003 +++ traps.c Tue Oct 7 15:10:28 2003 @@ -64,6 +66,11 @@ void (*board_be_init)(void); int (*board_be_handler)(struct pt_regs *regs, int is_fixup); +#ifdef CONFIG_NMI +unsigned long nmi_addr = 0; +void (*nmi_user_handler)(struct pt_regs *regs); +#endif + int kstack_depth_to_print = 24; /* @@ -841,6 +1095,8 @@ */ void nmi_exception_handler(struct pt_regs *regs) { + if (nmi_user_handler) + nmi_user_handler(regs); printk("NMI taken!!!!\n"); die("NMI", regs); while(1) ; @@ -1009,6 +1265,14 @@ restore_fp_context = fpu_emulator_restore_context; } +#ifdef CONFIG_NMI + { + extern char except_vec_nmi; + + memcpy((void *)(KSEG0 + nmi_addr), &except_vec_nmi, 0x8); + } +#endif + flush_icache_range(KSEG0, KSEG0 + 0x400); atomic_inc(&init_mm.mm_count); /* XXX UP? */