diff options
author | Arnd Bergmann <arnd@arndb.de> | 2011-12-27 22:45:51 (GMT) |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2011-12-27 22:45:51 (GMT) |
commit | e5570bbc9c06634cfac94e06ac1432b53d8595e5 (patch) | |
tree | bfaf6b5ddedaa03d31400b25b25cfaa3bd0c9107 /mm | |
parent | 5611cc4572e889b62a7b4c72a413536bf6a9c416 (diff) | |
parent | 6cc04a4420391c3f034afe8ea6e28d75912a70a3 (diff) | |
download | linux-fsl-qoriq-e5570bbc9c06634cfac94e06ac1432b53d8595e5.tar.xz |
Merge branch 'for-3.3/soc' of git://git.kernel.org/pub/scm/linux/kernel/git/olof/tegra into tegra/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 3231bf3..e583f77 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) |