diff options
author | Tom Cosgrove <tom@cvs.openbsd.org> | 2006-10-18 19:48:33 +0000 |
---|---|---|
committer | Tom Cosgrove <tom@cvs.openbsd.org> | 2006-10-18 19:48:33 +0000 |
commit | f7750d96ce8596a26b1847c0b88a2c5c8ae3b305 (patch) | |
tree | 05fb8c9d44b8631ab70c83a8538f0f27bb10cdca /sys/arch/i386/isa | |
parent | 447b7110ebde91d46fdf1d1cafeab32821cba0f5 (diff) |
Short-circuit the detection of the FPU by checking the CPUID features,
as done in FreeBSD. Fixes problems on AMD Geode LX-800 where our
detection logic doesn't detect the FP exception.
ok deraadt@ kettenis@
Diffstat (limited to 'sys/arch/i386/isa')
-rw-r--r-- | sys/arch/i386/isa/npx.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/arch/i386/isa/npx.c b/sys/arch/i386/isa/npx.c index 5e0dd5bfb2f..a5d4beb94a0 100644 --- a/sys/arch/i386/isa/npx.c +++ b/sys/arch/i386/isa/npx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: npx.c,v 1.41 2006/09/19 11:06:34 jsg Exp $ */ +/* $OpenBSD: npx.c,v 1.42 2006/10/18 19:48:32 tom Exp $ */ /* $NetBSD: npx.c,v 1.57 1996/05/12 23:12:24 mycroft Exp $ */ #if 0 @@ -123,6 +123,7 @@ enum npx_type { NPX_INTERRUPT, NPX_EXCEPTION, NPX_BROKEN, + NPX_CPUID, }; static enum npx_type npx_type; @@ -278,6 +279,15 @@ npxprobe(struct device *parent, void *match, void *aux) struct gate_descriptor save_idt_npxintr; struct gate_descriptor save_idt_npxtrap; + if (cpu_feature & CPUID_FPU) { + npx_type = NPX_CPUID; + i386_fpu_exception = 1; + ia->ia_irq = IRQUNK; /* Don't want the interrupt vector */ + ia->ia_iosize = 16; + ia->ia_msize = 0; + return 1; + } + /* * This routine is now just a wrapper for npxprobe1(), to install * special npx interrupt and trap handlers, to enable npx interrupts @@ -368,6 +378,10 @@ npxattach(struct device *parent, struct device *self, void *aux) case NPX_EXCEPTION: printf(": using exception 16\n"); break; + case NPX_CPUID: + printf(": reported by CPUID; using exception 16\n"); + npx_type = NPX_EXCEPTION; + break; case NPX_BROKEN: printf(": error reporting broken; not using\n"); npx_type = NPX_NONE; |