Use _kernel_lock_held() instead of __mp_lock_held(&kernel_lock).
authormpi <mpi@openbsd.org>
Mon, 4 Dec 2017 09:38:20 +0000 (09:38 +0000)
committermpi <mpi@openbsd.org>
Mon, 4 Dec 2017 09:38:20 +0000 (09:38 +0000)
ok visa@

sys/arch/amd64/amd64/ipifuncs.c
sys/kern/kern_synch.c
sys/kern/sched_bsd.c
sys/kern/vfs_subr.c

index 84a625a..c563de2 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ipifuncs.c,v 1.28 2015/11/23 22:57:12 deraadt Exp $   */
+/*     $OpenBSD: ipifuncs.c,v 1.29 2017/12/04 09:38:20 mpi Exp $       */
 /*     $NetBSD: ipifuncs.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $ */
 
 /*-
@@ -113,8 +113,8 @@ void
 x86_64_ipi_halt(struct cpu_info *ci)
 {
        SCHED_ASSERT_UNLOCKED();
-       KASSERT(!__mp_lock_held(&kernel_lock));
-       
+       KASSERT(!_kernel_lock_held());
+
        fpusave_cpu(ci, 1);
        disable_intr();
        lapic_disable();
index 83b4cc9..7fb2344 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: kern_synch.c,v 1.141 2017/05/18 07:08:45 mpi Exp $    */
+/*     $OpenBSD: kern_synch.c,v 1.142 2017/12/04 09:38:20 mpi Exp $    */
 /*     $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */
 
 /*
@@ -115,7 +115,7 @@ tsleep(const volatile void *ident, int priority, const char *wmesg, int timo)
        KASSERT((priority & ~(PRIMASK | PCATCH)) == 0);
 
 #ifdef MULTIPROCESSOR
-       KASSERT(timo || __mp_lock_held(&kernel_lock));
+       KASSERT(timo || _kernel_lock_held());
 #endif
 
 #ifdef DDB
@@ -133,7 +133,7 @@ tsleep(const volatile void *ident, int priority, const char *wmesg, int timo)
                s = splhigh();
                splx(safepri);
 #ifdef MULTIPROCESSOR
-               if (__mp_lock_held(&kernel_lock)) {
+               if (_kernel_lock_held()) {
                        hold_count = __mp_release_all(&kernel_lock);
                        __mp_acquire_count(&kernel_lock, hold_count);
                }
@@ -186,7 +186,7 @@ msleep(const volatile void *ident, struct mutex *mtx, int priority,
                MUTEX_OLDIPL(mtx) = safepri;
                mtx_leave(mtx);
 #ifdef MULTIPROCESSOR
-               if (__mp_lock_held(&kernel_lock)) {
+               if (_kernel_lock_held()) {
                        hold_count = __mp_release_all(&kernel_lock);
                        __mp_acquire_count(&kernel_lock, hold_count);
                }
index e594fbf..b4de163 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: sched_bsd.c,v 1.46 2017/02/14 10:31:15 mpi Exp $      */
+/*     $OpenBSD: sched_bsd.c,v 1.47 2017/12/04 09:38:20 mpi Exp $      */
 /*     $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */
 
 /*-
@@ -354,7 +354,7 @@ mi_switch(void)
         * Release the kernel_lock, as we are about to yield the CPU.
         */
        sched_count = __mp_release_all_but_one(&sched_lock);
-       if (__mp_lock_held(&kernel_lock))
+       if (_kernel_lock_held())
                hold_count = __mp_release_all(&kernel_lock);
        else
                hold_count = 0;
index 86e1190..5dc5a78 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: vfs_subr.c,v 1.260 2017/07/31 16:47:03 florian Exp $  */
+/*     $OpenBSD: vfs_subr.c,v 1.261 2017/12/04 09:38:20 mpi Exp $      */
 /*     $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $   */
 
 /*
@@ -1688,7 +1688,7 @@ vfs_syncwait(int verbose)
                if (verbose)
                        printf("%d ", nbusy);
 #ifdef MULTIPROCESSOR
-               if (__mp_lock_held(&kernel_lock))
+               if (_kernel_lock_held())
                        hold_count = __mp_release_all(&kernel_lock);
                else
                        hold_count = 0;