diff options
author | Tor Egge <tegge@FreeBSD.org> | 2000-01-04 22:24:59 +0000 |
---|---|---|
committer | Tor Egge <tegge@FreeBSD.org> | 2000-01-04 22:24:59 +0000 |
commit | 82916a112685adfd32f05944e6587f51d141800f (patch) | |
tree | 06814d68ea0e9506ec2f8f3f491384f267ad506f /sys/isa/atrtc.c | |
parent | 4164c447703ea9246b18edce3cd071c15c7ccaff (diff) | |
download | src-82916a112685adfd32f05944e6587f51d141800f.tar.gz src-82916a112685adfd32f05944e6587f51d141800f.zip |
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>
Notes
Notes:
svn path=/head/; revision=55420
Diffstat (limited to 'sys/isa/atrtc.c')
-rw-r--r-- | sys/isa/atrtc.c | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/sys/isa/atrtc.c b/sys/isa/atrtc.c index 11b142689145..ea39018548b9 100644 --- a/sys/isa/atrtc.c +++ b/sys/isa/atrtc.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 } |