remove useless passing of the lwp from the KERNEL_LOCK() ABI

(not the API; this would be easy as well)
agreed (a while ago) by ad
This commit is contained in:
drochner 2008-04-01 19:49:31 +00:00
parent 17cfc674b7
commit 76ad1614e9
3 changed files with 14 additions and 18 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_lock.c,v 1.136 2008/03/30 15:39:46 ad Exp $ */
/* $NetBSD: kern_lock.c,v 1.137 2008/04/01 19:49:31 drochner Exp $ */
/*-
* Copyright (c) 2002, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.136 2008/03/30 15:39:46 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.137 2008/04/01 19:49:31 drochner Exp $");
#include "opt_multiprocessor.h"
@ -162,7 +162,7 @@ _kernel_lock_dump(volatile void *junk)
* acquisition is from process context.
*/
void
_kernel_lock(int nlocks, struct lwp *l)
_kernel_lock(int nlocks)
{
struct cpu_info *ci = curcpu();
LOCKSTAT_TIMER(spintime);
@ -170,13 +170,10 @@ _kernel_lock(int nlocks, struct lwp *l)
struct lwp *owant;
u_int spins;
int s;
struct lwp *l = curlwp;
if (nlocks == 0)
return;
_KERNEL_LOCK_ASSERT(nlocks > 0);
l = curlwp;
if (ci->ci_biglock_count != 0) {
_KERNEL_LOCK_ASSERT(__SIMPLELOCK_LOCKED_P(kernel_lock));
ci->ci_biglock_count += nlocks;
@ -269,13 +266,12 @@ _kernel_lock(int nlocks, struct lwp *l)
* all holds. If 'l' is non-null, the release is from process context.
*/
void
_kernel_unlock(int nlocks, struct lwp *l, int *countp)
_kernel_unlock(int nlocks, int *countp)
{
struct cpu_info *ci = curcpu();
u_int olocks;
int s;
l = curlwp;
struct lwp *l = curlwp;
_KERNEL_LOCK_ASSERT(nlocks < 2);

View File

@ -1,4 +1,4 @@
/* $NetBSD: locks.c,v 1.12 2008/03/11 10:50:16 pooka Exp $ */
/* $NetBSD: locks.c,v 1.13 2008/04/01 19:49:31 drochner Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@ -230,7 +230,7 @@ cv_broadcast(kcondvar_t *cv)
/* kernel biglock, only for vnode_if */
void
_kernel_lock(int nlocks, struct lwp *l)
_kernel_lock(int nlocks)
{
KASSERT(nlocks == 1);
@ -238,7 +238,7 @@ _kernel_lock(int nlocks, struct lwp *l)
}
void
_kernel_unlock(int nlocks, struct lwp *l, int *countp)
_kernel_unlock(int nlocks, int *countp)
{
KASSERT(nlocks == 1);

View File

@ -1,4 +1,4 @@
/* $NetBSD: systm.h,v 1.218 2008/03/25 23:21:42 yamt Exp $ */
/* $NetBSD: systm.h,v 1.219 2008/04/01 19:49:31 drochner Exp $ */
/*-
* Copyright (c) 1982, 1988, 1991, 1993
@ -463,16 +463,16 @@ void scdebug_call(register_t, const register_t[]);
void scdebug_ret(register_t, int, const register_t[]);
void kernel_lock_init(void);
void _kernel_lock(int, struct lwp *);
void _kernel_unlock(int, struct lwp *, int *);
void _kernel_lock(int);
void _kernel_unlock(int, int *);
#if defined(MULTIPROCESSOR) || defined(_LKM)
#define KERNEL_LOCK(count, lwp) \
do { \
if ((count) != 0) \
_kernel_lock((count), (lwp)); \
_kernel_lock((count)); \
} while (/* CONSTCOND */ 0)
#define KERNEL_UNLOCK(all, lwp, p) _kernel_unlock((all), (lwp), (p))
#define KERNEL_UNLOCK(all, lwp, p) _kernel_unlock((all), (p))
#else
#define KERNEL_LOCK(count, lwp) /* nothing */
#define KERNEL_UNLOCK(all, lwp, ptr) /* nothing */