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/tsunami.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/tsunami.c')
-rw-r--r-- | sys/alpha/pci/tsunami.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/sys/alpha/pci/tsunami.c b/sys/alpha/pci/tsunami.c index 1ca0803..3ca127b 100644 --- a/sys/alpha/pci/tsunami.c +++ b/sys/alpha/pci/tsunami.c @@ -31,7 +31,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 <sys/proc.h> @@ -305,15 +307,23 @@ tsunami_attach(device_t dev) static void tsunami_disable_intr_vec(int vector) { - int irq = (vector - 0x900) >> 4; + int irq; + + irq = (vector - 0x900) >> 4; + mtx_lock_spin(&icu_lock); platform.pci_intr_disable(irq); + mtx_unlock_spin(&icu_lock); } static void tsunami_enable_intr_vec(int vector) { - int irq = (vector - 0x900) >> 4; + int irq; + + irq = (vector - 0x900) >> 4; + mtx_lock_spin(&icu_lock); platform.pci_intr_enable(irq); + mtx_unlock_spin(&icu_lock); } static int @@ -335,7 +345,9 @@ tsunami_setup_intr(device_t dev, device_t child, return error; /* Enable PCI interrupt */ + mtx_lock_spin(&icu_lock); platform.pci_intr_enable(irq->r_start); + mtx_unlock_spin(&icu_lock); device_printf(child, "interrupting at TSUNAMI irq %d\n", (int) irq->r_start); @@ -391,7 +403,6 @@ tsunami_intr_disable(int irq) saved_mask = *mask; alpha_mb(); alpha_mb(); - } |