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