From 40d8c8da9521816bf6decf7536a30a5ca6d92cbb Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Sun, 21 Oct 2001 05:18:30 +0000 Subject: MFpc98: all changes in sys/pc98/pc98/npx.c related to FPU_ERROR_BROKEN. - 1.58 (2000/09/01; author: kato) Fixed FPU_ERROR_BROKEN code. It had old-isa code. - 1.33 (1998/03/09; author: kato) Make FPU_ERROR_BROKEN a new-style option. - 1.7 (1996/10/09; author: asami) Make sure FPU is recognized for non-Intel CPUs. The log for rev.1.7 should have said something like: Added FPU_ERROR_BROKEN option. This forces a successful probe for exception 16, so that hardware with a broken FPU error signal can sort of work. --- sys/amd64/amd64/fpu.c | 9 +++++++++ sys/amd64/isa/npx.c | 9 +++++++++ sys/i386/isa/npx.c | 9 +++++++++ 3 files changed, 27 insertions(+) (limited to 'sys') diff --git a/sys/amd64/amd64/fpu.c b/sys/amd64/amd64/fpu.c index b742f50f4195..620356d4d243 100644 --- a/sys/amd64/amd64/fpu.c +++ b/sys/amd64/amd64/fpu.c @@ -38,6 +38,7 @@ #include "opt_cpu.h" #include "opt_debug_npx.h" #include "opt_math_emulate.h" +#include "opt_npx.h" #include #include @@ -363,6 +364,14 @@ npx_probe(dev) */ control &= ~(1 << 2); /* enable divide by 0 trap */ fldcw(&control); +#ifdef FPU_ERROR_BROKEN + /* + * FPU error signal doesn't work on some CPU + * accelerator board. + */ + npx_ex16 = 1; + return (0); +#endif npx_traps_while_probing = npx_intrs_while_probing = 0; fp_divide_by_0(); if (npx_traps_while_probing != 0) { diff --git a/sys/amd64/isa/npx.c b/sys/amd64/isa/npx.c index b742f50f4195..620356d4d243 100644 --- a/sys/amd64/isa/npx.c +++ b/sys/amd64/isa/npx.c @@ -38,6 +38,7 @@ #include "opt_cpu.h" #include "opt_debug_npx.h" #include "opt_math_emulate.h" +#include "opt_npx.h" #include #include @@ -363,6 +364,14 @@ npx_probe(dev) */ control &= ~(1 << 2); /* enable divide by 0 trap */ fldcw(&control); +#ifdef FPU_ERROR_BROKEN + /* + * FPU error signal doesn't work on some CPU + * accelerator board. + */ + npx_ex16 = 1; + return (0); +#endif npx_traps_while_probing = npx_intrs_while_probing = 0; fp_divide_by_0(); if (npx_traps_while_probing != 0) { diff --git a/sys/i386/isa/npx.c b/sys/i386/isa/npx.c index b742f50f4195..620356d4d243 100644 --- a/sys/i386/isa/npx.c +++ b/sys/i386/isa/npx.c @@ -38,6 +38,7 @@ #include "opt_cpu.h" #include "opt_debug_npx.h" #include "opt_math_emulate.h" +#include "opt_npx.h" #include #include @@ -363,6 +364,14 @@ npx_probe(dev) */ control &= ~(1 << 2); /* enable divide by 0 trap */ fldcw(&control); +#ifdef FPU_ERROR_BROKEN + /* + * FPU error signal doesn't work on some CPU + * accelerator board. + */ + npx_ex16 = 1; + return (0); +#endif npx_traps_while_probing = npx_intrs_while_probing = 0; fp_divide_by_0(); if (npx_traps_while_probing != 0) { -- cgit v1.3