diff options
Diffstat (limited to 'arch/arm/lib/uaccess.S')
-rw-r--r-- | arch/arm/lib/uaccess.S | 83 |
1 files changed, 42 insertions, 41 deletions
diff --git a/arch/arm/lib/uaccess.S b/arch/arm/lib/uaccess.S index fee9f6f88adb..d0ece2aeb70d 100644 --- a/arch/arm/lib/uaccess.S +++ b/arch/arm/lib/uaccess.S | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/linkage.h> | 14 | #include <linux/linkage.h> |
15 | #include <asm/assembler.h> | 15 | #include <asm/assembler.h> |
16 | #include <asm/errno.h> | 16 | #include <asm/errno.h> |
17 | #include <asm/domain.h> | ||
17 | 18 | ||
18 | .text | 19 | .text |
19 | 20 | ||
@@ -31,11 +32,11 @@ | |||
31 | rsb ip, ip, #4 | 32 | rsb ip, ip, #4 |
32 | cmp ip, #2 | 33 | cmp ip, #2 |
33 | ldrb r3, [r1], #1 | 34 | ldrb r3, [r1], #1 |
34 | USER( strbt r3, [r0], #1) @ May fault | 35 | USER( T(strb) r3, [r0], #1) @ May fault |
35 | ldrgeb r3, [r1], #1 | 36 | ldrgeb r3, [r1], #1 |
36 | USER( strgebt r3, [r0], #1) @ May fault | 37 | USER( T(strgeb) r3, [r0], #1) @ May fault |
37 | ldrgtb r3, [r1], #1 | 38 | ldrgtb r3, [r1], #1 |
38 | USER( strgtbt r3, [r0], #1) @ May fault | 39 | USER( T(strgtb) r3, [r0], #1) @ May fault |
39 | sub r2, r2, ip | 40 | sub r2, r2, ip |
40 | b .Lc2u_dest_aligned | 41 | b .Lc2u_dest_aligned |
41 | 42 | ||
@@ -58,7 +59,7 @@ ENTRY(__copy_to_user) | |||
58 | addmi ip, r2, #4 | 59 | addmi ip, r2, #4 |
59 | bmi .Lc2u_0nowords | 60 | bmi .Lc2u_0nowords |
60 | ldr r3, [r1], #4 | 61 | ldr r3, [r1], #4 |
61 | USER( strt r3, [r0], #4) @ May fault | 62 | USER( T(str) r3, [r0], #4) @ May fault |
62 | mov ip, r0, lsl #32 - PAGE_SHIFT @ On each page, use a ld/st??t instruction | 63 | mov ip, r0, lsl #32 - PAGE_SHIFT @ On each page, use a ld/st??t instruction |
63 | rsb ip, ip, #0 | 64 | rsb ip, ip, #0 |
64 | movs ip, ip, lsr #32 - PAGE_SHIFT | 65 | movs ip, ip, lsr #32 - PAGE_SHIFT |
@@ -87,18 +88,18 @@ USER( strt r3, [r0], #4) @ May fault | |||
87 | stmneia r0!, {r3 - r4} @ Shouldnt fault | 88 | stmneia r0!, {r3 - r4} @ Shouldnt fault |
88 | tst ip, #4 | 89 | tst ip, #4 |
89 | ldrne r3, [r1], #4 | 90 | ldrne r3, [r1], #4 |
90 | strnet r3, [r0], #4 @ Shouldnt fault | 91 | T(strne) r3, [r0], #4 @ Shouldnt fault |
91 | ands ip, ip, #3 | 92 | ands ip, ip, #3 |
92 | beq .Lc2u_0fupi | 93 | beq .Lc2u_0fupi |
93 | .Lc2u_0nowords: teq ip, #0 | 94 | .Lc2u_0nowords: teq ip, #0 |
94 | beq .Lc2u_finished | 95 | beq .Lc2u_finished |
95 | .Lc2u_nowords: cmp ip, #2 | 96 | .Lc2u_nowords: cmp ip, #2 |
96 | ldrb r3, [r1], #1 | 97 | ldrb r3, [r1], #1 |
97 | USER( strbt r3, [r0], #1) @ May fault | 98 | USER( T(strb) r3, [r0], #1) @ May fault |
98 | ldrgeb r3, [r1], #1 | 99 | ldrgeb r3, [r1], #1 |
99 | USER( strgebt r3, [r0], #1) @ May fault | 100 | USER( T(strgeb) r3, [r0], #1) @ May fault |
100 | ldrgtb r3, [r1], #1 | 101 | ldrgtb r3, [r1], #1 |
101 | USER( strgtbt r3, [r0], #1) @ May fault | 102 | USER( T(strgtb) r3, [r0], #1) @ May fault |
102 | b .Lc2u_finished | 103 | b .Lc2u_finished |
103 | 104 | ||
104 | .Lc2u_not_enough: | 105 | .Lc2u_not_enough: |
@@ -119,7 +120,7 @@ USER( strgtbt r3, [r0], #1) @ May fault | |||
119 | mov r3, r7, pull #8 | 120 | mov r3, r7, pull #8 |
120 | ldr r7, [r1], #4 | 121 | ldr r7, [r1], #4 |
121 | orr r3, r3, r7, push #24 | 122 | orr r3, r3, r7, push #24 |
122 | USER( strt r3, [r0], #4) @ May fault | 123 | USER( T(str) r3, [r0], #4) @ May fault |
123 | mov ip, r0, lsl #32 - PAGE_SHIFT | 124 | mov ip, r0, lsl #32 - PAGE_SHIFT |
124 | rsb ip, ip, #0 | 125 | rsb ip, ip, #0 |
125 | movs ip, ip, lsr #32 - PAGE_SHIFT | 126 | movs ip, ip, lsr #32 - PAGE_SHIFT |
@@ -154,18 +155,18 @@ USER( strt r3, [r0], #4) @ May fault | |||
154 | movne r3, r7, pull #8 | 155 | movne r3, r7, pull #8 |
155 | ldrne r7, [r1], #4 | 156 | ldrne r7, [r1], #4 |
156 | orrne r3, r3, r7, push #24 | 157 | orrne r3, r3, r7, push #24 |
157 | strnet r3, [r0], #4 @ Shouldnt fault | 158 | T(strne) r3, [r0], #4 @ Shouldnt fault |
158 | ands ip, ip, #3 | 159 | ands ip, ip, #3 |
159 | beq .Lc2u_1fupi | 160 | beq .Lc2u_1fupi |
160 | .Lc2u_1nowords: mov r3, r7, get_byte_1 | 161 | .Lc2u_1nowords: mov r3, r7, get_byte_1 |
161 | teq ip, #0 | 162 | teq ip, #0 |
162 | beq .Lc2u_finished | 163 | beq .Lc2u_finished |
163 | cmp ip, #2 | 164 | cmp ip, #2 |
164 | USER( strbt r3, [r0], #1) @ May fault | 165 | USER( T(strb) r3, [r0], #1) @ May fault |
165 | movge r3, r7, get_byte_2 | 166 | movge r3, r7, get_byte_2 |
166 | USER( strgebt r3, [r0], #1) @ May fault | 167 | USER( T(strgeb) r3, [r0], #1) @ May fault |
167 | movgt r3, r7, get_byte_3 | 168 | movgt r3, r7, get_byte_3 |
168 | USER( strgtbt r3, [r0], #1) @ May fault | 169 | USER( T(strgtb) r3, [r0], #1) @ May fault |
169 | b .Lc2u_finished | 170 | b .Lc2u_finished |
170 | 171 | ||
171 | .Lc2u_2fupi: subs r2, r2, #4 | 172 | .Lc2u_2fupi: subs r2, r2, #4 |
@@ -174,7 +175,7 @@ USER( strgtbt r3, [r0], #1) @ May fault | |||
174 | mov r3, r7, pull #16 | 175 | mov r3, r7, pull #16 |
175 | ldr r7, [r1], #4 | 176 | ldr r7, [r1], #4 |
176 | orr r3, r3, r7, push #16 | 177 | orr r3, r3, r7, push #16 |
177 | USER( strt r3, [r0], #4) @ May fault | 178 | USER( T(str) r3, [r0], #4) @ May fault |
178 | mov ip, r0, lsl #32 - PAGE_SHIFT | 179 | mov ip, r0, lsl #32 - PAGE_SHIFT |
179 | rsb ip, ip, #0 | 180 | rsb ip, ip, #0 |
180 | movs ip, ip, lsr #32 - PAGE_SHIFT | 181 | movs ip, ip, lsr #32 - PAGE_SHIFT |
@@ -209,18 +210,18 @@ USER( strt r3, [r0], #4) @ May fault | |||
209 | movne r3, r7, pull #16 | 210 | movne r3, r7, pull #16 |
210 | ldrne r7, [r1], #4 | 211 | ldrne r7, [r1], #4 |
211 | orrne r3, r3, r7, push #16 | 212 | orrne r3, r3, r7, push #16 |
212 | strnet r3, [r0], #4 @ Shouldnt fault | 213 | T(strne) r3, [r0], #4 @ Shouldnt fault |
213 | ands ip, ip, #3 | 214 | ands ip, ip, #3 |
214 | beq .Lc2u_2fupi | 215 | beq .Lc2u_2fupi |
215 | .Lc2u_2nowords: mov r3, r7, get_byte_2 | 216 | .Lc2u_2nowords: mov r3, r7, get_byte_2 |
216 | teq ip, #0 | 217 | teq ip, #0 |
217 | beq .Lc2u_finished | 218 | beq .Lc2u_finished |
218 | cmp ip, #2 | 219 | cmp ip, #2 |
219 | USER( strbt r3, [r0], #1) @ May fault | 220 | USER( T(strb) r3, [r0], #1) @ May fault |
220 | movge r3, r7, get_byte_3 | 221 | movge r3, r7, get_byte_3 |
221 | USER( strgebt r3, [r0], #1) @ May fault | 222 | USER( T(strgeb) r3, [r0], #1) @ May fault |
222 | ldrgtb r3, [r1], #0 | 223 | ldrgtb r3, [r1], #0 |
223 | USER( strgtbt r3, [r0], #1) @ May fault | 224 | USER( T(strgtb) r3, [r0], #1) @ May fault |
224 | b .Lc2u_finished | 225 | b .Lc2u_finished |
225 | 226 | ||
226 | .Lc2u_3fupi: subs r2, r2, #4 | 227 | .Lc2u_3fupi: subs r2, r2, #4 |
@@ -229,7 +230,7 @@ USER( strgtbt r3, [r0], #1) @ May fault | |||
229 | mov r3, r7, pull #24 | 230 | mov r3, r7, pull #24 |
230 | ldr r7, [r1], #4 | 231 | ldr r7, [r1], #4 |
231 | orr r3, r3, r7, push #8 | 232 | orr r3, r3, r7, push #8 |
232 | USER( strt r3, [r0], #4) @ May fault | 233 | USER( T(str) r3, [r0], #4) @ May fault |
233 | mov ip, r0, lsl #32 - PAGE_SHIFT | 234 | mov ip, r0, lsl #32 - PAGE_SHIFT |
234 | rsb ip, ip, #0 | 235 | rsb ip, ip, #0 |
235 | movs ip, ip, lsr #32 - PAGE_SHIFT | 236 | movs ip, ip, lsr #32 - PAGE_SHIFT |
@@ -264,18 +265,18 @@ USER( strt r3, [r0], #4) @ May fault | |||
264 | movne r3, r7, pull #24 | 265 | movne r3, r7, pull #24 |
265 | ldrne r7, [r1], #4 | 266 | ldrne r7, [r1], #4 |
266 | orrne r3, r3, r7, push #8 | 267 | orrne r3, r3, r7, push #8 |
267 | strnet r3, [r0], #4 @ Shouldnt fault | 268 | T(strne) r3, [r0], #4 @ Shouldnt fault |
268 | ands ip, ip, #3 | 269 | ands ip, ip, #3 |
269 | beq .Lc2u_3fupi | 270 | beq .Lc2u_3fupi |
270 | .Lc2u_3nowords: mov r3, r7, get_byte_3 | 271 | .Lc2u_3nowords: mov r3, r7, get_byte_3 |
271 | teq ip, #0 | 272 | teq ip, #0 |
272 | beq .Lc2u_finished | 273 | beq .Lc2u_finished |
273 | cmp ip, #2 | 274 | cmp ip, #2 |
274 | USER( strbt r3, [r0], #1) @ May fault | 275 | USER( T(strb) r3, [r0], #1) @ May fault |
275 | ldrgeb r3, [r1], #1 | 276 | ldrgeb r3, [r1], #1 |
276 | USER( strgebt r3, [r0], #1) @ May fault | 277 | USER( T(strgeb) r3, [r0], #1) @ May fault |
277 | ldrgtb r3, [r1], #0 | 278 | ldrgtb r3, [r1], #0 |
278 | USER( strgtbt r3, [r0], #1) @ May fault | 279 | USER( T(strgtb) r3, [r0], #1) @ May fault |
279 | b .Lc2u_finished | 280 | b .Lc2u_finished |
280 | ENDPROC(__copy_to_user) | 281 | ENDPROC(__copy_to_user) |
281 | 282 | ||
@@ -294,11 +295,11 @@ ENDPROC(__copy_to_user) | |||
294 | .Lcfu_dest_not_aligned: | 295 | .Lcfu_dest_not_aligned: |
295 | rsb ip, ip, #4 | 296 | rsb ip, ip, #4 |
296 | cmp ip, #2 | 297 | cmp ip, #2 |
297 | USER( ldrbt r3, [r1], #1) @ May fault | 298 | USER( T(ldrb) r3, [r1], #1) @ May fault |
298 | strb r3, [r0], #1 | 299 | strb r3, [r0], #1 |
299 | USER( ldrgebt r3, [r1], #1) @ May fault | 300 | USER( T(ldrgeb) r3, [r1], #1) @ May fault |
300 | strgeb r3, [r0], #1 | 301 | strgeb r3, [r0], #1 |
301 | USER( ldrgtbt r3, [r1], #1) @ May fault | 302 | USER( T(ldrgtb) r3, [r1], #1) @ May fault |
302 | strgtb r3, [r0], #1 | 303 | strgtb r3, [r0], #1 |
303 | sub r2, r2, ip | 304 | sub r2, r2, ip |
304 | b .Lcfu_dest_aligned | 305 | b .Lcfu_dest_aligned |
@@ -321,7 +322,7 @@ ENTRY(__copy_from_user) | |||
321 | .Lcfu_0fupi: subs r2, r2, #4 | 322 | .Lcfu_0fupi: subs r2, r2, #4 |
322 | addmi ip, r2, #4 | 323 | addmi ip, r2, #4 |
323 | bmi .Lcfu_0nowords | 324 | bmi .Lcfu_0nowords |
324 | USER( ldrt r3, [r1], #4) | 325 | USER( T(ldr) r3, [r1], #4) |
325 | str r3, [r0], #4 | 326 | str r3, [r0], #4 |
326 | mov ip, r1, lsl #32 - PAGE_SHIFT @ On each page, use a ld/st??t instruction | 327 | mov ip, r1, lsl #32 - PAGE_SHIFT @ On each page, use a ld/st??t instruction |
327 | rsb ip, ip, #0 | 328 | rsb ip, ip, #0 |
@@ -350,18 +351,18 @@ USER( ldrt r3, [r1], #4) | |||
350 | ldmneia r1!, {r3 - r4} @ Shouldnt fault | 351 | ldmneia r1!, {r3 - r4} @ Shouldnt fault |
351 | stmneia r0!, {r3 - r4} | 352 | stmneia r0!, {r3 - r4} |
352 | tst ip, #4 | 353 | tst ip, #4 |
353 | ldrnet r3, [r1], #4 @ Shouldnt fault | 354 | T(ldrne) r3, [r1], #4 @ Shouldnt fault |
354 | strne r3, [r0], #4 | 355 | strne r3, [r0], #4 |
355 | ands ip, ip, #3 | 356 | ands ip, ip, #3 |
356 | beq .Lcfu_0fupi | 357 | beq .Lcfu_0fupi |
357 | .Lcfu_0nowords: teq ip, #0 | 358 | .Lcfu_0nowords: teq ip, #0 |
358 | beq .Lcfu_finished | 359 | beq .Lcfu_finished |
359 | .Lcfu_nowords: cmp ip, #2 | 360 | .Lcfu_nowords: cmp ip, #2 |
360 | USER( ldrbt r3, [r1], #1) @ May fault | 361 | USER( T(ldrb) r3, [r1], #1) @ May fault |
361 | strb r3, [r0], #1 | 362 | strb r3, [r0], #1 |
362 | USER( ldrgebt r3, [r1], #1) @ May fault | 363 | USER( T(ldrgeb) r3, [r1], #1) @ May fault |
363 | strgeb r3, [r0], #1 | 364 | strgeb r3, [r0], #1 |
364 | USER( ldrgtbt r3, [r1], #1) @ May fault | 365 | USER( T(ldrgtb) r3, [r1], #1) @ May fault |
365 | strgtb r3, [r0], #1 | 366 | strgtb r3, [r0], #1 |
366 | b .Lcfu_finished | 367 | b .Lcfu_finished |
367 | 368 | ||
@@ -374,7 +375,7 @@ USER( ldrgtbt r3, [r1], #1) @ May fault | |||
374 | 375 | ||
375 | .Lcfu_src_not_aligned: | 376 | .Lcfu_src_not_aligned: |
376 | bic r1, r1, #3 | 377 | bic r1, r1, #3 |
377 | USER( ldrt r7, [r1], #4) @ May fault | 378 | USER( T(ldr) r7, [r1], #4) @ May fault |
378 | cmp ip, #2 | 379 | cmp ip, #2 |
379 | bgt .Lcfu_3fupi | 380 | bgt .Lcfu_3fupi |
380 | beq .Lcfu_2fupi | 381 | beq .Lcfu_2fupi |
@@ -382,7 +383,7 @@ USER( ldrt r7, [r1], #4) @ May fault | |||
382 | addmi ip, r2, #4 | 383 | addmi ip, r2, #4 |
383 | bmi .Lcfu_1nowords | 384 | bmi .Lcfu_1nowords |
384 | mov r3, r7, pull #8 | 385 | mov r3, r7, pull #8 |
385 | USER( ldrt r7, [r1], #4) @ May fault | 386 | USER( T(ldr) r7, [r1], #4) @ May fault |
386 | orr r3, r3, r7, push #24 | 387 | orr r3, r3, r7, push #24 |
387 | str r3, [r0], #4 | 388 | str r3, [r0], #4 |
388 | mov ip, r1, lsl #32 - PAGE_SHIFT | 389 | mov ip, r1, lsl #32 - PAGE_SHIFT |
@@ -417,7 +418,7 @@ USER( ldrt r7, [r1], #4) @ May fault | |||
417 | stmneia r0!, {r3 - r4} | 418 | stmneia r0!, {r3 - r4} |
418 | tst ip, #4 | 419 | tst ip, #4 |
419 | movne r3, r7, pull #8 | 420 | movne r3, r7, pull #8 |
420 | USER( ldrnet r7, [r1], #4) @ May fault | 421 | USER( T(ldrne) r7, [r1], #4) @ May fault |
421 | orrne r3, r3, r7, push #24 | 422 | orrne r3, r3, r7, push #24 |
422 | strne r3, [r0], #4 | 423 | strne r3, [r0], #4 |
423 | ands ip, ip, #3 | 424 | ands ip, ip, #3 |
@@ -437,7 +438,7 @@ USER( ldrnet r7, [r1], #4) @ May fault | |||
437 | addmi ip, r2, #4 | 438 | addmi ip, r2, #4 |
438 | bmi .Lcfu_2nowords | 439 | bmi .Lcfu_2nowords |
439 | mov r3, r7, pull #16 | 440 | mov r3, r7, pull #16 |
440 | USER( ldrt r7, [r1], #4) @ May fault | 441 | USER( T(ldr) r7, [r1], #4) @ May fault |
441 | orr r3, r3, r7, push #16 | 442 | orr r3, r3, r7, push #16 |
442 | str r3, [r0], #4 | 443 | str r3, [r0], #4 |
443 | mov ip, r1, lsl #32 - PAGE_SHIFT | 444 | mov ip, r1, lsl #32 - PAGE_SHIFT |
@@ -473,7 +474,7 @@ USER( ldrt r7, [r1], #4) @ May fault | |||
473 | stmneia r0!, {r3 - r4} | 474 | stmneia r0!, {r3 - r4} |
474 | tst ip, #4 | 475 | tst ip, #4 |
475 | movne r3, r7, pull #16 | 476 | movne r3, r7, pull #16 |
476 | USER( ldrnet r7, [r1], #4) @ May fault | 477 | USER( T(ldrne) r7, [r1], #4) @ May fault |
477 | orrne r3, r3, r7, push #16 | 478 | orrne r3, r3, r7, push #16 |
478 | strne r3, [r0], #4 | 479 | strne r3, [r0], #4 |
479 | ands ip, ip, #3 | 480 | ands ip, ip, #3 |
@@ -485,7 +486,7 @@ USER( ldrnet r7, [r1], #4) @ May fault | |||
485 | strb r3, [r0], #1 | 486 | strb r3, [r0], #1 |
486 | movge r3, r7, get_byte_3 | 487 | movge r3, r7, get_byte_3 |
487 | strgeb r3, [r0], #1 | 488 | strgeb r3, [r0], #1 |
488 | USER( ldrgtbt r3, [r1], #0) @ May fault | 489 | USER( T(ldrgtb) r3, [r1], #0) @ May fault |
489 | strgtb r3, [r0], #1 | 490 | strgtb r3, [r0], #1 |
490 | b .Lcfu_finished | 491 | b .Lcfu_finished |
491 | 492 | ||
@@ -493,7 +494,7 @@ USER( ldrgtbt r3, [r1], #0) @ May fault | |||
493 | addmi ip, r2, #4 | 494 | addmi ip, r2, #4 |
494 | bmi .Lcfu_3nowords | 495 | bmi .Lcfu_3nowords |
495 | mov r3, r7, pull #24 | 496 | mov r3, r7, pull #24 |
496 | USER( ldrt r7, [r1], #4) @ May fault | 497 | USER( T(ldr) r7, [r1], #4) @ May fault |
497 | orr r3, r3, r7, push #8 | 498 | orr r3, r3, r7, push #8 |
498 | str r3, [r0], #4 | 499 | str r3, [r0], #4 |
499 | mov ip, r1, lsl #32 - PAGE_SHIFT | 500 | mov ip, r1, lsl #32 - PAGE_SHIFT |
@@ -528,7 +529,7 @@ USER( ldrt r7, [r1], #4) @ May fault | |||
528 | stmneia r0!, {r3 - r4} | 529 | stmneia r0!, {r3 - r4} |
529 | tst ip, #4 | 530 | tst ip, #4 |
530 | movne r3, r7, pull #24 | 531 | movne r3, r7, pull #24 |
531 | USER( ldrnet r7, [r1], #4) @ May fault | 532 | USER( T(ldrne) r7, [r1], #4) @ May fault |
532 | orrne r3, r3, r7, push #8 | 533 | orrne r3, r3, r7, push #8 |
533 | strne r3, [r0], #4 | 534 | strne r3, [r0], #4 |
534 | ands ip, ip, #3 | 535 | ands ip, ip, #3 |
@@ -538,9 +539,9 @@ USER( ldrnet r7, [r1], #4) @ May fault | |||
538 | beq .Lcfu_finished | 539 | beq .Lcfu_finished |
539 | cmp ip, #2 | 540 | cmp ip, #2 |
540 | strb r3, [r0], #1 | 541 | strb r3, [r0], #1 |
541 | USER( ldrgebt r3, [r1], #1) @ May fault | 542 | USER( T(ldrgeb) r3, [r1], #1) @ May fault |
542 | strgeb r3, [r0], #1 | 543 | strgeb r3, [r0], #1 |
543 | USER( ldrgtbt r3, [r1], #1) @ May fault | 544 | USER( T(ldrgtb) r3, [r1], #1) @ May fault |
544 | strgtb r3, [r0], #1 | 545 | strgtb r3, [r0], #1 |
545 | b .Lcfu_finished | 546 | b .Lcfu_finished |
546 | ENDPROC(__copy_from_user) | 547 | ENDPROC(__copy_from_user) |