diff options
author | Olof Johansson <olof@lixom.net> | 2011-12-15 22:02:11 -0800 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2011-12-15 22:02:11 -0800 |
commit | 017c899c2db3da481cc174049e47307ed3aba530 (patch) | |
tree | d2e55932579421d0196ac63c45bad1de8dbfa5eb /mm | |
parent | dc47ce90c3a822cd7c9e9339fe4d5f61dcb26b50 (diff) | |
parent | c97136307c2cd336a3ee68cc0890b0f55d01d2d4 (diff) |
Merge branch 'omap/soc' into next/soc
Diffstat (limited to 'mm')
-rw-r--r-- | mm/vmalloc.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 1d8b32f0713..f87577042a8 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -1118,6 +1118,32 @@ void *vm_map_ram(struct page **pages, unsigned int count, int node, pgprot_t pro EXPORT_SYMBOL(vm_map_ram); /** + * vm_area_add_early - add vmap area early during boot + * @vm: vm_struct to add + * + * This function is used to add fixed kernel vm area to vmlist before + * vmalloc_init() is called. @vm->addr, @vm->size, and @vm->flags + * should contain proper values and the other fields should be zero. + * + * DO NOT USE THIS FUNCTION UNLESS YOU KNOW WHAT YOU'RE DOING. + */ +void __init vm_area_add_early(struct vm_struct *vm) +{ + struct vm_struct *tmp, **p; + + BUG_ON(vmap_initialized); + for (p = &vmlist; (tmp = *p) != NULL; p = &tmp->next) { + if (tmp->addr >= vm->addr) { + BUG_ON(tmp->addr < vm->addr + vm->size); + break; + } else + BUG_ON(tmp->addr + tmp->size > vm->addr); + } + vm->next = *p; + *p = vm; +} + +/** * vm_area_register_early - register vmap area early during boot * @vm: vm_struct to register * @align: requested alignment @@ -1139,8 +1165,7 @@ void __init vm_area_register_early(struct vm_struct *vm, size_t align) vm->addr = (void *)addr; - vm->next = vmlist; - vmlist = vm; + vm_area_add_early(vm); } void __init vmalloc_init(void) |