summaryrefslogtreecommitdiffstats
path: root/sys/isa/atrtc.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-12-20 23:48:31 +0000
committerjhb <jhb@FreeBSD.org>2001-12-20 23:48:31 +0000
commit2463f40fc340e69b97e1ba3f1a7db47384b50a83 (patch)
treedec76d77f99795635c90df0631ffc2beb333b91b /sys/isa/atrtc.c
parent7a0109b5c0a87d4cff83c1923789cf9c5b38126a (diff)
downloadFreeBSD-src-2463f40fc340e69b97e1ba3f1a7db47384b50a83.zip
FreeBSD-src-2463f40fc340e69b97e1ba3f1a7db47384b50a83.tar.gz
Introduce a standard name for the lock protecting an interrupt controller
and it's associated state variables: icu_lock with the name "icu". This renames the imen_mtx for x86 SMP, but also uses the lock to protect access to the 8259 PIC on x86 UP. This also adds an appropriate lock to the various Alpha chipsets which fixes problems with Alpha SMP machines dropping interrupts with an SMP kernel.
Diffstat (limited to 'sys/isa/atrtc.c')
-rw-r--r--sys/isa/atrtc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/isa/atrtc.c b/sys/isa/atrtc.c
index a7aaea0..a39f773 100644
--- a/sys/isa/atrtc.c
+++ b/sys/isa/atrtc.c
@@ -1026,7 +1026,9 @@ cpu_initclocks()
inthand_add("clk", apic_8254_intr, (driver_intr_t *)clkintr, NULL,
INTR_TYPE_CLK | INTR_FAST, &clkdesc);
+ mtx_lock_spin(&icu_lock);
INTREN(1 << apic_8254_intr);
+ mtx_unlock_spin(&icu_lock);
#else /* APIC_IO */
@@ -1037,7 +1039,9 @@ cpu_initclocks()
*/
inthand_add("clk", 0, (driver_intr_t *)clkintr, NULL,
INTR_TYPE_CLK | INTR_FAST, NULL);
+ mtx_lock_spin(&icu_lock);
INTREN(IRQ0);
+ mtx_unlock_spin(&icu_lock);
#endif /* APIC_IO */
@@ -1060,11 +1064,13 @@ cpu_initclocks()
inthand_add("rtc", 8, (driver_intr_t *)rtcintr, NULL,
INTR_TYPE_CLK | INTR_FAST, NULL);
+ mtx_lock_spin(&icu_lock);
#ifdef APIC_IO
INTREN(APIC_IRQ8);
#else
INTREN(IRQ8);
#endif /* APIC_IO */
+ mtx_unlock_spin(&icu_lock);
writertc(RTC_STATUSB, rtc_statusb);
@@ -1081,7 +1087,9 @@ cpu_initclocks()
* on the IO APIC.
* Workaround: Limited variant of mixed mode.
*/
+ mtx_lock_spin(&icu_lock);
INTRDIS(1 << apic_8254_intr);
+ mtx_unlock_spin(&icu_lock);
inthand_remove(clkdesc);
printf("APIC_IO: Broken MP table detected: "
"8254 is not connected to "
@@ -1104,7 +1112,9 @@ cpu_initclocks()
inthand_add("clk", apic_8254_intr,
(driver_intr_t *)clkintr, NULL,
INTR_TYPE_CLK | INTR_FAST, NULL);
+ mtx_lock_spin(&icu_lock);
INTREN(1 << apic_8254_intr);
+ mtx_unlock_spin(&icu_lock);
}
}
OpenPOWER on IntegriCloud