--- sys/dev/pci/pci.c.back Thu Sep 11 22:57:44 2003 +++ sys/dev/pci/pci.c Sat Sep 13 06:58:26 2003 @@ -784,7 +784,7 @@ pcicfgregs *cfg = &dinfo->cfg; struct resource_list *rl = &dinfo->resources; struct pci_quirk *q; - int b, i, f, s; + int b, i, irq, f, s; b = cfg->bus; s = cfg->slot; @@ -800,14 +800,17 @@ } if (cfg->intpin > 0 && PCI_INTERRUPT_VALID(cfg->intline)) { -#ifdef __ia64__ /* - * Re-route interrupts on ia64 so that we can get the - * I/O SAPIC interrupt numbers (the BIOS leaves legacy - * PIC interrupt numbers in the intline registers). + * Try to re-route interrupts. Sometimes the BIOS or + * firmware may leave bogus values in these registers. + * If the re-route fails, then just stick with what we + * have. */ cfg->intline = PCIB_ROUTE_INTERRUPT(pcib, dev, cfg->intpin); -#endif + irq = PCIB_ROUTE_INTERRUPT(pcib, dev, cfg->intpin); + if (PCI_INTERRUPT_VALID(irq)) { + cfg->intline = irq; + } resource_list_add(rl, SYS_RES_IRQ, 0, cfg->intline, cfg->intline, 1); }