diff options
author | bde <bde@FreeBSD.org> | 1996-11-11 20:39:03 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1996-11-11 20:39:03 +0000 |
commit | 2335bd93096ea252b0144bc937fae129b9022eb4 (patch) | |
tree | 760b0cb3170f0c1b7ea0d6f3a6248425414b616d /sys/i386/isa/npx.c | |
parent | 2f9365fa023694943d0c7256736bf2feb293b8b0 (diff) | |
download | FreeBSD-src-2335bd93096ea252b0144bc937fae129b9022eb4.zip FreeBSD-src-2335bd93096ea252b0144bc937fae129b9022eb4.tar.gz |
Replaced I586_OPTIMIZED_BCOPY and I586_OPTIMIZED_BZERO with boot-time
negative-logic flags (flags 0x01 and 0x02 for npx0, defaulting to unset = on).
This changes the default from off to on. The options have been in current
for several months with no problems reported.
Added a boot-time negative-logic flag for the old I5886_FAST_BCOPY option
which went away too soon (flag 0x04 for npx0, defaulting to unset = on).
Added a boot-time way to set the memory size (iosiz in config, iosize in
userconfig for npx0).
LINT:
Removed old options. Documented npx0's flags and iosiz.
options.i386:
Removed old options.
identcpu.c:
Don't set the function pointers here. Setting them has to be delayed
until after userconfig has had a chance to disable them and until after
a good npx0 has been detected.
machdep.c:
Use npx0's iosize instead of MAXMEM if it is nonzero.
support.s:
Added vectors and glue code for copyin() and copyout().
Fixed ifdefs for i586_bzero().
Added ifdefs for i586_bcopy().
npx.c:
Set the function pointers here.
Clear hw_float when an npx exists but is too broken to use.
Restored style from a year or three ago in npxattach().
Diffstat (limited to 'sys/i386/isa/npx.c')
-rw-r--r-- | sys/i386/isa/npx.c | 60 |
1 files changed, 47 insertions, 13 deletions
diff --git a/sys/i386/isa/npx.c b/sys/i386/isa/npx.c index 687ff73..25b7533 100644 --- a/sys/i386/isa/npx.c +++ b/sys/i386/isa/npx.c @@ -32,12 +32,13 @@ * SUCH DAMAGE. * * from: @(#)npx.c 7.2 (Berkeley) 5/12/91 - * $Id: npx.c,v 1.30 1996/06/25 20:30:38 bde Exp $ + * $Id: npx.c,v 1.31 1996/09/06 23:07:53 phk Exp $ */ #include "npx.h" #if NNPX > 0 +#include "opt_cpu.h" #include "opt_math_emulate.h" #include <sys/param.h> @@ -66,6 +67,22 @@ * 387 and 287 Numeric Coprocessor Extension (NPX) Driver. */ +/* Configuration flags. */ +#define NPX_DISABLE_I586_OPTIMIZED_BCOPY (1 << 0) +#define NPX_DISABLE_I586_OPTIMIZED_BZERO (1 << 1) +#define NPX_DISABLE_I586_OPTIMIZED_COPYIO (1 << 2) + +/* XXX - should be in header file. */ +extern void (*bcopy_vector) __P((const void *from, void *to, size_t len)); +extern void (*ovbcopy_vector) __P((const void *from, void *to, size_t len)); +extern int (*copyin_vector) __P((const void *udaddr, void *kaddr, size_t len)); +extern int (*copyout_vector) __P((const void *kaddr, void *udaddr, size_t len)); + +void i586_bcopy __P((const void *from, void *to, size_t len)); +void i586_bzero __P((void *buf, size_t len)); +int i586_copyin __P((const void *udaddr, void *kaddr, size_t len)); +int i586_copyout __P((const void *kaddr, void *udaddr, size_t len)); + #ifdef __GNUC__ #define fldcw(addr) __asm("fldcw %0" : : "m" (*(addr))) @@ -324,22 +341,39 @@ int npxattach(dvp) struct isa_device *dvp; { - if (npx_ex16) - printf("npx%d: INT 16 interface\n", dvp->id_unit); - else if (npx_irq13) - ; /* higher level has printed "irq 13" */ + /* The caller has printed "irq 13" for the npx_irq13 case. */ + if (!npx_irq13) { + printf("npx%d: ", dvp->id_unit); + if (npx_ex16) + printf("INT 16 interface\n"); #if defined(MATH_EMULATE) || defined(GPL_MATH_EMULATE) - else if (npx_exists) { - printf("npx%d: error reporting broken; using 387 emulator\n", - dvp->id_unit); - npx_exists = 0; - } else - printf("npx%d: 387 emulator\n",dvp->id_unit); + else if (npx_exists) { + printf("error reporting broken; using 387 emulator\n"); + hw_float = npx_exists = 0; + } else + printf("387 emulator\n"); #else - else - printf("npx%d: no 387 emulator in kernel!\n", dvp->id_unit); + else + printf("no 387 emulator in kernel!\n"); #endif + } npxinit(__INITIAL_NPXCW__); + +#ifdef I586_CPU + if (cpu_class == CPUCLASS_586 && npx_ex16) { + if (!(dvp->id_flags & NPX_DISABLE_I586_OPTIMIZED_BCOPY)) { + bcopy_vector = i586_bcopy; + ovbcopy_vector = i586_bcopy; + } + if (!(dvp->id_flags & NPX_DISABLE_I586_OPTIMIZED_BZERO)) + bzero = i586_bzero; + if (!(dvp->id_flags & NPX_DISABLE_I586_OPTIMIZED_COPYIO)) { + copyin_vector = i586_copyin; + copyout_vector = i586_copyout; + } + } +#endif + return (1); /* XXX unused */ } |