diff options
author | jhb <jhb@FreeBSD.org> | 2001-12-20 23:48:31 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-12-20 23:48:31 +0000 |
commit | 2463f40fc340e69b97e1ba3f1a7db47384b50a83 (patch) | |
tree | dec76d77f99795635c90df0631ffc2beb333b91b /sys/alpha/pci/t2.c | |
parent | 7a0109b5c0a87d4cff83c1923789cf9c5b38126a (diff) | |
download | FreeBSD-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/alpha/pci/t2.c')
-rw-r--r-- | sys/alpha/pci/t2.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/alpha/pci/t2.c b/sys/alpha/pci/t2.c index d9d0b9d..3dcfe35 100644 --- a/sys/alpha/pci/t2.c +++ b/sys/alpha/pci/t2.c @@ -55,8 +55,10 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> -#include <sys/module.h> +#include <sys/lock.h> #include <sys/malloc.h> +#include <sys/module.h> +#include <sys/mutex.h> #include <sys/bus.h> #include <machine/bus.h> #include <sys/proc.h> @@ -460,6 +462,7 @@ t2_enable_vec(int vector) hose = (vector >= 0xC00); irq = (vector - 0x800) >> 4; + mtx_lock_spin(&icu_lock); if (pci_int_type[hose]) { /* Write the air register on the T3/T4 with the @@ -481,6 +484,7 @@ t2_enable_vec(int vector) /* Old style 8259 (Gack!!!) interrupts */ t2_8259_enable_mask(irq); } + mtx_unlock_spin(&icu_lock); } static void @@ -492,6 +496,7 @@ t2_disable_vec(int vector) hose = (vector >= 0xC00); irq = (vector - 0x800) >> 4; + mtx_lock_spin(&icu_lock); if (pci_int_type[hose]) { /* Write the air register on the T3/T4 wioth the @@ -515,6 +520,7 @@ t2_disable_vec(int vector) /* Old style 8259 (Gack!!!) interrupts */ t2_8259_disable_mask(irq); } + mtx_unlock_spin(&icu_lock); } @@ -590,12 +596,14 @@ t2_teardown_intr(device_t dev, device_t child, t2_shadow_mask |= (1UL << mask); + mtx_lock_spin(&icu_lock); if (mask <= 7) outb(SLAVE0_ICU, t2_shadow_mask); else if (mask <= 15) outb(SLAVE1_ICU, t2_shadow_mask >> 8); else outb(SLAVE2_ICU, t2_shadow_mask >> 16); + mtx_unlock_spin(&icu_lock); alpha_teardown_intr(cookie); return rman_deactivate_resource(irq); @@ -607,7 +615,9 @@ static void t2_dispatch_intr(void *frame, unsigned long vector) { alpha_dispatch_intr(frame, vector); + mtx_lock_spin(&icu_lock); t2_eoi(vector); + mtx_unlock_spin(&icu_lock); } static void |