-/* $OpenBSD: mplock.h,v 1.5 2021/05/21 00:39:35 gkoehler Exp $ */
+/* $OpenBSD: mplock.h,v 1.6 2024/04/03 19:30:59 gkoehler Exp $ */
/*
* Copyright (c) 2004 Niklas Hallqvist. All rights reserved.
#ifndef _LOCORE
-void __ppc_lock_init(struct __ppc_lock *);
+#define PPC_LOCK_INITIALIZER { NULL, 0 }
+
void __ppc_lock(struct __ppc_lock *);
void __ppc_unlock(struct __ppc_lock *);
-/* $OpenBSD: lock_machdep.c,v 1.11 2023/04/11 00:45:07 jsg Exp $ */
+/* $OpenBSD: lock_machdep.c,v 1.12 2024/04/03 19:30:59 gkoehler Exp $ */
/*
* Copyright (c) 2021 George Koehler <gkoehler@openbsd.org>
* Released the lock: mpl->mpl_cpu == NULL
*/
-void
-__ppc_lock_init(struct __ppc_lock *lock)
-{
- lock->mpl_cpu = NULL;
- lock->mpl_count = 0;
-}
-
#if defined(MP_LOCKDEBUG)
#ifndef DDB
#error "MP_LOCKDEBUG requires DDB"
-/* $OpenBSD: pmap.c,v 1.182 2023/02/21 04:49:43 gkoehler Exp $ */
+/* $OpenBSD: pmap.c,v 1.183 2024/04/03 19:30:59 gkoehler Exp $ */
/*
* Copyright (c) 2015 Martin Pieuchot
int physmaxaddr;
#ifdef MULTIPROCESSOR
-struct __ppc_lock pmap_hash_lock;
-
-#define PMAP_HASH_LOCK_INIT() __ppc_lock_init(&pmap_hash_lock)
+struct __ppc_lock pmap_hash_lock = PPC_LOCK_INITIALIZER;
#define PMAP_HASH_LOCK(s) \
do { \
#else /* ! MULTIPROCESSOR */
-#define PMAP_HASH_LOCK_INIT() /* nothing */
#define PMAP_HASH_LOCK(s) (void)s
#define PMAP_HASH_UNLOCK(s) /* nothing */
"pted", NULL);
pool_setlowat(&pmap_pted_pool, 20);
- PMAP_HASH_LOCK_INIT();
-
pmap_initialized = 1;
}
-/* $OpenBSD: pmap.c,v 1.60 2023/04/13 15:23:22 miod Exp $ */
+/* $OpenBSD: pmap.c,v 1.61 2024/04/03 19:30:59 gkoehler Exp $ */
/*
* Copyright (c) 2015 Martin Pieuchot
#ifdef MULTIPROCESSOR
-struct mutex pmap_hash_lock;
-
-#define PMAP_HASH_LOCK_INIT() mtx_init(&pmap_hash_lock, IPL_HIGH)
+struct mutex pmap_hash_lock = MUTEX_INITIALIZER(IPL_HIGH);
#define PMAP_HASH_LOCK(s) \
do { \
#else
-#define PMAP_HASH_LOCK_INIT() /* nothing */
#define PMAP_HASH_LOCK(s) (void)s
#define PMAP_HASH_UNLOCK(s) /* nothing */
"slbd", NULL);
pool_setlowat(&pmap_slbd_pool, 5);
- PMAP_HASH_LOCK_INIT();
-
LIST_INIT(&pmap_kernel()->pm_slbd);
for (i = 0; i < nitems(kernel_slb_desc); i++) {
LIST_INSERT_HEAD(&pmap_kernel()->pm_slbd,