]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] generalise traps and nmi
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Thu, 17 Apr 2003 09:29:41 +0000 (02:29 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Thu, 17 Apr 2003 09:29:41 +0000 (02:29 -0700)
arch/i386/kernel/traps.c

index 53c610ea831ccfa3dc1f92a68b4ac929026f27fb..47bde2e8dc67de27bf2ffca3eed99ee941b51f0c 100644 (file)
@@ -51,6 +51,8 @@
 #include <linux/irq.h>
 #include <linux/module.h>
 
+#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 {
                /*