diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-11-15 19:16:01 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-12-22 06:05:32 -0500 |
commit | d30e45eeabefadc6039d7f876a59e5f5f6cb11c6 (patch) | |
tree | 9873141aac1042fe8b230aa525599135f5411e36 /arch/arm/mm/proc-v7.S | |
parent | f6e3354d02aa1f30672e3671098c12cb49c7da25 (diff) |
ARM: pgtable: switch order of Linux vs hardware page tables
This switches the ordering of the Linux vs hardware page tables in
each page, thereby eliminating some of the arithmetic in the page
table walks. As we now place the Linux page table at the beginning
of the page, we can deal with the offset in the pgt by simply masking
it away, along with the other control bits.
This also makes the arithmetic all be positive, rather than a mixture.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/proc-v7.S')
-rw-r--r-- | arch/arm/mm/proc-v7.S | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index 53cbe2225153..89c31a6dae5c 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S | |||
@@ -124,15 +124,13 @@ ENDPROC(cpu_v7_switch_mm) | |||
124 | * Set a level 2 translation table entry. | 124 | * Set a level 2 translation table entry. |
125 | * | 125 | * |
126 | * - ptep - pointer to level 2 translation table entry | 126 | * - ptep - pointer to level 2 translation table entry |
127 | * (hardware version is stored at -1024 bytes) | 127 | * (hardware version is stored at +2048 bytes) |
128 | * - pte - PTE value to store | 128 | * - pte - PTE value to store |
129 | * - ext - value for extended PTE bits | 129 | * - ext - value for extended PTE bits |
130 | */ | 130 | */ |
131 | ENTRY(cpu_v7_set_pte_ext) | 131 | ENTRY(cpu_v7_set_pte_ext) |
132 | #ifdef CONFIG_MMU | 132 | #ifdef CONFIG_MMU |
133 | ARM( str r1, [r0], #-2048 ) @ linux version | 133 | str r1, [r0] @ linux version |
134 | THUMB( str r1, [r0] ) @ linux version | ||
135 | THUMB( sub r0, r0, #2048 ) | ||
136 | 134 | ||
137 | bic r3, r1, #0x000003f0 | 135 | bic r3, r1, #0x000003f0 |
138 | bic r3, r3, #PTE_TYPE_MASK | 136 | bic r3, r3, #PTE_TYPE_MASK |
@@ -158,7 +156,7 @@ ENTRY(cpu_v7_set_pte_ext) | |||
158 | tstne r1, #L_PTE_PRESENT | 156 | tstne r1, #L_PTE_PRESENT |
159 | moveq r3, #0 | 157 | moveq r3, #0 |
160 | 158 | ||
161 | str r3, [r0] | 159 | str r3, [r0, #2048]! |
162 | mcr p15, 0, r0, c7, c10, 1 @ flush_pte | 160 | mcr p15, 0, r0, c7, c10, 1 @ flush_pte |
163 | #endif | 161 | #endif |
164 | mov pc, lr | 162 | mov pc, lr |