diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-04-19 19:13:58 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-04-19 19:13:58 +0000 |
commit | b1b99d0ea29b8d8c4d0fd7612ffbea278855e476 (patch) | |
tree | fc11c437bc8d87fe71712d8e7aca256f6d928cab /sys/arch | |
parent | 3b509950ceb7b447321109975cd684f00cf73222 (diff) |
For consistency, make sure that all archs that use the same pattern
always increment uvmexp.softs while inside the lock.
While i'm here, make alpha's dispatch loop look like the rest.
"sure" miod@
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/alpha/alpha/interrupt.c | 17 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/softintr.c | 6 | ||||
-rw-r--r-- | sys/arch/i386/i386/softintr.c | 6 |
3 files changed, 16 insertions, 13 deletions
diff --git a/sys/arch/alpha/alpha/interrupt.c b/sys/arch/alpha/alpha/interrupt.c index 568aa609610..952498d253e 100644 --- a/sys/arch/alpha/alpha/interrupt.c +++ b/sys/arch/alpha/alpha/interrupt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interrupt.c,v 1.28 2009/03/25 21:41:40 miod Exp $ */ +/* $OpenBSD: interrupt.c,v 1.29 2009/04/19 19:13:57 oga Exp $ */ /* $NetBSD: interrupt.c,v 1.46 2000/06/03 20:47:36 thorpej Exp $ */ /*- @@ -553,18 +553,17 @@ softintr_dispatch() mtx_enter(&asi->softintr_mtx); sih = TAILQ_FIRST(&asi->softintr_q); - if (sih != NULL) { - TAILQ_REMOVE(&asi->softintr_q, sih, - sih_q); - sih->sih_pending = 0; + if (sih == NULL) { + mtx_leave(&asi->softintr_mtx); + break; } + TAILQ_REMOVE(&asi->softintr_q, sih, sih_q); + sih->sih_pending = 0; - mtx_leave(&asi->softintr_mtx); + uvmexp.softs++; - if (sih == NULL) - break; + mtx_leave(&asi->softintr_mtx); - uvmexp.softs++; (*sih->sih_fn)(sih->sih_arg); } } diff --git a/sys/arch/amd64/amd64/softintr.c b/sys/arch/amd64/amd64/softintr.c index a6e659d2744..b0d22813c76 100644 --- a/sys/arch/amd64/amd64/softintr.c +++ b/sys/arch/amd64/amd64/softintr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softintr.c,v 1.4 2009/04/19 17:50:18 oga Exp $ */ +/* $OpenBSD: softintr.c,v 1.5 2009/04/19 19:13:57 oga Exp $ */ /* $NetBSD: softintr.c,v 1.1 2003/02/26 21:26:12 fvdl Exp $ */ /*- @@ -88,9 +88,11 @@ softintr_dispatch(int which) } TAILQ_REMOVE(&si->softintr_q, sih, sih_q); sih->sih_pending = 0; - mtx_leave(&si->softintr_lock); uvmexp.softs++; + + mtx_leave(&si->softintr_lock); + (*sih->sih_fn)(sih->sih_arg); } } diff --git a/sys/arch/i386/i386/softintr.c b/sys/arch/i386/i386/softintr.c index 4a9a65a04d4..1c2f9dde53d 100644 --- a/sys/arch/i386/i386/softintr.c +++ b/sys/arch/i386/i386/softintr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softintr.c,v 1.3 2009/04/19 17:50:18 oga Exp $ */ +/* $OpenBSD: softintr.c,v 1.4 2009/04/19 19:13:57 oga Exp $ */ /* $NetBSD: softintr.c,v 1.1 2003/02/26 21:26:12 fvdl Exp $ */ /*- @@ -88,9 +88,11 @@ softintr_dispatch(int which) } TAILQ_REMOVE(&si->softintr_q, sih, sih_q); sih->sih_pending = 0; - mtx_leave(&si->softintr_lock); uvmexp.softs++; + + mtx_leave(&si->softintr_lock); + (*sih->sih_fn)(sih->sih_arg); } } |