summaryrefslogtreecommitdiffstats
path: root/sys/amd64/isa
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2005-12-05 22:09:30 +0000
committerjhb <jhb@FreeBSD.org>2005-12-05 22:09:30 +0000
commitbd6187382d540409c5cc6247f2a804826c10424a (patch)
tree0c3d127b2c2dac80169bcb1af8ce629eaa621376 /sys/amd64/isa
parent6df33a8d26246dfd19b65fe387f54ec15efdbaf7 (diff)
downloadFreeBSD-src-bd6187382d540409c5cc6247f2a804826c10424a.zip
FreeBSD-src-bd6187382d540409c5cc6247f2a804826c10424a.tar.gz
Really slam the door on mixed mode now that we don't depend on it for a
working IRQ0 with APIC anymore. Previously, it was possible to have some other ATPIC IRQS "leak" through in a few edge cases. For example, on my x86 test machine, ACPI re-routes the SCI (IRQ 9) to intpin 13 on the first I/O APIC. This leaves a hole for IRQ 13 (since the APIC doesn't provide a source for IRQ 13 in that case) with the result that the ATPIC IRQ13 source was registered instead. This changes the 8259A drivers to only register their interrupt sources if none of the 16 ISA IRQs have an interrupt source already installed. MFC after: 1 week
Diffstat (limited to 'sys/amd64/isa')
-rw-r--r--sys/amd64/isa/atpic.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/amd64/isa/atpic.c b/sys/amd64/isa/atpic.c
index 9cc6969..88d461f 100644
--- a/sys/amd64/isa/atpic.c
+++ b/sys/amd64/isa/atpic.c
@@ -453,6 +453,21 @@ atpic_init(void *dummy __unused)
struct atpic_intsrc *ai;
int i;
+ /*
+ * If any of the ISA IRQs have an interrupt source already, then
+ * assume that the APICs are being used and don't register any
+ * of our interrupt sources. This makes sure we don't accidentally
+ * use mixed mode. The "accidental" use could otherwise occur on
+ * machines that route the ACPI SCI interrupt to a different ISA
+ * IRQ (at least one machines routes it to IRQ 13) thus disabling
+ * that APIC ISA routing and allowing the ATPIC source for that IRQ
+ * to leak through. We used to depend on this feature for routing
+ * IRQ0 via mixed mode, but now we don't use mixed mode at all.
+ */
+ for (i = 0; i < NUM_ISA_IRQS; i++)
+ if (intr_lookup_source(i) != NULL)
+ return;
+
/* Loop through all interrupt sources and add them. */
for (i = 0, ai = atintrs; i < NUM_ISA_IRQS; i++, ai++) {
if (i == ICU_SLAVEID)
OpenPOWER on IntegriCloud