diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2011-04-20 16:10:54 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2011-04-20 16:10:54 +0000 |
commit | c951c232d74f347986f71326b8b2d691a32860bd (patch) | |
tree | 4a9b86400d0edac8196cd6c8714ce90a31008d20 /sys/arch/hppa | |
parent | 60eef9f8ac191c7fd43a67ab57c85b241aed3208 (diff) |
Back out r1.10 of mutex.c as this breaks serial on hppa (at least for MP).
Diffstat (limited to 'sys/arch/hppa')
-rw-r--r-- | sys/arch/hppa/hppa/mutex.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/sys/arch/hppa/hppa/mutex.c b/sys/arch/hppa/hppa/mutex.c index 33638801e65..98c2002db63 100644 --- a/sys/arch/hppa/hppa/mutex.c +++ b/sys/arch/hppa/hppa/mutex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mutex.c,v 1.10 2011/04/03 18:46:40 miod Exp $ */ +/* $OpenBSD: mutex.c,v 1.11 2011/04/20 16:10:53 jsing Exp $ */ /* * Copyright (c) 2004 Artur Grabowski <art@openbsd.org> @@ -66,16 +66,19 @@ mtx_enter(struct mutex *mtx) int s; for (;;) { - s = splraise(mtx->mtx_wantipl); + if (mtx->mtx_wantipl != IPL_NONE) + s = splraise(mtx->mtx_wantipl); if (try_lock(mtx)) { - mtx->mtx_oldipl = s; + if (mtx->mtx_wantipl != IPL_NONE) + mtx->mtx_oldipl = s; mtx->mtx_owner = curcpu(); #ifdef DIAGNOSTIC curcpu()->ci_mutex_level++; #endif return; } - splx(s); + if (mtx->mtx_wantipl != IPL_NONE) + splx(s); } } @@ -84,16 +87,19 @@ mtx_enter_try(struct mutex *mtx) { int s; - s = splraise(mtx->mtx_wantipl); + if (mtx->mtx_wantipl != IPL_NONE) + s = splraise(mtx->mtx_wantipl); if (try_lock(mtx)) { - mtx->mtx_oldipl = s; + if (mtx->mtx_wantipl != IPL_NONE) + mtx->mtx_oldipl = s; mtx->mtx_owner = curcpu(); #ifdef DIAGNOSTIC curcpu()->ci_mutex_level++; #endif return 1; } - splx(s); + if (mtx->mtx_wantipl != IPL_NONE) + splx(s); return 0; } @@ -116,5 +122,6 @@ mtx_leave(struct mutex *mtx) mtx->mtx_lock[2] = 1; mtx->mtx_lock[3] = 1; - splx(s); + if (mtx->mtx_wantipl != IPL_NONE) + splx(s); } |