diff options
Diffstat (limited to 'sys/arch/i386/include/intr.h')
-rw-r--r-- | sys/arch/i386/include/intr.h | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/sys/arch/i386/include/intr.h b/sys/arch/i386/include/intr.h index 812af4d74d1..fd5f02fa4af 100644 --- a/sys/arch/i386/include/intr.h +++ b/sys/arch/i386/include/intr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.h,v 1.37 2009/03/15 19:40:40 miod Exp $ */ +/* $OpenBSD: intr.h,v 1.38 2009/04/19 17:50:18 oga Exp $ */ /* $NetBSD: intr.h,v 1.5 1996/05/13 06:11:28 mycroft Exp $ */ /* @@ -36,6 +36,7 @@ #include <machine/intrdefs.h> #ifndef _LOCORE +#include <sys/mutex.h> #include <machine/cpu.h> extern volatile u_int32_t lapic_tpr; /* Current interrupt priority level. */ @@ -170,23 +171,11 @@ struct i386_soft_intrhand { struct i386_soft_intr { TAILQ_HEAD(, i386_soft_intrhand) - softintr_q; - int softintr_ssir; - struct simplelock softintr_slock; + softintr_q; + int softintr_ssir; + struct mutex softintr_lock; }; -#define i386_softintr_lock(si, s) \ -do { \ - (s) = splhigh(); \ - simple_lock(&si->softintr_slock); \ -} while (/*CONSTCOND*/ 0) - -#define i386_softintr_unlock(si, s) \ -do { \ - simple_unlock(&si->softintr_slock); \ - splx((s)); \ -} while (/*CONSTCOND*/ 0) - void *softintr_establish(int, void (*)(void *), void *); void softintr_disestablish(void *); void softintr_init(void); @@ -196,15 +185,14 @@ void softintr_dispatch(int); do { \ struct i386_soft_intrhand *__sih = (arg); \ struct i386_soft_intr *__si = __sih->sih_intrhead; \ - int __s; \ \ - i386_softintr_lock(__si, __s); \ + mtx_enter(&__si->softintr_lock); \ if (__sih->sih_pending == 0) { \ TAILQ_INSERT_TAIL(&__si->softintr_q, __sih, sih_q); \ __sih->sih_pending = 1; \ softintr(__si->softintr_ssir); \ } \ - i386_softintr_unlock(__si, __s); \ + mtx_leave(&__si->softintr_lock); \ } while (/*CONSTCOND*/ 0) #endif /* _LOCORE */ |