Expand NEW_VMCMD() macro to a real function new_vmcmd() for the
non-debugging case as well, rather than expanding it inline. This saves a bunch of kernel bits, e.g. 4kB from GENERIC on i386.
This commit is contained in:
parent
d8ede84c0f
commit
d532b6f4e6
sys
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: exec_subr.c,v 1.40 2003/08/24 17:52:47 chs Exp $ */
|
||||
/* $NetBSD: exec_subr.c,v 1.41 2003/08/29 01:44:02 junyoung Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993, 1994, 1996 Christopher G. Demetriou
|
||||
@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: exec_subr.c,v 1.40 2003/08/24 17:52:47 chs Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: exec_subr.c,v 1.41 2003/08/29 01:44:02 junyoung Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -50,14 +50,11 @@ __KERNEL_RCSID(0, "$NetBSD: exec_subr.c,v 1.40 2003/08/24 17:52:47 chs Exp $");
|
||||
* (calls, extends, kills).
|
||||
*/
|
||||
|
||||
#ifdef DEBUG
|
||||
/*
|
||||
* new_vmcmd():
|
||||
* create a new vmcmd structure and fill in its fields based
|
||||
* on function call arguments. make sure objects ref'd by
|
||||
* the vmcmd are 'held'.
|
||||
*
|
||||
* If not debugging, this is a macro, so it's expanded inline.
|
||||
*/
|
||||
|
||||
void
|
||||
@ -80,7 +77,6 @@ new_vmcmd(struct exec_vmcmd_set *evsp,
|
||||
vcp->ev_prot = prot;
|
||||
vcp->ev_flags = flags;
|
||||
}
|
||||
#endif /* DEBUG */
|
||||
|
||||
void
|
||||
vmcmdset_extend(struct exec_vmcmd_set *evsp)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: exec.h,v 1.100 2003/08/08 18:54:16 christos Exp $ */
|
||||
/* $NetBSD: exec.h,v 1.101 2003/08/29 01:44:03 junyoung Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -247,7 +247,6 @@ int exec_add __P((struct execsw *, const char *));
|
||||
int exec_remove __P((const struct execsw *));
|
||||
#endif /* LKM */
|
||||
|
||||
#ifdef DEBUG
|
||||
void new_vmcmd __P((struct exec_vmcmd_set *,
|
||||
int (*) __P((struct proc *, struct exec_vmcmd *)),
|
||||
u_long, u_long, struct vnode *, u_long, u_int, int));
|
||||
@ -255,24 +254,6 @@ void new_vmcmd __P((struct exec_vmcmd_set *,
|
||||
new_vmcmd(evsp,proc,len,addr,vp,offset,prot,0)
|
||||
#define NEW_VMCMD2(evsp,proc,len,addr,vp,offset,prot,flags) \
|
||||
new_vmcmd(evsp,proc,len,addr,vp,offset,prot,flags)
|
||||
#else /* DEBUG */
|
||||
#define NEW_VMCMD(evsp,proc,len,addr,vp,offset,prot) \
|
||||
NEW_VMCMD2(evsp,proc,len,addr,vp,offset,prot,0)
|
||||
#define NEW_VMCMD2(evsp,proc,len,addr,vp,offset,prot,flags) do { \
|
||||
struct exec_vmcmd *vcp; \
|
||||
if ((evsp)->evs_used >= (evsp)->evs_cnt) \
|
||||
vmcmdset_extend(evsp); \
|
||||
vcp = &(evsp)->evs_cmds[(evsp)->evs_used++]; \
|
||||
vcp->ev_proc = (proc); \
|
||||
vcp->ev_len = (len); \
|
||||
vcp->ev_addr = (addr); \
|
||||
if ((vcp->ev_vp = (vp)) != NULLVP) \
|
||||
VREF(vp); \
|
||||
vcp->ev_offset = (offset); \
|
||||
vcp->ev_prot = (prot); \
|
||||
vcp->ev_flags = (flags); \
|
||||
} while (/* CONSTCOND */ 0)
|
||||
#endif /* DEBUG */
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user