diff options
author | tegge <tegge@FreeBSD.org> | 1998-11-26 23:14:23 +0000 |
---|---|---|
committer | tegge <tegge@FreeBSD.org> | 1998-11-26 23:14:23 +0000 |
commit | 930e900772dc85557b86907fc2872a3d334dd538 (patch) | |
tree | 828f09a27eb295506b749ff87a83485816ef33ad /sys/kern/subr_smp.c | |
parent | 1f1ab4819c23e37e12cd77a9f862f0b56a026bd6 (diff) | |
download | FreeBSD-src-930e900772dc85557b86907fc2872a3d334dd538.zip FreeBSD-src-930e900772dc85557b86907fc2872a3d334dd538.tar.gz |
Attempt to handle interrupts delivered to all IO APICs by using the first
IO APIC with a sufficient number of pins.
Diffstat (limited to 'sys/kern/subr_smp.c')
-rw-r--r-- | sys/kern/subr_smp.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c index 0575e03..e7ff739 100644 --- a/sys/kern/subr_smp.c +++ b/sys/kern/subr_smp.c @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: mp_machdep.c,v 1.83 1998/10/10 13:37:16 kato Exp $ + * $Id: mp_machdep.c,v 1.84 1998/11/26 18:50:22 eivind Exp $ */ #include "opt_smp.h" @@ -1197,11 +1197,26 @@ lookup_bus_type(char *name) static int int_entry(int_entry_ptr entry, int intr) { + int apic; + io_apic_ints[intr].int_type = entry->int_type; io_apic_ints[intr].int_flags = entry->int_flags; io_apic_ints[intr].src_bus_id = entry->src_bus_id; io_apic_ints[intr].src_bus_irq = entry->src_bus_irq; - io_apic_ints[intr].dst_apic_id = entry->dst_apic_id; + if (entry->dst_apic_id == 255) { + /* This signal goes to all IO APICS. Select an IO APIC + with sufficient number of interrupt pins */ + for (apic = 0; apic < mp_napics; apic++) + if (((io_apic_read(apic, IOAPIC_VER) & + IOART_VER_MAXREDIR) >> MAXREDIRSHIFT) >= + entry->dst_apic_int) + break; + if (apic < mp_napics) + io_apic_ints[intr].dst_apic_id = IO_TO_ID(apic); + else + io_apic_ints[intr].dst_apic_id = entry->dst_apic_id; + } else + io_apic_ints[intr].dst_apic_id = entry->dst_apic_id; io_apic_ints[intr].dst_apic_int = entry->dst_apic_int; return 1; |