f98baaec0a1588c433c7221ebe77d62e120e0b2e
[deliverable/linux.git] / arch / arm / include / asm / page.h
1 /*
2 * arch/arm/include/asm/page.h
3 *
4 * Copyright (C) 1995-2003 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10 #ifndef _ASMARM_PAGE_H
11 #define _ASMARM_PAGE_H
12
13 /* PAGE_SHIFT determines the page size */
14 #define PAGE_SHIFT 12
15 #define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
16 #define PAGE_MASK (~((1 << PAGE_SHIFT) - 1))
17
18 #ifndef __ASSEMBLY__
19
20 #include <linux/personality.h> /* For READ_IMPLIES_EXEC */
21
22 #ifndef CONFIG_MMU
23
24 #include <asm/page-nommu.h>
25
26 #else
27
28 #include <asm/glue.h>
29
30 /*
31 * User Space Model
32 * ================
33 *
34 * This section selects the correct set of functions for dealing with
35 * page-based copying and clearing for user space for the particular
36 * processor(s) we're building for.
37 *
38 * We have the following to choose from:
39 * v4wt - ARMv4 with writethrough cache, without minicache
40 * v4wb - ARMv4 with writeback cache, without minicache
41 * v4_mc - ARMv4 with minicache
42 * xscale - Xscale
43 * xsc3 - XScalev3
44 */
45 #undef _USER
46 #undef MULTI_USER
47
48 #ifdef CONFIG_CPU_COPY_V4WT
49 # ifdef _USER
50 # define MULTI_USER 1
51 # else
52 # define _USER v4wt
53 # endif
54 #endif
55
56 #ifdef CONFIG_CPU_COPY_V4WB
57 # ifdef _USER
58 # define MULTI_USER 1
59 # else
60 # define _USER v4wb
61 # endif
62 #endif
63
64 #ifdef CONFIG_CPU_COPY_FEROCEON
65 # ifdef _USER
66 # define MULTI_USER 1
67 # else
68 # define _USER feroceon
69 # endif
70 #endif
71
72 #ifdef CONFIG_CPU_COPY_FA
73 # ifdef _USER
74 # define MULTI_USER 1
75 # else
76 # define _USER fa
77 # endif
78 #endif
79
80 #ifdef CONFIG_CPU_SA1100
81 # ifdef _USER
82 # define MULTI_USER 1
83 # else
84 # define _USER v4_mc
85 # endif
86 #endif
87
88 #ifdef CONFIG_CPU_XSCALE
89 # ifdef _USER
90 # define MULTI_USER 1
91 # else
92 # define _USER xscale_mc
93 # endif
94 #endif
95
96 #ifdef CONFIG_CPU_XSC3
97 # ifdef _USER
98 # define MULTI_USER 1
99 # else
100 # define _USER xsc3_mc
101 # endif
102 #endif
103
104 #ifdef CONFIG_CPU_COPY_V6
105 # define MULTI_USER 1
106 #endif
107
108 #if !defined(_USER) && !defined(MULTI_USER)
109 #error Unknown user operations model
110 #endif
111
112 struct page;
113 struct vm_area_struct;
114
115 struct cpu_user_fns {
116 void (*cpu_clear_user_highpage)(struct page *page, unsigned long vaddr);
117 void (*cpu_copy_user_highpage)(struct page *to, struct page *from,
118 unsigned long vaddr, struct vm_area_struct *vma);
119 };
120
121 #ifdef MULTI_USER
122 extern struct cpu_user_fns cpu_user;
123
124 #define __cpu_clear_user_highpage cpu_user.cpu_clear_user_highpage
125 #define __cpu_copy_user_highpage cpu_user.cpu_copy_user_highpage
126
127 #else
128
129 #define __cpu_clear_user_highpage __glue(_USER,_clear_user_highpage)
130 #define __cpu_copy_user_highpage __glue(_USER,_copy_user_highpage)
131
132 extern void __cpu_clear_user_highpage(struct page *page, unsigned long vaddr);
133 extern void __cpu_copy_user_highpage(struct page *to, struct page *from,
134 unsigned long vaddr, struct vm_area_struct *vma);
135 #endif
136
137 #define clear_user_highpage(page,vaddr) \
138 __cpu_clear_user_highpage(page, vaddr)
139
140 #define __HAVE_ARCH_COPY_USER_HIGHPAGE
141 #define copy_user_highpage(to,from,vaddr,vma) \
142 __cpu_copy_user_highpage(to, from, vaddr, vma)
143
144 #define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
145 extern void copy_page(void *to, const void *from);
146
147 #ifdef CONFIG_KUSER_HELPERS
148 #define __HAVE_ARCH_GATE_AREA 1
149 #endif
150
151 #ifdef CONFIG_ARM_LPAE
152 #include <asm/pgtable-3level-types.h>
153 #else
154 #include <asm/pgtable-2level-types.h>
155 #endif
156
157 #endif /* CONFIG_MMU */
158
159 typedef struct page *pgtable_t;
160
161 #ifdef CONFIG_HAVE_ARCH_PFN_VALID
162 extern int pfn_valid(unsigned long);
163 #endif
164
165 #include <asm/memory.h>
166
167 #endif /* !__ASSEMBLY__ */
168
169 #define VM_DATA_DEFAULT_FLAGS \
170 (((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0) | \
171 VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
172
173 #include <asm-generic/getorder.h>
174
175 #endif
This page took 0.034231 seconds and 5 git commands to generate.