aboutsummaryrefslogtreecommitdiffstats
path: root/mm/vmalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/vmalloc.c')
-rw-r--r--mm/vmalloc.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index c37924a2ee36..d206261ad9ef 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -24,6 +24,7 @@
24#include <linux/radix-tree.h> 24#include <linux/radix-tree.h>
25#include <linux/rcupdate.h> 25#include <linux/rcupdate.h>
26#include <linux/bootmem.h> 26#include <linux/bootmem.h>
27#include <linux/pfn.h>
27 28
28#include <asm/atomic.h> 29#include <asm/atomic.h>
29#include <asm/uaccess.h> 30#include <asm/uaccess.h>
@@ -982,6 +983,29 @@ void *vm_map_ram(struct page **pages, unsigned int count, int node, pgprot_t pro
982} 983}
983EXPORT_SYMBOL(vm_map_ram); 984EXPORT_SYMBOL(vm_map_ram);
984 985
986/**
987 * vm_area_register_early - register vmap area early during boot
988 * @vm: vm_struct to register
989 * @size: size of area to register
990 *
991 * This function is used to register kernel vm area before
992 * vmalloc_init() is called. @vm->size and @vm->flags should contain
993 * proper values on entry and other fields should be zero. On return,
994 * vm->addr contains the allocated address.
995 *
996 * DO NOT USE THIS FUNCTION UNLESS YOU KNOW WHAT YOU'RE DOING.
997 */
998void __init vm_area_register_early(struct vm_struct *vm)
999{
1000 static size_t vm_init_off __initdata;
1001
1002 vm->addr = (void *)VMALLOC_START + vm_init_off;
1003 vm_init_off = PFN_ALIGN(vm_init_off + vm->size);
1004
1005 vm->next = vmlist;
1006 vmlist = vm;
1007}
1008
985void __init vmalloc_init(void) 1009void __init vmalloc_init(void)
986{ 1010{
987 struct vmap_area *va; 1011 struct vmap_area *va;