struct vm_map *map = &ovm->vm_map;
vm_map_t map = &ovm->vm_map;
uvmspace_exec(p, start, end)	struct proc *p;	vaddr_t start, end;{	struct vmspace *nvm, *ovm = p->p_vmspace;	struct vm_map *map = &ovm->vm_map;#ifdef __sparc__	/* XXX cgd 960926: the sparc #ifdef should be a MD hook */	kill_user_windows(p);   /* before stack addresses go away */#endif	/*	 * see if more than one process is using this vmspace...	 */	if (ovm->vm_refcnt == 1) {		/*		 * if p is the only process using its vmspace then we can safely		 * recycle that vmspace for the program that is being exec'd.		 */#ifdef SYSVSHM		/*		 * SYSV SHM semantics require us to kill all segments on an exec		 */		if (ovm->vm_shm)			shmexit(ovm);#endif		/*		 * POSIX 1003.1b -- "lock future mappings" is revoked		 * when a process execs another program image.		 */		vm_map_lock(map);		vm_map_modflags(map, 0, VM_MAP_WIREFUTURE);		vm_map_unlock(map);		/*		 * now unmap the old program		 */		uvm_unmap(map, map->min_offset, map->max_offset);		/*		 * resize the map		 */		vm_map_lock(map);		map->min_offset = start;		map->max_offset = end;		vm_map_unlock(map);	} else {		/*		 * p's vmspace is being shared, so we can't reuse it for p since		 * it is still being used for others.   allocate a new vmspace		 * for p		 */		nvm = uvmspace_alloc(start, end);		/*		 * install new vmspace and drop our ref to the old one.		 */		pmap_deactivate(p);		p->p_vmspace = nvm;		pmap_activate(p);		uvmspace_free(ovm);	}}