commit - 72859e7f076a3781edcccf9a89646c54101ecdd3
commit + af1a00f9e0048050db8ad368227d3917fd4b7c7b
blob - 6f949985856981002d58aae8ec74b94b53aad496
blob + 4edcd536c41afc5f3b7da040847f22b6cdd2a002
--- sys/arch/alpha/alpha/lock_machdep.c
+++ sys/arch/alpha/alpha/lock_machdep.c
-/* $OpenBSD: lock_machdep.c,v 1.8 2020/03/05 09:28:31 claudio Exp $ */
+/* $OpenBSD: lock_machdep.c,v 1.9 2024/07/03 01:36:50 jsg Exp $ */
/*
* Copyright (c) 2007 Artur Grabowski <art@openbsd.org>
return (rv);
}
-int
-__mp_release_all_but_one(struct __mp_lock *mpl)
-{
- int rv = mpl->mpl_count - 2;
-#ifdef MP_LOCKDEBUG
- if (mpl->mpl_cpu != curcpu()) {
- db_printf("__mp_release_all_but_one(%p): not held lock\n", mpl);
- db_enter();
- }
-#endif
-
- mpl->mpl_count = 2;
-
- return (rv);
-}
-
void
__mp_acquire_count(struct __mp_lock *mpl, int count)
{
blob - 664e9430b9e6bdcbe254420e790d29687cd48710
blob + 32fb7305d971ca19b36c2fadfce1a9bacd945abb
--- sys/arch/alpha/include/mplock.h
+++ sys/arch/alpha/include/mplock.h
-/* $OpenBSD: mplock.h,v 1.2 2017/12/04 09:51:03 mpi Exp $ */
+/* $OpenBSD: mplock.h,v 1.3 2024/07/03 01:36:50 jsg Exp $ */
/*
* Copyright (c) 2004 Niklas Hallqvist. All rights reserved.
void __mp_lock(struct __mp_lock *);
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 *, struct cpu_info *);
blob - 44c9dda7fb4e246c4917134181e1503a96ebc80d
blob + 67d515a46c0a931e1a4c29d11f3cc877440b151f
--- sys/arch/hppa/hppa/lock_machdep.c
+++ sys/arch/hppa/hppa/lock_machdep.c
-/* $OpenBSD: lock_machdep.c,v 1.14 2019/04/23 13:35:12 visa Exp $ */
+/* $OpenBSD: lock_machdep.c,v 1.15 2024/07/03 01:36:50 jsg Exp $ */
/*
* Copyright (c) 2007 Artur Grabowski <art@openbsd.org>
return (rv);
}
-int
-__mp_release_all_but_one(struct __mp_lock *mpl)
-{
- int rv = mpl->mpl_count - 2;
-#ifdef WITNESS
- int i;
-#endif
-
-#ifdef MP_LOCKDEBUG
- if (mpl->mpl_cpu != curcpu()) {
- db_printf("__mp_release_all_but_one(%p): lock not held - "
- "%p != %p\n", mpl, mpl->mpl_cpu, curcpu());
- db_enter();
- }
-#endif
-
-#ifdef WITNESS
- for (i = 0; i < rv; i++)
- WITNESS_UNLOCK(&mpl->mpl_lock_obj, LOP_EXCLUSIVE);
-#endif
-
- mpl->mpl_count = 2;
-
- return (rv);
-}
-
void
__mp_acquire_count(struct __mp_lock *mpl, int count)
{
blob - b0c2d7299e28ff5446c29c428f5153857daa5acd
blob + 87f01b205c188649952ce89a9515ce3bdb98b076
--- sys/arch/hppa/include/mplock.h
+++ sys/arch/hppa/include/mplock.h
-/* $OpenBSD: mplock.h,v 1.5 2019/04/23 13:35:12 visa Exp $ */
+/* $OpenBSD: mplock.h,v 1.6 2024/07/03 01:36:50 jsg Exp $ */
/*
* Copyright (c) 2004 Niklas Hallqvist. All rights reserved.
void __mp_lock(struct __mp_lock *);
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 *, struct cpu_info *);
blob - fb38210927d333d92956b0ae082ea4821c2efa7a
blob + ec16111a8fd083456400ddfb7b0701cfa4f4f182
--- sys/kern/kern_lock.c
+++ sys/kern/kern_lock.c
-/* $OpenBSD: kern_lock.c,v 1.74 2024/05/29 18:55:45 claudio Exp $ */
+/* $OpenBSD: kern_lock.c,v 1.75 2024/07/03 01:36:50 jsg Exp $ */
/*
* Copyright (c) 2017 Visa Hankala
membar_exit();
mpl->mpl_ticket++;
intr_restore(s);
-
- return (rv);
-}
-
-int
-__mp_release_all_but_one(struct __mp_lock *mpl)
-{
- struct __mp_lock_cpu *cpu = &mpl->mpl_cpus[cpu_number()];
- int rv = cpu->mplc_depth - 1;
-#ifdef WITNESS
- int i;
-
- for (i = 0; i < rv; i++)
- WITNESS_UNLOCK(&mpl->mpl_lock_obj, LOP_EXCLUSIVE);
-#endif
-#ifdef MP_LOCKDEBUG
- if (!__mp_lock_held(mpl, curcpu())) {
- db_printf("__mp_release_all_but_one(%p): not held lock\n", mpl);
- db_enter();
- }
-#endif
-
- cpu->mplc_depth = 1;
-
return (rv);
}
blob - 34f2f97c97baf205bd18ebaa37f58e74c0eec546
blob + b28ac240d944879f1be8314ab3dadbcffe5070f7
--- sys/sys/mplock.h
+++ sys/sys/mplock.h
-/* $OpenBSD: mplock.h,v 1.13 2019/04/23 13:35:12 visa Exp $ */
+/* $OpenBSD: mplock.h,v 1.14 2024/07/03 01:36:50 jsg Exp $ */
/*
* Copyright (c) 2004 Niklas Hallqvist. All rights reserved.
void __mp_lock(struct __mp_lock *);
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 *, struct cpu_info *);