1 #ifndef __LINUX_VMALLOC_H
2 #define __LINUX_VMALLOC_H
4 #include <linux/sched.h>
6 #include <linux/spinlock.h>
8 #include <linux/highmem.h> /* several arch define VMALLOC_END via PKMAP_BASE */
9 #include <asm/pgtable.h>
11 /* bits in vm_struct->flags */
12 #define VM_IOREMAP 0x00000001 /* ioremap() and friends */
13 #define VM_ALLOC 0x00000002 /* vmalloc() */
19 struct vm_struct * next;
22 extern struct vm_struct * get_vm_area (unsigned long size, unsigned long flags);
23 extern void vfree(void * addr);
24 #define vunmap(addr) vfree(addr)
25 extern void * vmap(struct page **pages, int count,
26 unsigned long flags, pgprot_t prot);
27 extern void * __vmalloc (unsigned long size, int gfp_mask, pgprot_t prot);
28 extern long vread(char *buf, char *addr, unsigned long count);
29 extern void vmfree_area_pages(unsigned long address, unsigned long size);
30 extern int vmalloc_area_pages(unsigned long address, unsigned long size,
31 int gfp_mask, pgprot_t prot);
37 static inline void * vmalloc (unsigned long size)
39 return __vmalloc(size, GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL);
43 * Allocate ISA addressable pages for broke crap
46 static inline void * vmalloc_dma (unsigned long size)
48 return __vmalloc(size, GFP_KERNEL|GFP_DMA, PAGE_KERNEL);
52 * vmalloc 32bit PA addressable pages - eg for PCI 32bit devices
55 static inline void * vmalloc_32(unsigned long size)
57 return __vmalloc(size, GFP_KERNEL, PAGE_KERNEL);
61 * vmlist_lock is a read-write spinlock that protects vmlist
62 * Used in mm/vmalloc.c (get_vm_area() and vfree()) and fs/proc/kcore.c.
64 extern rwlock_t vmlist_lock;
66 extern struct vm_struct * vmlist;