diff options
| author | Imre_Deak <imre.deak@solidboot.com> | 2007-02-11 07:45:13 -0500 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2007-02-11 12:06:17 -0500 |
| commit | 44b18693904e65d840ae999ac8aa717551cf509f (patch) | |
| tree | e4c7c9b1676a94d4488b0a5a4023fcbf23c002e4 /include | |
| parent | eeea82ff4a3aebed9f501f04ca7b65d3605f247a (diff) | |
[ARM] 4158/1: Fix user page protection macros
The PAGE_* user page protection macros don't take into account the
configured memory policy and other architecture specific bits like
the global/ASID and shared mapping bits. Instead of constants let
these depend on a variable fixed up at init just like PAGE_KERNEL.
Signed-off-by: Imre Deak <imre.deak@solidboot.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-arm/pgtable.h | 54 |
1 files changed, 32 insertions, 22 deletions
diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h index b8cf2d5ec304..7b2bafce21a2 100644 --- a/include/asm-arm/pgtable.h +++ b/include/asm-arm/pgtable.h | |||
| @@ -175,19 +175,29 @@ extern void __pgd_error(const char *file, int line, unsigned long val); | |||
| 175 | #ifndef __ASSEMBLY__ | 175 | #ifndef __ASSEMBLY__ |
| 176 | 176 | ||
| 177 | /* | 177 | /* |
| 178 | * The following macros handle the cache and bufferable bits... | 178 | * The pgprot_* and protection_map entries will be fixed up in runtime |
| 179 | * to include the cachable and bufferable bits based on memory policy, | ||
| 180 | * as well as any architecture dependent bits like global/ASID and SMP | ||
| 181 | * shared mapping bits. | ||
| 179 | */ | 182 | */ |
| 180 | #define _L_PTE_DEFAULT L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_CACHEABLE | L_PTE_BUFFERABLE | 183 | #define _L_PTE_DEFAULT L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_CACHEABLE | L_PTE_BUFFERABLE |
| 181 | #define _L_PTE_READ L_PTE_USER | L_PTE_EXEC | 184 | #define _L_PTE_READ L_PTE_USER | L_PTE_EXEC |
| 182 | 185 | ||
| 186 | extern pgprot_t pgprot_user; | ||
| 183 | extern pgprot_t pgprot_kernel; | 187 | extern pgprot_t pgprot_kernel; |
| 184 | 188 | ||
| 185 | #define PAGE_NONE __pgprot(_L_PTE_DEFAULT) | 189 | #define PAGE_NONE pgprot_user |
| 186 | #define PAGE_COPY __pgprot(_L_PTE_DEFAULT | _L_PTE_READ) | 190 | #define PAGE_COPY __pgprot(pgprot_val(pgprot_user) | _L_PTE_READ) |
| 187 | #define PAGE_SHARED __pgprot(_L_PTE_DEFAULT | _L_PTE_READ | L_PTE_WRITE) | 191 | #define PAGE_SHARED __pgprot(pgprot_val(pgprot_user) | _L_PTE_READ | \ |
| 188 | #define PAGE_READONLY __pgprot(_L_PTE_DEFAULT | _L_PTE_READ) | 192 | L_PTE_WRITE) |
| 193 | #define PAGE_READONLY __pgprot(pgprot_val(pgprot_user) | _L_PTE_READ) | ||
| 189 | #define PAGE_KERNEL pgprot_kernel | 194 | #define PAGE_KERNEL pgprot_kernel |
| 190 | 195 | ||
| 196 | #define __PAGE_NONE __pgprot(_L_PTE_DEFAULT) | ||
| 197 | #define __PAGE_COPY __pgprot(_L_PTE_DEFAULT | _L_PTE_READ) | ||
| 198 | #define __PAGE_SHARED __pgprot(_L_PTE_DEFAULT | _L_PTE_READ | L_PTE_WRITE) | ||
| 199 | #define __PAGE_READONLY __pgprot(_L_PTE_DEFAULT | _L_PTE_READ) | ||
| 200 | |||
| 191 | #endif /* __ASSEMBLY__ */ | 201 | #endif /* __ASSEMBLY__ */ |
| 192 | 202 | ||
| 193 | /* | 203 | /* |
| @@ -198,23 +208,23 @@ extern pgprot_t pgprot_kernel; | |||
| 198 | * 2) If we could do execute protection, then read is implied | 208 | * 2) If we could do execute protection, then read is implied |
| 199 | * 3) write implies read permissions | 209 | * 3) write implies read permissions |
| 200 | */ | 210 | */ |
| 201 | #define __P000 PAGE_NONE | 211 | #define __P000 __PAGE_NONE |
| 202 | #define __P001 PAGE_READONLY | 212 | #define __P001 __PAGE_READONLY |
| 203 | #define __P010 PAGE_COPY | 213 | #define __P010 __PAGE_COPY |
| 204 | #define __P011 PAGE_COPY | 214 | #define __P011 __PAGE_COPY |
| 205 | #define __P100 PAGE_READONLY | 215 | #define __P100 __PAGE_READONLY |
| 206 | #define __P101 PAGE_READONLY | 216 | #define __P101 __PAGE_READONLY |
| 207 | #define __P110 PAGE_COPY | 217 | #define __P110 __PAGE_COPY |
| 208 | #define __P111 PAGE_COPY | 218 | #define __P111 __PAGE_COPY |
| 209 | 219 | ||
| 210 | #define __S000 PAGE_NONE | 220 | #define __S000 __PAGE_NONE |
| 211 | #define __S001 PAGE_READONLY | 221 | #define __S001 __PAGE_READONLY |
| 212 | #define __S010 PAGE_SHARED | 222 | #define __S010 __PAGE_SHARED |
| 213 | #define __S011 PAGE_SHARED | 223 | #define __S011 __PAGE_SHARED |
| 214 | #define __S100 PAGE_READONLY | 224 | #define __S100 __PAGE_READONLY |
| 215 | #define __S101 PAGE_READONLY | 225 | #define __S101 __PAGE_READONLY |
| 216 | #define __S110 PAGE_SHARED | 226 | #define __S110 __PAGE_SHARED |
| 217 | #define __S111 PAGE_SHARED | 227 | #define __S111 __PAGE_SHARED |
| 218 | 228 | ||
| 219 | #ifndef __ASSEMBLY__ | 229 | #ifndef __ASSEMBLY__ |
| 220 | /* | 230 | /* |
