Specify a process' address space limits for uvmspace_exec().

This commit is contained in:
eeh 2001-02-06 17:01:51 +00:00
parent 6a7b420b7e
commit 4380259bc7
4 changed files with 14 additions and 11 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_netbsd.c,v 1.54 2001/02/04 09:00:14 mrg Exp $ */
/* $NetBSD: netbsd32_netbsd.c,v 1.55 2001/02/06 17:01:53 eeh Exp $ */
/*
* Copyright (c) 1998 Matthew R. Green
@ -2021,7 +2021,7 @@ netbsd32_execve2(p, uap, retval)
* for remapping. Note that this might replace the current
* vmspace with another!
*/
uvmspace_exec(p);
uvmspace_exec(p, VM_MIN_ADDRESS, (vaddr_t)pack.ep_minsaddr);
/* Now map address space */
vm = p->p_vmspace;
@ -4134,8 +4134,10 @@ netbsd32_mmap(p, v, retval)
NETBSD32TOX_UAP(pad, long);
NETBSD32TOX_UAP(pos, off_t);
error = sys_mmap(p, &ua, (register_t *)&rt);
if ((long)rt > (long)UINT_MAX)
if ((u_long)rt > (u_long)UINT_MAX) {
printf("netbsd32_mmap: retval out of range: %p", rt);
/* Should try to recover and return an error here. */
}
*retval = (netbsd32_voidp)(u_long)rt;
return (error);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_exec.c,v 1.134 2000/12/22 22:58:59 jdolecek Exp $ */
/* $NetBSD: kern_exec.c,v 1.135 2001/02/06 17:01:53 eeh Exp $ */
/*-
* Copyright (C) 1993, 1994, 1996 Christopher G. Demetriou
@ -453,7 +453,7 @@ sys_execve(struct proc *p, void *v, register_t *retval)
* for remapping. Note that this might replace the current
* vmspace with another!
*/
uvmspace_exec(p);
uvmspace_exec(p, VM_MIN_ADDRESS, (vaddr_t)pack.ep_minsaddr);
/* Now map address space */
vm = p->p_vmspace;

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_extern.h,v 1.55 2000/11/30 11:04:43 simonb Exp $ */
/* $NetBSD: uvm_extern.h,v 1.56 2001/02/06 17:01:52 eeh Exp $ */
/*
*
@ -593,7 +593,7 @@ struct vmspace *uvmspace_alloc __P((vaddr_t, vaddr_t,
boolean_t));
void uvmspace_init __P((struct vmspace *, struct pmap *,
vaddr_t, vaddr_t, boolean_t));
void uvmspace_exec __P((struct proc *));
void uvmspace_exec __P((struct proc *, vaddr_t, vaddr_t));
struct vmspace *uvmspace_fork __P((struct vmspace *));
void uvmspace_free __P((struct vmspace *));
void uvmspace_share __P((struct proc *, struct proc *));

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_map.c,v 1.90 2001/02/05 11:29:54 chs Exp $ */
/* $NetBSD: uvm_map.c,v 1.91 2001/02/06 17:01:51 eeh Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@ -2763,8 +2763,9 @@ uvmspace_unshare(p)
*/
void
uvmspace_exec(p)
uvmspace_exec(p, start, end)
struct proc *p;
vaddr_t start, end;
{
struct vmspace *nvm, *ovm = p->p_vmspace;
vm_map_t map = &ovm->vm_map;
@ -2804,7 +2805,7 @@ uvmspace_exec(p)
/*
* now unmap the old program
*/
uvm_unmap(map, VM_MIN_ADDRESS, VM_MAXUSER_ADDRESS);
uvm_unmap(map, map->min_offset, map->max_offset);
} else {
@ -2813,7 +2814,7 @@ uvmspace_exec(p)
* it is still being used for others. allocate a new vmspace
* for p
*/
nvm = uvmspace_alloc(map->min_offset, map->max_offset,
nvm = uvmspace_alloc(start, end,
(map->flags & VM_MAP_PAGEABLE) ? TRUE : FALSE);
/*