diff options
author | Nicolas Pitre <nico@cam.org> | 2005-11-11 16:51:47 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-11-11 16:51:47 -0500 |
commit | 7ba11a9c1598ced7d719648a5998a2a81ba06dc9 (patch) | |
tree | c8f24e6a12366bdb8874db03ef213ebf78590d43 /arch/arm | |
parent | 388f7ef720a982f49925e7b4e96f216f208f8c03 (diff) |
[ARM] 3150/1: make various assembly local labels actually local (uaccess.S)
Patch from Nicolas Pitre
For assembly labels to actually be local they must start with ".L" and
not only "." otherwise they still remain visible in the final link and
clutter kallsyms needlessly, and possibly make for unclear symbolic
backtrace. This patch simply inserts a"L" where appropriate. The code
itself is unchanged.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/lib/uaccess.S | 230 |
1 files changed, 116 insertions, 114 deletions
diff --git a/arch/arm/lib/uaccess.S b/arch/arm/lib/uaccess.S index 6f1b5b49fe4c..0cc450f863b6 100644 --- a/arch/arm/lib/uaccess.S +++ b/arch/arm/lib/uaccess.S | |||
@@ -27,7 +27,7 @@ | |||
27 | * Returns : Number of bytes NOT copied. | 27 | * Returns : Number of bytes NOT copied. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | .c2u_dest_not_aligned: | 30 | .Lc2u_dest_not_aligned: |
31 | rsb ip, ip, #4 | 31 | rsb ip, ip, #4 |
32 | cmp ip, #2 | 32 | cmp ip, #2 |
33 | ldrb r3, [r1], #1 | 33 | ldrb r3, [r1], #1 |
@@ -37,32 +37,32 @@ USER( strgebt r3, [r0], #1) @ May fault | |||
37 | ldrgtb r3, [r1], #1 | 37 | ldrgtb r3, [r1], #1 |
38 | USER( strgtbt r3, [r0], #1) @ May fault | 38 | USER( strgtbt r3, [r0], #1) @ May fault |
39 | sub r2, r2, ip | 39 | sub r2, r2, ip |
40 | b .c2u_dest_aligned | 40 | b .Lc2u_dest_aligned |
41 | 41 | ||
42 | ENTRY(__arch_copy_to_user) | 42 | 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 .Lc2u_not_enough |
46 | ands ip, r0, #3 | 46 | ands ip, r0, #3 |
47 | bne .c2u_dest_not_aligned | 47 | bne .Lc2u_dest_not_aligned |
48 | .c2u_dest_aligned: | 48 | .Lc2u_dest_aligned: |
49 | 49 | ||
50 | ands ip, r1, #3 | 50 | ands ip, r1, #3 |
51 | bne .c2u_src_not_aligned | 51 | bne .Lc2u_src_not_aligned |
52 | /* | 52 | /* |
53 | * Seeing as there has to be at least 8 bytes to copy, we can | 53 | * Seeing as there has to be at least 8 bytes to copy, we can |
54 | * copy one word, and force a user-mode page fault... | 54 | * copy one word, and force a user-mode page fault... |
55 | */ | 55 | */ |
56 | 56 | ||
57 | .c2u_0fupi: subs r2, r2, #4 | 57 | .Lc2u_0fupi: subs r2, r2, #4 |
58 | addmi ip, r2, #4 | 58 | addmi ip, r2, #4 |
59 | bmi .c2u_0nowords | 59 | bmi .Lc2u_0nowords |
60 | ldr r3, [r1], #4 | 60 | ldr r3, [r1], #4 |
61 | USER( strt r3, [r0], #4) @ May fault | 61 | USER( strt r3, [r0], #4) @ May fault |
62 | mov ip, r0, lsl #32 - PAGE_SHIFT @ On each page, use a ld/st??t instruction | 62 | mov ip, r0, lsl #32 - PAGE_SHIFT @ On each page, use a ld/st??t instruction |
63 | rsb ip, ip, #0 | 63 | rsb ip, ip, #0 |
64 | movs ip, ip, lsr #32 - PAGE_SHIFT | 64 | movs ip, ip, lsr #32 - PAGE_SHIFT |
65 | beq .c2u_0fupi | 65 | beq .Lc2u_0fupi |
66 | /* | 66 | /* |
67 | * ip = max no. of bytes to copy before needing another "strt" insn | 67 | * ip = max no. of bytes to copy before needing another "strt" insn |
68 | */ | 68 | */ |
@@ -70,16 +70,16 @@ USER( strt r3, [r0], #4) @ May fault | |||
70 | movlt ip, r2 | 70 | movlt ip, r2 |
71 | sub r2, r2, ip | 71 | sub r2, r2, ip |
72 | subs ip, ip, #32 | 72 | subs ip, ip, #32 |
73 | blt .c2u_0rem8lp | 73 | blt .Lc2u_0rem8lp |
74 | 74 | ||
75 | .c2u_0cpy8lp: ldmia r1!, {r3 - r6} | 75 | .Lc2u_0cpy8lp: ldmia r1!, {r3 - r6} |
76 | stmia r0!, {r3 - r6} @ Shouldnt fault | 76 | stmia r0!, {r3 - r6} @ Shouldnt fault |
77 | ldmia r1!, {r3 - r6} | 77 | ldmia r1!, {r3 - r6} |
78 | subs ip, ip, #32 | 78 | subs ip, ip, #32 |
79 | stmia r0!, {r3 - r6} @ Shouldnt fault | 79 | stmia r0!, {r3 - r6} @ Shouldnt fault |
80 | bpl .c2u_0cpy8lp | 80 | bpl .Lc2u_0cpy8lp |
81 | 81 | ||
82 | .c2u_0rem8lp: cmn ip, #16 | 82 | .Lc2u_0rem8lp: cmn ip, #16 |
83 | ldmgeia r1!, {r3 - r6} | 83 | ldmgeia r1!, {r3 - r6} |
84 | stmgeia r0!, {r3 - r6} @ Shouldnt fault | 84 | stmgeia r0!, {r3 - r6} @ Shouldnt fault |
85 | tst ip, #8 | 85 | tst ip, #8 |
@@ -89,33 +89,33 @@ USER( strt r3, [r0], #4) @ May fault | |||
89 | ldrne r3, [r1], #4 | 89 | ldrne r3, [r1], #4 |
90 | strnet r3, [r0], #4 @ Shouldnt fault | 90 | strnet r3, [r0], #4 @ Shouldnt fault |
91 | ands ip, ip, #3 | 91 | ands ip, ip, #3 |
92 | beq .c2u_0fupi | 92 | beq .Lc2u_0fupi |
93 | .c2u_0nowords: teq ip, #0 | 93 | .Lc2u_0nowords: teq ip, #0 |
94 | beq .c2u_finished | 94 | beq .Lc2u_finished |
95 | .c2u_nowords: cmp ip, #2 | 95 | .Lc2u_nowords: cmp ip, #2 |
96 | ldrb r3, [r1], #1 | 96 | ldrb r3, [r1], #1 |
97 | USER( strbt r3, [r0], #1) @ May fault | 97 | USER( strbt r3, [r0], #1) @ May fault |
98 | ldrgeb r3, [r1], #1 | 98 | ldrgeb r3, [r1], #1 |
99 | USER( strgebt r3, [r0], #1) @ May fault | 99 | USER( strgebt r3, [r0], #1) @ May fault |
100 | ldrgtb r3, [r1], #1 | 100 | ldrgtb r3, [r1], #1 |
101 | USER( strgtbt r3, [r0], #1) @ May fault | 101 | USER( strgtbt r3, [r0], #1) @ May fault |
102 | b .c2u_finished | 102 | b .Lc2u_finished |
103 | 103 | ||
104 | .c2u_not_enough: | 104 | .Lc2u_not_enough: |
105 | movs ip, r2 | 105 | movs ip, r2 |
106 | bne .c2u_nowords | 106 | bne .Lc2u_nowords |
107 | .c2u_finished: mov r0, #0 | 107 | .Lc2u_finished: mov r0, #0 |
108 | LOADREGS(fd,sp!,{r2, r4 - r7, pc}) | 108 | LOADREGS(fd,sp!,{r2, r4 - r7, pc}) |
109 | 109 | ||
110 | .c2u_src_not_aligned: | 110 | .Lc2u_src_not_aligned: |
111 | bic r1, r1, #3 | 111 | bic r1, r1, #3 |
112 | ldr r7, [r1], #4 | 112 | ldr r7, [r1], #4 |
113 | cmp ip, #2 | 113 | cmp ip, #2 |
114 | bgt .c2u_3fupi | 114 | bgt .Lc2u_3fupi |
115 | beq .c2u_2fupi | 115 | beq .Lc2u_2fupi |
116 | .c2u_1fupi: subs r2, r2, #4 | 116 | .Lc2u_1fupi: subs r2, r2, #4 |
117 | addmi ip, r2, #4 | 117 | addmi ip, r2, #4 |
118 | bmi .c2u_1nowords | 118 | bmi .Lc2u_1nowords |
119 | mov r3, r7, pull #8 | 119 | mov r3, r7, pull #8 |
120 | ldr r7, [r1], #4 | 120 | ldr r7, [r1], #4 |
121 | orr r3, r3, r7, push #24 | 121 | orr r3, r3, r7, push #24 |
@@ -123,14 +123,14 @@ USER( strt r3, [r0], #4) @ May fault | |||
123 | mov ip, r0, lsl #32 - PAGE_SHIFT | 123 | mov ip, r0, lsl #32 - PAGE_SHIFT |
124 | rsb ip, ip, #0 | 124 | rsb ip, ip, #0 |
125 | movs ip, ip, lsr #32 - PAGE_SHIFT | 125 | movs ip, ip, lsr #32 - PAGE_SHIFT |
126 | beq .c2u_1fupi | 126 | beq .Lc2u_1fupi |
127 | cmp r2, ip | 127 | cmp r2, ip |
128 | movlt ip, r2 | 128 | movlt ip, r2 |
129 | sub r2, r2, ip | 129 | sub r2, r2, ip |
130 | subs ip, ip, #16 | 130 | subs ip, ip, #16 |
131 | blt .c2u_1rem8lp | 131 | blt .Lc2u_1rem8lp |
132 | 132 | ||
133 | .c2u_1cpy8lp: mov r3, r7, pull #8 | 133 | .Lc2u_1cpy8lp: mov r3, r7, pull #8 |
134 | ldmia r1!, {r4 - r7} | 134 | ldmia r1!, {r4 - r7} |
135 | subs ip, ip, #16 | 135 | subs ip, ip, #16 |
136 | orr r3, r3, r4, push #24 | 136 | orr r3, r3, r4, push #24 |
@@ -141,9 +141,9 @@ USER( strt r3, [r0], #4) @ May fault | |||
141 | mov r6, r6, pull #8 | 141 | mov r6, r6, pull #8 |
142 | orr r6, r6, r7, push #24 | 142 | orr r6, r6, r7, push #24 |
143 | stmia r0!, {r3 - r6} @ Shouldnt fault | 143 | stmia r0!, {r3 - r6} @ Shouldnt fault |
144 | bpl .c2u_1cpy8lp | 144 | bpl .Lc2u_1cpy8lp |
145 | 145 | ||
146 | .c2u_1rem8lp: tst ip, #8 | 146 | .Lc2u_1rem8lp: tst ip, #8 |
147 | movne r3, r7, pull #8 | 147 | movne r3, r7, pull #8 |
148 | ldmneia r1!, {r4, r7} | 148 | ldmneia r1!, {r4, r7} |
149 | orrne r3, r3, r4, push #24 | 149 | orrne r3, r3, r4, push #24 |
@@ -156,21 +156,21 @@ USER( strt r3, [r0], #4) @ May fault | |||
156 | orrne r3, r3, r7, push #24 | 156 | orrne r3, r3, r7, push #24 |
157 | strnet r3, [r0], #4 @ Shouldnt fault | 157 | strnet r3, [r0], #4 @ Shouldnt fault |
158 | ands ip, ip, #3 | 158 | ands ip, ip, #3 |
159 | beq .c2u_1fupi | 159 | beq .Lc2u_1fupi |
160 | .c2u_1nowords: mov r3, r7, get_byte_1 | 160 | .Lc2u_1nowords: mov r3, r7, get_byte_1 |
161 | teq ip, #0 | 161 | teq ip, #0 |
162 | beq .c2u_finished | 162 | beq .Lc2u_finished |
163 | cmp ip, #2 | 163 | cmp ip, #2 |
164 | USER( strbt r3, [r0], #1) @ May fault | 164 | USER( strbt r3, [r0], #1) @ May fault |
165 | movge r3, r7, get_byte_2 | 165 | movge r3, r7, get_byte_2 |
166 | USER( strgebt r3, [r0], #1) @ May fault | 166 | USER( strgebt r3, [r0], #1) @ May fault |
167 | movgt r3, r7, get_byte_3 | 167 | movgt r3, r7, get_byte_3 |
168 | USER( strgtbt r3, [r0], #1) @ May fault | 168 | USER( strgtbt r3, [r0], #1) @ May fault |
169 | b .c2u_finished | 169 | b .Lc2u_finished |
170 | 170 | ||
171 | .c2u_2fupi: subs r2, r2, #4 | 171 | .Lc2u_2fupi: subs r2, r2, #4 |
172 | addmi ip, r2, #4 | 172 | addmi ip, r2, #4 |
173 | bmi .c2u_2nowords | 173 | bmi .Lc2u_2nowords |
174 | mov r3, r7, pull #16 | 174 | mov r3, r7, pull #16 |
175 | ldr r7, [r1], #4 | 175 | ldr r7, [r1], #4 |
176 | orr r3, r3, r7, push #16 | 176 | orr r3, r3, r7, push #16 |
@@ -178,14 +178,14 @@ USER( strt r3, [r0], #4) @ May fault | |||
178 | mov ip, r0, lsl #32 - PAGE_SHIFT | 178 | mov ip, r0, lsl #32 - PAGE_SHIFT |
179 | rsb ip, ip, #0 | 179 | rsb ip, ip, #0 |
180 | movs ip, ip, lsr #32 - PAGE_SHIFT | 180 | movs ip, ip, lsr #32 - PAGE_SHIFT |
181 | beq .c2u_2fupi | 181 | beq .Lc2u_2fupi |
182 | cmp r2, ip | 182 | cmp r2, ip |
183 | movlt ip, r2 | 183 | movlt ip, r2 |
184 | sub r2, r2, ip | 184 | sub r2, r2, ip |
185 | subs ip, ip, #16 | 185 | subs ip, ip, #16 |
186 | blt .c2u_2rem8lp | 186 | blt .Lc2u_2rem8lp |
187 | 187 | ||
188 | .c2u_2cpy8lp: mov r3, r7, pull #16 | 188 | .Lc2u_2cpy8lp: mov r3, r7, pull #16 |
189 | ldmia r1!, {r4 - r7} | 189 | ldmia r1!, {r4 - r7} |
190 | subs ip, ip, #16 | 190 | subs ip, ip, #16 |
191 | orr r3, r3, r4, push #16 | 191 | orr r3, r3, r4, push #16 |
@@ -196,9 +196,9 @@ USER( strt r3, [r0], #4) @ May fault | |||
196 | mov r6, r6, pull #16 | 196 | mov r6, r6, pull #16 |
197 | orr r6, r6, r7, push #16 | 197 | orr r6, r6, r7, push #16 |
198 | stmia r0!, {r3 - r6} @ Shouldnt fault | 198 | stmia r0!, {r3 - r6} @ Shouldnt fault |
199 | bpl .c2u_2cpy8lp | 199 | bpl .Lc2u_2cpy8lp |
200 | 200 | ||
201 | .c2u_2rem8lp: tst ip, #8 | 201 | .Lc2u_2rem8lp: tst ip, #8 |
202 | movne r3, r7, pull #16 | 202 | movne r3, r7, pull #16 |
203 | ldmneia r1!, {r4, r7} | 203 | ldmneia r1!, {r4, r7} |
204 | orrne r3, r3, r4, push #16 | 204 | orrne r3, r3, r4, push #16 |
@@ -211,21 +211,21 @@ USER( strt r3, [r0], #4) @ May fault | |||
211 | orrne r3, r3, r7, push #16 | 211 | orrne r3, r3, r7, push #16 |
212 | strnet r3, [r0], #4 @ Shouldnt fault | 212 | strnet r3, [r0], #4 @ Shouldnt fault |
213 | ands ip, ip, #3 | 213 | ands ip, ip, #3 |
214 | beq .c2u_2fupi | 214 | beq .Lc2u_2fupi |
215 | .c2u_2nowords: mov r3, r7, get_byte_2 | 215 | .Lc2u_2nowords: mov r3, r7, get_byte_2 |
216 | teq ip, #0 | 216 | teq ip, #0 |
217 | beq .c2u_finished | 217 | beq .Lc2u_finished |
218 | cmp ip, #2 | 218 | cmp ip, #2 |
219 | USER( strbt r3, [r0], #1) @ May fault | 219 | USER( strbt r3, [r0], #1) @ May fault |
220 | movge r3, r7, get_byte_3 | 220 | movge r3, r7, get_byte_3 |
221 | USER( strgebt r3, [r0], #1) @ May fault | 221 | USER( strgebt r3, [r0], #1) @ May fault |
222 | ldrgtb r3, [r1], #0 | 222 | ldrgtb r3, [r1], #0 |
223 | USER( strgtbt r3, [r0], #1) @ May fault | 223 | USER( strgtbt r3, [r0], #1) @ May fault |
224 | b .c2u_finished | 224 | b .Lc2u_finished |
225 | 225 | ||
226 | .c2u_3fupi: subs r2, r2, #4 | 226 | .Lc2u_3fupi: subs r2, r2, #4 |
227 | addmi ip, r2, #4 | 227 | addmi ip, r2, #4 |
228 | bmi .c2u_3nowords | 228 | bmi .Lc2u_3nowords |
229 | mov r3, r7, pull #24 | 229 | mov r3, r7, pull #24 |
230 | ldr r7, [r1], #4 | 230 | ldr r7, [r1], #4 |
231 | orr r3, r3, r7, push #8 | 231 | orr r3, r3, r7, push #8 |
@@ -233,14 +233,14 @@ USER( strt r3, [r0], #4) @ May fault | |||
233 | mov ip, r0, lsl #32 - PAGE_SHIFT | 233 | mov ip, r0, lsl #32 - PAGE_SHIFT |
234 | rsb ip, ip, #0 | 234 | rsb ip, ip, #0 |
235 | movs ip, ip, lsr #32 - PAGE_SHIFT | 235 | movs ip, ip, lsr #32 - PAGE_SHIFT |
236 | beq .c2u_3fupi | 236 | beq .Lc2u_3fupi |
237 | cmp r2, ip | 237 | cmp r2, ip |
238 | movlt ip, r2 | 238 | movlt ip, r2 |
239 | sub r2, r2, ip | 239 | sub r2, r2, ip |
240 | subs ip, ip, #16 | 240 | subs ip, ip, #16 |
241 | blt .c2u_3rem8lp | 241 | blt .Lc2u_3rem8lp |
242 | 242 | ||
243 | .c2u_3cpy8lp: mov r3, r7, pull #24 | 243 | .Lc2u_3cpy8lp: mov r3, r7, pull #24 |
244 | ldmia r1!, {r4 - r7} | 244 | ldmia r1!, {r4 - r7} |
245 | subs ip, ip, #16 | 245 | subs ip, ip, #16 |
246 | orr r3, r3, r4, push #8 | 246 | orr r3, r3, r4, push #8 |
@@ -251,9 +251,9 @@ USER( strt r3, [r0], #4) @ May fault | |||
251 | mov r6, r6, pull #24 | 251 | mov r6, r6, pull #24 |
252 | orr r6, r6, r7, push #8 | 252 | orr r6, r6, r7, push #8 |
253 | stmia r0!, {r3 - r6} @ Shouldnt fault | 253 | stmia r0!, {r3 - r6} @ Shouldnt fault |
254 | bpl .c2u_3cpy8lp | 254 | bpl .Lc2u_3cpy8lp |
255 | 255 | ||
256 | .c2u_3rem8lp: tst ip, #8 | 256 | .Lc2u_3rem8lp: tst ip, #8 |
257 | movne r3, r7, pull #24 | 257 | movne r3, r7, pull #24 |
258 | ldmneia r1!, {r4, r7} | 258 | ldmneia r1!, {r4, r7} |
259 | orrne r3, r3, r4, push #8 | 259 | orrne r3, r3, r4, push #8 |
@@ -266,17 +266,17 @@ USER( strt r3, [r0], #4) @ May fault | |||
266 | orrne r3, r3, r7, push #8 | 266 | orrne r3, r3, r7, push #8 |
267 | strnet r3, [r0], #4 @ Shouldnt fault | 267 | strnet r3, [r0], #4 @ Shouldnt fault |
268 | ands ip, ip, #3 | 268 | ands ip, ip, #3 |
269 | beq .c2u_3fupi | 269 | beq .Lc2u_3fupi |
270 | .c2u_3nowords: mov r3, r7, get_byte_3 | 270 | .Lc2u_3nowords: mov r3, r7, get_byte_3 |
271 | teq ip, #0 | 271 | teq ip, #0 |
272 | beq .c2u_finished | 272 | beq .Lc2u_finished |
273 | cmp ip, #2 | 273 | cmp ip, #2 |
274 | USER( strbt r3, [r0], #1) @ May fault | 274 | USER( strbt r3, [r0], #1) @ May fault |
275 | ldrgeb r3, [r1], #1 | 275 | ldrgeb r3, [r1], #1 |
276 | USER( strgebt r3, [r0], #1) @ May fault | 276 | USER( strgebt r3, [r0], #1) @ May fault |
277 | ldrgtb r3, [r1], #0 | 277 | ldrgtb r3, [r1], #0 |
278 | USER( strgtbt r3, [r0], #1) @ May fault | 278 | USER( strgtbt r3, [r0], #1) @ May fault |
279 | b .c2u_finished | 279 | b .Lc2u_finished |
280 | 280 | ||
281 | .section .fixup,"ax" | 281 | .section .fixup,"ax" |
282 | .align 0 | 282 | .align 0 |
@@ -290,7 +290,7 @@ USER( strgtbt r3, [r0], #1) @ May fault | |||
290 | * : n - number of bytes to copy | 290 | * : n - number of bytes to copy |
291 | * Returns : Number of bytes NOT copied. | 291 | * Returns : Number of bytes NOT copied. |
292 | */ | 292 | */ |
293 | .cfu_dest_not_aligned: | 293 | .Lcfu_dest_not_aligned: |
294 | rsb ip, ip, #4 | 294 | rsb ip, ip, #4 |
295 | cmp ip, #2 | 295 | cmp ip, #2 |
296 | USER( ldrbt r3, [r1], #1) @ May fault | 296 | USER( ldrbt r3, [r1], #1) @ May fault |
@@ -300,31 +300,32 @@ USER( ldrgebt r3, [r1], #1) @ May fault | |||
300 | USER( ldrgtbt r3, [r1], #1) @ May fault | 300 | USER( ldrgtbt r3, [r1], #1) @ May fault |
301 | strgtb r3, [r0], #1 | 301 | strgtb r3, [r0], #1 |
302 | sub r2, r2, ip | 302 | sub r2, r2, ip |
303 | b .cfu_dest_aligned | 303 | b .Lcfu_dest_aligned |
304 | 304 | ||
305 | ENTRY(__arch_copy_from_user) | 305 | ENTRY(__arch_copy_from_user) |
306 | stmfd sp!, {r0, r2, r4 - r7, lr} | 306 | stmfd sp!, {r0, r2, r4 - r7, lr} |
307 | cmp r2, #4 | 307 | cmp r2, #4 |
308 | blt .cfu_not_enough | 308 | blt .Lcfu_not_enough |
309 | ands ip, r0, #3 | 309 | ands ip, r0, #3 |
310 | bne .cfu_dest_not_aligned | 310 | bne .Lcfu_dest_not_aligned |
311 | .cfu_dest_aligned: | 311 | .Lcfu_dest_aligned: |
312 | ands ip, r1, #3 | 312 | ands ip, r1, #3 |
313 | bne .cfu_src_not_aligned | 313 | bne .Lcfu_src_not_aligned |
314 | |||
314 | /* | 315 | /* |
315 | * Seeing as there has to be at least 8 bytes to copy, we can | 316 | * Seeing as there has to be at least 8 bytes to copy, we can |
316 | * copy one word, and force a user-mode page fault... | 317 | * copy one word, and force a user-mode page fault... |
317 | */ | 318 | */ |
318 | 319 | ||
319 | .cfu_0fupi: subs r2, r2, #4 | 320 | .Lcfu_0fupi: subs r2, r2, #4 |
320 | addmi ip, r2, #4 | 321 | addmi ip, r2, #4 |
321 | bmi .cfu_0nowords | 322 | bmi .Lcfu_0nowords |
322 | USER( ldrt r3, [r1], #4) | 323 | USER( ldrt r3, [r1], #4) |
323 | str r3, [r0], #4 | 324 | str r3, [r0], #4 |
324 | mov ip, r1, lsl #32 - PAGE_SHIFT @ On each page, use a ld/st??t instruction | 325 | mov ip, r1, lsl #32 - PAGE_SHIFT @ On each page, use a ld/st??t instruction |
325 | rsb ip, ip, #0 | 326 | rsb ip, ip, #0 |
326 | movs ip, ip, lsr #32 - PAGE_SHIFT | 327 | movs ip, ip, lsr #32 - PAGE_SHIFT |
327 | beq .cfu_0fupi | 328 | beq .Lcfu_0fupi |
328 | /* | 329 | /* |
329 | * ip = max no. of bytes to copy before needing another "strt" insn | 330 | * ip = max no. of bytes to copy before needing another "strt" insn |
330 | */ | 331 | */ |
@@ -332,16 +333,16 @@ USER( ldrt r3, [r1], #4) | |||
332 | movlt ip, r2 | 333 | movlt ip, r2 |
333 | sub r2, r2, ip | 334 | sub r2, r2, ip |
334 | subs ip, ip, #32 | 335 | subs ip, ip, #32 |
335 | blt .cfu_0rem8lp | 336 | blt .Lcfu_0rem8lp |
336 | 337 | ||
337 | .cfu_0cpy8lp: ldmia r1!, {r3 - r6} @ Shouldnt fault | 338 | .Lcfu_0cpy8lp: ldmia r1!, {r3 - r6} @ Shouldnt fault |
338 | stmia r0!, {r3 - r6} | 339 | stmia r0!, {r3 - r6} |
339 | ldmia r1!, {r3 - r6} @ Shouldnt fault | 340 | ldmia r1!, {r3 - r6} @ Shouldnt fault |
340 | subs ip, ip, #32 | 341 | subs ip, ip, #32 |
341 | stmia r0!, {r3 - r6} | 342 | stmia r0!, {r3 - r6} |
342 | bpl .cfu_0cpy8lp | 343 | bpl .Lcfu_0cpy8lp |
343 | 344 | ||
344 | .cfu_0rem8lp: cmn ip, #16 | 345 | .Lcfu_0rem8lp: cmn ip, #16 |
345 | ldmgeia r1!, {r3 - r6} @ Shouldnt fault | 346 | ldmgeia r1!, {r3 - r6} @ Shouldnt fault |
346 | stmgeia r0!, {r3 - r6} | 347 | stmgeia r0!, {r3 - r6} |
347 | tst ip, #8 | 348 | tst ip, #8 |
@@ -351,34 +352,34 @@ USER( ldrt r3, [r1], #4) | |||
351 | ldrnet r3, [r1], #4 @ Shouldnt fault | 352 | ldrnet r3, [r1], #4 @ Shouldnt fault |
352 | strne r3, [r0], #4 | 353 | strne r3, [r0], #4 |
353 | ands ip, ip, #3 | 354 | ands ip, ip, #3 |
354 | beq .cfu_0fupi | 355 | beq .Lcfu_0fupi |
355 | .cfu_0nowords: teq ip, #0 | 356 | .Lcfu_0nowords: teq ip, #0 |
356 | beq .cfu_finished | 357 | beq .Lcfu_finished |
357 | .cfu_nowords: cmp ip, #2 | 358 | .Lcfu_nowords: cmp ip, #2 |
358 | USER( ldrbt r3, [r1], #1) @ May fault | 359 | USER( ldrbt r3, [r1], #1) @ May fault |
359 | strb r3, [r0], #1 | 360 | strb r3, [r0], #1 |
360 | USER( ldrgebt r3, [r1], #1) @ May fault | 361 | USER( ldrgebt r3, [r1], #1) @ May fault |
361 | strgeb r3, [r0], #1 | 362 | strgeb r3, [r0], #1 |
362 | USER( ldrgtbt r3, [r1], #1) @ May fault | 363 | USER( ldrgtbt r3, [r1], #1) @ May fault |
363 | strgtb r3, [r0], #1 | 364 | strgtb r3, [r0], #1 |
364 | b .cfu_finished | 365 | b .Lcfu_finished |
365 | 366 | ||
366 | .cfu_not_enough: | 367 | .Lcfu_not_enough: |
367 | movs ip, r2 | 368 | movs ip, r2 |
368 | bne .cfu_nowords | 369 | bne .Lcfu_nowords |
369 | .cfu_finished: mov r0, #0 | 370 | .Lcfu_finished: mov r0, #0 |
370 | add sp, sp, #8 | 371 | add sp, sp, #8 |
371 | LOADREGS(fd,sp!,{r4 - r7, pc}) | 372 | LOADREGS(fd,sp!,{r4 - r7, pc}) |
372 | 373 | ||
373 | .cfu_src_not_aligned: | 374 | .Lcfu_src_not_aligned: |
374 | bic r1, r1, #3 | 375 | bic r1, r1, #3 |
375 | USER( ldrt r7, [r1], #4) @ May fault | 376 | USER( ldrt r7, [r1], #4) @ May fault |
376 | cmp ip, #2 | 377 | cmp ip, #2 |
377 | bgt .cfu_3fupi | 378 | bgt .Lcfu_3fupi |
378 | beq .cfu_2fupi | 379 | beq .Lcfu_2fupi |
379 | .cfu_1fupi: subs r2, r2, #4 | 380 | .Lcfu_1fupi: subs r2, r2, #4 |
380 | addmi ip, r2, #4 | 381 | addmi ip, r2, #4 |
381 | bmi .cfu_1nowords | 382 | bmi .Lcfu_1nowords |
382 | mov r3, r7, pull #8 | 383 | mov r3, r7, pull #8 |
383 | USER( ldrt r7, [r1], #4) @ May fault | 384 | USER( ldrt r7, [r1], #4) @ May fault |
384 | orr r3, r3, r7, push #24 | 385 | orr r3, r3, r7, push #24 |
@@ -386,14 +387,14 @@ USER( ldrt r7, [r1], #4) @ May fault | |||
386 | mov ip, r1, lsl #32 - PAGE_SHIFT | 387 | mov ip, r1, lsl #32 - PAGE_SHIFT |
387 | rsb ip, ip, #0 | 388 | rsb ip, ip, #0 |
388 | movs ip, ip, lsr #32 - PAGE_SHIFT | 389 | movs ip, ip, lsr #32 - PAGE_SHIFT |
389 | beq .cfu_1fupi | 390 | beq .Lcfu_1fupi |
390 | cmp r2, ip | 391 | cmp r2, ip |
391 | movlt ip, r2 | 392 | movlt ip, r2 |
392 | sub r2, r2, ip | 393 | sub r2, r2, ip |
393 | subs ip, ip, #16 | 394 | subs ip, ip, #16 |
394 | blt .cfu_1rem8lp | 395 | blt .Lcfu_1rem8lp |
395 | 396 | ||
396 | .cfu_1cpy8lp: mov r3, r7, pull #8 | 397 | .Lcfu_1cpy8lp: mov r3, r7, pull #8 |
397 | ldmia r1!, {r4 - r7} @ Shouldnt fault | 398 | ldmia r1!, {r4 - r7} @ Shouldnt fault |
398 | subs ip, ip, #16 | 399 | subs ip, ip, #16 |
399 | orr r3, r3, r4, push #24 | 400 | orr r3, r3, r4, push #24 |
@@ -404,9 +405,9 @@ USER( ldrt r7, [r1], #4) @ May fault | |||
404 | mov r6, r6, pull #8 | 405 | mov r6, r6, pull #8 |
405 | orr r6, r6, r7, push #24 | 406 | orr r6, r6, r7, push #24 |
406 | stmia r0!, {r3 - r6} | 407 | stmia r0!, {r3 - r6} |
407 | bpl .cfu_1cpy8lp | 408 | bpl .Lcfu_1cpy8lp |
408 | 409 | ||
409 | .cfu_1rem8lp: tst ip, #8 | 410 | .Lcfu_1rem8lp: tst ip, #8 |
410 | movne r3, r7, pull #8 | 411 | movne r3, r7, pull #8 |
411 | ldmneia r1!, {r4, r7} @ Shouldnt fault | 412 | ldmneia r1!, {r4, r7} @ Shouldnt fault |
412 | orrne r3, r3, r4, push #24 | 413 | orrne r3, r3, r4, push #24 |
@@ -419,21 +420,21 @@ USER( ldrnet r7, [r1], #4) @ May fault | |||
419 | orrne r3, r3, r7, push #24 | 420 | orrne r3, r3, r7, push #24 |
420 | strne r3, [r0], #4 | 421 | strne r3, [r0], #4 |
421 | ands ip, ip, #3 | 422 | ands ip, ip, #3 |
422 | beq .cfu_1fupi | 423 | beq .Lcfu_1fupi |
423 | .cfu_1nowords: mov r3, r7, get_byte_1 | 424 | .Lcfu_1nowords: mov r3, r7, get_byte_1 |
424 | teq ip, #0 | 425 | teq ip, #0 |
425 | beq .cfu_finished | 426 | beq .Lcfu_finished |
426 | cmp ip, #2 | 427 | cmp ip, #2 |
427 | strb r3, [r0], #1 | 428 | strb r3, [r0], #1 |
428 | movge r3, r7, get_byte_2 | 429 | movge r3, r7, get_byte_2 |
429 | strgeb r3, [r0], #1 | 430 | strgeb r3, [r0], #1 |
430 | movgt r3, r7, get_byte_3 | 431 | movgt r3, r7, get_byte_3 |
431 | strgtb r3, [r0], #1 | 432 | strgtb r3, [r0], #1 |
432 | b .cfu_finished | 433 | b .Lcfu_finished |
433 | 434 | ||
434 | .cfu_2fupi: subs r2, r2, #4 | 435 | .Lcfu_2fupi: subs r2, r2, #4 |
435 | addmi ip, r2, #4 | 436 | addmi ip, r2, #4 |
436 | bmi .cfu_2nowords | 437 | bmi .Lcfu_2nowords |
437 | mov r3, r7, pull #16 | 438 | mov r3, r7, pull #16 |
438 | USER( ldrt r7, [r1], #4) @ May fault | 439 | USER( ldrt r7, [r1], #4) @ May fault |
439 | orr r3, r3, r7, push #16 | 440 | orr r3, r3, r7, push #16 |
@@ -441,14 +442,15 @@ USER( ldrt r7, [r1], #4) @ May fault | |||
441 | mov ip, r1, lsl #32 - PAGE_SHIFT | 442 | mov ip, r1, lsl #32 - PAGE_SHIFT |
442 | rsb ip, ip, #0 | 443 | rsb ip, ip, #0 |
443 | movs ip, ip, lsr #32 - PAGE_SHIFT | 444 | movs ip, ip, lsr #32 - PAGE_SHIFT |
444 | beq .cfu_2fupi | 445 | beq .Lcfu_2fupi |
445 | cmp r2, ip | 446 | cmp r2, ip |
446 | movlt ip, r2 | 447 | movlt ip, r2 |
447 | sub r2, r2, ip | 448 | sub r2, r2, ip |
448 | subs ip, ip, #16 | 449 | subs ip, ip, #16 |
449 | blt .cfu_2rem8lp | 450 | blt .Lcfu_2rem8lp |
451 | |||
450 | 452 | ||
451 | .cfu_2cpy8lp: mov r3, r7, pull #16 | 453 | .Lcfu_2cpy8lp: mov r3, r7, pull #16 |
452 | ldmia r1!, {r4 - r7} @ Shouldnt fault | 454 | ldmia r1!, {r4 - r7} @ Shouldnt fault |
453 | subs ip, ip, #16 | 455 | subs ip, ip, #16 |
454 | orr r3, r3, r4, push #16 | 456 | orr r3, r3, r4, push #16 |
@@ -459,9 +461,9 @@ USER( ldrt r7, [r1], #4) @ May fault | |||
459 | mov r6, r6, pull #16 | 461 | mov r6, r6, pull #16 |
460 | orr r6, r6, r7, push #16 | 462 | orr r6, r6, r7, push #16 |
461 | stmia r0!, {r3 - r6} | 463 | stmia r0!, {r3 - r6} |
462 | bpl .cfu_2cpy8lp | 464 | bpl .Lcfu_2cpy8lp |
463 | 465 | ||
464 | .cfu_2rem8lp: tst ip, #8 | 466 | .Lcfu_2rem8lp: tst ip, #8 |
465 | movne r3, r7, pull #16 | 467 | movne r3, r7, pull #16 |
466 | ldmneia r1!, {r4, r7} @ Shouldnt fault | 468 | ldmneia r1!, {r4, r7} @ Shouldnt fault |
467 | orrne r3, r3, r4, push #16 | 469 | orrne r3, r3, r4, push #16 |
@@ -474,21 +476,21 @@ USER( ldrnet r7, [r1], #4) @ May fault | |||
474 | orrne r3, r3, r7, push #16 | 476 | orrne r3, r3, r7, push #16 |
475 | strne r3, [r0], #4 | 477 | strne r3, [r0], #4 |
476 | ands ip, ip, #3 | 478 | ands ip, ip, #3 |
477 | beq .cfu_2fupi | 479 | beq .Lcfu_2fupi |
478 | .cfu_2nowords: mov r3, r7, get_byte_2 | 480 | .Lcfu_2nowords: mov r3, r7, get_byte_2 |
479 | teq ip, #0 | 481 | teq ip, #0 |
480 | beq .cfu_finished | 482 | beq .Lcfu_finished |
481 | cmp ip, #2 | 483 | cmp ip, #2 |
482 | strb r3, [r0], #1 | 484 | strb r3, [r0], #1 |
483 | movge r3, r7, get_byte_3 | 485 | movge r3, r7, get_byte_3 |
484 | strgeb r3, [r0], #1 | 486 | strgeb r3, [r0], #1 |
485 | USER( ldrgtbt r3, [r1], #0) @ May fault | 487 | USER( ldrgtbt r3, [r1], #0) @ May fault |
486 | strgtb r3, [r0], #1 | 488 | strgtb r3, [r0], #1 |
487 | b .cfu_finished | 489 | b .Lcfu_finished |
488 | 490 | ||
489 | .cfu_3fupi: subs r2, r2, #4 | 491 | .Lcfu_3fupi: subs r2, r2, #4 |
490 | addmi ip, r2, #4 | 492 | addmi ip, r2, #4 |
491 | bmi .cfu_3nowords | 493 | bmi .Lcfu_3nowords |
492 | mov r3, r7, pull #24 | 494 | mov r3, r7, pull #24 |
493 | USER( ldrt r7, [r1], #4) @ May fault | 495 | USER( ldrt r7, [r1], #4) @ May fault |
494 | orr r3, r3, r7, push #8 | 496 | orr r3, r3, r7, push #8 |
@@ -496,14 +498,14 @@ USER( ldrt r7, [r1], #4) @ May fault | |||
496 | mov ip, r1, lsl #32 - PAGE_SHIFT | 498 | mov ip, r1, lsl #32 - PAGE_SHIFT |
497 | rsb ip, ip, #0 | 499 | rsb ip, ip, #0 |
498 | movs ip, ip, lsr #32 - PAGE_SHIFT | 500 | movs ip, ip, lsr #32 - PAGE_SHIFT |
499 | beq .cfu_3fupi | 501 | beq .Lcfu_3fupi |
500 | cmp r2, ip | 502 | cmp r2, ip |
501 | movlt ip, r2 | 503 | movlt ip, r2 |
502 | sub r2, r2, ip | 504 | sub r2, r2, ip |
503 | subs ip, ip, #16 | 505 | subs ip, ip, #16 |
504 | blt .cfu_3rem8lp | 506 | blt .Lcfu_3rem8lp |
505 | 507 | ||
506 | .cfu_3cpy8lp: mov r3, r7, pull #24 | 508 | .Lcfu_3cpy8lp: mov r3, r7, pull #24 |
507 | ldmia r1!, {r4 - r7} @ Shouldnt fault | 509 | ldmia r1!, {r4 - r7} @ Shouldnt fault |
508 | orr r3, r3, r4, push #8 | 510 | orr r3, r3, r4, push #8 |
509 | mov r4, r4, pull #24 | 511 | mov r4, r4, pull #24 |
@@ -514,9 +516,9 @@ USER( ldrt r7, [r1], #4) @ May fault | |||
514 | orr r6, r6, r7, push #8 | 516 | orr r6, r6, r7, push #8 |
515 | stmia r0!, {r3 - r6} | 517 | stmia r0!, {r3 - r6} |
516 | subs ip, ip, #16 | 518 | subs ip, ip, #16 |
517 | bpl .cfu_3cpy8lp | 519 | bpl .Lcfu_3cpy8lp |
518 | 520 | ||
519 | .cfu_3rem8lp: tst ip, #8 | 521 | .Lcfu_3rem8lp: tst ip, #8 |
520 | movne r3, r7, pull #24 | 522 | movne r3, r7, pull #24 |
521 | ldmneia r1!, {r4, r7} @ Shouldnt fault | 523 | ldmneia r1!, {r4, r7} @ Shouldnt fault |
522 | orrne r3, r3, r4, push #8 | 524 | orrne r3, r3, r4, push #8 |
@@ -529,17 +531,17 @@ USER( ldrnet r7, [r1], #4) @ May fault | |||
529 | orrne r3, r3, r7, push #8 | 531 | orrne r3, r3, r7, push #8 |
530 | strne r3, [r0], #4 | 532 | strne r3, [r0], #4 |
531 | ands ip, ip, #3 | 533 | ands ip, ip, #3 |
532 | beq .cfu_3fupi | 534 | beq .Lcfu_3fupi |
533 | .cfu_3nowords: mov r3, r7, get_byte_3 | 535 | .Lcfu_3nowords: mov r3, r7, get_byte_3 |
534 | teq ip, #0 | 536 | teq ip, #0 |
535 | beq .cfu_finished | 537 | beq .Lcfu_finished |
536 | cmp ip, #2 | 538 | cmp ip, #2 |
537 | strb r3, [r0], #1 | 539 | strb r3, [r0], #1 |
538 | USER( ldrgebt r3, [r1], #1) @ May fault | 540 | USER( ldrgebt r3, [r1], #1) @ May fault |
539 | strgeb r3, [r0], #1 | 541 | strgeb r3, [r0], #1 |
540 | USER( ldrgtbt r3, [r1], #1) @ May fault | 542 | USER( ldrgtbt r3, [r1], #1) @ May fault |
541 | strgtb r3, [r0], #1 | 543 | strgtb r3, [r0], #1 |
542 | b .cfu_finished | 544 | b .Lcfu_finished |
543 | 545 | ||
544 | .section .fixup,"ax" | 546 | .section .fixup,"ax" |
545 | .align 0 | 547 | .align 0 |