summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/npx.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1999-05-15 17:58:58 +0000
committerpeter <peter@FreeBSD.org>1999-05-15 17:58:58 +0000
commit2359d3bde7cc405654c657fd6867c1a4cf5b3959 (patch)
tree4d93f3523ad9740430cf6825434b5061aedbdec3 /sys/i386/isa/npx.c
parent6c3f971989d28a691c14dc3e4f7e9a39a67cbca6 (diff)
downloadFreeBSD-src-2359d3bde7cc405654c657fd6867c1a4cf5b3959.zip
FreeBSD-src-2359d3bde7cc405654c657fd6867c1a4cf5b3959.tar.gz
Don't hardcode IRQ 13 for NPX. It's as good as hardwired in the hardware
though, on systems (386 mostly) that still have a seperate fpu, but it might be possible to find systems where the FPU coprocessor is wired to a different IRQ pin.
Diffstat (limited to 'sys/i386/isa/npx.c')
-rw-r--r--sys/i386/isa/npx.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/sys/i386/isa/npx.c b/sys/i386/isa/npx.c
index e18a08e..ce4a077 100644
--- a/sys/i386/isa/npx.c
+++ b/sys/i386/isa/npx.c
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* from: @(#)npx.c 7.2 (Berkeley) 5/12/91
- * $Id: npx.c,v 1.71 1999/05/08 21:59:27 dfr Exp $
+ * $Id: npx.c,v 1.72 1999/05/11 16:29:18 luoqi Exp $
*/
#include "npx.h"
@@ -146,6 +146,7 @@ static volatile u_int npx_traps_while_probing;
static bool_t npx_ex16;
static bool_t npx_exists;
static bool_t npx_irq13;
+static int npx_irq; /* irq number */
#ifndef SMP
/*
@@ -196,6 +197,8 @@ npx_probe(dev)
{
#ifdef SMP
+ if (resource_int_value("npx", 0, "irq", &npx_irq) != 0)
+ npx_irq = 13;
return npx_probe1(dev);
#else /* SMP */
@@ -213,7 +216,9 @@ npx_probe(dev)
* install suitable handlers and run with interrupts enabled so we
* won't need to do so much here.
*/
- npx_intrno = NRSVIDT + 13;
+ if (resource_int_value("npx", 0, "irq", &npx_irq) != 0)
+ npx_irq = 13;
+ npx_intrno = NRSVIDT + npx_irq;
save_eflags = read_eflags();
disable_intr();
save_icu1_mask = inb(IO_ICU1 + 1);
@@ -221,7 +226,7 @@ npx_probe(dev)
save_idt_npxintr = idt[npx_intrno];
save_idt_npxtrap = idt[16];
outb(IO_ICU1 + 1, ~IRQ_SLAVE);
- outb(IO_ICU2 + 1, ~(1 << (13 - 8)));
+ outb(IO_ICU2 + 1, ~(1 << (npx_irq - 8)));
setidt(16, probetrap, SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
setidt(npx_intrno, probeintr, SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
npx_idt_probeintr = idt[npx_intrno];
@@ -342,9 +347,9 @@ npx_probe1(dev)
*/
npx_irq13 = 1;
/*
- * npxattach would be too late to set npx0_imask.
+ * npxattach would be too late to set npx0_imask
*/
- npx0_imask |= (1 << 13);
+ npx0_imask |= (1 << npx_irq);
/*
* We allocate these resources permanently,
@@ -358,7 +363,7 @@ npx_probe1(dev)
panic("npx: can't get ports");
rid = 0;
r = bus_alloc_resource(dev, SYS_RES_IRQ,
- &rid, 13, 13,
+ &rid, npx_irq, npx_irq,
1, RF_ACTIVE);
if (r == 0)
panic("npx: can't get IRQ");
OpenPOWER on IntegriCloud