summaryrefslogtreecommitdiffstats
path: root/sys/pci/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/pci/pci.c')
-rw-r--r--sys/pci/pci.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/sys/pci/pci.c b/sys/pci/pci.c
index 8c1bc7d..96a71e8 100644
--- a/sys/pci/pci.c
+++ b/sys/pci/pci.c
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** $Id: pci.c,v 1.68 1997/03/25 19:12:08 se Exp $
+** $Id: pci.c,v 1.69 1997/04/23 19:43:20 se Exp $
**
** General subroutines for the PCI bus.
** pci_configure ()
@@ -46,6 +46,8 @@
**========================================================
*/
+#include "opt_smp.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/malloc.h>
@@ -70,9 +72,6 @@
#include <pci/pcibus.h>
#include <pci/pci_ioctl.h>
-#define PCI_MAX_IRQ (16)
-
-
/*========================================================
**
** Structs and Functions
@@ -403,6 +402,10 @@ static void pci_attach (int bus, int dev, int func,
u_char reg;
u_char pciint;
int irq;
+#if defined(APIC_IO)
+ u_char airq = 0xff;
+ u_char rirq = 0xff;
+#endif /* APIC_IO */
pcici_t tag = pcibus->pb_tag (bus, dev, func);
/*
@@ -437,14 +440,33 @@ static void pci_attach (int bus, int dev, int func,
** and we cannot bind the pci interrupt.
*/
+#if defined(APIC_IO)
+ if (irq && (irq != 0xff)) {
+ airq = get_pci_apic_irq (bus, dev, pciint);
+ if (airq != 0xff) { /* APIC IRQ exists */
+ rirq = irq; /* 're-directed' IRQ */
+ irq = airq; /* use APIC IRQ */
+ }
+ printf ("%d", irq);
+ }
+#else
if (irq && (irq != 0xff))
printf ("%d", irq);
+#endif /* APIC_IO */
else
printf ("??");
};
printf (" on pci%d:%d:%d\n", bus, dev, func);
+#if defined(APIC_IO)
+ if (airq != 0xff) { /* APIC IRQ exists */
+ data = PCI_INTERRUPT_LINE_INSERT(data, airq);
+ pci_conf_write (tag, PCI_INTERRUPT_REG, data);
+ undirect_pci_irq (rirq); /* free for ISA card */
+ }
+#endif /* APIC_IO */
+
/*
** Read the current mapping,
** and update the pcicb fields.
OpenPOWER on IntegriCloud