* vm_map_find_min() is a variant of vm_map_find() that takes an * additional parameter (min_addr) and treats the given address * (*addr) differently. Specifically, it treats *addr as a hint * and not as the minimum address where the mapping is created. * * This function works in two phases. First, it tries to * allocate above the hint. If that fails and the hint is * greater than min_add
| 2279 | * allocation. |
| 2280 | */ |
| 2281 | int |
| 2282 | vm_map_find_min(vm_map_t map, vm_object_t object, vm_ooffset_t offset, |
| 2283 | vm_offset_t *addr, vm_size_t length, vm_offset_t min_addr, |
| 2284 | vm_offset_t max_addr, int find_space, vm_prot_t prot, vm_prot_t max, |
| 2285 | int cow) |
| 2286 | { |
| 2287 | vm_offset_t hint; |
| 2288 | int rv; |
| 2289 | |
| 2290 | hint = *addr; |
| 2291 | for (;;) { |
| 2292 | rv = vm_map_find(map, object, offset, addr, length, max_addr, |
| 2293 | find_space, prot, max, cow); |
| 2294 | if (rv == KERN_SUCCESS || min_addr >= hint) |
| 2295 | return (rv); |
| 2296 | *addr = hint = min_addr; |
| 2297 | } |
| 2298 | } |
| 2299 | |
| 2300 | /* |
| 2301 | * A map entry with any of the following flags set must not be merged with |
no test coverage detected