Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102927252
D41249.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D41249.diff
View Options
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c
--- a/sys/vm/vm_fault.c
+++ b/sys/vm/vm_fault.c
@@ -539,8 +539,7 @@
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,
diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h
--- a/sys/vm/vm_map.h
+++ b/sys/vm/vm_map.h
@@ -154,8 +154,10 @@
#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
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -2449,8 +2449,7 @@
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 @@
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 @@
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_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)) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 19, 8:31 PM (21 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14723115
Default Alt Text
D41249.diff (2 KB)
Attached To
Mode
D41249: vm_map: Add a macro to fetch a map entry's split boundary index
Attached
Detach File
Event Timeline
Log In to Comment