aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/lib')
-rw-r--r--arch/arm/lib/uaccess.S132
1 files changed, 16 insertions, 116 deletions
diff --git a/arch/arm/lib/uaccess.S b/arch/arm/lib/uaccess.S
index c28449157bea..6f1b5b49fe4c 100644
--- a/arch/arm/lib/uaccess.S
+++ b/arch/arm/lib/uaccess.S
@@ -43,8 +43,6 @@ ENTRY(__arch_copy_to_user)
43 stmfd sp!, {r2, r4 - r7, lr} 43 stmfd sp!, {r2, r4 - r7, lr}
44 cmp r2, #4 44 cmp r2, #4
45 blt .c2u_not_enough 45 blt .c2u_not_enough
46 PLD( pld [r1, #0] )
47 PLD( pld [r0, #0] )
48 ands ip, r0, #3 46 ands ip, r0, #3
49 bne .c2u_dest_not_aligned 47 bne .c2u_dest_not_aligned
50.c2u_dest_aligned: 48.c2u_dest_aligned:
@@ -73,25 +71,13 @@ USER( strt r3, [r0], #4) @ May fault
73 sub r2, r2, ip 71 sub r2, r2, ip
74 subs ip, ip, #32 72 subs ip, ip, #32
75 blt .c2u_0rem8lp 73 blt .c2u_0rem8lp
76 PLD( pld [r1, #28] ) 74
77 PLD( pld [r0, #28] ) 75.c2u_0cpy8lp: ldmia r1!, {r3 - r6}
78 PLD( subs ip, ip, #64 )
79 PLD( blt .c2u_0cpynopld )
80 PLD( pld [r1, #60] )
81 PLD( pld [r0, #60] )
82
83.c2u_0cpy8lp:
84 PLD( pld [r1, #92] )
85 PLD( pld [r0, #92] )
86.c2u_0cpynopld: ldmia r1!, {r3 - r6}
87 stmia r0!, {r3 - r6} @ Shouldnt fault 76 stmia r0!, {r3 - r6} @ Shouldnt fault
88 ldmia r1!, {r3 - r6} 77 ldmia r1!, {r3 - r6}
89 subs ip, ip, #32 78 subs ip, ip, #32
90 stmia r0!, {r3 - r6} @ Shouldnt fault 79 stmia r0!, {r3 - r6} @ Shouldnt fault
91 bpl .c2u_0cpy8lp 80 bpl .c2u_0cpy8lp
92 PLD( cmn ip, #64 )
93 PLD( bge .c2u_0cpynopld )
94 PLD( add ip, ip, #64 )
95 81
96.c2u_0rem8lp: cmn ip, #16 82.c2u_0rem8lp: cmn ip, #16
97 ldmgeia r1!, {r3 - r6} 83 ldmgeia r1!, {r3 - r6}
@@ -143,17 +129,8 @@ USER( strt r3, [r0], #4) @ May fault
143 sub r2, r2, ip 129 sub r2, r2, ip
144 subs ip, ip, #16 130 subs ip, ip, #16
145 blt .c2u_1rem8lp 131 blt .c2u_1rem8lp
146 PLD( pld [r1, #12] ) 132
147 PLD( pld [r0, #12] ) 133.c2u_1cpy8lp: mov r3, r7, pull #8
148 PLD( subs ip, ip, #32 )
149 PLD( blt .c2u_1cpynopld )
150 PLD( pld [r1, #28] )
151 PLD( pld [r0, #28] )
152
153.c2u_1cpy8lp:
154 PLD( pld [r1, #44] )
155 PLD( pld [r0, #44] )
156.c2u_1cpynopld: mov r3, r7, pull #8
157 ldmia r1!, {r4 - r7} 134 ldmia r1!, {r4 - r7}
158 subs ip, ip, #16 135 subs ip, ip, #16
159 orr r3, r3, r4, push #24 136 orr r3, r3, r4, push #24
@@ -165,9 +142,6 @@ USER( strt r3, [r0], #4) @ May fault
165 orr r6, r6, r7, push #24 142 orr r6, r6, r7, push #24
166 stmia r0!, {r3 - r6} @ Shouldnt fault 143 stmia r0!, {r3 - r6} @ Shouldnt fault
167 bpl .c2u_1cpy8lp 144 bpl .c2u_1cpy8lp
168 PLD( cmn ip, #32 )
169 PLD( bge .c2u_1cpynopld )
170 PLD( add ip, ip, #32 )
171 145
172.c2u_1rem8lp: tst ip, #8 146.c2u_1rem8lp: tst ip, #8
173 movne r3, r7, pull #8 147 movne r3, r7, pull #8
@@ -210,17 +184,8 @@ USER( strt r3, [r0], #4) @ May fault
210 sub r2, r2, ip 184 sub r2, r2, ip
211 subs ip, ip, #16 185 subs ip, ip, #16
212 blt .c2u_2rem8lp 186 blt .c2u_2rem8lp
213 PLD( pld [r1, #12] ) 187
214 PLD( pld [r0, #12] ) 188.c2u_2cpy8lp: mov r3, r7, pull #16
215 PLD( subs ip, ip, #32 )
216 PLD( blt .c2u_2cpynopld )
217 PLD( pld [r1, #28] )
218 PLD( pld [r0, #28] )
219
220.c2u_2cpy8lp:
221 PLD( pld [r1, #44] )
222 PLD( pld [r0, #44] )
223.c2u_2cpynopld: mov r3, r7, pull #16
224 ldmia r1!, {r4 - r7} 189 ldmia r1!, {r4 - r7}
225 subs ip, ip, #16 190 subs ip, ip, #16
226 orr r3, r3, r4, push #16 191 orr r3, r3, r4, push #16
@@ -232,9 +197,6 @@ USER( strt r3, [r0], #4) @ May fault
232 orr r6, r6, r7, push #16 197 orr r6, r6, r7, push #16
233 stmia r0!, {r3 - r6} @ Shouldnt fault 198 stmia r0!, {r3 - r6} @ Shouldnt fault
234 bpl .c2u_2cpy8lp 199 bpl .c2u_2cpy8lp
235 PLD( cmn ip, #32 )
236 PLD( bge .c2u_2cpynopld )
237 PLD( add ip, ip, #32 )
238 200
239.c2u_2rem8lp: tst ip, #8 201.c2u_2rem8lp: tst ip, #8
240 movne r3, r7, pull #16 202 movne r3, r7, pull #16
@@ -277,17 +239,8 @@ USER( strt r3, [r0], #4) @ May fault
277 sub r2, r2, ip 239 sub r2, r2, ip
278 subs ip, ip, #16 240 subs ip, ip, #16
279 blt .c2u_3rem8lp 241 blt .c2u_3rem8lp
280 PLD( pld [r1, #12] ) 242
281 PLD( pld [r0, #12] ) 243.c2u_3cpy8lp: mov r3, r7, pull #24
282 PLD( subs ip, ip, #32 )
283 PLD( blt .c2u_3cpynopld )
284 PLD( pld [r1, #28] )
285 PLD( pld [r0, #28] )
286
287.c2u_3cpy8lp:
288 PLD( pld [r1, #44] )
289 PLD( pld [r0, #44] )
290.c2u_3cpynopld: mov r3, r7, pull #24
291 ldmia r1!, {r4 - r7} 244 ldmia r1!, {r4 - r7}
292 subs ip, ip, #16 245 subs ip, ip, #16
293 orr r3, r3, r4, push #8 246 orr r3, r3, r4, push #8
@@ -299,9 +252,6 @@ USER( strt r3, [r0], #4) @ May fault
299 orr r6, r6, r7, push #8 252 orr r6, r6, r7, push #8
300 stmia r0!, {r3 - r6} @ Shouldnt fault 253 stmia r0!, {r3 - r6} @ Shouldnt fault
301 bpl .c2u_3cpy8lp 254 bpl .c2u_3cpy8lp
302 PLD( cmn ip, #32 )
303 PLD( bge .c2u_3cpynopld )
304 PLD( add ip, ip, #32 )
305 255
306.c2u_3rem8lp: tst ip, #8 256.c2u_3rem8lp: tst ip, #8
307 movne r3, r7, pull #24 257 movne r3, r7, pull #24
@@ -356,8 +306,6 @@ ENTRY(__arch_copy_from_user)
356 stmfd sp!, {r0, r2, r4 - r7, lr} 306 stmfd sp!, {r0, r2, r4 - r7, lr}
357 cmp r2, #4 307 cmp r2, #4
358 blt .cfu_not_enough 308 blt .cfu_not_enough
359 PLD( pld [r1, #0] )
360 PLD( pld [r0, #0] )
361 ands ip, r0, #3 309 ands ip, r0, #3
362 bne .cfu_dest_not_aligned 310 bne .cfu_dest_not_aligned
363.cfu_dest_aligned: 311.cfu_dest_aligned:
@@ -385,25 +333,13 @@ USER( ldrt r3, [r1], #4)
385 sub r2, r2, ip 333 sub r2, r2, ip
386 subs ip, ip, #32 334 subs ip, ip, #32
387 blt .cfu_0rem8lp 335 blt .cfu_0rem8lp
388 PLD( pld [r1, #28] ) 336
389 PLD( pld [r0, #28] ) 337.cfu_0cpy8lp: ldmia r1!, {r3 - r6} @ Shouldnt fault
390 PLD( subs ip, ip, #64 )
391 PLD( blt .cfu_0cpynopld )
392 PLD( pld [r1, #60] )
393 PLD( pld [r0, #60] )
394
395.cfu_0cpy8lp:
396 PLD( pld [r1, #92] )
397 PLD( pld [r0, #92] )
398.cfu_0cpynopld: ldmia r1!, {r3 - r6} @ Shouldnt fault
399 stmia r0!, {r3 - r6} 338 stmia r0!, {r3 - r6}
400 ldmia r1!, {r3 - r6} @ Shouldnt fault 339 ldmia r1!, {r3 - r6} @ Shouldnt fault
401 subs ip, ip, #32 340 subs ip, ip, #32
402 stmia r0!, {r3 - r6} 341 stmia r0!, {r3 - r6}
403 bpl .cfu_0cpy8lp 342 bpl .cfu_0cpy8lp
404 PLD( cmn ip, #64 )
405 PLD( bge .cfu_0cpynopld )
406 PLD( add ip, ip, #64 )
407 343
408.cfu_0rem8lp: cmn ip, #16 344.cfu_0rem8lp: cmn ip, #16
409 ldmgeia r1!, {r3 - r6} @ Shouldnt fault 345 ldmgeia r1!, {r3 - r6} @ Shouldnt fault
@@ -456,17 +392,8 @@ USER( ldrt r7, [r1], #4) @ May fault
456 sub r2, r2, ip 392 sub r2, r2, ip
457 subs ip, ip, #16 393 subs ip, ip, #16
458 blt .cfu_1rem8lp 394 blt .cfu_1rem8lp
459 PLD( pld [r1, #12] ) 395
460 PLD( pld [r0, #12] ) 396.cfu_1cpy8lp: mov r3, r7, pull #8
461 PLD( subs ip, ip, #32 )
462 PLD( blt .cfu_1cpynopld )
463 PLD( pld [r1, #28] )
464 PLD( pld [r0, #28] )
465
466.cfu_1cpy8lp:
467 PLD( pld [r1, #44] )
468 PLD( pld [r0, #44] )
469.cfu_1cpynopld: mov r3, r7, pull #8
470 ldmia r1!, {r4 - r7} @ Shouldnt fault 397 ldmia r1!, {r4 - r7} @ Shouldnt fault
471 subs ip, ip, #16 398 subs ip, ip, #16
472 orr r3, r3, r4, push #24 399 orr r3, r3, r4, push #24
@@ -478,9 +405,6 @@ USER( ldrt r7, [r1], #4) @ May fault
478 orr r6, r6, r7, push #24 405 orr r6, r6, r7, push #24
479 stmia r0!, {r3 - r6} 406 stmia r0!, {r3 - r6}
480 bpl .cfu_1cpy8lp 407 bpl .cfu_1cpy8lp
481 PLD( cmn ip, #32 )
482 PLD( bge .cfu_1cpynopld )
483 PLD( add ip, ip, #32 )
484 408
485.cfu_1rem8lp: tst ip, #8 409.cfu_1rem8lp: tst ip, #8
486 movne r3, r7, pull #8 410 movne r3, r7, pull #8
@@ -523,17 +447,8 @@ USER( ldrt r7, [r1], #4) @ May fault
523 sub r2, r2, ip 447 sub r2, r2, ip
524 subs ip, ip, #16 448 subs ip, ip, #16
525 blt .cfu_2rem8lp 449 blt .cfu_2rem8lp
526 PLD( pld [r1, #12] ) 450
527 PLD( pld [r0, #12] ) 451.cfu_2cpy8lp: mov r3, r7, pull #16
528 PLD( subs ip, ip, #32 )
529 PLD( blt .cfu_2cpynopld )
530 PLD( pld [r1, #28] )
531 PLD( pld [r0, #28] )
532
533.cfu_2cpy8lp:
534 PLD( pld [r1, #44] )
535 PLD( pld [r0, #44] )
536.cfu_2cpynopld: mov r3, r7, pull #16
537 ldmia r1!, {r4 - r7} @ Shouldnt fault 452 ldmia r1!, {r4 - r7} @ Shouldnt fault
538 subs ip, ip, #16 453 subs ip, ip, #16
539 orr r3, r3, r4, push #16 454 orr r3, r3, r4, push #16
@@ -545,9 +460,6 @@ USER( ldrt r7, [r1], #4) @ May fault
545 orr r6, r6, r7, push #16 460 orr r6, r6, r7, push #16
546 stmia r0!, {r3 - r6} 461 stmia r0!, {r3 - r6}
547 bpl .cfu_2cpy8lp 462 bpl .cfu_2cpy8lp
548 PLD( cmn ip, #32 )
549 PLD( bge .cfu_2cpynopld )
550 PLD( add ip, ip, #32 )
551 463
552.cfu_2rem8lp: tst ip, #8 464.cfu_2rem8lp: tst ip, #8
553 movne r3, r7, pull #16 465 movne r3, r7, pull #16
@@ -590,17 +502,8 @@ USER( ldrt r7, [r1], #4) @ May fault
590 sub r2, r2, ip 502 sub r2, r2, ip
591 subs ip, ip, #16 503 subs ip, ip, #16
592 blt .cfu_3rem8lp 504 blt .cfu_3rem8lp
593 PLD( pld [r1, #12] ) 505
594 PLD( pld [r0, #12] ) 506.cfu_3cpy8lp: mov r3, r7, pull #24
595 PLD( subs ip, ip, #32 )
596 PLD( blt .cfu_3cpynopld )
597 PLD( pld [r1, #28] )
598 PLD( pld [r0, #28] )
599
600.cfu_3cpy8lp:
601 PLD( pld [r1, #44] )
602 PLD( pld [r0, #44] )
603.cfu_3cpynopld: mov r3, r7, pull #24
604 ldmia r1!, {r4 - r7} @ Shouldnt fault 507 ldmia r1!, {r4 - r7} @ Shouldnt fault
605 orr r3, r3, r4, push #8 508 orr r3, r3, r4, push #8
606 mov r4, r4, pull #24 509 mov r4, r4, pull #24
@@ -612,9 +515,6 @@ USER( ldrt r7, [r1], #4) @ May fault
612 stmia r0!, {r3 - r6} 515 stmia r0!, {r3 - r6}
613 subs ip, ip, #16 516 subs ip, ip, #16
614 bpl .cfu_3cpy8lp 517 bpl .cfu_3cpy8lp
615 PLD( cmn ip, #32 )
616 PLD( bge .cfu_3cpynopld )
617 PLD( add ip, ip, #32 )
618 518
619.cfu_3rem8lp: tst ip, #8 519.cfu_3rem8lp: tst ip, #8
620 movne r3, r7, pull #24 520 movne r3, r7, pull #24