-/* $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)
{
-/* $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 *);
-/* $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)
{
-/* $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 *);
-/* $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
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);
-}
-
void
__mp_acquire_count(struct __mp_lock *mpl, int count)
{
-/* $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 *);