diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2017-12-04 09:51:04 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2017-12-04 09:51:04 +0000 |
commit | 1764f0df2a112e820709360ae1c631b59cc1bc05 (patch) | |
tree | 6882f126f28754a7a4010a36ac6b74bde6cbb1bf /sys/arch/powerpc | |
parent | 7c011d9e8d8db99faeb35a7df465a3d0da5621ac (diff) |
Change __mp_lock_held() to work with an arbitrary CPU info structure and
extend ddb(4) "ps /o" output to print which CPU is currently holding the
KERNEL_LOCK().
Tested by dhill@, ok visa@
Diffstat (limited to 'sys/arch/powerpc')
-rw-r--r-- | sys/arch/powerpc/include/mplock.h | 4 | ||||
-rw-r--r-- | sys/arch/powerpc/powerpc/lock_machdep.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sys/arch/powerpc/include/mplock.h b/sys/arch/powerpc/include/mplock.h index 29fbfbbdd14..a412a6c07a4 100644 --- a/sys/arch/powerpc/include/mplock.h +++ b/sys/arch/powerpc/include/mplock.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mplock.h,v 1.2 2015/06/26 11:22:12 dlg Exp $ */ +/* $OpenBSD: mplock.h,v 1.3 2017/12/04 09:51:03 mpi Exp $ */ /* * Copyright (c) 2004 Niklas Hallqvist. All rights reserved. @@ -45,7 +45,7 @@ void __mp_unlock(struct __mp_lock *); int __mp_release_all(struct __mp_lock *); int __mp_release_all_but_one(struct __mp_lock *); void __mp_acquire_count(struct __mp_lock *, int); -int __mp_lock_held(struct __mp_lock *); +int __mp_lock_held(struct __mp_lock *, struct cpu_info *); #endif diff --git a/sys/arch/powerpc/powerpc/lock_machdep.c b/sys/arch/powerpc/powerpc/lock_machdep.c index b78af743d4d..de6690da5a8 100644 --- a/sys/arch/powerpc/powerpc/lock_machdep.c +++ b/sys/arch/powerpc/powerpc/lock_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lock_machdep.c,v 1.6 2017/05/29 14:19:50 mpi Exp $ */ +/* $OpenBSD: lock_machdep.c,v 1.7 2017/12/04 09:51:03 mpi Exp $ */ /* * Copyright (c) 2007 Artur Grabowski <art@openbsd.org> @@ -164,7 +164,7 @@ __mp_acquire_count(struct __mp_lock *mpl, int count) } int -__mp_lock_held(struct __mp_lock *mpl) +__mp_lock_held(struct __mp_lock *mpl, struct cpu_info *ci) { - return mpl->mpl_cpu == curcpu(); + return mpl->mpl_cpu == ci; } |