diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-09-06 15:04:59 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-10-01 11:40:56 -0400 |
commit | bb30f36f9b71c31dc8fe3483bba4c9884fc86080 (patch) | |
tree | c99b583586ebec2a29be2b0173d1eb9ad07a68f9 /arch/arm/include/asm | |
parent | 9cff96e5bfc8e366166bfb07610604c7604ac48c (diff) |
[ARM] Introduce new PTE memory type bits
Provide L_PTE_MT_xxx definitions to describe the memory types that we
use in Linux/ARM. These definitions are carefully picked such that:
1. their LSBs match what is required for pre-ARMv6 CPUs.
2. they all have a unique encoding, including after modification
by build_mem_type_table() (the result being that some have more
than one combination.)
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/include/asm')
-rw-r--r-- | arch/arm/include/asm/pgtable.h | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h index 5c75e02b3c7c..8df2e254a3e4 100644 --- a/arch/arm/include/asm/pgtable.h +++ b/arch/arm/include/asm/pgtable.h | |||
@@ -164,14 +164,35 @@ extern void __pgd_error(const char *file, int line, unsigned long val); | |||
164 | #define L_PTE_PRESENT (1 << 0) | 164 | #define L_PTE_PRESENT (1 << 0) |
165 | #define L_PTE_FILE (1 << 1) /* only when !PRESENT */ | 165 | #define L_PTE_FILE (1 << 1) /* only when !PRESENT */ |
166 | #define L_PTE_YOUNG (1 << 1) | 166 | #define L_PTE_YOUNG (1 << 1) |
167 | #define L_PTE_BUFFERABLE (1 << 2) /* matches PTE */ | 167 | #define L_PTE_BUFFERABLE (1 << 2) /* obsolete, matches PTE */ |
168 | #define L_PTE_CACHEABLE (1 << 3) /* matches PTE */ | 168 | #define L_PTE_CACHEABLE (1 << 3) /* obsolete, matches PTE */ |
169 | #define L_PTE_DIRTY (1 << 6) | 169 | #define L_PTE_DIRTY (1 << 6) |
170 | #define L_PTE_WRITE (1 << 7) | 170 | #define L_PTE_WRITE (1 << 7) |
171 | #define L_PTE_USER (1 << 8) | 171 | #define L_PTE_USER (1 << 8) |
172 | #define L_PTE_EXEC (1 << 9) | 172 | #define L_PTE_EXEC (1 << 9) |
173 | #define L_PTE_SHARED (1 << 10) /* shared(v6), coherent(xsc3) */ | 173 | #define L_PTE_SHARED (1 << 10) /* shared(v6), coherent(xsc3) */ |
174 | 174 | ||
175 | /* | ||
176 | * These are the memory types, defined to be compatible with | ||
177 | * pre-ARMv6 CPUs cacheable and bufferable bits: XXCB | ||
178 | * (note: build_mem_type_table modifies these bits | ||
179 | * to work with our existing proc-*.S setup.) | ||
180 | */ | ||
181 | #define L_PTE_MT_UNCACHED (0x00 << 2) /* 0000 */ | ||
182 | #define L_PTE_MT_BUFFERABLE (0x01 << 2) /* 0001 */ | ||
183 | #define L_PTE_MT_WRITETHROUGH (0x02 << 2) /* 0010 */ | ||
184 | #define L_PTE_MT_WRITEBACK (0x03 << 2) /* 0011 */ | ||
185 | #define L_PTE_MT_MINICACHE (0x06 << 2) /* 0110 (sa1100, xscale) */ | ||
186 | #define L_PTE_MT_WRITEALLOC (0x07 << 2) /* 0111 */ | ||
187 | #define L_PTE_MT_DEV_SHARED (0x04 << 2) /* 0100 (pre-v6) */ | ||
188 | #define L_PTE_MT_DEV_SHARED2 (0x05 << 2) /* 0101 (v6) */ | ||
189 | #define L_PTE_MT_DEV_NONSHARED (0x0c << 2) /* 1100 */ | ||
190 | #define L_PTE_MT_DEV_IXP2000 (0x0d << 2) /* 1101 */ | ||
191 | #define L_PTE_MT_DEV_WC (0x09 << 2) /* 1001 (pre-v6, !xsc3) */ | ||
192 | #define L_PTE_MT_DEV_WC2 (0x08 << 2) /* 1000 (xsc3, v6) */ | ||
193 | #define L_PTE_MT_DEV_CACHED (0x0b << 2) /* 1011 */ | ||
194 | #define L_PTE_MT_MASK (0x0f << 2) | ||
195 | |||
175 | #ifndef __ASSEMBLY__ | 196 | #ifndef __ASSEMBLY__ |
176 | 197 | ||
177 | /* | 198 | /* |
@@ -180,7 +201,7 @@ extern void __pgd_error(const char *file, int line, unsigned long val); | |||
180 | * as well as any architecture dependent bits like global/ASID and SMP | 201 | * as well as any architecture dependent bits like global/ASID and SMP |
181 | * shared mapping bits. | 202 | * shared mapping bits. |
182 | */ | 203 | */ |
183 | #define _L_PTE_DEFAULT L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_CACHEABLE | L_PTE_BUFFERABLE | 204 | #define _L_PTE_DEFAULT L_PTE_PRESENT | L_PTE_YOUNG |
184 | #define _L_PTE_READ L_PTE_USER | L_PTE_EXEC | 205 | #define _L_PTE_READ L_PTE_USER | L_PTE_EXEC |
185 | 206 | ||
186 | extern pgprot_t pgprot_user; | 207 | extern pgprot_t pgprot_user; |
@@ -286,8 +307,10 @@ static inline pte_t pte_mkspecial(pte_t pte) { return pte; } | |||
286 | /* | 307 | /* |
287 | * Mark the prot value as uncacheable and unbufferable. | 308 | * Mark the prot value as uncacheable and unbufferable. |
288 | */ | 309 | */ |
289 | #define pgprot_noncached(prot) __pgprot(pgprot_val(prot) & ~(L_PTE_CACHEABLE | L_PTE_BUFFERABLE)) | 310 | #define pgprot_noncached(prot) \ |
290 | #define pgprot_writecombine(prot) __pgprot(pgprot_val(prot) & ~L_PTE_CACHEABLE) | 311 | __pgprot((pgprot_val(prot) & ~L_PTE_MT_MASK) | L_PTE_MT_UNCACHED) |
312 | #define pgprot_writecombine(prot) \ | ||
313 | __pgprot((pgprot_val(prot) & ~L_PTE_MT_MASK) | L_PTE_MT_BUFFERABLE) | ||
291 | 314 | ||
292 | #define pmd_none(pmd) (!pmd_val(pmd)) | 315 | #define pmd_none(pmd) (!pmd_val(pmd)) |
293 | #define pmd_present(pmd) (pmd_val(pmd)) | 316 | #define pmd_present(pmd) (pmd_val(pmd)) |