1 #ifndef __LINUX_VMALLOC_H
2 #define __LINUX_VMALLOC_H
3
4 #include <linux/sched.h>
5 #include <linux/mm.h>
6 #include <linux/spinlock.h>
7
8 #include <asm/pgtable.h>
9
10 /* bits in vm_struct->flags */
11 #define VM_IOREMAP 0x00000001 /* ioremap() and friends */
12 #define VM_ALLOC 0x00000002 /* vmalloc() */
13
14 struct vm_struct {
15 unsigned long flags;
16 void * addr;
17 unsigned long size;
18 struct vm_struct * next;
19 };
20
21 extern struct vm_struct * get_vm_area (unsigned long size, unsigned long flags);
22 extern void vfree(void * addr);
23 extern void * __vmalloc (unsigned long size, int gfp_mask, pgprot_t prot);
24 extern long vread(char *buf, char *addr, unsigned long count);
25 extern void vmfree_area_pages(unsigned long address, unsigned long size);
26 extern int vmalloc_area_pages(unsigned long address, unsigned long size,
27 int gfp_mask, pgprot_t prot);
28
29 /*
30 * Allocate any pages
31 */
32
33 static inline void * vmalloc (unsigned long size)
34 {
35 return __vmalloc(size, GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL);
36 }
37
38 /*
39 * Allocate ISA addressable pages for broke crap
40 */
41
42 static inline void * vmalloc_dma (unsigned long size)
43 {
44 return __vmalloc(size, GFP_KERNEL|GFP_DMA, PAGE_KERNEL);
45 }
46
47 /*
48 * vmalloc 32bit PA addressable pages - eg for PCI 32bit devices
49 */
50
51 static inline void * vmalloc_32(unsigned long size)
52 {
53 return __vmalloc(size, GFP_KERNEL, PAGE_KERNEL);
54 }
55
56 /*
57 * vmlist_lock is a read-write spinlock that protects vmlist
58 * Used in mm/vmalloc.c (get_vm_area() and vfree()) and fs/proc/kcore.c.
59 */
60 extern rwlock_t vmlist_lock;
61
62 extern struct vm_struct * vmlist;
63 #endif
64
65
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.