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.123 retrieving revision 1.123.2.2 diff -u -p -r1.123 -r1.123.2.2 --- src/sys/kern/kern_lock.c 2007/10/17 17:22:19 1.123 +++ src/sys/kern/kern_lock.c 2007/11/18 19:35:48 1.123.2.2 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_lock.c,v 1.123 2007/10/17 17:22:19 ad Exp $ */ +/* $NetBSD: kern_lock.c,v 1.123.2.2 2007/11/18 19:35:48 bouyer Exp $ */ /*- * Copyright (c) 1999, 2000, 2006, 2007 The NetBSD Foundation, Inc. @@ -76,7 +76,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.123 2007/10/17 17:22:19 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.123.2.2 2007/11/18 19:35:48 bouyer Exp $"); #include "opt_multiprocessor.h" @@ -84,6 +84,7 @@ __KERNEL_RCSID(0, "$NetBSD: kern_lock.c, #include #include #include +#include #include #include #include @@ -325,7 +326,7 @@ lockmgr(struct lock *lkp, u_int flags, s /* LK_RETRY is for vn_lock, not for lockmgr. */ KASSERT((flags & LK_RETRY) == 0); - KASSERT((l->l_flag & LW_INTR) == 0 || panicstr != NULL); + KASSERT((l->l_pflag & LP_INTR) == 0 || panicstr != NULL); simple_lock(&lkp->lk_interlock); if (flags & LK_INTERLOCK) @@ -684,13 +685,21 @@ assert_sleepable(struct simplelock *inte if (panicstr != NULL) return; LOCKDEBUG_BARRIER(&kernel_lock, 1); - if (CURCPU_IDLE_P()) { + if (CURCPU_IDLE_P() && !cold) { panic("assert_sleepable: idle"); } } #endif /* + * rump doesn't need the kernel lock so force it out. We cannot + * currently easily include it for compilation because of + * a) SPINLOCK_* b) mb_write(). They are defined in different + * places / way for each arch, so just simply do not bother to + * fight a lot for no gain (i.e. pain but still no gain). + */ +#ifndef _RUMPKERNEL +/* * Functions for manipulating the kernel_lock. We put them here * so that they show up in profiles. */ @@ -878,25 +887,4 @@ _kernel_unlock(int nlocks, struct lwp *l if (countp != NULL) *countp = olocks; } - -#if defined(DEBUG) -/* - * Assert that the kernel lock is held. - */ -void -_kernel_lock_assert_locked(void) -{ - - if (!__SIMPLELOCK_LOCKED_P(&kernel_lock) || - curcpu()->ci_biglock_count == 0) - _KERNEL_LOCK_ABORT("not locked"); -} - -void -_kernel_lock_assert_unlocked() -{ - - if (curcpu()->ci_biglock_count != 0) - _KERNEL_LOCK_ABORT("locked"); -} -#endif +#endif /* !_RUMPKERNEL */