Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/vm_map.h
Show First 20 Lines • Show All 249 Lines • ▼ Show 20 Lines | vm_map_pmap(vm_map_t map) | ||||
return (map->pmap); | return (map->pmap); | ||||
} | } | ||||
static __inline void | static __inline void | ||||
vm_map_modflags(vm_map_t map, vm_flags_t set, vm_flags_t clear) | vm_map_modflags(vm_map_t map, vm_flags_t set, vm_flags_t clear) | ||||
{ | { | ||||
map->flags = (map->flags | set) & ~clear; | map->flags = (map->flags | set) & ~clear; | ||||
} | } | ||||
static inline bool | |||||
vm_map_check_range(vm_map_t map, vm_offset_t start, vm_offset_t end) | |||||
dougm: vm_map_valid_range sounds more boolean. A non-blocking suggestion. | |||||
markjAuthorUnsubmitted Done Inline ActionsI think that sounds better. vm_map_range_valid() seems a bit more natural to me, so I will go with that. markj: I think that sounds better. vm_map_range_valid() seems a bit more natural to me, so I will go… | |||||
{ | |||||
if (end < start) | |||||
Not Done Inline ActionsAt least the code in vm_map.c does <= check there. I think it visibly changes the user error code. kib: At least the code in vm_map.c does <= check there.
I think it visibly changes the user error… | |||||
Done Inline ActionsThat case is weird. Note it checks addr + length <= length, not <= addr. So it is just checking for overflow, not for length == 0. I'm not sure if it is intended or not. markj: That case is weird. Note it checks addr + length <= length, not <= addr. So it is just checking… | |||||
return (false); | |||||
if (start < vm_map_min(map) || end > vm_map_max(map)) | |||||
return (false); | |||||
return (true); | |||||
} | |||||
#endif /* KLD_MODULE */ | #endif /* KLD_MODULE */ | ||||
#endif /* _KERNEL */ | #endif /* _KERNEL */ | ||||
/* | /* | ||||
* Shareable process virtual address space. | * Shareable process virtual address space. | ||||
* | * | ||||
* List of locks | * List of locks | ||||
* (c) const until freed | * (c) const until freed | ||||
▲ Show 20 Lines • Show All 244 Lines • Show Last 20 Lines |
vm_map_valid_range sounds more boolean. A non-blocking suggestion.