From b60180305152277b2d2e45a8a34a677319e170d1 Mon Sep 17 00:00:00 2001 From: kib Date: Mon, 4 Dec 2017 10:05:59 +0000 Subject: [PATCH] MFC r326424: Add comment for vm_map_find_min(). git-svn-id: svn://svn.freebsd.org/base/stable/10@326523 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/vm/vm_map.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index c254123c7..5454668a7 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -1509,6 +1509,18 @@ vm_map_find(vm_map_t map, vm_object_t object, vm_ooffset_t offset, return (result); } +/* + * 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_addr, it performs a second pass, replacing + * the hint with min_addr as the minimum address for the + * allocation. + */ int vm_map_find_min(vm_map_t map, vm_object_t object, vm_ooffset_t offset, vm_offset_t *addr, vm_size_t length, vm_offset_t min_addr, -- 2.45.0