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/apecs.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/apecs.c')
-rw-r--r-- | sys/alpha/pci/apecs.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/sys/alpha/pci/apecs.c b/sys/alpha/pci/apecs.c index ebe350b..c74e940 100644 --- a/sys/alpha/pci/apecs.c +++ b/sys/alpha/pci/apecs.c @@ -58,8 +58,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> @@ -304,15 +306,23 @@ apecs_attach(device_t dev) static void apecs_disable_intr(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 apecs_enable_intr(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 @@ -342,7 +352,9 @@ apecs_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 APECS irq %d\n", (int) irq->r_start); |