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
11#define VM_IOREMAP 0x00000001
12#define VM_ALLOC 0x00000002
13
14struct vm_struct {
15 unsigned long flags;
16 void * addr;
17 unsigned long size;
18 struct vm_struct * next;
19};
20
21extern struct vm_struct * get_vm_area (unsigned long size, unsigned long flags);
22extern void vfree(void * addr);
23extern void * __vmalloc (unsigned long size, int gfp_mask, pgprot_t prot);
24extern long vread(char *buf, char *addr, unsigned long count);
25extern void vmfree_area_pages(unsigned long address, unsigned long size);
26extern int vmalloc_area_pages(unsigned long address, unsigned long size,
27 int gfp_mask, pgprot_t prot);
28
29
30
31
32
33static inline void * vmalloc (unsigned long size)
34{
35 return __vmalloc(size, GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL);
36}
37
38
39
40
41
42static inline void * vmalloc_dma (unsigned long size)
43{
44 return __vmalloc(size, GFP_KERNEL|GFP_DMA, PAGE_KERNEL);
45}
46
47
48
49
50
51static inline void * vmalloc_32(unsigned long size)
52{
53 return __vmalloc(size, GFP_KERNEL, PAGE_KERNEL);
54}
55
56
57
58
59
60extern rwlock_t vmlist_lock;
61
62extern struct vm_struct * vmlist;
63#endif
64
65