From 477a642cee98950f11ce12c94468b0156991a8eb Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Sat, 26 Apr 1997 11:46:25 +0000 Subject: 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! --- sys/dev/pci/pci.c | 30 ++++++++++++++++++++++++++---- sys/dev/sio/sio.c | 13 ++++++++++++- 2 files changed, 38 insertions(+), 5 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 8c1bc7dbc19b..96a71e841cf0 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/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 #include #include @@ -70,9 +72,6 @@ #include #include -#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. diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index 7d5e78db1be2..54420e863661 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -31,12 +31,13 @@ * SUCH DAMAGE. * * from: @(#)com.c 7.5 (Berkeley) 5/16/91 - * $Id: sio.c,v 1.162 1997/04/05 13:11:27 bde Exp $ + * $Id: sio.c,v 1.163 1997/04/18 18:28:09 bde Exp $ */ #include "opt_comconsole.h" #include "opt_ddb.h" #include "opt_sio.h" +#include "opt_smp.h" #include "sio.h" /* @@ -82,6 +83,16 @@ #include #endif +#if defined(APIC_IO) +/* + * INTs are masked in the (global) IO APIC, + * but the IRR register is in each LOCAL APIC, + * so we HAVE to unmask the INT to be able to "see INT pending" + * BUT how do we clear them??? + */ +#define isa_irq_pending icu_irq_pending +#endif /* APIC_IO */ + #define LOTS_OF_EVENTS 64 /* helps separate urgent events from input */ #define RB_I_HIGH_WATER (TTYHOG - 2 * RS_IBUFSIZE) #define RS_IBUFSIZE 256 -- cgit v1.3