summaryrefslogtreecommitdiffstats
path: root/sys/pci/pci.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1997-04-26 11:46:25 +0000
committerpeter <peter@FreeBSD.org>1997-04-26 11:46:25 +0000
commit6323aa10bffe459912ba8b2f8592c7ac4ffd8705 (patch)
treebf48960e09e26f0de373de093c89322724bbdd64 /sys/pci/pci.c
parent96efe480c0c091aecb2f359675c74aca30f36a4a (diff)
downloadFreeBSD-src-6323aa10bffe459912ba8b2f8592c7ac4ffd8705.zip
FreeBSD-src-6323aa10bffe459912ba8b2f8592c7ac4ffd8705.tar.gz
Man the liferafts! Here comes the long awaited SMP -> -current merge!
There are various options documented in i386/conf/LINT, there is more to come over the next few days. The kernel should run pretty much "as before" without the options to activate SMP mode. There are a handful of known "loose ends" that need to be fixed, but have been put off since the SMP kernel is in a moderately good condition at the moment. This commit is the result of the tinkering and testing over the last 14 months by many people. A special thanks to Steve Passe for implementing the APIC code!
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