Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/vm_map.c
Context not available. | |||||
* Delete all of the mappings and pages they hold, then call | * Delete all of the mappings and pages they hold, then call | ||||
* the pmap module to reclaim anything left. | * the pmap module to reclaim anything left. | ||||
*/ | */ | ||||
(void)vm_map_remove(&vm->vm_map, vm->vm_map.min_offset, | (void)vm_map_remove(&vm->vm_map, vm->vm_map.header.end, | ||||
vm->vm_map.max_offset); | vm->vm_map.header.start); | ||||
pmap_release(vmspace_pmap(vm)); | pmap_release(vmspace_pmap(vm)); | ||||
vm->vm_map.pmap = NULL; | vm->vm_map.pmap = NULL; | ||||
Context not available. | |||||
map->needs_wakeup = FALSE; | map->needs_wakeup = FALSE; | ||||
map->system_map = 0; | map->system_map = 0; | ||||
map->pmap = pmap; | map->pmap = pmap; | ||||
map->min_offset = min; | map->header.end = min; | ||||
map->max_offset = max; | map->header.start = max; | ||||
map->flags = 0; | map->flags = 0; | ||||
map->root = NULL; | map->root = NULL; | ||||
map->timestamp = 0; | map->timestamp = 0; | ||||
Context not available. | |||||
/* | /* | ||||
* Check that the start and end points are not bogus. | * Check that the start and end points are not bogus. | ||||
*/ | */ | ||||
if (start < map->min_offset || end > map->max_offset || start >= end) | if (start < map->header.end || end > map->header.start || start >= end) | ||||
return (KERN_INVALID_ADDRESS); | return (KERN_INVALID_ADDRESS); | ||||
/* | /* | ||||
Context not available. | |||||
* Request must fit within min/max VM address and must avoid | * Request must fit within min/max VM address and must avoid | ||||
* address wrap. | * address wrap. | ||||
*/ | */ | ||||
if (start < map->min_offset) | if (start < map->header.end) | ||||
start = map->min_offset; | start = map->header.end; | ||||
if (start + length > map->max_offset || start + length < start) | if (start + length > map->header.start || start + length < start) | ||||
return (1); | return (1); | ||||
/* Empty tree means wide open address space. */ | /* Empty tree means wide open address space. */ | ||||
Context not available. | |||||
old_map = &vm1->vm_map; | old_map = &vm1->vm_map; | ||||
/* Copy immutable fields of vm1 to vm2. */ | /* Copy immutable fields of vm1 to vm2. */ | ||||
vm2 = vmspace_alloc(old_map->min_offset, old_map->max_offset, NULL); | vm2 = vmspace_alloc(old_map->header.end, old_map->header.start, NULL); | ||||
if (vm2 == NULL) | if (vm2 == NULL) | ||||
return (NULL); | return (NULL); | ||||
vm2->vm_taddr = vm1->vm_taddr; | vm2->vm_taddr = vm1->vm_taddr; | ||||
Context not available. | |||||
vm_map_max_KBI(const struct vm_map *map) | vm_map_max_KBI(const struct vm_map *map) | ||||
{ | { | ||||
return (map->max_offset); | return (map->header.start); | ||||
} | } | ||||
vm_offset_t | vm_offset_t | ||||
Context not available. | |||||
vm_map_min_KBI(const struct vm_map *map) | vm_map_min_KBI(const struct vm_map *map) | ||||
{ | { | ||||
return (map->min_offset); | return (map->header.end); | ||||
} | } | ||||
pmap_t | pmap_t | ||||
Context not available. |