summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2003-11-21 03:00:05 +0000
committerpeter <peter@FreeBSD.org>2003-11-21 03:00:05 +0000
commit8bb74c49aa521edbbb542e8e7c613a47c82a2007 (patch)
tree21308e4646ded67372ef97b23c9454758b1fe687
parentcccfc8f4107b77dd1e4fe79c4b7875f08232998f (diff)
downloadFreeBSD-src-8bb74c49aa521edbbb542e8e7c613a47c82a2007.zip
FreeBSD-src-8bb74c49aa521edbbb542e8e7c613a47c82a2007.tar.gz
MFi386 rev 1.54 (jhb): Add interrupts that are actually available to the
resource manager, rather than adding everything. Approved by: re (scottl)
-rw-r--r--sys/amd64/amd64/nexus.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/sys/amd64/amd64/nexus.c b/sys/amd64/amd64/nexus.c
index 1fab16b..f969c44 100644
--- a/sys/amd64/amd64/nexus.c
+++ b/sys/amd64/amd64/nexus.c
@@ -135,6 +135,7 @@ DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0);
static int
nexus_probe(device_t dev)
{
+ int irq, last;
device_quiet(dev); /* suppress attach message for neatness */
@@ -160,12 +161,27 @@ nexus_probe(device_t dev)
irq_rman.rm_type = RMAN_ARRAY;
irq_rman.rm_descr = "Interrupt request lines";
irq_rman.rm_end = NUM_IO_INTS - 1;
- if (rman_init(&irq_rman)
- || rman_manage_region(&irq_rman,
- irq_rman.rm_start, irq_rman.rm_end))
+ if (rman_init(&irq_rman))
panic("nexus_probe irq_rman");
/*
+ * We search for regions of existing IRQs and add those to the IRQ
+ * resource manager.
+ */
+ last = -1;
+ for (irq = 0; irq < NUM_IO_INTS; irq++)
+ if (intr_lookup_source(irq) != NULL) {
+ if (last == -1)
+ last = irq;
+ } else if (last != -1) {
+ if (rman_manage_region(&irq_rman, last, irq - 1) != 0)
+ panic("nexus_probe irq_rman add");
+ last = -1;
+ }
+ if (last != -1 && rman_manage_region(&irq_rman, last, irq - 1) != 0)
+ panic("nexus_probe irq_rman add");
+
+ /*
* ISA DMA on PCI systems is implemented in the ISA part of each
* PCI->ISA bridge and the channels can be duplicated if there are
* multiple bridges. (eg: laptops with docking stations)
OpenPOWER on IntegriCloud