Module Name: src
Committed By: snj
Date: Sun Sep 21 18:31:06 UTC 2014
Modified Files:
src/sys/external/bsd/drm2/include/linux [netbsd-7]: ww_mutex.h
Log Message:
Pull up following revision(s) (requested by riastradh in ticket #102):
sys/external/bsd/drm2/include/linux/ww_mutex.h: revisions 1.5, 1.6
Use KASSERTMSG in ww_acquire_fini to show number of locks held.
Omit vestigial notes on porting before the API was made to match.
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.4.1 \
src/sys/external/bsd/drm2/include/linux/ww_mutex.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/external/bsd/drm2/include/linux/ww_mutex.h
diff -u src/sys/external/bsd/drm2/include/linux/ww_mutex.h:1.4 src/sys/external/bsd/drm2/include/linux/ww_mutex.h:1.4.4.1
--- src/sys/external/bsd/drm2/include/linux/ww_mutex.h:1.4 Sat Jul 26 21:36:40 2014
+++ src/sys/external/bsd/drm2/include/linux/ww_mutex.h Sun Sep 21 18:31:06 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: ww_mutex.h,v 1.4 2014/07/26 21:36:40 riastradh Exp $ */
+/* $NetBSD: ww_mutex.h,v 1.4.4.1 2014/09/21 18:31:06 snj Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -29,17 +29,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-/*
- * Notes on porting:
- *
- * - We require a context for all locks, so ww_mutex_lock(m, NULL) is
- * not kosher. Locking without a context is too painful to
- * contemplate.
- *
- * - We require passing the context to trylock and unlock. Unlocking
- * the wrong lock is too serious an error to pass up detection.
- */
-
#ifndef _ASM_WW_MUTEX_H_
#define _ASM_WW_MUTEX_H_
@@ -119,7 +108,8 @@ static inline void
ww_acquire_fini(struct ww_acquire_ctx *ctx)
{
- KASSERT(ctx->wwx_acquired == 0);
+ KASSERTMSG((ctx->wwx_acquired == 0), "ctx %p still holds %u locks",
+ ctx, ctx->wwx_acquired);
ctx->wwx_acquired = ~0U; /* Fail if called again. */
}