rwlock(9): Nix extern _rw_init in .c; use sys/rwlock.h.
This commit is contained in:
parent
ed636a2cc7
commit
7fbe66c347
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: kern_rwlock_obj.c,v 1.7 2022/04/09 23:38:33 riastradh Exp $ */
|
||||
/* $NetBSD: kern_rwlock_obj.c,v 1.8 2022/10/26 23:22:22 riastradh Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2008, 2009, 2019 The NetBSD Foundation, Inc.
|
||||
|
@ -30,7 +30,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: kern_rwlock_obj.c,v 1.7 2022/04/09 23:38:33 riastradh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: kern_rwlock_obj.c,v 1.8 2022/10/26 23:22:22 riastradh Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/atomic.h>
|
||||
|
@ -87,7 +87,6 @@ krwlock_t *
|
|||
rw_obj_alloc(void)
|
||||
{
|
||||
struct krwobj *ro;
|
||||
extern void _rw_init(krwlock_t *, uintptr_t);
|
||||
|
||||
ro = pool_cache_get(rw_obj_cache, PR_WAITOK);
|
||||
_rw_init(&ro->ro_lock, (uintptr_t)__builtin_return_address(0));
|
||||
|
@ -105,7 +104,6 @@ krwlock_t *
|
|||
rw_obj_tryalloc(void)
|
||||
{
|
||||
struct krwobj *ro;
|
||||
extern void _rw_init(krwlock_t *, uintptr_t);
|
||||
|
||||
ro = pool_cache_get(rw_obj_cache, PR_NOWAIT);
|
||||
if (__predict_true(ro != NULL)) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: locks.c,v 1.82 2022/10/26 23:21:20 riastradh Exp $ */
|
||||
/* $NetBSD: locks.c,v 1.83 2022/10/26 23:22:22 riastradh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved.
|
||||
|
@ -26,7 +26,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: locks.c,v 1.82 2022/10/26 23:21:20 riastradh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: locks.c,v 1.83 2022/10/26 23:22:22 riastradh Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/kmem.h>
|
||||
|
@ -246,7 +246,6 @@ krw2rumprw(const krw_t op)
|
|||
}
|
||||
}
|
||||
|
||||
void _rw_init(krwlock_t *, uintptr_t);
|
||||
void
|
||||
_rw_init(krwlock_t *rw, uintptr_t return_address)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rwlock.h,v 1.16 2020/02/22 21:24:45 ad Exp $ */
|
||||
/* $NetBSD: rwlock.h,v 1.17 2022/10/26 23:22:22 riastradh Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2002, 2006, 2007, 2008, 2019, 2020 The NetBSD Foundation, Inc.
|
||||
|
@ -83,7 +83,6 @@ typedef struct krwlock krwlock_t;
|
|||
void rw_vector_enter(krwlock_t *, const krw_t);
|
||||
void rw_vector_exit(krwlock_t *);
|
||||
int rw_vector_tryenter(krwlock_t *, const krw_t);
|
||||
void _rw_init(krwlock_t *, uintptr_t);
|
||||
bool rw_owner_running(const krwlock_t *);
|
||||
#endif /* __RWLOCK_PRIVATE */
|
||||
|
||||
|
@ -93,6 +92,7 @@ struct krwlock {
|
|||
|
||||
#ifdef _KERNEL
|
||||
|
||||
void _rw_init(krwlock_t *, uintptr_t);
|
||||
void rw_init(krwlock_t *);
|
||||
void rw_destroy(krwlock_t *);
|
||||
|
||||
|
|
Loading…
Reference in New Issue