1
2
3
4
5
6
7
8
9
10
11
12#ifndef __UNICORE_PAGE_H__
13#define __UNICORE_PAGE_H__
14
15
16#define PAGE_SHIFT 12
17#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)
18#define PAGE_MASK (~(PAGE_SIZE-1))
19
20#ifndef __ASSEMBLY__
21
22struct page;
23struct vm_area_struct;
24
25#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
26extern void copy_page(void *to, const void *from);
27
28#define clear_user_page(page, vaddr, pg) clear_page(page)
29#define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
30
31#undef STRICT_MM_TYPECHECKS
32
33#ifdef STRICT_MM_TYPECHECKS
34
35
36
37typedef struct { unsigned long pte; } pte_t;
38typedef struct { unsigned long pgd; } pgd_t;
39typedef struct { unsigned long pgprot; } pgprot_t;
40
41#define pte_val(x) ((x).pte)
42#define pgd_val(x) ((x).pgd)
43#define pgprot_val(x) ((x).pgprot)
44
45#define __pte(x) ((pte_t) { (x) })
46#define __pgd(x) ((pgd_t) { (x) })
47#define __pgprot(x) ((pgprot_t) { (x) })
48
49#else
50
51
52
53typedef unsigned long pte_t;
54typedef unsigned long pgd_t;
55typedef unsigned long pgprot_t;
56
57#define pte_val(x) (x)
58#define pgd_val(x) (x)
59#define pgprot_val(x) (x)
60
61#define __pte(x) (x)
62#define __pgd(x) (x)
63#define __pgprot(x) (x)
64
65#endif
66
67typedef struct page *pgtable_t;
68
69extern int pfn_valid(unsigned long);
70
71#include <asm/memory.h>
72
73#endif
74
75#define VM_DATA_DEFAULT_FLAGS \
76 (VM_READ | VM_WRITE | VM_EXEC | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
77
78#include <asm-generic/getorder.h>
79
80#endif
81