diff options
Diffstat (limited to 'include/linux/vmalloc.h')
-rw-r--r-- | include/linux/vmalloc.h | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 6071e911c7f4..7d5773a99f20 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
@@ -3,7 +3,9 @@ | |||
3 | 3 | ||
4 | #include <linux/spinlock.h> | 4 | #include <linux/spinlock.h> |
5 | #include <linux/init.h> | 5 | #include <linux/init.h> |
6 | #include <linux/list.h> | ||
6 | #include <asm/page.h> /* pgprot_t */ | 7 | #include <asm/page.h> /* pgprot_t */ |
8 | #include <linux/rbtree.h> | ||
7 | 9 | ||
8 | struct vm_area_struct; /* vma defining user mapping in mm_types.h */ | 10 | struct vm_area_struct; /* vma defining user mapping in mm_types.h */ |
9 | 11 | ||
@@ -35,6 +37,17 @@ struct vm_struct { | |||
35 | const void *caller; | 37 | const void *caller; |
36 | }; | 38 | }; |
37 | 39 | ||
40 | struct vmap_area { | ||
41 | unsigned long va_start; | ||
42 | unsigned long va_end; | ||
43 | unsigned long flags; | ||
44 | struct rb_node rb_node; /* address sorted rbtree */ | ||
45 | struct list_head list; /* address sorted list */ | ||
46 | struct list_head purge_list; /* "lazy purge" list */ | ||
47 | struct vm_struct *vm; | ||
48 | struct rcu_head rcu_head; | ||
49 | }; | ||
50 | |||
38 | /* | 51 | /* |
39 | * Highlevel APIs for driver use | 52 | * Highlevel APIs for driver use |
40 | */ | 53 | */ |
@@ -130,8 +143,7 @@ extern long vwrite(char *buf, char *addr, unsigned long count); | |||
130 | /* | 143 | /* |
131 | * Internals. Dont't use.. | 144 | * Internals. Dont't use.. |
132 | */ | 145 | */ |
133 | extern rwlock_t vmlist_lock; | 146 | extern struct list_head vmap_area_list; |
134 | extern struct vm_struct *vmlist; | ||
135 | extern __init void vm_area_add_early(struct vm_struct *vm); | 147 | extern __init void vm_area_add_early(struct vm_struct *vm); |
136 | extern __init void vm_area_register_early(struct vm_struct *vm, size_t align); | 148 | extern __init void vm_area_register_early(struct vm_struct *vm, size_t align); |
137 | 149 | ||
@@ -158,4 +170,22 @@ pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms) | |||
158 | # endif | 170 | # endif |
159 | #endif | 171 | #endif |
160 | 172 | ||
173 | struct vmalloc_info { | ||
174 | unsigned long used; | ||
175 | unsigned long largest_chunk; | ||
176 | }; | ||
177 | |||
178 | #ifdef CONFIG_MMU | ||
179 | #define VMALLOC_TOTAL (VMALLOC_END - VMALLOC_START) | ||
180 | extern void get_vmalloc_info(struct vmalloc_info *vmi); | ||
181 | #else | ||
182 | |||
183 | #define VMALLOC_TOTAL 0UL | ||
184 | #define get_vmalloc_info(vmi) \ | ||
185 | do { \ | ||
186 | (vmi)->used = 0; \ | ||
187 | (vmi)->largest_chunk = 0; \ | ||
188 | } while (0) | ||
189 | #endif | ||
190 | |||
161 | #endif /* _LINUX_VMALLOC_H */ | 191 | #endif /* _LINUX_VMALLOC_H */ |