summaryrefslogtreecommitdiffstats
path: root/sys/pc98/cbus/pcrtc.c
diff options
context:
space:
mode:
authorkato <kato@FreeBSD.org>2000-01-05 12:35:03 +0000
committerkato <kato@FreeBSD.org>2000-01-05 12:35:03 +0000
commit19a55adf4bef843d46c7e47876bc863711d4ffb7 (patch)
treeaa5eaaba8f687771fc118bff899686035976d03e /sys/pc98/cbus/pcrtc.c
parent841bcf06308c8c2d85f5392d756b1c8309b34a29 (diff)
downloadFreeBSD-src-19a55adf4bef843d46c7e47876bc863711d4ffb7.zip
FreeBSD-src-19a55adf4bef843d46c7e47876bc863711d4ffb7.tar.gz
Synced with sys/i386/isa/clock.c rev 1.149.
Diffstat (limited to 'sys/pc98/cbus/pcrtc.c')
-rw-r--r--sys/pc98/cbus/pcrtc.c36
1 files changed, 27 insertions, 9 deletions
diff --git a/sys/pc98/cbus/pcrtc.c b/sys/pc98/cbus/pcrtc.c
index 9d5c882..bd29e52 100644
--- a/sys/pc98/cbus/pcrtc.c
+++ b/sys/pc98/cbus/pcrtc.c
@@ -1333,7 +1333,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");
@@ -1396,21 +1396,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