diff options
author | Olof Johansson <olof@lixom.net> | 2011-12-20 06:12:24 +0100 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2011-12-20 06:13:41 +0100 |
commit | 844e8a16f25568eefd02a6bfb40bdd9bc04704b8 (patch) | |
tree | fdfe4de420c66517a2e4a2a25a454997c6210e95 /mm/vmalloc.c | |
parent | Merge branch 'davinci/cleanup' into next/cleanup (diff) | |
parent | MAINTAINERS: add maintainer entry for Picochip picoxcell (diff) | |
download | linux-844e8a16f25568eefd02a6bfb40bdd9bc04704b8.tar.xz linux-844e8a16f25568eefd02a6bfb40bdd9bc04704b8.zip |
Merge branch 'picoxcell/cleanup' into next/cleanup
* picoxcell/cleanup: (4 commits)
MAINTAINERS: add maintainer entry for Picochip picoxcell
ARM: picoxcell: move io mappings to common.c
ARM: picoxcell: don't reserve irq_descs
ARM: picoxcell: remove mach/memory.h
Conflicts:
arch/arm/mach-at91/setup.c
Diffstat (limited to 'mm/vmalloc.c')
-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 1d8b32f07139..f87577042a86 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) |