aboutsummaryrefslogtreecommitdiffstats
path: root/mm/vmalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/vmalloc.c')
-rw-r--r--mm/vmalloc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 224eca9650a8..366ae9ea6af2 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -995,7 +995,7 @@ EXPORT_SYMBOL(vm_map_ram);
995/** 995/**
996 * vm_area_register_early - register vmap area early during boot 996 * vm_area_register_early - register vmap area early during boot
997 * @vm: vm_struct to register 997 * @vm: vm_struct to register
998 * @size: size of area to register 998 * @align: requested alignment
999 * 999 *
1000 * This function is used to register kernel vm area before 1000 * This function is used to register kernel vm area before
1001 * vmalloc_init() is called. @vm->size and @vm->flags should contain 1001 * vmalloc_init() is called. @vm->size and @vm->flags should contain
@@ -1004,12 +1004,15 @@ EXPORT_SYMBOL(vm_map_ram);
1004 * 1004 *
1005 * DO NOT USE THIS FUNCTION UNLESS YOU KNOW WHAT YOU'RE DOING. 1005 * DO NOT USE THIS FUNCTION UNLESS YOU KNOW WHAT YOU'RE DOING.
1006 */ 1006 */
1007void __init vm_area_register_early(struct vm_struct *vm) 1007void __init vm_area_register_early(struct vm_struct *vm, size_t align)
1008{ 1008{
1009 static size_t vm_init_off __initdata; 1009 static size_t vm_init_off __initdata;
1010 unsigned long addr;
1011
1012 addr = ALIGN(VMALLOC_START + vm_init_off, align);
1013 vm_init_off = PFN_ALIGN(addr + vm->size) - VMALLOC_START;
1010 1014
1011 vm->addr = (void *)VMALLOC_START + vm_init_off; 1015 vm->addr = (void *)addr;
1012 vm_init_off = PFN_ALIGN(vm_init_off + vm->size);
1013 1016
1014 vm->next = vmlist; 1017 vm->next = vmlist;
1015 vmlist = vm; 1018 vmlist = vm;