summaryrefslogtreecommitdiff
path: root/vm/vm_map.c
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2012-12-07 20:27:52 +0100
committerRichard Braun <rbraun@sceen.net>2012-12-07 20:27:52 +0100
commit44f26441c6fbaf4bfe960c4655684b6433395a46 (patch)
tree408f43f83ea6741200031ace5d1f72e6dd165314 /vm/vm_map.c
parent370fb1486d7b1c9c0f186994d6cf9704bad34a94 (diff)
vm/vm_map: handle alignment
Diffstat (limited to 'vm/vm_map.c')
-rw-r--r--vm/vm_map.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/vm/vm_map.c b/vm/vm_map.c
index 7acdb286..193f1fc2 100644
--- a/vm/vm_map.c
+++ b/vm/vm_map.c
@@ -450,7 +450,7 @@ vm_map_find_avail(struct vm_map *map, struct vm_map_request *request)
struct vm_map_entry *next;
struct list *node;
unsigned long base, start;
- size_t size, space;
+ size_t size, align, space;
int error;
/* If there is a hint, try there */
@@ -462,6 +462,7 @@ vm_map_find_avail(struct vm_map *map, struct vm_map_request *request)
}
size = request->size;
+ align = request->align;
if (size > map->find_cache_threshold)
base = map->find_cache;
@@ -483,6 +484,9 @@ retry:
for (;;) {
assert(start <= map->end);
+ if (align != 0)
+ start = P2ROUND(start, align);
+
/*
* The end of the map has been reached, and no space could be found.
* If the search didn't start at map->start, retry from there in case