diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 2004-06-13 21:49:30 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 2004-06-13 21:49:30 +0000 |
commit | 2dd254afa61a7c0cc5ae920b463d3d4266852804 (patch) | |
tree | 7adbebef3be24ba910fd83ee1ba09e1577ae21a8 /sys/arch/i386/eisa/eisa_machdep.c | |
parent | 4d62e331dcde739b4067d712dd602c0927ce11b3 (diff) |
debranch SMP, have fun
Diffstat (limited to 'sys/arch/i386/eisa/eisa_machdep.c')
-rw-r--r-- | sys/arch/i386/eisa/eisa_machdep.c | 49 |
1 files changed, 43 insertions, 6 deletions
diff --git a/sys/arch/i386/eisa/eisa_machdep.c b/sys/arch/i386/eisa/eisa_machdep.c index 178950e9e86..e086091fd75 100644 --- a/sys/arch/i386/eisa/eisa_machdep.c +++ b/sys/arch/i386/eisa/eisa_machdep.c @@ -1,5 +1,5 @@ -/* $OpenBSD: eisa_machdep.c,v 1.7 2004/06/09 20:13:10 deraadt Exp $ */ -/* $NetBSD: eisa_machdep.c,v 1.6 1997/06/06 23:12:52 thorpej Exp $ */ +/* $OpenBSD: eisa_machdep.c,v 1.8 2004/06/13 21:49:15 niklas Exp $ */ +/* $NetBSD: eisa_machdep.c,v 1.10.22.2 2000/06/25 19:36:58 sommerfeld Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -81,8 +81,8 @@ #define _I386_BUS_DMA_PRIVATE #include <machine/bus.h> +#include <machine/i8259.h> -#include <i386/isa/icu.h> #include <dev/isa/isavar.h> #include <dev/eisa/eisavar.h> @@ -133,6 +133,9 @@ eisa_intr_map(ec, irq, ihp) u_int irq; eisa_intr_handle_t *ihp; { +#if NIOAPIC > 0 + struct mp_intr_map *mip; +#endif if (irq >= ICU_LEN) { printf("eisa_intr_map: bad IRQ %d\n", irq); @@ -144,6 +147,26 @@ eisa_intr_map(ec, irq, ihp) irq = 9; } +#if NIOAPIC > 0 + if (mp_busses != NULL) { + /* + * Assumes 1:1 mapping between PCI bus numbers and + * the numbers given by the MP bios. + * XXX Is this a valid assumption? + */ + + for (mip = mp_busses[bus].mb_intrs; mip != NULL; + mip = mip->next) { + if (mip->bus_pin == irq) { + *ihp = mip->ioapic_ih | irq; + return (0); + } + } + if (mip == NULL) + printf("eisa_intr_map: no MP mapping found\n"); + } +#endif + *ihp = irq; return (0); } @@ -155,9 +178,17 @@ eisa_intr_string(ec, ih) { static char irqstr[8]; /* 4 + 2 + NUL + sanity */ - if (ih == 0 || ih >= ICU_LEN || ih == 2) + if (ih == 0 || (ih & 0xff) >= ICU_LEN || ih == 2) panic("eisa_intr_string: bogus handle 0x%x", ih); +#if NIOAPIC > 0 + if (ih & APIC_INT_VIA_APIC) { + sprintf(irqstr, "apic %d int %d (irq %d)", + APIC_IRQ_APIC(ih), APIC_IRQ_PIN(ih), ih & 0xff); + return (irqstr); + } +#endif + snprintf(irqstr, sizeof irqstr, "irq %d", ih); return (irqstr); @@ -171,7 +202,14 @@ eisa_intr_establish(ec, ih, type, level, func, arg, what) void *arg; char *what; { - +#if NIOAPIC > 0 + if (ih != -1) { + if (ih != -1 && (ih & APIC_INT_VIA_APIC)) { + return (apic_intr_establish(ih, type, level, func, arg, + what)); + } + } +#endif if (ih == 0 || ih >= ICU_LEN || ih == 2) panic("eisa_intr_establish: bogus handle 0x%x", ih); @@ -183,6 +221,5 @@ eisa_intr_disestablish(ec, cookie) eisa_chipset_tag_t ec; void *cookie; { - return (isa_intr_disestablish(NULL, cookie)); } |