Source-Changes-HG archive

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

[src/trunk]: src/sys/kern {mutex, rw}_vector_enter: use macro versions to disa...



details:   https://anonhg.NetBSD.org/src/rev/a4c9c9413618
branches:  trunk
changeset: 777621:a4c9c9413618
user:      rmind <rmind%NetBSD.org@localhost>
date:      Sat Feb 25 22:32:44 2012 +0000

description:
{mutex,rw}_vector_enter: use macro versions to disable/enable preemption.

diffstat:

 sys/kern/kern_mutex.c  |  8 ++++----
 sys/kern/kern_rwlock.c |  8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diffs (60 lines):

diff -r e6657954a506 -r a4c9c9413618 sys/kern/kern_mutex.c
--- a/sys/kern/kern_mutex.c     Sat Feb 25 22:28:06 2012 +0000
+++ b/sys/kern/kern_mutex.c     Sat Feb 25 22:32:44 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_mutex.c,v 1.52 2012/02/19 21:06:52 rmind Exp $    */
+/*     $NetBSD: kern_mutex.c,v 1.53 2012/02/25 22:32:44 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.52 2012/02/19 21:06:52 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.53 2012/02/25 22:32:44 rmind Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -534,9 +534,9 @@
                        LOCKSTAT_START_TIMER(lsflag, spintime);
                        count = SPINLOCK_BACKOFF_MIN;
                        do {
-                               kpreempt_enable();
+                               KPREEMPT_ENABLE(curlwp);
                                SPINLOCK_BACKOFF(count);
-                               kpreempt_disable();
+                               KPREEMPT_DISABLE(curlwp);
                                owner = mtx->mtx_owner;
                        } while (mutex_oncpu(owner));
                        LOCKSTAT_STOP_TIMER(lsflag, spintime);
diff -r e6657954a506 -r a4c9c9413618 sys/kern/kern_rwlock.c
--- a/sys/kern/kern_rwlock.c    Sat Feb 25 22:28:06 2012 +0000
+++ b/sys/kern/kern_rwlock.c    Sat Feb 25 22:32:44 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_rwlock.c,v 1.37 2011/03/20 23:19:16 rmind Exp $   */
+/*     $NetBSD: kern_rwlock.c,v 1.38 2012/02/25 22:32:44 rmind Exp $   */
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_rwlock.c,v 1.37 2011/03/20 23:19:16 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_rwlock.c,v 1.38 2012/02/25 22:32:44 rmind Exp $");
 
 #define        __RWLOCK_PRIVATE
 
@@ -348,9 +348,9 @@
                        LOCKSTAT_START_TIMER(lsflag, spintime);
                        u_int count = SPINLOCK_BACKOFF_MIN;
                        do {
-                               kpreempt_enable();
+                               KPREEMPT_ENABLE(curlwp);
                                SPINLOCK_BACKOFF(count);
-                               kpreempt_disable();
+                               KPREEMPT_DISABLE(curlwp);
                                owner = rw->rw_owner;
                        } while (rw_oncpu(owner));
                        LOCKSTAT_STOP_TIMER(lsflag, spintime);



Home | Main Index | Thread Index | Old Index