From 25391aceeff3784e353740a04fe0c6eb34daed23 Mon Sep 17 00:00:00 2001 From: mpi Date: Mon, 4 Dec 2017 09:38:20 +0000 Subject: [PATCH] Use _kernel_lock_held() instead of __mp_lock_held(&kernel_lock). ok visa@ --- sys/arch/amd64/amd64/ipifuncs.c | 6 +++--- sys/kern/kern_synch.c | 8 ++++---- sys/kern/sched_bsd.c | 4 ++-- sys/kern/vfs_subr.c | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/arch/amd64/amd64/ipifuncs.c b/sys/arch/amd64/amd64/ipifuncs.c index 84a625a0e03..c563de2fd4d 100644 --- a/sys/arch/amd64/amd64/ipifuncs.c +++ b/sys/arch/amd64/amd64/ipifuncs.c @@ -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(); diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index 83b4cc9f3b5..7fb23449560 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -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); } diff --git a/sys/kern/sched_bsd.c b/sys/kern/sched_bsd.c index e594fbfbed1..b4de163a296 100644 --- a/sys/kern/sched_bsd.c +++ b/sys/kern/sched_bsd.c @@ -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; diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 86e119003bf..5dc5a7813be 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -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; -- 2.20.1