summaryrefslogtreecommitdiffstats
path: root/include/linux/vmalloc.h
blob: ad744753027f6a7f9b90f5ee876c322dc2ec1001 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef __LINUX_VMALLOC_H
#define __LINUX_VMALLOC_H

#include <linux/sched.h>
#include <linux/mm.h>

#include <asm/pgtable.h>

struct vm_struct {
	unsigned long flags;
	void * addr;
	unsigned long size;
	struct vm_struct * next;
};

struct vm_struct * get_vm_area(unsigned long size);
void vfree(void * addr);
void * vmalloc_prot(unsigned long size, pgprot_t prot);
void * vmalloc_uncached(unsigned long size);

extern inline void * vmalloc(unsigned long size)
{
	vmalloc_prot (size, PAGE_KERNEL);
}

int vread(char *buf, char *addr, int count);
void vmfree_area_pages(unsigned long address, unsigned long size);
int vmalloc_area_pages(unsigned long address, unsigned long size, pgprot_t prot);

extern inline void set_pgdir(unsigned long address, pgd_t entry)
{
#if !defined(__mc68000__) && !defined(__sparc_v9__)
	struct task_struct * p;

	read_lock(&tasklist_lock);
	for_each_task(p) {
		if (!p->mm)
			continue;
		*pgd_offset(p->mm,address) = entry;
	}
	read_unlock(&tasklist_lock);
#endif
}

#endif