Module Name:    src
Committed By:   rmind
Date:           Sat Feb 25 22:32:44 UTC 2012

Modified Files:
        src/sys/kern: kern_mutex.c kern_rwlock.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/kern/kern_mutex.c
cvs rdiff -u -r1.37 -r1.38 src/sys/kern/kern_rwlock.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/kern_mutex.c
diff -u src/sys/kern/kern_mutex.c:1.52 src/sys/kern/kern_mutex.c:1.53
--- src/sys/kern/kern_mutex.c:1.52	Sun Feb 19 21:06:52 2012
+++ src/sys/kern/kern_mutex.c	Sat Feb 25 22:32:44 2012
@@ -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 @@ mutex_vector_enter(kmutex_t *mtx)
 			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);

Index: src/sys/kern/kern_rwlock.c
diff -u src/sys/kern/kern_rwlock.c:1.37 src/sys/kern/kern_rwlock.c:1.38
--- src/sys/kern/kern_rwlock.c:1.37	Sun Mar 20 23:19:16 2011
+++ src/sys/kern/kern_rwlock.c	Sat Feb 25 22:32:44 2012
@@ -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 @@ rw_vector_enter(krwlock_t *rw, const krw
 			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);

Reply via email to