summaryrefslogtreecommitdiffstats
path: root/sys/amd64/amd64/tsc.c
diff options
context:
space:
mode:
authortegge <tegge@FreeBSD.org>2000-01-04 22:24:59 +0000
committertegge <tegge@FreeBSD.org>2000-01-04 22:24:59 +0000
commit8bfa846d9356da2586f4a6e1d554c39177f59e14 (patch)
treec6080f3bb42c4a733d4d4ce7c0d651f056f6f374 /sys/amd64/amd64/tsc.c
parent4f702e355c9a539bf4c04e5f1f2a333c2bc4fe25 (diff)
downloadFreeBSD-src-8bfa846d9356da2586f4a6e1d554c39177f59e14.zip
FreeBSD-src-8bfa846d9356da2586f4a6e1d554c39177f59e14.tar.gz
ISA device drivers use the ISA source interrupt number in locations where
the low level interrupt handler number should be used. Change setup_apic_irq_mapping() to allocate low level interrupt handler X (Xintr${X}) for any ISA interrupt X mentioned in the MP table. Remove an assumption in the driver for the system clock (clock.c) that interrupts mentioned in the MP table as delivered to IOAPIC #0 intpin Y is handled by low level interrupt handler Y (Xintr${Y}) but don't assume that low level interrupt handler 0 (Xintr0) is used. Don't allocate two low level interrupt handlers for the system clock. Reviewed by: NOKUBI Hirotaka <hnokubi@yyy.or.jp>
Diffstat (limited to 'sys/amd64/amd64/tsc.c')
-rw-r--r--sys/amd64/amd64/tsc.c36
1 files changed, 27 insertions, 9 deletions
diff --git a/sys/amd64/amd64/tsc.c b/sys/amd64/amd64/tsc.c
index 11b1426..ea39018 100644
--- a/sys/amd64/amd64/tsc.c
+++ b/sys/amd64/amd64/tsc.c
@@ -1001,7 +1001,7 @@ cpu_initclocks()
} else {
/* look for ExtInt on pin 0 */
if (apic_int_type(0, 0) == 3) {
- apic_8254_intr = 0;
+ apic_8254_intr = apic_irq(0, 0);
setup_8254_mixed_mode();
} else
panic("APIC_IO: Cannot route 8254 interrupt to CPU");
@@ -1062,21 +1062,39 @@ cpu_initclocks()
INTRDIS(1 << apic_8254_intr);
inthand_remove(clkdesc);
printf("APIC_IO: Broken MP table detected: "
- "8254 is not connected to IO APIC int pin %d\n",
- apic_8254_intr);
-
- apic_8254_intr = 0;
+ "8254 is not connected to "
+ "IOAPIC #%d intpin %d\n",
+ int_to_apicintpin[apic_8254_intr].ioapic,
+ int_to_apicintpin[apic_8254_intr].int_pin);
+ /*
+ * Revoke current ISA IRQ 0 assignment and
+ * configure a fallback interrupt routing from
+ * the 8254 Timer via the 8259 PIC to the
+ * an ExtInt interrupt line on IOAPIC #0 intpin 0.
+ * We reuse the low level interrupt handler number.
+ */
+ if (apic_irq(0, 0) < 0) {
+ revoke_apic_irq(apic_8254_intr);
+ assign_apic_irq(0, 0, apic_8254_intr);
+ }
+ apic_8254_intr = apic_irq(0, 0);
setup_8254_mixed_mode();
- inthand_add("clk", apic_8254_intr,(inthand2_t *)clkintr,
+ inthand_add("clk", apic_8254_intr,
+ (inthand2_t *)clkintr,
NULL, &clk_imask, INTR_EXCL);
INTREN(1 << apic_8254_intr);
}
}
- if (apic_8254_intr)
- printf("APIC_IO: routing 8254 via pin %d\n",apic_8254_intr);
+ if (apic_int_type(0, 0) != 3 ||
+ int_to_apicintpin[apic_8254_intr].ioapic != 0 ||
+ int_to_apicintpin[apic_8254_intr].int_pin != 0)
+ printf("APIC_IO: routing 8254 via IOAPIC #%d intpin %d\n",
+ int_to_apicintpin[apic_8254_intr].ioapic,
+ int_to_apicintpin[apic_8254_intr].int_pin);
else
- printf("APIC_IO: routing 8254 via 8259 on pin 0\n");
+ printf("APIC_IO: "
+ "routing 8254 via 8259 and IOAPIC #0 intpin 0\n");
#endif
}
OpenPOWER on IntegriCloud