diff options
| author | ad <ad@NetBSD.org> | 2019-12-11 20:34:06 +0000 |
|---|---|---|
| committer | ad <ad@NetBSD.org> | 2019-12-11 20:34:06 +0000 |
| commit | 2777d9e241b00a2ebbe18948665d93e4cb4c9010 (patch) | |
| tree | 33bab946bd9f6ba51cab1713d194db6480fcf81f /sys | |
| parent | 431d6486f574d7b2cceb5af32db231d559f7f71e (diff) | |
mutex_vector_exit: if the arch doesn't have assembly stubs, we need to
unconditionally release the lock if(cold), so mutexes can be used before
interrupts are set up. Removed with panicstr checks in 1.81.
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/kern/kern_mutex.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c index 2f9a92e1fce..3cf51349ec9 100644 --- a/sys/kern/kern_mutex.c +++ b/sys/kern/kern_mutex.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_mutex.c,v 1.84 2019/12/10 13:36:44 kre Exp $ */ +/* $NetBSD: kern_mutex.c,v 1.85 2019/12/11 20:34:06 ad Exp $ */ /*- * Copyright (c) 2002, 2006, 2007, 2008, 2019 The NetBSD Foundation, Inc. @@ -40,7 +40,7 @@ #define __MUTEX_PRIVATE #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.84 2019/12/10 13:36:44 kre Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.85 2019/12/11 20:34:06 ad Exp $"); #include <sys/param.h> #include <sys/atomic.h> @@ -719,6 +719,14 @@ mutex_vector_exit(kmutex_t *mtx) return; } +#ifndef __HAVE_MUTEX_STUBS + if (__predict_false(cold)) { + MUTEX_UNLOCKED(mtx); + MUTEX_RELEASE(mtx); + return; + } +#endif + curthread = (uintptr_t)curlwp; MUTEX_DASSERT(mtx, curthread != 0); MUTEX_ASSERT(mtx, MUTEX_OWNER(mtx->mtx_owner) == curthread); |
