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/tlsb | |
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/tlsb')
-rw-r--r-- | sys/alpha/tlsb/dwlpx.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/alpha/tlsb/dwlpx.c b/sys/alpha/tlsb/dwlpx.c index 2f778ef..939fd69 100644 --- a/sys/alpha/tlsb/dwlpx.c +++ b/sys/alpha/tlsb/dwlpx.c @@ -63,7 +63,9 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> +#include <sys/lock.h> #include <sys/module.h> +#include <sys/mutex.h> #include <sys/bus.h> #include <machine/bus.h> #include <machine/md_var.h> @@ -344,7 +346,7 @@ dwlpx_enadis_intr(int vector, int intpin, int onoff) { unsigned long paddr; u_int32_t val; - int device, ionode, hose, hpc, s; + int device, ionode, hose, hpc; ionode = DWLPX_MVEC_IONODE(vector); hose = DWLPX_MVEC_HOSE(vector); @@ -363,16 +365,15 @@ dwlpx_enadis_intr(int vector, int intpin, int onoff) device -= 8; } intpin <<= (device << 2); + mtx_lock_spin(&icu_lock); val = imaskcache[ionode][hose][hpc]; if (onoff) val |= intpin; else val &= ~intpin; imaskcache[ionode][hose][hpc] = val; - s = splhigh(); REGVAL(PCIA_IMASK(hpc) + paddr) = val; - alpha_mb(); - splx(s); + mtx_unlock_spin(&icu_lock); } static int |