summaryrefslogtreecommitdiff
path: root/sys/kern/kern_exec.c
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2001-06-27 04:49:49 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2001-06-27 04:49:49 +0000
commitb61e35faf27549918f1230cc2ce84736dd843937 (patch)
tree30c8c327ade6c3964b6174515a7d4ac49fb5d480 /sys/kern/kern_exec.c
parentedcf27d64733b7c58c5e752241e2f00119bdc747 (diff)
remove old vm
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r--sys/kern/kern_exec.c39
1 files changed, 1 insertions, 38 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 2194904adeb..eaa05b0dc75 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exec.c,v 1.53 2001/06/22 23:55:23 art Exp $ */
+/* $OpenBSD: kern_exec.c,v 1.54 2001/06/27 04:49:41 art Exp $ */
/* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */
/*-
@@ -61,9 +61,7 @@
#include <vm/vm.h>
#include <vm/vm_kern.h>
-#if defined(UVM)
#include <uvm/uvm_extern.h>
-#endif
#include <machine/cpu.h>
#include <machine/reg.h>
@@ -282,11 +280,7 @@ sys_execve(p, v, retval)
/* XXX -- THE FOLLOWING SECTION NEEDS MAJOR CLEANUP */
/* allocate an argument buffer */
-#if defined(UVM)
argp = (char *) uvm_km_valloc_wait(exec_map, NCARGS);
-#else
- argp = (char *)kmem_alloc_wait(exec_map, NCARGS);
-#endif
#ifdef DIAGNOSTIC
if (argp == (vaddr_t) 0)
panic("execve: argp == NULL");
@@ -380,21 +374,7 @@ sys_execve(p, v, retval)
* Prepare vmspace for remapping. Note that uvmspace_exec can replace
* p_vmspace!
*/
-#if defined(UVM)
uvmspace_exec(p);
-#else
- /* Unmap old program */
-#ifdef __sparc__
- kill_user_windows(p); /* before stack addresses go away */
-#endif
- /* Kill shared memory and unmap old program */
-#ifdef SYSVSHM
- if (vm->vm_shm && vm->vm_refcnt == 1)
- shmexit(vm);
-#endif
- vm_deallocate(&vm->vm_map, VM_MIN_ADDRESS,
- VM_MAXUSER_ADDRESS - VM_MIN_ADDRESS);
-#endif
vm = p->p_vmspace;
/* Now map address space */
@@ -589,11 +569,7 @@ sys_execve(p, v, retval)
splx(s);
}
-#if defined(UVM)
uvm_km_free_wakeup(exec_map, (vaddr_t) argp, NCARGS);
-#else
- kmem_free_wakeup(exec_map, (vaddr_t)argp, NCARGS);
-#endif
FREE(nid.ni_cnd.cn_pnbuf, M_NAMEI);
VOP_CLOSE(pack.ep_vp, FREAD, cred, p);
@@ -639,11 +615,7 @@ bad:
VOP_CLOSE(pack.ep_vp, FREAD, cred, p);
vput(pack.ep_vp);
FREE(nid.ni_cnd.cn_pnbuf, M_NAMEI);
-#if defined(UVM)
uvm_km_free_wakeup(exec_map, (vaddr_t) argp, NCARGS);
-#else
- kmem_free_wakeup(exec_map, (vaddr_t) argp, NCARGS);
-#endif
freehdr:
free(pack.ep_hdr, M_EXEC);
@@ -655,23 +627,14 @@ exec_abort:
* get rid of the (new) address space we have created, if any, get rid
* of our namei data and vnode, and exit noting failure
*/
-#if defined(UVM)
uvm_deallocate(&vm->vm_map, VM_MIN_ADDRESS,
VM_MAXUSER_ADDRESS - VM_MIN_ADDRESS);
-#else
- vm_deallocate(&vm->vm_map, VM_MIN_ADDRESS,
- VM_MAXUSER_ADDRESS - VM_MIN_ADDRESS);
-#endif
if (pack.ep_emul_arg)
FREE(pack.ep_emul_arg, M_TEMP);
FREE(nid.ni_cnd.cn_pnbuf, M_NAMEI);
VOP_CLOSE(pack.ep_vp, FREAD, cred, p);
vput(pack.ep_vp);
-#if defined(UVM)
uvm_km_free_wakeup(exec_map, (vaddr_t) argp, NCARGS);
-#else
- kmem_free_wakeup(exec_map, (vaddr_t) argp, NCARGS);
-#endif
free_pack_abort:
free(pack.ep_hdr, M_EXEC);