Changeset View
Changeset View
Standalone View
Standalone View
head/sys/vm/vm_map.c
Show First 20 Lines • Show All 2,371 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* vm_map_clip_start: [ internal use only ] | * vm_map_clip_start: [ internal use only ] | ||||
* | * | ||||
* Asserts that the given entry begins at or after | * Asserts that the given entry begins at or after | ||||
* the specified address; if necessary, | * the specified address; if necessary, | ||||
* it splits the entry into two. | * it splits the entry into two. | ||||
*/ | */ | ||||
#define vm_map_clip_start(map, entry, startaddr) \ | |||||
{ \ | |||||
if (startaddr > entry->start) \ | |||||
_vm_map_clip_start(map, entry, startaddr); \ | |||||
} | |||||
/* | |||||
* This routine is called only when it is known that | |||||
* the entry must be split. | |||||
*/ | |||||
static inline void | static inline void | ||||
_vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, vm_offset_t start) | vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, vm_offset_t start) | ||||
{ | { | ||||
vm_map_entry_t new_entry; | vm_map_entry_t new_entry; | ||||
if (start <= entry->start) | |||||
return; | |||||
VM_MAP_ASSERT_LOCKED(map); | VM_MAP_ASSERT_LOCKED(map); | ||||
KASSERT(entry->end > start && entry->start < start, | KASSERT(entry->end > start && entry->start < start, | ||||
("_vm_map_clip_start: invalid clip of entry %p", entry)); | ("%s: invalid clip of entry %p", __func__, entry)); | ||||
new_entry = vm_map_entry_clone(map, entry); | new_entry = vm_map_entry_clone(map, entry); | ||||
/* | /* | ||||
* Split off the front portion. Insert the new entry BEFORE this one, | * Split off the front portion. Insert the new entry BEFORE this one, | ||||
* so that this entry has the specified starting address. | * so that this entry has the specified starting address. | ||||
*/ | */ | ||||
new_entry->end = start; | new_entry->end = start; | ||||
Show All 24 Lines | |||||
/* | /* | ||||
* vm_map_clip_end: [ internal use only ] | * vm_map_clip_end: [ internal use only ] | ||||
* | * | ||||
* Asserts that the given entry ends at or before | * Asserts that the given entry ends at or before | ||||
* the specified address; if necessary, | * the specified address; if necessary, | ||||
* it splits the entry into two. | * it splits the entry into two. | ||||
*/ | */ | ||||
#define vm_map_clip_end(map, entry, endaddr) \ | |||||
{ \ | |||||
if ((endaddr) < (entry->end)) \ | |||||
_vm_map_clip_end((map), (entry), (endaddr)); \ | |||||
} | |||||
/* | |||||
* This routine is called only when it is known that | |||||
* the entry must be split. | |||||
*/ | |||||
static inline void | static inline void | ||||
_vm_map_clip_end(vm_map_t map, vm_map_entry_t entry, vm_offset_t end) | vm_map_clip_end(vm_map_t map, vm_map_entry_t entry, vm_offset_t end) | ||||
{ | { | ||||
vm_map_entry_t new_entry; | vm_map_entry_t new_entry; | ||||
if (end >= entry->end) | |||||
return; | |||||
VM_MAP_ASSERT_LOCKED(map); | VM_MAP_ASSERT_LOCKED(map); | ||||
KASSERT(entry->start < end && entry->end > end, | KASSERT(entry->start < end && entry->end > end, | ||||
("_vm_map_clip_end: invalid clip of entry %p", entry)); | ("%s: invalid clip of entry %p", __func__, entry)); | ||||
new_entry = vm_map_entry_clone(map, entry); | new_entry = vm_map_entry_clone(map, entry); | ||||
/* | /* | ||||
* Split off the back portion. Insert the new entry AFTER this one, | * Split off the back portion. Insert the new entry AFTER this one, | ||||
* so that this entry has the specified ending address. | * so that this entry has the specified ending address. | ||||
*/ | */ | ||||
new_entry->start = end; | new_entry->start = end; | ||||
▲ Show 20 Lines • Show All 2,727 Lines • Show Last 20 Lines |