summaryrefslogtreecommitdiff
path: root/sys/arch/arm/include/softintr.h
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2009-04-19 18:54:07 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2009-04-19 18:54:07 +0000
commit3b509950ceb7b447321109975cd684f00cf73222 (patch)
tree4aea83de5136436ef226e28fc7958cb5c636e5fc /sys/arch/arm/include/softintr.h
parent00da0191a871a2352a51dd105e6824a88df82cb1 (diff)
Mutexes for arm and sh softinterrupts.
ok miod@
Diffstat (limited to 'sys/arch/arm/include/softintr.h')
-rw-r--r--sys/arch/arm/include/softintr.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/arch/arm/include/softintr.h b/sys/arch/arm/include/softintr.h
index cc4065ba67c..8d3feb39fba 100644
--- a/sys/arch/arm/include/softintr.h
+++ b/sys/arch/arm/include/softintr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: softintr.h,v 1.3 2009/04/08 21:19:30 kettenis Exp $ */
+/* $OpenBSD: softintr.h,v 1.4 2009/04/19 18:54:06 oga Exp $ */
/* $NetBSD: softintr.h,v 1.1 2002/01/29 22:54:14 thorpej Exp $ */
/*
@@ -41,6 +41,8 @@
#ifdef _KERNEL
+#include <sys/mutex.h>
+
/*
* Generic software interrupt support for all ARM platforms.
*
@@ -64,8 +66,10 @@ struct soft_intrhand {
};
struct soft_intrq {
- TAILQ_HEAD(, soft_intrhand) siq_list;
- int siq_si;
+ TAILQ_HEAD(, soft_intrhand)
+ siq_list;
+ int siq_si;
+ struct mutex siq_mtx;
};
void *softintr_establish(int, void (*)(void *), void *);
@@ -77,15 +81,14 @@ void softintr_dispatch(int);
do { \
struct soft_intrhand *__sih = (arg); \
struct soft_intrq *__siq = __sih->sih_siq; \
- int __s; \
\
- __s = splhigh(); \
+ mtx_enter(&__siq->siq_mtx); \
if (__sih->sih_pending == 0) { \
TAILQ_INSERT_TAIL(&__siq->siq_list, __sih, sih_list); \
__sih->sih_pending = 1; \
_setsoftintr(__siq->siq_si); \
} \
- splx(__s); \
+ mtx_leave(&__siq->siq_mtx); \
} while (/*CONSTCOND*/0)
/* XXX For legacy software interrupts. */