Eleminate 3 PC98 ifdefs:

o Use IP_NPX in preference to hard coded value to write 0 to clear busy#
o Use md macro for a full reset of the npx
o Use IRQ_NPX in preference to hard coded value for each platform.

# The other two ifdefs in this file are hard to remove
This commit is contained in:
Warner Losh 2005-03-16 20:46:16 +00:00
parent 8afd8dde0c
commit 402f124a2b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=143718

View file

@ -218,11 +218,7 @@ npx_intr(dummy)
* The BUSY# latch must be cleared in all cases so that the next * The BUSY# latch must be cleared in all cases so that the next
* unmasked npx exception causes an interrupt. * unmasked npx exception causes an interrupt.
*/ */
#ifdef PC98 outb(IO_NPX, 0);
outb(0xf8, 0);
#else
outb(0xf0, 0);
#endif
/* /*
* fpcurthread is normally non-null here. In that case, schedule an * fpcurthread is normally non-null here. In that case, schedule an
@ -270,13 +266,8 @@ npx_probe(dev)
IO_NPX, IO_NPX + IO_NPXSIZE - 1, IO_NPXSIZE, RF_ACTIVE); IO_NPX, IO_NPX + IO_NPXSIZE - 1, IO_NPXSIZE, RF_ACTIVE);
if (ioport_res == NULL) if (ioport_res == NULL)
panic("npx: can't get ports"); panic("npx: can't get ports");
#ifdef PC98
if (resource_int_value("npx", 0, "irq", &irq_num) != 0) if (resource_int_value("npx", 0, "irq", &irq_num) != 0)
irq_num = 8; irq_num = IRQ_NPX;
#else
if (resource_int_value("npx", 0, "irq", &irq_num) != 0)
irq_num = 13;
#endif
irq_rid = 0; irq_rid = 0;
irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &irq_rid, irq_num, irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &irq_rid, irq_num,
irq_num, 1, RF_ACTIVE); irq_num, 1, RF_ACTIVE);
@ -290,12 +281,9 @@ npx_probe(dev)
* Partially reset the coprocessor, if any. Some BIOS's don't reset * Partially reset the coprocessor, if any. Some BIOS's don't reset
* it after a warm boot. * it after a warm boot.
*/ */
#ifdef PC98 npx_full_reset();
outb(0xf8,0); outb(IO_NPX, 0);
#else
outb(0xf1, 0); /* full reset on some systems, NOP on others */
outb(0xf0, 0); /* clear BUSY# latch */
#endif
/* /*
* Prepare to trap all ESC (i.e., NPX) instructions and all WAIT * Prepare to trap all ESC (i.e., NPX) instructions and all WAIT
* instructions. We must set the CR0_MP bit and use the CR0_TS * instructions. We must set the CR0_MP bit and use the CR0_TS