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