Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/kern/kern_lock.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/kern/kern_lock.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.92.6.1 retrieving revision 1.93 diff -u -p -r1.92.6.1 -r1.93 --- src/sys/kern/kern_lock.c 2006/04/22 11:39:58 1.92.6.1 +++ src/sys/kern/kern_lock.c 2006/03/16 00:52:32 1.93 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_lock.c,v 1.92.6.1 2006/04/22 11:39:58 simonb Exp $ */ +/* $NetBSD: kern_lock.c,v 1.93 2006/03/16 00:52:32 erh Exp $ */ /*- * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc. @@ -76,7 +76,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.92.6.1 2006/04/22 11:39:58 simonb Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.93 2006/03/16 00:52:32 erh Exp $"); #include "opt_multiprocessor.h" #include "opt_lockdebug.h" @@ -1367,45 +1367,6 @@ simple_lock_only_held(volatile struct si SLOCK_DEBUGGER(); } } - -/* - * Set to 1 by simple_lock_assert_*(). - * Can be cleared from ddb to avoid a panic. - */ -int slock_assert_will_panic; - -/* - * If the lock isn't held, print a traceback, optionally drop into the - * debugger, then panic. - * The panic can be avoided by clearing slock_assert_with_panic from the - * debugger. - */ -void -_simple_lock_assert_locked(volatile struct simplelock *alp, - const char *lockname, const char *id, int l) -{ - if (simple_lock_held(alp) == 0) { - slock_assert_will_panic = 1; - lock_printf("%s lock not held\n", lockname); - SLOCK_WHERE("lock not held", alp, id, l); - if (slock_assert_will_panic) - panic("%s: not locked", lockname); - } -} - -void -_simple_lock_assert_unlocked(volatile struct simplelock *alp, - const char *lockname, const char *id, int l) -{ - if (simple_lock_held(alp)) { - slock_assert_will_panic = 1; - lock_printf("%s lock held\n", lockname); - SLOCK_WHERE("lock held", alp, id, l); - if (slock_assert_will_panic) - panic("%s: locked", lockname); - } -} - #endif /* LOCKDEBUG */ /* } */ #if defined(MULTIPROCESSOR) @@ -1534,8 +1495,8 @@ _kernel_lock_acquire_count(int hold_coun void _kernel_lock_assert_locked() { - simple_lock_assert_locked(&kernel_lock, "kernel_lock"); + + LOCK_ASSERT(simple_lock_held(&kernel_lock)); } #endif - #endif /* MULTIPROCESSOR */