From 7614948abb08e730b60c4a611c46ee56401608f1 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Thu, 17 Apr 2003 02:29:41 -0700 Subject: [PATCH] [PATCH] generalise traps and nmi --- arch/i386/kernel/traps.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c index 53c610ea831c..47bde2e8dc67 100644 --- a/arch/i386/kernel/traps.c +++ b/arch/i386/kernel/traps.c @@ -51,6 +51,8 @@ #include #include +#include "mach_traps.h" + asmlinkage int system_call(void); asmlinkage void lcall7(void); asmlinkage void lcall27(void); @@ -58,6 +60,9 @@ asmlinkage void lcall27(void); struct desc_struct default_ldt[] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }; +/* Do we ignore FPU interrupts ? */ +char ignore_fpu_irq = 0; + /* * The IDT has to be page-aligned to simplify the Pentium * F0 0F bug workaround.. We have a special link segment @@ -393,8 +398,7 @@ static void mem_parity_error(unsigned char reason, struct pt_regs * regs) printk("You probably have a hardware problem with your RAM chips\n"); /* Clear and disable the memory parity error line. */ - reason = (reason & 0xf) | 4; - outb(reason, 0x61); + clear_mem_error(reason); } static void io_check_error(unsigned char reason, struct pt_regs * regs) @@ -431,7 +435,7 @@ static void unknown_nmi_error(unsigned char reason, struct pt_regs * regs) static void default_do_nmi(struct pt_regs * regs) { - unsigned char reason = inb(0x61); + unsigned char reason = get_nmi_reason(); if (!(reason & 0xc0)) { #if CONFIG_X86_LOCAL_APIC @@ -455,10 +459,7 @@ static void default_do_nmi(struct pt_regs * regs) * Reassert NMI in case it became active meanwhile * as it's edge-triggered. */ - outb(0x8f, 0x70); - inb(0x71); /* dummy */ - outb(0x0f, 0x70); - inb(0x71); /* dummy */ + reassert_nmi(); } static int dummy_nmi_callback(struct pt_regs * regs, int cpu) @@ -652,7 +653,7 @@ void math_error(void *eip) asmlinkage void do_coprocessor_error(struct pt_regs * regs, long error_code) { - ignore_irq13 = 1; + ignore_fpu_irq = 1; math_error((void *)regs->eip); } @@ -709,7 +710,7 @@ asmlinkage void do_simd_coprocessor_error(struct pt_regs * regs, { if (cpu_has_xmm) { /* Handle SIMD FPU exceptions on PIII+ processors. */ - ignore_irq13 = 1; + ignore_fpu_irq = 1; simd_math_error((void *)regs->eip); } else { /* -- 2.39.5