Though the #include's are to be cleaned up. Signed-off-by: Cyrill Gorcunov --- arch/x86/kernel/irqinit_32.c | 8 ++++++-- arch/x86/kernel/irqinit_64.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 2 deletions(-) Index: linux-2.6.git/arch/x86/kernel/irqinit_32.c =================================================================== --- linux-2.6.git.orig/arch/x86/kernel/irqinit_32.c +++ linux-2.6.git/arch/x86/kernel/irqinit_32.c @@ -1,19 +1,23 @@ +#include #include #include #include #include #include +#include #include #include #include #include #include #include +#include #include #include #include #include +#include #include #include #include @@ -22,7 +26,7 @@ #include #include - +#ifdef CONFIG_X86_32 /* * Note that on a 486, we don't want to do a SIGFPE on an irq13 * as the irq is unreliable, and exception 16 works correctly @@ -34,7 +38,6 @@ * leads to races. IBM designers who came up with it should * be shot. */ - static irqreturn_t math_error_irq(int cpl, void *dev_id) { outb(0, 0xF0); @@ -53,6 +56,7 @@ static struct irqaction fpu_irq = { .mask = CPU_MASK_NONE, .name = "fpu", }; +#endif /* CONFIG_X86_32 */ /* * ISA PIC or low IO-APIC triggered (INTA-cycle or APIC) interrupts: Index: linux-2.6.git/arch/x86/kernel/irqinit_64.c =================================================================== --- linux-2.6.git.orig/arch/x86/kernel/irqinit_64.c +++ linux-2.6.git/arch/x86/kernel/irqinit_64.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -18,11 +19,45 @@ #include #include #include +#include #include #include #include #include #include +#include + +#ifdef CONFIG_X86_32 +/* + * Note that on a 486, we don't want to do a SIGFPE on an irq13 + * as the irq is unreliable, and exception 16 works correctly + * (ie as explained in the intel literature). On a 386, you + * can't use exception 16 due to bad IBM design, so we have to + * rely on the less exact irq13. + * + * Careful.. Not only is IRQ13 unreliable, but it is also + * leads to races. IBM designers who came up with it should + * be shot. + */ +static irqreturn_t math_error_irq(int cpl, void *dev_id) +{ + outb(0, 0xF0); + if (ignore_fpu_irq || !boot_cpu_data.hard_math) + return IRQ_NONE; + math_error((void __user *)get_irq_regs()->ip); + return IRQ_HANDLED; +} + +/* + * New motherboards sometimes make IRQ 13 be a PCI interrupt, + * so allow interrupt sharing. + */ +static struct irqaction fpu_irq = { + .handler = math_error_irq, + .mask = CPU_MASK_NONE, + .name = "fpu", +}; +#endif /* CONFIG_X86_32 */ /* * ISA PIC or low IO-APIC triggered (INTA-cycle or APIC) interrupts: -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/