Add back mutex_owner() for Solaris compat.

This commit is contained in:
ad 2007-12-24 14:57:56 +00:00
parent a5b4bcb2d5
commit ce6680f888
2 changed files with 7 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_mutex.c,v 1.26 2007/12/06 01:18:46 ad Exp $ */
/* $NetBSD: kern_mutex.c,v 1.27 2007/12/24 14:57:56 ad Exp $ */
/*-
* Copyright (c) 2002, 2006, 2007 The NetBSD Foundation, Inc.
@ -47,7 +47,7 @@
#define __MUTEX_PRIVATE
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.26 2007/12/06 01:18:46 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.27 2007/12/24 14:57:56 ad Exp $");
#include "opt_multiprocessor.h"
@ -254,7 +254,6 @@ __strong_alias(mutex_spin_exit,mutex_vector_exit);
void mutex_abort(kmutex_t *, const char *, const char *);
void mutex_dump(volatile void *);
int mutex_onproc(uintptr_t, struct cpu_info **);
static struct lwp *mutex_owner(wchan_t);
lockops_t mutex_spin_lockops = {
"Mutex",
@ -273,7 +272,7 @@ syncobj_t mutex_syncobj = {
turnstile_unsleep,
turnstile_changepri,
sleepq_lendpri,
mutex_owner,
(void *)mutex_owner,
};
/*
@ -816,10 +815,9 @@ mutex_owned(kmutex_t *mtx)
* Return the current owner of an adaptive mutex. Used for
* priority inheritance.
*/
static struct lwp *
mutex_owner(wchan_t obj)
lwp_t *
mutex_owner(kmutex_t *mtx)
{
kmutex_t *mtx = (void *)(uintptr_t)obj; /* discard qualifiers */
MUTEX_ASSERT(mtx, MUTEX_ADAPTIVE_P(mtx));
return (struct lwp *)MUTEX_OWNER(mtx->mtx_owner);

View File

@ -1,4 +1,4 @@
/* $NetBSD: mutex.h,v 1.13 2007/12/05 07:06:55 ad Exp $ */
/* $NetBSD: mutex.h,v 1.14 2007/12/24 14:57:56 ad Exp $ */
/*-
* Copyright (c) 2002, 2006, 2007 The NetBSD Foundation, Inc.
@ -207,6 +207,7 @@ void mutex_spin_exit(kmutex_t *);
int mutex_tryenter(kmutex_t *);
int mutex_owned(kmutex_t *);
lwp_t *mutex_owner(kmutex_t *);
#endif /* _KERNEL */