vm_map: Add a macro to fetch a map entry's split boundary index
The resulting code is a bit more concise. No functional change intended. Reviewed by: alc, dougm, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D41249
This commit is contained in:
parent
135c2b7156
commit
d0e4e53ebd
@ -539,8 +539,7 @@ vm_fault_populate(struct faultstate *fs)
|
||||
MPASS(pager_last < fs->first_object->size);
|
||||
|
||||
vm_fault_restore_map_lock(fs);
|
||||
bdry_idx = (fs->entry->eflags & MAP_ENTRY_SPLIT_BOUNDARY_MASK) >>
|
||||
MAP_ENTRY_SPLIT_BOUNDARY_SHIFT;
|
||||
bdry_idx = MAP_ENTRY_SPLIT_BOUNDARY_INDEX(fs->entry);
|
||||
if (fs->map->timestamp != fs->map_generation) {
|
||||
if (bdry_idx == 0) {
|
||||
vm_fault_populate_cleanup(fs->first_object, pager_first,
|
||||
|
@ -2449,8 +2449,7 @@ vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, vm_offset_t startaddr)
|
||||
KASSERT(entry->end > startaddr && entry->start < startaddr,
|
||||
("%s: invalid clip of entry %p", __func__, entry));
|
||||
|
||||
bdry_idx = (entry->eflags & MAP_ENTRY_SPLIT_BOUNDARY_MASK) >>
|
||||
MAP_ENTRY_SPLIT_BOUNDARY_SHIFT;
|
||||
bdry_idx = MAP_ENTRY_SPLIT_BOUNDARY_INDEX(entry);
|
||||
if (bdry_idx != 0) {
|
||||
if ((startaddr & (pagesizes[bdry_idx] - 1)) != 0)
|
||||
return (KERN_INVALID_ARGUMENT);
|
||||
@ -2523,8 +2522,7 @@ vm_map_clip_end(vm_map_t map, vm_map_entry_t entry, vm_offset_t endaddr)
|
||||
KASSERT(entry->start < endaddr && entry->end > endaddr,
|
||||
("%s: invalid clip of entry %p", __func__, entry));
|
||||
|
||||
bdry_idx = (entry->eflags & MAP_ENTRY_SPLIT_BOUNDARY_MASK) >>
|
||||
MAP_ENTRY_SPLIT_BOUNDARY_SHIFT;
|
||||
bdry_idx = MAP_ENTRY_SPLIT_BOUNDARY_INDEX(entry);
|
||||
if (bdry_idx != 0) {
|
||||
if ((endaddr & (pagesizes[bdry_idx] - 1)) != 0)
|
||||
return (KERN_INVALID_ARGUMENT);
|
||||
@ -3516,8 +3514,7 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm_offset_t end, int flags)
|
||||
saved_start = entry->start;
|
||||
saved_end = entry->end;
|
||||
last_timestamp = map->timestamp;
|
||||
bidx = (entry->eflags & MAP_ENTRY_SPLIT_BOUNDARY_MASK)
|
||||
>> MAP_ENTRY_SPLIT_BOUNDARY_SHIFT;
|
||||
bidx = MAP_ENTRY_SPLIT_BOUNDARY_INDEX(entry);
|
||||
incr = pagesizes[bidx];
|
||||
vm_map_busy(map);
|
||||
vm_map_unlock(map);
|
||||
@ -3715,9 +3712,7 @@ vm_map_sync(
|
||||
vm_map_unlock_read(map);
|
||||
return (KERN_INVALID_ARGUMENT);
|
||||
}
|
||||
bdry_idx = (entry->eflags &
|
||||
MAP_ENTRY_SPLIT_BOUNDARY_MASK) >>
|
||||
MAP_ENTRY_SPLIT_BOUNDARY_SHIFT;
|
||||
bdry_idx = MAP_ENTRY_SPLIT_BOUNDARY_INDEX(entry);
|
||||
if (bdry_idx != 0 &&
|
||||
((start & (pagesizes[bdry_idx] - 1)) != 0 ||
|
||||
(end & (pagesizes[bdry_idx] - 1)) != 0)) {
|
||||
|
@ -154,8 +154,10 @@ struct vm_map_entry {
|
||||
#define MAP_ENTRY_HEADER 0x00080000
|
||||
|
||||
#define MAP_ENTRY_SPLIT_BOUNDARY_MASK 0x00300000
|
||||
|
||||
#define MAP_ENTRY_SPLIT_BOUNDARY_SHIFT 20
|
||||
#define MAP_ENTRY_SPLIT_BOUNDARY_INDEX(entry) \
|
||||
(((entry)->eflags & MAP_ENTRY_SPLIT_BOUNDARY_MASK) >> \
|
||||
MAP_ENTRY_SPLIT_BOUNDARY_SHIFT)
|
||||
|
||||
#ifdef _KERNEL
|
||||
static __inline u_char
|
||||
|
Loading…
Reference in New Issue
Block a user