summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2008-12-07 14:33:27 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2008-12-07 14:33:27 +0000
commitf2014a25a75a20aae3f5d03c818ac451438354ed (patch)
tree43392ab60fd110a76dfd9739017f0934c1daa956 /sys/arch/amd64
parent2e337f9c11e25ca2db4b76eff16a6138f4e0f829 (diff)
Make acpiprt(4) check whether the current interrupt routing is "possible" and
pick a new one from the list of possible routings if it isn't or if a pin is currently not routed. Delay re-routing interrupts until we establish a handler for it. This prevents us from messing with unused interrupt pins which may have fatal consequences (some machines spontaniously reboot). The heuristics for picking an interrupt from the list of possibe ones probably needs some tweaking still, but this makes several NVIDIA-based boards work much better than before. tested by many, ok marco@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/pci/pci_machdep.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/arch/amd64/pci/pci_machdep.c b/sys/arch/amd64/pci/pci_machdep.c
index 722b6e3591d..8e866ccb1ff 100644
--- a/sys/arch/amd64/pci/pci_machdep.c
+++ b/sys/arch/amd64/pci/pci_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.c,v 1.18 2008/12/06 19:59:38 tedu Exp $ */
+/* $OpenBSD: pci_machdep.c,v 1.19 2008/12/07 14:33:26 kettenis Exp $ */
/* $NetBSD: pci_machdep.c,v 1.3 2003/05/07 21:33:58 fvdl Exp $ */
/*-
@@ -517,13 +517,24 @@ pci_intr_string(pci_chipset_tag_t pc, pci_intr_handle_t ih)
return (irqstr);
}
+#include "acpiprt.h"
+#if NACPIPRT > 0
+void acpiprt_route_interrupt(int bus, int dev, int pin);
+#endif
+
void *
pci_intr_establish(pci_chipset_tag_t pc, pci_intr_handle_t ih, int level,
int (*func)(void *), void *arg, char *what)
{
int pin, irq;
+ int bus, dev;
struct pic *pic;
+ pci_decompose_tag(pc, ih.tag, &bus, &dev, NULL);
+#if NACPIPRT > 0
+ acpiprt_route_interrupt(bus, dev, ih.pin);
+#endif
+
pic = &i8259_pic;
pin = irq = ih.line;