diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2024-11-02 10:02:24 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2024-11-02 10:02:24 +0000 |
commit | e5fbe6bf3dfd04c3a74eeb4005e5c976a2bd2eb0 (patch) | |
tree | 4447897ba372644acfaae0126b981dda84138ac8 /sys | |
parent | a8c23be6880c4a0849ad6732eb382629563e483b (diff) |
Always use new_vmcmd() from exec_subr.c, remove the macro which
duplicated code with no benefit.
ok mpi@ miod@ deraadt@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/exec_subr.c | 6 | ||||
-rw-r--r-- | sys/sys/exec.h | 22 |
2 files changed, 2 insertions, 26 deletions
diff --git a/sys/kern/exec_subr.c b/sys/kern/exec_subr.c index 4ebca1b981d..9f4aea64a8f 100644 --- a/sys/kern/exec_subr.c +++ b/sys/kern/exec_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_subr.c,v 1.67 2024/04/02 08:39:16 deraadt Exp $ */ +/* $OpenBSD: exec_subr.c,v 1.68 2024/11/02 10:02:23 jsg Exp $ */ /* $NetBSD: exec_subr.c,v 1.9 1994/12/04 03:10:42 mycroft Exp $ */ /* @@ -42,14 +42,11 @@ #include <uvm/uvm_extern.h> -#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 @@ -71,7 +68,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) diff --git a/sys/sys/exec.h b/sys/sys/exec.h index 687ccb3ec6f..7c777ac90a6 100644 --- a/sys/sys/exec.h +++ b/sys/sys/exec.h @@ -1,4 +1,4 @@ -/* $OpenBSD: exec.h,v 1.55 2024/10/16 18:47:48 miod Exp $ */ +/* $OpenBSD: exec.h,v 1.56 2024/11/02 10:02:23 jsg Exp $ */ /* $NetBSD: exec.h,v 1.59 1996/02/09 18:25:09 christos Exp $ */ /*- @@ -161,7 +161,6 @@ int check_exec(struct proc *, struct exec_package *); int exec_setup_stack(struct proc *, struct exec_package *); int exec_process_vmcmds(struct proc *, struct exec_package *); -#ifdef DEBUG void new_vmcmd(struct exec_vmcmd_set *evsp, int (*proc)(struct proc *p, struct exec_vmcmd *), u_long len, u_long addr, struct vnode *vp, u_long offset, @@ -170,25 +169,6 @@ void new_vmcmd(struct exec_vmcmd_set *evsp, 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 (0) - -#endif /* DEBUG */ /* Initialize an empty vmcmd set */ #define VMCMDSET_INIT(vmc) do { \ |