From f2014a25a75a20aae3f5d03c818ac451438354ed Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sun, 7 Dec 2008 14:33:27 +0000 Subject: 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@ --- sys/arch/amd64/pci/pci_machdep.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'sys/arch/amd64') 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; -- cgit v1.2.3