summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2006-03-08 19:44:03 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2006-03-08 19:44:03 +0000
commitd17f9ab0fda381b704f5b4ddc5d324a1aa93f1b4 (patch)
tree4f88616aac2a70d40ac251ee9ccffdfa2053af0d /sys/arch
parente74ba7070b969ab165b398ae6a82c4efaab962f3 (diff)
Properly route ISA interrupts through ioapics.
tested by many; ok mickey@, brad@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/amd64/isa/isa_machdep.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/sys/arch/amd64/isa/isa_machdep.c b/sys/arch/amd64/isa/isa_machdep.c
index 35e37978d08..c8366a83dcf 100644
--- a/sys/arch/amd64/isa/isa_machdep.c
+++ b/sys/arch/amd64/isa/isa_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isa_machdep.c,v 1.7 2006/03/01 21:51:39 deraadt Exp $ */
+/* $OpenBSD: isa_machdep.c,v 1.8 2006/03/08 19:44:02 kettenis Exp $ */
/* $NetBSD: isa_machdep.c,v 1.22 1997/06/12 23:57:32 thorpej Exp $ */
#define ISA_DMA_STATS
@@ -122,6 +122,13 @@
#include <uvm/uvm_extern.h>
+#include "ioapic.h"
+
+#if NIOAPIC > 0
+#include <machine/i82093var.h>
+#include <machine/mpbiosvar.h>
+#endif
+
#define _X86_BUS_DMA_PRIVATE
#include <machine/bus.h>
@@ -358,7 +365,27 @@ isa_intr_establish(ic, irq, type, level, ih_fun, ih_arg, ih_what)
void *ih_arg;
char *ih_what;
{
- return intr_establish(irq, &i8259_pic, irq, type, level, ih_fun,
+ struct pic *pic = &i8259_pic;
+ int pin = irq;
+
+#if NIOAPIC > 0
+ struct mp_intr_map *mip;
+
+ if (mp_busses != NULL) {
+ for (mip = mp_busses[mp_isa_bus].mb_intrs; mip != NULL;
+ mip = mip->next) {
+ if (mip->bus_pin == pin) {
+ pin = APIC_IRQ_PIN(mip->ioapic_ih);
+ pic = &mip->ioapic->sc_pic;
+ break;
+ }
+ }
+ }
+#endif
+
+ KASSERT(pic);
+
+ return intr_establish(irq, pic, pin, type, level, ih_fun,
ih_arg, ih_what);
}