diff options
Diffstat (limited to 'include/linux/vmalloc.h')
-rw-r--r-- | include/linux/vmalloc.h | 48 |
1 files changed, 40 insertions, 8 deletions
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 01c2145118dc..9332e52ea8c2 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
@@ -7,8 +7,6 @@ | |||
7 | 7 | ||
8 | struct vm_area_struct; /* vma defining user mapping in mm_types.h */ | 8 | struct vm_area_struct; /* vma defining user mapping in mm_types.h */ |
9 | 9 | ||
10 | extern bool vmap_lazy_unmap; | ||
11 | |||
12 | /* bits in flags of vmalloc's vm_struct below */ | 10 | /* bits in flags of vmalloc's vm_struct below */ |
13 | #define VM_IOREMAP 0x00000001 /* ioremap() and friends */ | 11 | #define VM_IOREMAP 0x00000001 /* ioremap() and friends */ |
14 | #define VM_ALLOC 0x00000002 /* vmalloc() */ | 12 | #define VM_ALLOC 0x00000002 /* vmalloc() */ |
@@ -53,14 +51,17 @@ static inline void vmalloc_init(void) | |||
53 | #endif | 51 | #endif |
54 | 52 | ||
55 | extern void *vmalloc(unsigned long size); | 53 | extern void *vmalloc(unsigned long size); |
54 | extern void *vzalloc(unsigned long size); | ||
56 | extern void *vmalloc_user(unsigned long size); | 55 | extern void *vmalloc_user(unsigned long size); |
57 | extern void *vmalloc_node(unsigned long size, int node); | 56 | extern void *vmalloc_node(unsigned long size, int node); |
57 | extern void *vzalloc_node(unsigned long size, int node); | ||
58 | extern void *vmalloc_exec(unsigned long size); | 58 | extern void *vmalloc_exec(unsigned long size); |
59 | extern void *vmalloc_32(unsigned long size); | 59 | extern void *vmalloc_32(unsigned long size); |
60 | extern void *vmalloc_32_user(unsigned long size); | 60 | extern void *vmalloc_32_user(unsigned long size); |
61 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); | 61 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); |
62 | extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask, | 62 | extern void *__vmalloc_node_range(unsigned long size, unsigned long align, |
63 | pgprot_t prot); | 63 | unsigned long start, unsigned long end, gfp_t gfp_mask, |
64 | pgprot_t prot, int node, void *caller); | ||
64 | extern void vfree(const void *addr); | 65 | extern void vfree(const void *addr); |
65 | 66 | ||
66 | extern void *vmap(struct page **pages, unsigned int count, | 67 | extern void *vmap(struct page **pages, unsigned int count, |
@@ -90,17 +91,31 @@ extern struct vm_struct *__get_vm_area_caller(unsigned long size, | |||
90 | unsigned long flags, | 91 | unsigned long flags, |
91 | unsigned long start, unsigned long end, | 92 | unsigned long start, unsigned long end, |
92 | void *caller); | 93 | void *caller); |
93 | extern struct vm_struct *get_vm_area_node(unsigned long size, | ||
94 | unsigned long flags, int node, | ||
95 | gfp_t gfp_mask); | ||
96 | extern struct vm_struct *remove_vm_area(const void *addr); | 94 | extern struct vm_struct *remove_vm_area(const void *addr); |
97 | 95 | ||
98 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, | 96 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, |
99 | struct page ***pages); | 97 | struct page ***pages); |
98 | #ifdef CONFIG_MMU | ||
100 | extern int map_kernel_range_noflush(unsigned long start, unsigned long size, | 99 | extern int map_kernel_range_noflush(unsigned long start, unsigned long size, |
101 | pgprot_t prot, struct page **pages); | 100 | pgprot_t prot, struct page **pages); |
102 | extern void unmap_kernel_range_noflush(unsigned long addr, unsigned long size); | 101 | extern void unmap_kernel_range_noflush(unsigned long addr, unsigned long size); |
103 | extern void unmap_kernel_range(unsigned long addr, unsigned long size); | 102 | extern void unmap_kernel_range(unsigned long addr, unsigned long size); |
103 | #else | ||
104 | static inline int | ||
105 | map_kernel_range_noflush(unsigned long start, unsigned long size, | ||
106 | pgprot_t prot, struct page **pages) | ||
107 | { | ||
108 | return size >> PAGE_SHIFT; | ||
109 | } | ||
110 | static inline void | ||
111 | unmap_kernel_range_noflush(unsigned long addr, unsigned long size) | ||
112 | { | ||
113 | } | ||
114 | static inline void | ||
115 | unmap_kernel_range(unsigned long addr, unsigned long size) | ||
116 | { | ||
117 | } | ||
118 | #endif | ||
104 | 119 | ||
105 | /* Allocate/destroy a 'vmalloc' VM area. */ | 120 | /* Allocate/destroy a 'vmalloc' VM area. */ |
106 | extern struct vm_struct *alloc_vm_area(size_t size); | 121 | extern struct vm_struct *alloc_vm_area(size_t size); |
@@ -117,10 +132,27 @@ extern rwlock_t vmlist_lock; | |||
117 | extern struct vm_struct *vmlist; | 132 | extern struct vm_struct *vmlist; |
118 | extern __init void vm_area_register_early(struct vm_struct *vm, size_t align); | 133 | extern __init void vm_area_register_early(struct vm_struct *vm, size_t align); |
119 | 134 | ||
135 | #ifdef CONFIG_SMP | ||
136 | # ifdef CONFIG_MMU | ||
120 | struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets, | 137 | struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets, |
121 | const size_t *sizes, int nr_vms, | 138 | const size_t *sizes, int nr_vms, |
122 | size_t align, gfp_t gfp_mask); | 139 | size_t align); |
123 | 140 | ||
124 | void pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms); | 141 | void pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms); |
142 | # else | ||
143 | static inline struct vm_struct ** | ||
144 | pcpu_get_vm_areas(const unsigned long *offsets, | ||
145 | const size_t *sizes, int nr_vms, | ||
146 | size_t align) | ||
147 | { | ||
148 | return NULL; | ||
149 | } | ||
150 | |||
151 | static inline void | ||
152 | pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms) | ||
153 | { | ||
154 | } | ||
155 | # endif | ||
156 | #endif | ||
125 | 157 | ||
126 | #endif /* _LINUX_VMALLOC_H */ | 158 | #endif /* _LINUX_VMALLOC_H */ |