diff options
Diffstat (limited to 'arch/sparc/kernel/ktlb.S')
-rw-r--r-- | arch/sparc/kernel/ktlb.S | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/arch/sparc/kernel/ktlb.S b/arch/sparc/kernel/ktlb.S index 79f310364849..0746e5e32b37 100644 --- a/arch/sparc/kernel/ktlb.S +++ b/arch/sparc/kernel/ktlb.S | |||
@@ -188,31 +188,26 @@ valid_addr_bitmap_patch: | |||
188 | be,pn %xcc, kvmap_dtlb_longpath | 188 | be,pn %xcc, kvmap_dtlb_longpath |
189 | 189 | ||
190 | 2: sethi %hi(kpte_linear_bitmap), %g2 | 190 | 2: sethi %hi(kpte_linear_bitmap), %g2 |
191 | or %g2, %lo(kpte_linear_bitmap), %g2 | ||
192 | 191 | ||
193 | /* Get the 256MB physical address index. */ | 192 | /* Get the 256MB physical address index. */ |
194 | sllx %g4, 21, %g5 | 193 | sllx %g4, 21, %g5 |
195 | mov 1, %g7 | 194 | or %g2, %lo(kpte_linear_bitmap), %g2 |
196 | srlx %g5, 21 + 28, %g5 | 195 | srlx %g5, 21 + 28, %g5 |
196 | and %g5, (32 - 1), %g7 | ||
197 | 197 | ||
198 | /* Don't try this at home kids... this depends upon srlx | 198 | /* Divide by 32 to get the offset into the bitmask. */ |
199 | * only taking the low 6 bits of the shift count in %g5. | 199 | srlx %g5, 5, %g5 |
200 | */ | 200 | add %g7, %g7, %g7 |
201 | sllx %g7, %g5, %g7 | ||
202 | |||
203 | /* Divide by 64 to get the offset into the bitmask. */ | ||
204 | srlx %g5, 6, %g5 | ||
205 | sllx %g5, 3, %g5 | 201 | sllx %g5, 3, %g5 |
206 | 202 | ||
207 | /* kern_linear_pte_xor[((mask & bit) ? 1 : 0)] */ | 203 | /* kern_linear_pte_xor[(mask >> shift) & 3)] */ |
208 | ldx [%g2 + %g5], %g2 | 204 | ldx [%g2 + %g5], %g2 |
209 | andcc %g2, %g7, %g0 | 205 | srlx %g2, %g7, %g7 |
210 | sethi %hi(kern_linear_pte_xor), %g5 | 206 | sethi %hi(kern_linear_pte_xor), %g5 |
207 | and %g7, 3, %g7 | ||
211 | or %g5, %lo(kern_linear_pte_xor), %g5 | 208 | or %g5, %lo(kern_linear_pte_xor), %g5 |
212 | bne,a,pt %xcc, 1f | 209 | sllx %g7, 3, %g7 |
213 | add %g5, 8, %g5 | 210 | ldx [%g5 + %g7], %g2 |
214 | |||
215 | 1: ldx [%g5], %g2 | ||
216 | 211 | ||
217 | .globl kvmap_linear_patch | 212 | .globl kvmap_linear_patch |
218 | kvmap_linear_patch: | 213 | kvmap_linear_patch: |