Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys G/C unused MUTEX_COUNT_BIAS (it was for VAX)



details:   https://anonhg.NetBSD.org/src/rev/3cf209e1e2ac
branches:  trunk
changeset: 764112:3cf209e1e2ac
user:      rmind <rmind%NetBSD.org@localhost>
date:      Mon Apr 11 19:11:08 2011 +0000

description:
G/C unused MUTEX_COUNT_BIAS (it was for VAX)

diffstat:

 sys/arch/vax/vax/genassym.cf |   5 +----
 sys/kern/kern_mutex.c        |  11 ++++-------
 2 files changed, 5 insertions(+), 11 deletions(-)

diffs (65 lines):

diff -r b099d8504972 -r 3cf209e1e2ac sys/arch/vax/vax/genassym.cf
--- a/sys/arch/vax/vax/genassym.cf      Mon Apr 11 18:24:49 2011 +0000
+++ b/sys/arch/vax/vax/genassym.cf      Mon Apr 11 19:11:08 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: genassym.cf,v 1.48 2010/12/20 00:25:45 matt Exp $
+#      $NetBSD: genassym.cf,v 1.49 2011/04/11 19:11:08 rmind Exp $
 #
 # Copyright (c) 1997 Ludd, University of Lule}, Sweden.
 # All rights reserved.
@@ -170,9 +170,6 @@
 define MTX_OWNER       offsetof(struct kmutex, mtx_owner)
 define MTX_LOCK        offsetof(struct kmutex, mtx_lock)
 define MTX_IPL         offsetof(struct kmutex, mtx_ipl)
-ifdef  MUTEX_COUNT_BIAS
-define MTX_COUNT_BIAS  MUTEX_COUNT_BIAS
-endif
 
 define RW_OWNER        offsetof(struct krwlock, rw_owner)
 define RW_HAS_WAITERS  RW_HAS_WAITERS
diff -r b099d8504972 -r 3cf209e1e2ac sys/kern/kern_mutex.c
--- a/sys/kern/kern_mutex.c     Mon Apr 11 18:24:49 2011 +0000
+++ b/sys/kern/kern_mutex.c     Mon Apr 11 19:11:08 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_mutex.c,v 1.50 2011/03/20 23:19:16 rmind Exp $    */
+/*     $NetBSD: kern_mutex.c,v 1.51 2011/04/11 19:11:08 rmind Exp $    */
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 #define        __MUTEX_PRIVATE
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.50 2011/03/20 23:19:16 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.51 2011/04/11 19:11:08 rmind Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -117,9 +117,6 @@
 /*
  * Spin mutex SPL save / restore.
  */
-#ifndef MUTEX_COUNT_BIAS
-#define        MUTEX_COUNT_BIAS        0
-#endif
 
 #define        MUTEX_SPIN_SPLRAISE(mtx)                                        \
 do {                                                                   \
@@ -129,7 +126,7 @@
        x__ci = curcpu();                                               \
        x__cnt = x__ci->ci_mtx_count--;                                 \
        __insn_barrier();                                               \
-       if (x__cnt == MUTEX_COUNT_BIAS)                                 \
+       if (x__cnt == 0)                                                \
                x__ci->ci_mtx_oldspl = (s);                             \
 } while (/* CONSTCOND */ 0)
 
@@ -138,7 +135,7 @@
        struct cpu_info *x__ci = curcpu();                              \
        int s = x__ci->ci_mtx_oldspl;                                   \
        __insn_barrier();                                               \
-       if (++(x__ci->ci_mtx_count) == MUTEX_COUNT_BIAS)                \
+       if (++(x__ci->ci_mtx_count) == 0)                       \
                splx(s);                                                \
 } while (/* CONSTCOND */ 0)
 



Home | Main Index | Thread Index | Old Index