diff --git a/sys/arch/i386/isa/npx.c b/sys/arch/i386/isa/npx.c index 022ecaa93ef9..59211e162c25 100644 --- a/sys/arch/i386/isa/npx.c +++ b/sys/arch/i386/isa/npx.c @@ -1,4 +1,4 @@ -/* $NetBSD: npx.c,v 1.113 2006/10/12 01:30:43 christos Exp $ */ +/* $NetBSD: npx.c,v 1.114 2006/10/28 21:24:45 christos Exp $ */ /*- * Copyright (c) 1991 The Regents of the University of California. @@ -67,7 +67,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: npx.c,v 1.113 2006/10/12 01:30:43 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: npx.c,v 1.114 2006/10/28 21:24:45 christos Exp $"); #if 0 #define IPRINTF(x) printf x @@ -201,6 +201,10 @@ npxprobe1(bus_space_tag_t iot, bus_space_handle_t ioh, int irq) int status; unsigned irqmask; + if (cpu_feature & CPUID_FPU) { + i386_fpu_exception = 1; + return NPX_CPUID; + } save_eflags = read_eflags(); disable_intr(); save_idt_npxintr = idt[NRSVIDT + irq]; diff --git a/sys/arch/i386/isa/npx_isa.c b/sys/arch/i386/isa/npx_isa.c index f7b7b32dcaa3..c1dd3c6bfb61 100644 --- a/sys/arch/i386/isa/npx_isa.c +++ b/sys/arch/i386/isa/npx_isa.c @@ -1,4 +1,4 @@ -/* $NetBSD: npx_isa.c,v 1.12 2006/10/12 01:30:43 christos Exp $ */ +/* $NetBSD: npx_isa.c,v 1.13 2006/10/28 21:24:45 christos Exp $ */ /*- * Copyright (c) 1991 The Regents of the University of California. @@ -67,7 +67,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: npx_isa.c,v 1.12 2006/10/12 01:30:43 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: npx_isa.c,v 1.13 2006/10/28 21:24:45 christos Exp $"); #include #include @@ -117,7 +117,7 @@ npx_isa_probe(struct device *parent __unused, struct cfdata *match __unused, * Remember our result -- we don't want to have to npxprobe1() * again (especially if we've zapped the IRQ). */ - ia->ia_aux = (void *)(u_long)result; + ia->ia_aux = (void *)(intptr_t)result; ia->ia_nio = 1; ia->ia_io[0].ir_addr = 0xf0; @@ -160,7 +160,12 @@ npx_isa_attach(struct device *parent __unused, struct device *self, void *aux) IST_EDGE, IPL_NONE, (int (*)(void *))npxintr, 0); break; case NPX_EXCEPTION: - aprint_verbose("%s: using exception 16\n", sc->sc_dev.dv_xname); + /*FALLTHROUGH*/ + case NPX_CPUID: + aprint_verbose("%s:%s using exception 16\n", + sc->sc_type == NPX_CPUID ? " reported by CPUID;" : "", + sc->sc_dev.dv_xname); + sc->sc_type = NPX_EXCEPTION; break; case NPX_BROKEN: aprint_error("%s: error reporting broken; not using\n", diff --git a/sys/arch/i386/isa/npxvar.h b/sys/arch/i386/isa/npxvar.h index 26b364a9f31f..6030bbf67864 100644 --- a/sys/arch/i386/isa/npxvar.h +++ b/sys/arch/i386/isa/npxvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: npxvar.h,v 1.4 2005/12/11 12:17:43 christos Exp $ */ +/* $NetBSD: npxvar.h,v 1.5 2006/10/28 21:24:45 christos Exp $ */ /*- * Copyright (c) 1991 The Regents of the University of California. @@ -71,6 +71,7 @@ enum npx_type { NPX_INTERRUPT, NPX_EXCEPTION, NPX_BROKEN, + NPX_CPUID }; struct npx_softc {