summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2003-06-07 15:00:19 +0000
committerjhb <jhb@FreeBSD.org>2003-06-07 15:00:19 +0000
commit3ea76a77aab7d3194f5bfda0582116cdd02d949f (patch)
tree2dc7f1db96a5c039920dda6e41ea85f30d882ffb /sys/dev/pci
parentdf4d18c70c74ae792c0e50657c3a501026e37258 (diff)
downloadFreeBSD-src-3ea76a77aab7d3194f5bfda0582116cdd02d949f.zip
FreeBSD-src-3ea76a77aab7d3194f5bfda0582116cdd02d949f.tar.gz
- Adjust the comment about re-routing PCI interrupts to be less
ia64-specific. - When trying to re-route interrupts, don't change cfg->intline if the re-route fails by returning an invalid vector. This fixes machines without any way of routing interrupts such as older PC's without a $PIR table. We do not currently write the new intline value back to the hardware, but we should. That will likely be added in a later commit.
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/pci.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index 41412f0..dd0ba09 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -782,7 +782,7 @@ pci_add_resources(device_t pcib, device_t dev)
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,18 @@ pci_add_resources(device_t pcib, device_t dev)
if (cfg->intpin > 0 && PCI_INTERRUPT_VALID(cfg->intline)) {
#if defined(__ia64__) || (defined(__i386__) && !defined(SMP))
/*
- * 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);
+ irq = PCIB_ROUTE_INTERRUPT(pcib, dev, cfg->intpin);
+ if (PCI_INTERRUPT_VALID(irq))
+ cfg->intline = irq;
+ else
#endif
- resource_list_add(rl, SYS_RES_IRQ, 0, cfg->intline,
- cfg->intline, 1);
+ irq = cfg->intline;
+ resource_list_add(rl, SYS_RES_IRQ, 0, irq, irq, 1);
}
}
OpenPOWER on IntegriCloud