summaryrefslogtreecommitdiffstats
path: root/sys/amd64/pci/pci_cfgreg.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2002-03-16 23:02:41 +0000
committerimp <imp@FreeBSD.org>2002-03-16 23:02:41 +0000
commitbc38cccf354bea2cccd3242a94564a4c39a557c9 (patch)
tree4acbb2edf0ebb4f572273d6a4cadc5c53bc1de74 /sys/amd64/pci/pci_cfgreg.c
parentca0f2a1b7aeea0f4454943a372377cb8329d4e1b (diff)
downloadFreeBSD-src-bc38cccf354bea2cccd3242a94564a4c39a557c9.zip
FreeBSD-src-bc38cccf354bea2cccd3242a94564a4c39a557c9.tar.gz
Don't call the bios if the interrupt appaers to be already routed. Some
older PCI BIOSes hate this and this leads to panics when it is done. Also, assume that a uniquely routed interrupt is already routed. This also seems to help some older laptops with feable BIOSes cope.
Diffstat (limited to 'sys/amd64/pci/pci_cfgreg.c')
-rw-r--r--sys/amd64/pci/pci_cfgreg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/amd64/pci/pci_cfgreg.c b/sys/amd64/pci/pci_cfgreg.c
index 8ac47ee..825d9b7 100644
--- a/sys/amd64/pci/pci_cfgreg.c
+++ b/sys/amd64/pci/pci_cfgreg.c
@@ -267,10 +267,10 @@ pci_cfgintr(int bus, int device, int pin)
continue;
irq = pci_cfgintr_linked(pe, pin);
- if (irq != 255)
- already = 1;
if (irq == 255)
irq = pci_cfgintr_unique(pe, pin);
+ if (irq != 255)
+ already = 1;
if (irq == 255)
irq = pci_cfgintr_virgin(pe, pin);
if (irq == 255)
@@ -282,7 +282,7 @@ pci_cfgintr(int bus, int device, int pin)
args.eax = PCIBIOS_ROUTE_INTERRUPT;
args.ebx = (bus << 8) | (device << 3);
args.ecx = (irq << 8) | (0xa + pin - 1); /* pin value is 0xa - 0xd */
- if (bios32(&args, PCIbios.ventry, GSEL(GCODE_SEL, SEL_KPL)) && !already) {
+ if (!already && bios32(&args, PCIbios.ventry, GSEL(GCODE_SEL, SEL_KPL))) {
/*
* XXX if it fails, we should try to smack the router
* hardware directly.
OpenPOWER on IntegriCloud