diff options
-rw-r--r-- | sys/compat/common/compat_exec.c | 12 | ||||
-rw-r--r-- | sys/compat/hpux/hpux_exec.c | 12 | ||||
-rw-r--r-- | sys/compat/linux/linux_exec.c | 12 | ||||
-rw-r--r-- | sys/compat/m68k4k/m68k4k_exec.c | 12 | ||||
-rw-r--r-- | sys/compat/sunos/sunos_exec.c | 6 |
5 files changed, 27 insertions, 27 deletions
diff --git a/sys/compat/common/compat_exec.c b/sys/compat/common/compat_exec.c index d51393454f5..0f938a21507 100644 --- a/sys/compat/common/compat_exec.c +++ b/sys/compat/common/compat_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: compat_exec.c,v 1.4 1999/01/11 05:12:11 millert Exp $ */ +/* $OpenBSD: compat_exec.c,v 1.5 1999/11/26 16:44:27 art Exp $ */ /* $NetBSD: compat_exec.c,v 1.1 1996/05/18 15:52:21 christos Exp $ */ /* @@ -79,13 +79,13 @@ exec_aout_prep_oldzmagic(p, epp) /* set up command for text segment */ NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, execp->a_text, - epp->ep_taddr, epp->ep_vp, NBPG, /* XXX should NBPG be CLBYTES? */ + epp->ep_taddr, epp->ep_vp, PAGE_SIZE, VM_PROT_READ|VM_PROT_EXECUTE); /* set up command for data segment */ NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, execp->a_data, epp->ep_daddr, epp->ep_vp, - execp->a_text + NBPG, /* XXX should NBPG be CLBYTES? */ + execp->a_text + PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); /* set up command for bss segment */ @@ -131,7 +131,7 @@ exec_aout_prep_oldnmagic(p, epp) VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); /* set up command for bss segment */ - baddr = roundup(epp->ep_daddr + execp->a_data, NBPG); + baddr = round_page(epp->ep_daddr + execp->a_data); bsize = epp->ep_daddr + epp->ep_dsize - baddr; if (bsize > 0) NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, bsize, baddr, @@ -170,7 +170,7 @@ exec_aout_prep_oldomagic(p, epp) sizeof(struct exec), VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); /* set up command for bss segment */ - baddr = roundup(epp->ep_daddr + execp->a_data, NBPG); + baddr = round_page(epp->ep_daddr + execp->a_data); bsize = epp->ep_daddr + epp->ep_dsize - baddr; if (bsize > 0) NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, bsize, baddr, @@ -184,7 +184,7 @@ exec_aout_prep_oldomagic(p, epp) * Compensate `ep_dsize' for the amount of data covered by the last * text page. */ - dsize = epp->ep_dsize + execp->a_text - roundup(execp->a_text, NBPG); + dsize = epp->ep_dsize + execp->a_text - round_page(execp->a_text); epp->ep_dsize = (dsize > 0) ? dsize : 0; return exec_setup_stack(p, epp); } diff --git a/sys/compat/hpux/hpux_exec.c b/sys/compat/hpux/hpux_exec.c index eb3bcf44927..db5b70d08ce 100644 --- a/sys/compat/hpux/hpux_exec.c +++ b/sys/compat/hpux/hpux_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hpux_exec.c,v 1.10 1999/11/10 15:55:21 mickey Exp $ */ +/* $OpenBSD: hpux_exec.c,v 1.11 1999/11/26 16:44:27 art Exp $ */ /* $NetBSD: hpux_exec.c,v 1.8 1997/03/16 10:14:44 thorpej Exp $ */ /* @@ -117,7 +117,7 @@ exec_hpux_makecmds(p, epp) * HP-UX is a 4k page size system, and executables assume * this. */ - if (NBPG != HPUX_LDPGSZ) + if (PAGE_SIZE != HPUX_LDPGSZ) return (ENOEXEC); switch (magic) { @@ -168,7 +168,7 @@ exec_hpux_prep_nmagic(p, epp) VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); /* set up command for bss segment */ - baddr = roundup(epp->ep_daddr + execp->ha_data, NBPG); + baddr = round_page(epp->ep_daddr + execp->ha_data); bsize = epp->ep_daddr + epp->ep_dsize - baddr; if (bsize > 0) NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, bsize, baddr, @@ -224,7 +224,7 @@ exec_hpux_prep_zmagic(p, epp) VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); /* set up command for bss segment */ - baddr = roundup(epp->ep_daddr + execp->ha_data, NBPG); + baddr = round_page(epp->ep_daddr + execp->ha_data); bsize = epp->ep_daddr + epp->ep_dsize - baddr; if (bsize > 0) NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, bsize, baddr, @@ -257,7 +257,7 @@ exec_hpux_prep_omagic(p, epp) VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); /* set up command for bss segment */ - baddr = roundup(epp->ep_daddr + execp->ha_data, NBPG); + baddr = round_page(epp->ep_daddr + execp->ha_data); bsize = epp->ep_daddr + epp->ep_dsize - baddr; if (bsize > 0) NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, bsize, baddr, @@ -271,7 +271,7 @@ exec_hpux_prep_omagic(p, epp) * Compensate `ep_dsize' for the amount of data covered by the last * text page. */ - dsize = epp->ep_dsize + execp->ha_text - roundup(execp->ha_text, NBPG); + dsize = epp->ep_dsize + execp->ha_text - round_page(execp->ha_text); epp->ep_dsize = (dsize > 0) ? dsize : 0; return (exec_setup_stack(p, epp)); } diff --git a/sys/compat/linux/linux_exec.c b/sys/compat/linux/linux_exec.c index 0ca350998be..c16b4ad72f1 100644 --- a/sys/compat/linux/linux_exec.c +++ b/sys/compat/linux/linux_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: linux_exec.c,v 1.12 1999/11/10 15:55:22 mickey Exp $ */ +/* $OpenBSD: linux_exec.c,v 1.13 1999/11/26 16:44:28 art Exp $ */ /* $NetBSD: linux_exec.c,v 1.13 1996/04/05 00:01:10 christos Exp $ */ /* @@ -277,7 +277,7 @@ exec_linux_aout_prep_nmagic(p, epp) VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); /* set up command for bss segment */ - baddr = roundup(epp->ep_daddr + execp->a_data, NBPG); + baddr = round_page(epp->ep_daddr + execp->a_data); bsize = epp->ep_daddr + epp->ep_dsize - baddr; if (bsize > 0) NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, bsize, baddr, @@ -311,7 +311,7 @@ exec_linux_aout_prep_omagic(p, epp) LINUX_N_TXTOFF(*execp, OMAGIC), VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); /* set up command for bss segment */ - baddr = roundup(epp->ep_daddr + execp->a_data, NBPG); + baddr = round_page(epp->ep_daddr + execp->a_data); bsize = epp->ep_daddr + epp->ep_dsize - baddr; if (bsize > 0) NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, bsize, baddr, @@ -325,7 +325,7 @@ exec_linux_aout_prep_omagic(p, epp) * Compensate `ep_dsize' for the amount of data covered by the last * text page. */ - dsize = epp->ep_dsize + execp->a_text - roundup(execp->a_text, NBPG); + dsize = epp->ep_dsize + execp->a_text - round_page(execp->a_text); epp->ep_dsize = (dsize > 0) ? dsize : 0; return (exec_setup_stack(p, epp)); } @@ -467,7 +467,7 @@ linux_sys_uselib(p, v, retval) return (ENOEXEC); magic = LINUX_N_MAGIC(&hdr); - taddr = hdr.a_entry & (~(NBPG - 1)); + taddr = trunc_page(hdr.a_entry); tsize = hdr.a_text; daddr = taddr + tsize; dsize = hdr.a_data + hdr.a_bss; @@ -486,7 +486,7 @@ linux_sys_uselib(p, v, retval) hdr.a_text + hdr.a_data, taddr, vp, LINUX_N_TXTOFF(hdr, magic), VM_PROT_READ|VM_PROT_EXECUTE|VM_PROT_WRITE); - baddr = roundup(daddr + hdr.a_data, NBPG); + baddr = round_page(daddr + hdr.a_data); bsize = daddr + dsize - baddr; if (bsize > 0) { NEW_VMCMD(&vcset, vmcmd_map_zero, bsize, baddr, diff --git a/sys/compat/m68k4k/m68k4k_exec.c b/sys/compat/m68k4k/m68k4k_exec.c index 484d674b7fb..ce2f79a46b7 100644 --- a/sys/compat/m68k4k/m68k4k_exec.c +++ b/sys/compat/m68k4k/m68k4k_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: m68k4k_exec.c,v 1.2 1999/01/11 05:12:14 millert Exp $ */ +/* $OpenBSD: m68k4k_exec.c,v 1.3 1999/11/26 16:44:28 art Exp $ */ /* $NetBSD: m68k4k_exec.c,v 1.1 1996/09/10 22:01:20 thorpej Exp $ */ /* @@ -38,7 +38,7 @@ * Taken directly from kern/exec_aout.c and frobbed to map text and * data as m68k4k executables expect. * - * This module only works on machines with NBPG == 4096. It's not clear + * This module only works on machines with PAGE_SIZE == 4096. It's not clear * that making it work on other machines is worth the trouble. */ @@ -86,7 +86,7 @@ exec_m68k4k_makecmds(p, epp) struct exec *execp = epp->ep_hdr; /* See note above... */ - if (M68K4K_LDPGSZ != NBPG) + if (M68K4K_LDPGSZ != PAGE_SIZE) return ENOEXEC; if (epp->ep_hdrvalid < sizeof(struct exec)) @@ -203,7 +203,7 @@ exec_m68k4k_prep_nmagic(p, epp) VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); /* set up command for bss segment */ - baddr = roundup(epp->ep_daddr + execp->a_data, NBPG); + baddr = round_page(epp->ep_daddr + execp->a_data); bsize = epp->ep_daddr + epp->ep_dsize - baddr; if (bsize > 0) NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, bsize, baddr, @@ -236,7 +236,7 @@ exec_m68k4k_prep_omagic(p, epp) sizeof(struct exec), VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); /* set up command for bss segment */ - baddr = roundup(epp->ep_daddr + execp->a_data, NBPG); + baddr = round_page(epp->ep_daddr + execp->a_data); bsize = epp->ep_daddr + epp->ep_dsize - baddr; if (bsize > 0) NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, bsize, baddr, @@ -250,7 +250,7 @@ exec_m68k4k_prep_omagic(p, epp) * Compensate `ep_dsize' for the amount of data covered by the last * text page. */ - dsize = epp->ep_dsize + execp->a_text - roundup(execp->a_text, NBPG); + dsize = epp->ep_dsize + execp->a_text - round_page(execp->a_text); epp->ep_dsize = (dsize > 0) ? dsize : 0; return exec_setup_stack(p, epp); } diff --git a/sys/compat/sunos/sunos_exec.c b/sys/compat/sunos/sunos_exec.c index 5c94adde5f5..b7b1d64f894 100644 --- a/sys/compat/sunos/sunos_exec.c +++ b/sys/compat/sunos/sunos_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sunos_exec.c,v 1.9 1999/07/02 17:53:50 brad Exp $ */ +/* $OpenBSD: sunos_exec.c,v 1.10 1999/11/26 16:44:28 art Exp $ */ /* $NetBSD: sunos_exec.c,v 1.11 1996/05/05 12:01:47 briggs Exp $ */ /* @@ -227,7 +227,7 @@ sunos_exec_aout_prep_nmagic(p, epp) VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); /* set up command for bss segment */ - baddr = roundup(epp->ep_daddr + execp->a_data, NBPG); + baddr = round_page(epp->ep_daddr + execp->a_data); bsize = epp->ep_daddr + epp->ep_dsize - baddr; if (bsize > 0) NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, bsize, baddr, @@ -259,7 +259,7 @@ sunos_exec_aout_prep_omagic(p, epp) SUNOS_N_TXTOFF(*execp, OMAGIC), VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); /* set up command for bss segment */ - baddr = roundup(epp->ep_daddr + execp->a_data, NBPG); + baddr = round_page(epp->ep_daddr + execp->a_data); bsize = epp->ep_daddr + epp->ep_dsize - baddr; if (bsize > 0) NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, bsize, baddr, |