Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Specify a process' address space limits for uvmspace_exe...
details: https://anonhg.NetBSD.org/src/rev/24dc462f328a
branches: trunk
changeset: 503458:24dc462f328a
user: eeh <eeh%NetBSD.org@localhost>
date: Tue Feb 06 17:01:51 2001 +0000
description:
Specify a process' address space limits for uvmspace_exec().
diffstat:
sys/compat/netbsd32/netbsd32_netbsd.c | 8 +++++---
sys/kern/kern_exec.c | 4 ++--
sys/uvm/uvm_extern.h | 4 ++--
sys/uvm/uvm_map.c | 9 +++++----
4 files changed, 14 insertions(+), 11 deletions(-)
diffs (104 lines):
diff -r 5d2b33fcf6dc -r 24dc462f328a sys/compat/netbsd32/netbsd32_netbsd.c
--- a/sys/compat/netbsd32/netbsd32_netbsd.c Tue Feb 06 16:45:19 2001 +0000
+++ b/sys/compat/netbsd32/netbsd32_netbsd.c Tue Feb 06 17:01:51 2001 +0000
@@ -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 @@
* 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 @@
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);
}
diff -r 5d2b33fcf6dc -r 24dc462f328a sys/kern/kern_exec.c
--- a/sys/kern/kern_exec.c Tue Feb 06 16:45:19 2001 +0000
+++ b/sys/kern/kern_exec.c Tue Feb 06 17:01:51 2001 +0000
@@ -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 @@
* 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;
diff -r 5d2b33fcf6dc -r 24dc462f328a sys/uvm/uvm_extern.h
--- a/sys/uvm/uvm_extern.h Tue Feb 06 16:45:19 2001 +0000
+++ b/sys/uvm/uvm_extern.h Tue Feb 06 17:01:51 2001 +0000
@@ -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 @@
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 *));
diff -r 5d2b33fcf6dc -r 24dc462f328a sys/uvm/uvm_map.c
--- a/sys/uvm/uvm_map.c Tue Feb 06 16:45:19 2001 +0000
+++ b/sys/uvm/uvm_map.c Tue Feb 06 17:01:51 2001 +0000
@@ -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 @@
*/
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 @@
/*
* 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 @@
* 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);
/*
Home |
Main Index |
Thread Index |
Old Index