diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-08-10 11:15:32 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-08-10 11:15:32 -0400 |
commit | 1b9749e7f15bf2db19f5d201f88401c7517910b7 (patch) | |
tree | 43654821aa73118f73f0e98e40bfb470f089e96d | |
parent | 86b3786078d63242d3194ffc58ae8dae1d1bbef3 (diff) |
[ARM] Use #defined constants for manipulating v6 hardware PTE bits
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/mm/proc-v6.S | 20 | ||||
-rw-r--r-- | include/asm-arm/pgtable.h | 12 |
2 files changed, 16 insertions, 16 deletions
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S index 352db98ee269..75e65522c8d2 100644 --- a/arch/arm/mm/proc-v6.S +++ b/arch/arm/mm/proc-v6.S | |||
@@ -111,12 +111,6 @@ ENTRY(cpu_v6_switch_mm) | |||
111 | mcr p15, 0, r1, c13, c0, 1 @ set context ID | 111 | mcr p15, 0, r1, c13, c0, 1 @ set context ID |
112 | mov pc, lr | 112 | mov pc, lr |
113 | 113 | ||
114 | #define nG (1 << 11) | ||
115 | #define APX (1 << 9) | ||
116 | #define AP1 (1 << 5) | ||
117 | #define AP0 (1 << 4) | ||
118 | #define XN (1 << 0) | ||
119 | |||
120 | /* | 114 | /* |
121 | * cpu_v6_set_pte(ptep, pte) | 115 | * cpu_v6_set_pte(ptep, pte) |
122 | * | 116 | * |
@@ -141,22 +135,22 @@ ENTRY(cpu_v6_set_pte) | |||
141 | 135 | ||
142 | bic r2, r1, #0x00000ff0 | 136 | bic r2, r1, #0x00000ff0 |
143 | bic r2, r2, #0x00000003 | 137 | bic r2, r2, #0x00000003 |
144 | orr r2, r2, #AP0 | 2 | 138 | orr r2, r2, #PTE_EXT_AP0 | 2 |
145 | 139 | ||
146 | tst r1, #L_PTE_WRITE | 140 | tst r1, #L_PTE_WRITE |
147 | tstne r1, #L_PTE_DIRTY | 141 | tstne r1, #L_PTE_DIRTY |
148 | orreq r2, r2, #APX | 142 | orreq r2, r2, #PTE_EXT_APX |
149 | 143 | ||
150 | tst r1, #L_PTE_USER | 144 | tst r1, #L_PTE_USER |
151 | orrne r2, r2, #AP1 | nG | 145 | orrne r2, r2, #PTE_EXT_AP1 | PTE_EXT_NG |
152 | tstne r2, #APX | 146 | tstne r2, #PTE_EXT_APX |
153 | bicne r2, r2, #APX | AP0 | 147 | bicne r2, r2, #PTE_EXT_APX | PTE_EXT_AP0 |
154 | 148 | ||
155 | tst r1, #L_PTE_YOUNG | 149 | tst r1, #L_PTE_YOUNG |
156 | biceq r2, r2, #APX | AP1 | AP0 | 150 | biceq r2, r2, #PTE_EXT_APX | PTE_EXT_AP_MASK |
157 | 151 | ||
158 | @ tst r1, #L_PTE_EXEC | 152 | @ tst r1, #L_PTE_EXEC |
159 | @ orreq r2, r2, #XN | 153 | @ orreq r2, r2, #PTE_EXT_XN |
160 | 154 | ||
161 | tst r1, #L_PTE_PRESENT | 155 | tst r1, #L_PTE_PRESENT |
162 | moveq r2, #0 | 156 | moveq r2, #0 |
diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h index a9892eb42a23..8bd4c0faf230 100644 --- a/include/asm-arm/pgtable.h +++ b/include/asm-arm/pgtable.h | |||
@@ -188,12 +188,18 @@ extern void __pgd_error(const char *file, int line, unsigned long val); | |||
188 | /* | 188 | /* |
189 | * - extended small page/tiny page | 189 | * - extended small page/tiny page |
190 | */ | 190 | */ |
191 | #define PTE_EXT_XN (1 << 0) /* v6 */ | ||
191 | #define PTE_EXT_AP_MASK (3 << 4) | 192 | #define PTE_EXT_AP_MASK (3 << 4) |
193 | #define PTE_EXT_AP0 (1 << 4) | ||
194 | #define PTE_EXT_AP1 (2 << 4) | ||
192 | #define PTE_EXT_AP_UNO_SRO (0 << 4) | 195 | #define PTE_EXT_AP_UNO_SRO (0 << 4) |
193 | #define PTE_EXT_AP_UNO_SRW (1 << 4) | 196 | #define PTE_EXT_AP_UNO_SRW (PTE_EXT_AP0) |
194 | #define PTE_EXT_AP_URO_SRW (2 << 4) | 197 | #define PTE_EXT_AP_URO_SRW (PTE_EXT_AP1) |
195 | #define PTE_EXT_AP_URW_SRW (3 << 4) | 198 | #define PTE_EXT_AP_URW_SRW (PTE_EXT_AP1|PTE_EXT_AP0) |
196 | #define PTE_EXT_TEX(x) ((x) << 6) /* v5 */ | 199 | #define PTE_EXT_TEX(x) ((x) << 6) /* v5 */ |
200 | #define PTE_EXT_APX (1 << 9) /* v6 */ | ||
201 | #define PTE_EXT_SHARED (1 << 10) /* v6 */ | ||
202 | #define PTE_EXT_NG (1 << 11) /* v6 */ | ||
197 | 203 | ||
198 | /* | 204 | /* |
199 | * - small page | 205 | * - small page |