Fix boolean inversion and missing definition.

This commit is contained in:
matt 2007-04-06 17:48:06 +00:00
parent 802469c2c9
commit d0ef60fca0
2 changed files with 11 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: mutex.h,v 1.7 2007/03/12 02:22:43 matt Exp $ */
/* $NetBSD: mutex.h,v 1.8 2007/04/06 17:48:06 matt Exp $ */
/*-
* Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
@ -82,6 +82,10 @@
* an interlocking step.
*/
#ifndef LOCKDEBUG
#define MUTEX_COUNT_BIAS 1
#endif
#ifndef __MUTEX_PRIVATE
struct kmutex {
@ -111,10 +115,6 @@ struct kmutex {
#define __HAVE_MUTEX_STUBS 1
#define __HAVE_SPIN_MUTEX_STUBS 1
#ifndef LOCKDEBUG
#define MUTEX_COUNT_BIAS 1
#endif
static inline uintptr_t
MUTEX_OWNER(uintptr_t owner)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: lock_stubs.S,v 1.3 2007/03/12 02:22:43 matt Exp $ */
/* $NetBSD: lock_stubs.S,v 1.4 2007/04/06 17:48:06 matt Exp $ */
/*-
* Copyright (c) 2002, 2006, 2007 The NetBSD Foundation, Inc.
@ -92,11 +92,13 @@ NENTRY(mutex_spin_enter, 0)
mtpr %r3, $PR_IPL /* yes, raise IPL */
1: mfpr $PR_SSP, %r1 /* get curcpu */
sobgeq CI_MTX_COUNT(%r1), 2f /* decr mutex count */
movl %r2, CI_MTX_OLDSPL(%r1) /* save was-current IPL */
brb 3f
2: movl %r2, CI_MTX_OLDSPL(%r1) /* save was-current IPL */
3:
#if defined(DIAGNOSTIC) || defined(MULTIPROCESSOR)
bbssi $0, (%r0), 3f /* take out mutex */
bbssi $0, (%r0), 4f /* take out mutex */
ret
3: callg (%ap), _C_LABEL(mutex_spin_retry) /* slow path */
4: callg (%ap), _C_LABEL(mutex_spin_retry) /* slow path */
#endif
ret