struct vm_map *map, *submap;
vm_map_t map, submap;
uvm_map_submap(map, start, end, submap)	struct vm_map *map, *submap;	vaddr_t start, end;{	struct vm_map_entry *entry;	int error;	vm_map_lock(map);	VM_MAP_RANGE_CHECK(map, start, end);	if (uvm_map_lookup_entry(map, start, &entry)) {		UVM_MAP_CLIP_START(map, entry, start);		UVM_MAP_CLIP_END(map, entry, end);		/* to be safe */	} else {		entry = NULL;	}	if (entry != NULL &&	    entry->start == start && entry->end == end &&	    entry->object.uvm_obj == NULL && entry->aref.ar_amap == NULL &&	    !UVM_ET_ISCOPYONWRITE(entry) && !UVM_ET_ISNEEDSCOPY(entry)) {		entry->etype |= UVM_ET_SUBMAP;		entry->object.sub_map = submap;		entry->offset = 0;		uvm_map_reference(submap);		error = 0;	} else {		error = EINVAL;	}	vm_map_unlock(map);	return error;}