aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/lib')
-rw-r--r--arch/arm/lib/csumpartial.S28
-rw-r--r--arch/arm/lib/csumpartialcopygeneric.S70
-rw-r--r--arch/arm/lib/delay.S4
-rw-r--r--arch/arm/lib/findbit.S18
-rw-r--r--arch/arm/lib/io-acorn.S4
-rw-r--r--arch/arm/lib/io-readsb.S24
-rw-r--r--arch/arm/lib/io-readsw-armv3.S30
-rw-r--r--arch/arm/lib/io-readsw-armv4.S24
-rw-r--r--arch/arm/lib/io-writesb.S25
-rw-r--r--arch/arm/lib/io-writesw-armv3.S30
-rw-r--r--arch/arm/lib/io-writesw-armv4.S25
-rw-r--r--arch/arm/lib/uaccess.S230
12 files changed, 259 insertions, 253 deletions
diff --git a/arch/arm/lib/csumpartial.S b/arch/arm/lib/csumpartial.S
index fe797cf320bb..a78dae5a7b28 100644
--- a/arch/arm/lib/csumpartial.S
+++ b/arch/arm/lib/csumpartial.S
@@ -26,7 +26,7 @@ td1 .req r4 @ save before use
26td2 .req r5 @ save before use 26td2 .req r5 @ save before use
27td3 .req lr 27td3 .req lr
28 28
29.zero: mov r0, sum 29.Lzero: mov r0, sum
30 add sp, sp, #4 30 add sp, sp, #4
31 ldr pc, [sp], #4 31 ldr pc, [sp], #4
32 32
@@ -34,8 +34,8 @@ td3 .req lr
34 * Handle 0 to 7 bytes, with any alignment of source and 34 * Handle 0 to 7 bytes, with any alignment of source and
35 * destination pointers. Note that when we get here, C = 0 35 * destination pointers. Note that when we get here, C = 0
36 */ 36 */
37.less8: teq len, #0 @ check for zero count 37.Lless8: teq len, #0 @ check for zero count
38 beq .zero 38 beq .Lzero
39 39
40 /* we must have at least one byte. */ 40 /* we must have at least one byte. */
41 tst buf, #1 @ odd address? 41 tst buf, #1 @ odd address?
@@ -44,12 +44,12 @@ td3 .req lr
44 subne len, len, #1 44 subne len, len, #1
45 adcnes sum, sum, td0, put_byte_1 45 adcnes sum, sum, td0, put_byte_1
46 46
47.less4: tst len, #6 47.Lless4: tst len, #6
48 beq .less8_byte 48 beq .Lless8_byte
49 49
50 /* we are now half-word aligned */ 50 /* we are now half-word aligned */
51 51
52.less8_wordlp: 52.Lless8_wordlp:
53#if __LINUX_ARM_ARCH__ >= 4 53#if __LINUX_ARM_ARCH__ >= 4
54 ldrh td0, [buf], #2 54 ldrh td0, [buf], #2
55 sub len, len, #2 55 sub len, len, #2
@@ -65,19 +65,19 @@ td3 .req lr
65#endif 65#endif
66 adcs sum, sum, td0 66 adcs sum, sum, td0
67 tst len, #6 67 tst len, #6
68 bne .less8_wordlp 68 bne .Lless8_wordlp
69 69
70.less8_byte: tst len, #1 @ odd number of bytes 70.Lless8_byte: tst len, #1 @ odd number of bytes
71 ldrneb td0, [buf], #1 @ include last byte 71 ldrneb td0, [buf], #1 @ include last byte
72 adcnes sum, sum, td0, put_byte_0 @ update checksum 72 adcnes sum, sum, td0, put_byte_0 @ update checksum
73 73
74.done: adc r0, sum, #0 @ collect up the last carry 74.Ldone: adc r0, sum, #0 @ collect up the last carry
75 ldr td0, [sp], #4 75 ldr td0, [sp], #4
76 tst td0, #1 @ check buffer alignment 76 tst td0, #1 @ check buffer alignment
77 movne r0, r0, ror #8 @ rotate checksum by 8 bits 77 movne r0, r0, ror #8 @ rotate checksum by 8 bits
78 ldr pc, [sp], #4 @ return 78 ldr pc, [sp], #4 @ return
79 79
80.not_aligned: tst buf, #1 @ odd address 80.Lnot_aligned: tst buf, #1 @ odd address
81 ldrneb td0, [buf], #1 @ make even 81 ldrneb td0, [buf], #1 @ make even
82 subne len, len, #1 82 subne len, len, #1
83 adcnes sum, sum, td0, put_byte_1 @ update checksum 83 adcnes sum, sum, td0, put_byte_1 @ update checksum
@@ -102,14 +102,14 @@ td3 .req lr
102ENTRY(csum_partial) 102ENTRY(csum_partial)
103 stmfd sp!, {buf, lr} 103 stmfd sp!, {buf, lr}
104 cmp len, #8 @ Ensure that we have at least 104 cmp len, #8 @ Ensure that we have at least
105 blo .less8 @ 8 bytes to copy. 105 blo .Lless8 @ 8 bytes to copy.
106 106
107 tst buf, #1 107 tst buf, #1
108 movne sum, sum, ror #8 108 movne sum, sum, ror #8
109 109
110 adds sum, sum, #0 @ C = 0 110 adds sum, sum, #0 @ C = 0
111 tst buf, #3 @ Test destination alignment 111 tst buf, #3 @ Test destination alignment
112 blne .not_aligned @ aligh destination, return here 112 blne .Lnot_aligned @ align destination, return here
113 113
1141: bics ip, len, #31 1141: bics ip, len, #31
115 beq 3f 115 beq 3f
@@ -131,11 +131,11 @@ ENTRY(csum_partial)
131 ldmfd sp!, {r4 - r5} 131 ldmfd sp!, {r4 - r5}
132 132
1333: tst len, #0x1c @ should not change C 1333: tst len, #0x1c @ should not change C
134 beq .less4 134 beq .Lless4
135 135
1364: ldr td0, [buf], #4 1364: ldr td0, [buf], #4
137 sub len, len, #4 137 sub len, len, #4
138 adcs sum, sum, td0 138 adcs sum, sum, td0
139 tst len, #0x1c 139 tst len, #0x1c
140 bne 4b 140 bne 4b
141 b .less4 141 b .Lless4
diff --git a/arch/arm/lib/csumpartialcopygeneric.S b/arch/arm/lib/csumpartialcopygeneric.S
index d3a2f4667db4..4a4609c19095 100644
--- a/arch/arm/lib/csumpartialcopygeneric.S
+++ b/arch/arm/lib/csumpartialcopygeneric.S
@@ -22,7 +22,7 @@ dst .req r1
22len .req r2 22len .req r2
23sum .req r3 23sum .req r3
24 24
25.zero: mov r0, sum 25.Lzero: mov r0, sum
26 load_regs ea 26 load_regs ea
27 27
28 /* 28 /*
@@ -31,8 +31,9 @@ sum .req r3
31 * the length. Note that the source pointer hasn't been 31 * the length. Note that the source pointer hasn't been
32 * aligned yet. 32 * aligned yet.
33 */ 33 */
34.dst_unaligned: tst dst, #1 34.Ldst_unaligned:
35 beq .dst_16bit 35 tst dst, #1
36 beq .Ldst_16bit
36 37
37 load1b ip 38 load1b ip
38 sub len, len, #1 39 sub len, len, #1
@@ -41,7 +42,7 @@ sum .req r3
41 tst dst, #2 42 tst dst, #2
42 moveq pc, lr @ dst is now 32bit aligned 43 moveq pc, lr @ dst is now 32bit aligned
43 44
44.dst_16bit: load2b r8, ip 45.Ldst_16bit: load2b r8, ip
45 sub len, len, #2 46 sub len, len, #2
46 adcs sum, sum, r8, put_byte_0 47 adcs sum, sum, r8, put_byte_0
47 strb r8, [dst], #1 48 strb r8, [dst], #1
@@ -53,12 +54,12 @@ sum .req r3
53 * Handle 0 to 7 bytes, with any alignment of source and 54 * Handle 0 to 7 bytes, with any alignment of source and
54 * destination pointers. Note that when we get here, C = 0 55 * destination pointers. Note that when we get here, C = 0
55 */ 56 */
56.less8: teq len, #0 @ check for zero count 57.Lless8: teq len, #0 @ check for zero count
57 beq .zero 58 beq .Lzero
58 59
59 /* we must have at least one byte. */ 60 /* we must have at least one byte. */
60 tst dst, #1 @ dst 16-bit aligned 61 tst dst, #1 @ dst 16-bit aligned
61 beq .less8_aligned 62 beq .Lless8_aligned
62 63
63 /* Align dst */ 64 /* Align dst */
64 load1b ip 65 load1b ip
@@ -66,7 +67,7 @@ sum .req r3
66 adcs sum, sum, ip, put_byte_1 @ update checksum 67 adcs sum, sum, ip, put_byte_1 @ update checksum
67 strb ip, [dst], #1 68 strb ip, [dst], #1
68 tst len, #6 69 tst len, #6
69 beq .less8_byteonly 70 beq .Lless8_byteonly
70 71
711: load2b r8, ip 721: load2b r8, ip
72 sub len, len, #2 73 sub len, len, #2
@@ -74,15 +75,16 @@ sum .req r3
74 strb r8, [dst], #1 75 strb r8, [dst], #1
75 adcs sum, sum, ip, put_byte_1 76 adcs sum, sum, ip, put_byte_1
76 strb ip, [dst], #1 77 strb ip, [dst], #1
77.less8_aligned: tst len, #6 78.Lless8_aligned:
79 tst len, #6
78 bne 1b 80 bne 1b
79.less8_byteonly: 81.Lless8_byteonly:
80 tst len, #1 82 tst len, #1
81 beq .done 83 beq .Ldone
82 load1b r8 84 load1b r8
83 adcs sum, sum, r8, put_byte_0 @ update checksum 85 adcs sum, sum, r8, put_byte_0 @ update checksum
84 strb r8, [dst], #1 86 strb r8, [dst], #1
85 b .done 87 b .Ldone
86 88
87FN_ENTRY 89FN_ENTRY
88 mov ip, sp 90 mov ip, sp
@@ -90,11 +92,11 @@ FN_ENTRY
90 sub fp, ip, #4 92 sub fp, ip, #4
91 93
92 cmp len, #8 @ Ensure that we have at least 94 cmp len, #8 @ Ensure that we have at least
93 blo .less8 @ 8 bytes to copy. 95 blo .Lless8 @ 8 bytes to copy.
94 96
95 adds sum, sum, #0 @ C = 0 97 adds sum, sum, #0 @ C = 0
96 tst dst, #3 @ Test destination alignment 98 tst dst, #3 @ Test destination alignment
97 blne .dst_unaligned @ align destination, return here 99 blne .Ldst_unaligned @ align destination, return here
98 100
99 /* 101 /*
100 * Ok, the dst pointer is now 32bit aligned, and we know 102 * Ok, the dst pointer is now 32bit aligned, and we know
@@ -103,7 +105,7 @@ FN_ENTRY
103 */ 105 */
104 106
105 tst src, #3 @ Test source alignment 107 tst src, #3 @ Test source alignment
106 bne .src_not_aligned 108 bne .Lsrc_not_aligned
107 109
108 /* Routine for src & dst aligned */ 110 /* Routine for src & dst aligned */
109 111
@@ -136,17 +138,17 @@ FN_ENTRY
136 adcs sum, sum, r4 138 adcs sum, sum, r4
137 139
1384: ands len, len, #3 1404: ands len, len, #3
139 beq .done 141 beq .Ldone
140 load1l r4 142 load1l r4
141 tst len, #2 143 tst len, #2
142 mov r5, r4, get_byte_0 144 mov r5, r4, get_byte_0
143 beq .exit 145 beq .Lexit
144 adcs sum, sum, r4, push #16 146 adcs sum, sum, r4, push #16
145 strb r5, [dst], #1 147 strb r5, [dst], #1
146 mov r5, r4, get_byte_1 148 mov r5, r4, get_byte_1
147 strb r5, [dst], #1 149 strb r5, [dst], #1
148 mov r5, r4, get_byte_2 150 mov r5, r4, get_byte_2
149.exit: tst len, #1 151.Lexit: tst len, #1
150 strneb r5, [dst], #1 152 strneb r5, [dst], #1
151 andne r5, r5, #255 153 andne r5, r5, #255
152 adcnes sum, sum, r5, put_byte_0 154 adcnes sum, sum, r5, put_byte_0
@@ -157,20 +159,20 @@ FN_ENTRY
157 * the inefficient byte manipulations in the 159 * the inefficient byte manipulations in the
158 * architecture independent code. 160 * architecture independent code.
159 */ 161 */
160.done: adc r0, sum, #0 162.Ldone: adc r0, sum, #0
161 ldr sum, [sp, #0] @ dst 163 ldr sum, [sp, #0] @ dst
162 tst sum, #1 164 tst sum, #1
163 movne r0, r0, ror #8 165 movne r0, r0, ror #8
164 load_regs ea 166 load_regs ea
165 167
166.src_not_aligned: 168.Lsrc_not_aligned:
167 adc sum, sum, #0 @ include C from dst alignment 169 adc sum, sum, #0 @ include C from dst alignment
168 and ip, src, #3 170 and ip, src, #3
169 bic src, src, #3 171 bic src, src, #3
170 load1l r5 172 load1l r5
171 cmp ip, #2 173 cmp ip, #2
172 beq .src2_aligned 174 beq .Lsrc2_aligned
173 bhi .src3_aligned 175 bhi .Lsrc3_aligned
174 mov r4, r5, pull #8 @ C = 0 176 mov r4, r5, pull #8 @ C = 0
175 bics ip, len, #15 177 bics ip, len, #15
176 beq 2f 178 beq 2f
@@ -211,18 +213,18 @@ FN_ENTRY
211 adcs sum, sum, r4 213 adcs sum, sum, r4
212 mov r4, r5, pull #8 214 mov r4, r5, pull #8
2134: ands len, len, #3 2154: ands len, len, #3
214 beq .done 216 beq .Ldone
215 mov r5, r4, get_byte_0 217 mov r5, r4, get_byte_0
216 tst len, #2 218 tst len, #2
217 beq .exit 219 beq .Lexit
218 adcs sum, sum, r4, push #16 220 adcs sum, sum, r4, push #16
219 strb r5, [dst], #1 221 strb r5, [dst], #1
220 mov r5, r4, get_byte_1 222 mov r5, r4, get_byte_1
221 strb r5, [dst], #1 223 strb r5, [dst], #1
222 mov r5, r4, get_byte_2 224 mov r5, r4, get_byte_2
223 b .exit 225 b .Lexit
224 226
225.src2_aligned: mov r4, r5, pull #16 227.Lsrc2_aligned: mov r4, r5, pull #16
226 adds sum, sum, #0 228 adds sum, sum, #0
227 bics ip, len, #15 229 bics ip, len, #15
228 beq 2f 230 beq 2f
@@ -263,20 +265,20 @@ FN_ENTRY
263 adcs sum, sum, r4 265 adcs sum, sum, r4
264 mov r4, r5, pull #16 266 mov r4, r5, pull #16
2654: ands len, len, #3 2674: ands len, len, #3
266 beq .done 268 beq .Ldone
267 mov r5, r4, get_byte_0 269 mov r5, r4, get_byte_0
268 tst len, #2 270 tst len, #2
269 beq .exit 271 beq .Lexit
270 adcs sum, sum, r4 272 adcs sum, sum, r4
271 strb r5, [dst], #1 273 strb r5, [dst], #1
272 mov r5, r4, get_byte_1 274 mov r5, r4, get_byte_1
273 strb r5, [dst], #1 275 strb r5, [dst], #1
274 tst len, #1 276 tst len, #1
275 beq .done 277 beq .Ldone
276 load1b r5 278 load1b r5
277 b .exit 279 b .Lexit
278 280
279.src3_aligned: mov r4, r5, pull #24 281.Lsrc3_aligned: mov r4, r5, pull #24
280 adds sum, sum, #0 282 adds sum, sum, #0
281 bics ip, len, #15 283 bics ip, len, #15
282 beq 2f 284 beq 2f
@@ -317,10 +319,10 @@ FN_ENTRY
317 adcs sum, sum, r4 319 adcs sum, sum, r4
318 mov r4, r5, pull #24 320 mov r4, r5, pull #24
3194: ands len, len, #3 3214: ands len, len, #3
320 beq .done 322 beq .Ldone
321 mov r5, r4, get_byte_0 323 mov r5, r4, get_byte_0
322 tst len, #2 324 tst len, #2
323 beq .exit 325 beq .Lexit
324 strb r5, [dst], #1 326 strb r5, [dst], #1
325 adcs sum, sum, r4 327 adcs sum, sum, r4
326 load1l r4 328 load1l r4
@@ -328,4 +330,4 @@ FN_ENTRY
328 strb r5, [dst], #1 330 strb r5, [dst], #1
329 adcs sum, sum, r4, push #24 331 adcs sum, sum, r4, push #24
330 mov r5, r4, get_byte_1 332 mov r5, r4, get_byte_1
331 b .exit 333 b .Lexit
diff --git a/arch/arm/lib/delay.S b/arch/arm/lib/delay.S
index 3c7f7e675dd8..b3fb475b4120 100644
--- a/arch/arm/lib/delay.S
+++ b/arch/arm/lib/delay.S
@@ -11,7 +11,7 @@
11#include <asm/assembler.h> 11#include <asm/assembler.h>
12 .text 12 .text
13 13
14LC0: .word loops_per_jiffy 14.LC0: .word loops_per_jiffy
15 15
16/* 16/*
17 * 0 <= r0 <= 2000 17 * 0 <= r0 <= 2000
@@ -21,7 +21,7 @@ ENTRY(__udelay)
21 orr r2, r2, #0x00db 21 orr r2, r2, #0x00db
22 mul r0, r2, r0 22 mul r0, r2, r0
23ENTRY(__const_udelay) @ 0 <= r0 <= 0x01ffffff 23ENTRY(__const_udelay) @ 0 <= r0 <= 0x01ffffff
24 ldr r2, LC0 24 ldr r2, .LC0
25 ldr r2, [r2] @ max = 0x0fffffff 25 ldr r2, [r2] @ max = 0x0fffffff
26 mov r0, r0, lsr #11 @ max = 0x00003fff 26 mov r0, r0, lsr #11 @ max = 0x00003fff
27 mov r2, r2, lsr #11 @ max = 0x0003ffff 27 mov r2, r2, lsr #11 @ max = 0x0003ffff
diff --git a/arch/arm/lib/findbit.S b/arch/arm/lib/findbit.S
index f055d56ea68a..6f8e27a58c78 100644
--- a/arch/arm/lib/findbit.S
+++ b/arch/arm/lib/findbit.S
@@ -27,7 +27,7 @@ ENTRY(_find_first_zero_bit_le)
27 mov r2, #0 27 mov r2, #0
281: ldrb r3, [r0, r2, lsr #3] 281: ldrb r3, [r0, r2, lsr #3]
29 eors r3, r3, #0xff @ invert bits 29 eors r3, r3, #0xff @ invert bits
30 bne .found @ any now set - found zero bit 30 bne .L_found @ any now set - found zero bit
31 add r2, r2, #8 @ next bit pointer 31 add r2, r2, #8 @ next bit pointer
322: cmp r2, r1 @ any more? 322: cmp r2, r1 @ any more?
33 blo 1b 33 blo 1b
@@ -46,7 +46,7 @@ ENTRY(_find_next_zero_bit_le)
46 ldrb r3, [r0, r2, lsr #3] 46 ldrb r3, [r0, r2, lsr #3]
47 eor r3, r3, #0xff @ now looking for a 1 bit 47 eor r3, r3, #0xff @ now looking for a 1 bit
48 movs r3, r3, lsr ip @ shift off unused bits 48 movs r3, r3, lsr ip @ shift off unused bits
49 bne .found 49 bne .L_found
50 orr r2, r2, #7 @ if zero, then no bits here 50 orr r2, r2, #7 @ if zero, then no bits here
51 add r2, r2, #1 @ align bit pointer 51 add r2, r2, #1 @ align bit pointer
52 b 2b @ loop for next bit 52 b 2b @ loop for next bit
@@ -61,7 +61,7 @@ ENTRY(_find_first_bit_le)
61 mov r2, #0 61 mov r2, #0
621: ldrb r3, [r0, r2, lsr #3] 621: ldrb r3, [r0, r2, lsr #3]
63 movs r3, r3 63 movs r3, r3
64 bne .found @ any now set - found zero bit 64 bne .L_found @ any now set - found zero bit
65 add r2, r2, #8 @ next bit pointer 65 add r2, r2, #8 @ next bit pointer
662: cmp r2, r1 @ any more? 662: cmp r2, r1 @ any more?
67 blo 1b 67 blo 1b
@@ -79,7 +79,7 @@ ENTRY(_find_next_bit_le)
79 beq 1b @ If new byte, goto old routine 79 beq 1b @ If new byte, goto old routine
80 ldrb r3, [r0, r2, lsr #3] 80 ldrb r3, [r0, r2, lsr #3]
81 movs r3, r3, lsr ip @ shift off unused bits 81 movs r3, r3, lsr ip @ shift off unused bits
82 bne .found 82 bne .L_found
83 orr r2, r2, #7 @ if zero, then no bits here 83 orr r2, r2, #7 @ if zero, then no bits here
84 add r2, r2, #1 @ align bit pointer 84 add r2, r2, #1 @ align bit pointer
85 b 2b @ loop for next bit 85 b 2b @ loop for next bit
@@ -93,7 +93,7 @@ ENTRY(_find_first_zero_bit_be)
931: eor r3, r2, #0x18 @ big endian byte ordering 931: eor r3, r2, #0x18 @ big endian byte ordering
94 ldrb r3, [r0, r3, lsr #3] 94 ldrb r3, [r0, r3, lsr #3]
95 eors r3, r3, #0xff @ invert bits 95 eors r3, r3, #0xff @ invert bits
96 bne .found @ any now set - found zero bit 96 bne .L_found @ any now set - found zero bit
97 add r2, r2, #8 @ next bit pointer 97 add r2, r2, #8 @ next bit pointer
982: cmp r2, r1 @ any more? 982: cmp r2, r1 @ any more?
99 blo 1b 99 blo 1b
@@ -109,7 +109,7 @@ ENTRY(_find_next_zero_bit_be)
109 ldrb r3, [r0, r3, lsr #3] 109 ldrb r3, [r0, r3, lsr #3]
110 eor r3, r3, #0xff @ now looking for a 1 bit 110 eor r3, r3, #0xff @ now looking for a 1 bit
111 movs r3, r3, lsr ip @ shift off unused bits 111 movs r3, r3, lsr ip @ shift off unused bits
112 bne .found 112 bne .L_found
113 orr r2, r2, #7 @ if zero, then no bits here 113 orr r2, r2, #7 @ if zero, then no bits here
114 add r2, r2, #1 @ align bit pointer 114 add r2, r2, #1 @ align bit pointer
115 b 2b @ loop for next bit 115 b 2b @ loop for next bit
@@ -121,7 +121,7 @@ ENTRY(_find_first_bit_be)
1211: eor r3, r2, #0x18 @ big endian byte ordering 1211: eor r3, r2, #0x18 @ big endian byte ordering
122 ldrb r3, [r0, r3, lsr #3] 122 ldrb r3, [r0, r3, lsr #3]
123 movs r3, r3 123 movs r3, r3
124 bne .found @ any now set - found zero bit 124 bne .L_found @ any now set - found zero bit
125 add r2, r2, #8 @ next bit pointer 125 add r2, r2, #8 @ next bit pointer
1262: cmp r2, r1 @ any more? 1262: cmp r2, r1 @ any more?
127 blo 1b 127 blo 1b
@@ -136,7 +136,7 @@ ENTRY(_find_next_bit_be)
136 eor r3, r2, #0x18 @ big endian byte ordering 136 eor r3, r2, #0x18 @ big endian byte ordering
137 ldrb r3, [r0, r3, lsr #3] 137 ldrb r3, [r0, r3, lsr #3]
138 movs r3, r3, lsr ip @ shift off unused bits 138 movs r3, r3, lsr ip @ shift off unused bits
139 bne .found 139 bne .L_found
140 orr r2, r2, #7 @ if zero, then no bits here 140 orr r2, r2, #7 @ if zero, then no bits here
141 add r2, r2, #1 @ align bit pointer 141 add r2, r2, #1 @ align bit pointer
142 b 2b @ loop for next bit 142 b 2b @ loop for next bit
@@ -146,7 +146,7 @@ ENTRY(_find_next_bit_be)
146/* 146/*
147 * One or more bits in the LSB of r3 are assumed to be set. 147 * One or more bits in the LSB of r3 are assumed to be set.
148 */ 148 */
149.found: 149.L_found:
150#if __LINUX_ARM_ARCH__ >= 5 150#if __LINUX_ARM_ARCH__ >= 5
151 rsb r1, r3, #0 151 rsb r1, r3, #0
152 and r3, r3, r1 152 and r3, r3, r1
diff --git a/arch/arm/lib/io-acorn.S b/arch/arm/lib/io-acorn.S
index 3aacd01d40e1..b153523631c3 100644
--- a/arch/arm/lib/io-acorn.S
+++ b/arch/arm/lib/io-acorn.S
@@ -17,7 +17,7 @@
17 .text 17 .text
18 .align 18 .align
19 19
20.iosl_warning: 20.Liosl_warning:
21 .ascii "<4>insl/outsl not implemented, called from %08lX\0" 21 .ascii "<4>insl/outsl not implemented, called from %08lX\0"
22 .align 22 .align
23 23
@@ -27,6 +27,6 @@
27 */ 27 */
28ENTRY(insl) 28ENTRY(insl)
29ENTRY(outsl) 29ENTRY(outsl)
30 adr r0, .iosl_warning 30 adr r0, .Liosl_warning
31 mov r1, lr 31 mov r1, lr
32 b printk 32 b printk
diff --git a/arch/arm/lib/io-readsb.S b/arch/arm/lib/io-readsb.S
index 081ef749298a..d3d8de71a2c8 100644
--- a/arch/arm/lib/io-readsb.S
+++ b/arch/arm/lib/io-readsb.S
@@ -10,7 +10,7 @@
10#include <linux/linkage.h> 10#include <linux/linkage.h>
11#include <asm/assembler.h> 11#include <asm/assembler.h>
12 12
13.insb_align: rsb ip, ip, #4 13.Linsb_align: rsb ip, ip, #4
14 cmp ip, r2 14 cmp ip, r2
15 movgt ip, r2 15 movgt ip, r2
16 cmp ip, #2 16 cmp ip, #2
@@ -21,20 +21,20 @@
21 ldrgtb r3, [r0] 21 ldrgtb r3, [r0]
22 strgtb r3, [r1], #1 22 strgtb r3, [r1], #1
23 subs r2, r2, ip 23 subs r2, r2, ip
24 bne .insb_aligned 24 bne .Linsb_aligned
25 25
26ENTRY(__raw_readsb) 26ENTRY(__raw_readsb)
27 teq r2, #0 @ do we have to check for the zero len? 27 teq r2, #0 @ do we have to check for the zero len?
28 moveq pc, lr 28 moveq pc, lr
29 ands ip, r1, #3 29 ands ip, r1, #3
30 bne .insb_align 30 bne .Linsb_align
31 31
32.insb_aligned: stmfd sp!, {r4 - r6, lr} 32.Linsb_aligned: stmfd sp!, {r4 - r6, lr}
33 33
34 subs r2, r2, #16 34 subs r2, r2, #16
35 bmi .insb_no_16 35 bmi .Linsb_no_16
36 36
37.insb_16_lp: ldrb r3, [r0] 37.Linsb_16_lp: ldrb r3, [r0]
38 ldrb r4, [r0] 38 ldrb r4, [r0]
39 ldrb r5, [r0] 39 ldrb r5, [r0]
40 mov r3, r3, put_byte_0 40 mov r3, r3, put_byte_0
@@ -69,13 +69,13 @@ ENTRY(__raw_readsb)
69 stmia r1!, {r3 - r6} 69 stmia r1!, {r3 - r6}
70 70
71 subs r2, r2, #16 71 subs r2, r2, #16
72 bpl .insb_16_lp 72 bpl .Linsb_16_lp
73 73
74 tst r2, #15 74 tst r2, #15
75 LOADREGS(eqfd, sp!, {r4 - r6, pc}) 75 LOADREGS(eqfd, sp!, {r4 - r6, pc})
76 76
77.insb_no_16: tst r2, #8 77.Linsb_no_16: tst r2, #8
78 beq .insb_no_8 78 beq .Linsb_no_8
79 79
80 ldrb r3, [r0] 80 ldrb r3, [r0]
81 ldrb r4, [r0] 81 ldrb r4, [r0]
@@ -95,8 +95,8 @@ ENTRY(__raw_readsb)
95 orr r4, r4, ip, put_byte_3 95 orr r4, r4, ip, put_byte_3
96 stmia r1!, {r3, r4} 96 stmia r1!, {r3, r4}
97 97
98.insb_no_8: tst r2, #4 98.Linsb_no_8: tst r2, #4
99 beq .insb_no_4 99 beq .Linsb_no_4
100 100
101 ldrb r3, [r0] 101 ldrb r3, [r0]
102 ldrb r4, [r0] 102 ldrb r4, [r0]
@@ -108,7 +108,7 @@ ENTRY(__raw_readsb)
108 orr r3, r3, r6, put_byte_3 108 orr r3, r3, r6, put_byte_3
109 str r3, [r1], #4 109 str r3, [r1], #4
110 110
111.insb_no_4: ands r2, r2, #3 111.Linsb_no_4: ands r2, r2, #3
112 LOADREGS(eqfd, sp!, {r4 - r6, pc}) 112 LOADREGS(eqfd, sp!, {r4 - r6, pc})
113 113
114 cmp r2, #2 114 cmp r2, #2
diff --git a/arch/arm/lib/io-readsw-armv3.S b/arch/arm/lib/io-readsw-armv3.S
index 476cf7f8a633..146d47c15455 100644
--- a/arch/arm/lib/io-readsw-armv3.S
+++ b/arch/arm/lib/io-readsw-armv3.S
@@ -11,16 +11,16 @@
11#include <asm/assembler.h> 11#include <asm/assembler.h>
12#include <asm/hardware.h> 12#include <asm/hardware.h>
13 13
14.insw_bad_alignment: 14.Linsw_bad_alignment:
15 adr r0, .insw_bad_align_msg 15 adr r0, .Linsw_bad_align_msg
16 mov r2, lr 16 mov r2, lr
17 b panic 17 b panic
18.insw_bad_align_msg: 18.Linsw_bad_align_msg:
19 .asciz "insw: bad buffer alignment (0x%p, lr=0x%08lX)\n" 19 .asciz "insw: bad buffer alignment (0x%p, lr=0x%08lX)\n"
20 .align 20 .align
21 21
22.insw_align: tst r1, #1 22.Linsw_align: tst r1, #1
23 bne .insw_bad_alignment 23 bne .Linsw_bad_alignment
24 24
25 ldr r3, [r0] 25 ldr r3, [r0]
26 strb r3, [r1], #1 26 strb r3, [r1], #1
@@ -34,16 +34,16 @@ ENTRY(__raw_readsw)
34 teq r2, #0 @ do we have to check for the zero len? 34 teq r2, #0 @ do we have to check for the zero len?
35 moveq pc, lr 35 moveq pc, lr
36 tst r1, #3 36 tst r1, #3
37 bne .insw_align 37 bne .Linsw_align
38 38
39.insw_aligned: mov ip, #0xff 39.Linsw_aligned: mov ip, #0xff
40 orr ip, ip, ip, lsl #8 40 orr ip, ip, ip, lsl #8
41 stmfd sp!, {r4, r5, r6, lr} 41 stmfd sp!, {r4, r5, r6, lr}
42 42
43 subs r2, r2, #8 43 subs r2, r2, #8
44 bmi .no_insw_8 44 bmi .Lno_insw_8
45 45
46.insw_8_lp: ldr r3, [r0] 46.Linsw_8_lp: ldr r3, [r0]
47 and r3, r3, ip 47 and r3, r3, ip
48 ldr r4, [r0] 48 ldr r4, [r0]
49 orr r3, r3, r4, lsl #16 49 orr r3, r3, r4, lsl #16
@@ -66,13 +66,13 @@ ENTRY(__raw_readsw)
66 stmia r1!, {r3 - r6} 66 stmia r1!, {r3 - r6}
67 67
68 subs r2, r2, #8 68 subs r2, r2, #8
69 bpl .insw_8_lp 69 bpl .Linsw_8_lp
70 70
71 tst r2, #7 71 tst r2, #7
72 LOADREGS(eqfd, sp!, {r4, r5, r6, pc}) 72 LOADREGS(eqfd, sp!, {r4, r5, r6, pc})
73 73
74.no_insw_8: tst r2, #4 74.Lno_insw_8: tst r2, #4
75 beq .no_insw_4 75 beq .Lno_insw_4
76 76
77 ldr r3, [r0] 77 ldr r3, [r0]
78 and r3, r3, ip 78 and r3, r3, ip
@@ -86,8 +86,8 @@ ENTRY(__raw_readsw)
86 86
87 stmia r1!, {r3, r4} 87 stmia r1!, {r3, r4}
88 88
89.no_insw_4: tst r2, #2 89.Lno_insw_4: tst r2, #2
90 beq .no_insw_2 90 beq .Lno_insw_2
91 91
92 ldr r3, [r0] 92 ldr r3, [r0]
93 and r3, r3, ip 93 and r3, r3, ip
@@ -96,7 +96,7 @@ ENTRY(__raw_readsw)
96 96
97 str r3, [r1], #4 97 str r3, [r1], #4
98 98
99.no_insw_2: tst r2, #1 99.Lno_insw_2: tst r2, #1
100 ldrne r3, [r0] 100 ldrne r3, [r0]
101 strneb r3, [r1], #1 101 strneb r3, [r1], #1
102 movne r3, r3, lsr #8 102 movne r3, r3, lsr #8
diff --git a/arch/arm/lib/io-readsw-armv4.S b/arch/arm/lib/io-readsw-armv4.S
index c92b66ecbe86..4db1c5f0b219 100644
--- a/arch/arm/lib/io-readsw-armv4.S
+++ b/arch/arm/lib/io-readsw-armv4.S
@@ -18,8 +18,8 @@
18#endif 18#endif
19 .endm 19 .endm
20 20
21.insw_align: movs ip, r1, lsl #31 21.Linsw_align: movs ip, r1, lsl #31
22 bne .insw_noalign 22 bne .Linsw_noalign
23 ldrh ip, [r0] 23 ldrh ip, [r0]
24 sub r2, r2, #1 24 sub r2, r2, #1
25 strh ip, [r1], #2 25 strh ip, [r1], #2
@@ -28,14 +28,14 @@ ENTRY(__raw_readsw)
28 teq r2, #0 28 teq r2, #0
29 moveq pc, lr 29 moveq pc, lr
30 tst r1, #3 30 tst r1, #3
31 bne .insw_align 31 bne .Linsw_align
32 32
33 stmfd sp!, {r4, r5, lr} 33 stmfd sp!, {r4, r5, lr}
34 34
35 subs r2, r2, #8 35 subs r2, r2, #8
36 bmi .no_insw_8 36 bmi .Lno_insw_8
37 37
38.insw_8_lp: ldrh r3, [r0] 38.Linsw_8_lp: ldrh r3, [r0]
39 ldrh r4, [r0] 39 ldrh r4, [r0]
40 pack r3, r3, r4 40 pack r3, r3, r4
41 41
@@ -53,10 +53,10 @@ ENTRY(__raw_readsw)
53 53
54 subs r2, r2, #8 54 subs r2, r2, #8
55 stmia r1!, {r3 - r5, ip} 55 stmia r1!, {r3 - r5, ip}
56 bpl .insw_8_lp 56 bpl .Linsw_8_lp
57 57
58.no_insw_8: tst r2, #4 58.Lno_insw_8: tst r2, #4
59 beq .no_insw_4 59 beq .Lno_insw_4
60 60
61 ldrh r3, [r0] 61 ldrh r3, [r0]
62 ldrh r4, [r0] 62 ldrh r4, [r0]
@@ -68,15 +68,15 @@ ENTRY(__raw_readsw)
68 68
69 stmia r1!, {r3, r4} 69 stmia r1!, {r3, r4}
70 70
71.no_insw_4: movs r2, r2, lsl #31 71.Lno_insw_4: movs r2, r2, lsl #31
72 bcc .no_insw_2 72 bcc .Lno_insw_2
73 73
74 ldrh r3, [r0] 74 ldrh r3, [r0]
75 ldrh ip, [r0] 75 ldrh ip, [r0]
76 pack r3, r3, ip 76 pack r3, r3, ip
77 str r3, [r1], #4 77 str r3, [r1], #4
78 78
79.no_insw_2: ldrneh r3, [r0] 79.Lno_insw_2: ldrneh r3, [r0]
80 strneh r3, [r1] 80 strneh r3, [r1]
81 81
82 ldmfd sp!, {r4, r5, pc} 82 ldmfd sp!, {r4, r5, pc}
@@ -93,7 +93,7 @@ ENTRY(__raw_readsw)
93#define pull_hbyte1 lsr #8 93#define pull_hbyte1 lsr #8
94#endif 94#endif
95 95
96.insw_noalign: stmfd sp!, {r4, lr} 96.Linsw_noalign: stmfd sp!, {r4, lr}
97 ldrccb ip, [r1, #-1]! 97 ldrccb ip, [r1, #-1]!
98 bcc 1f 98 bcc 1f
99 99
diff --git a/arch/arm/lib/io-writesb.S b/arch/arm/lib/io-writesb.S
index 70b2561bdb09..08209fc640ea 100644
--- a/arch/arm/lib/io-writesb.S
+++ b/arch/arm/lib/io-writesb.S
@@ -30,7 +30,7 @@
30#endif 30#endif
31 .endm 31 .endm
32 32
33.outsb_align: rsb ip, ip, #4 33.Loutsb_align: rsb ip, ip, #4
34 cmp ip, r2 34 cmp ip, r2
35 movgt ip, r2 35 movgt ip, r2
36 cmp ip, #2 36 cmp ip, #2
@@ -41,44 +41,45 @@
41 ldrgtb r3, [r1], #1 41 ldrgtb r3, [r1], #1
42 strgtb r3, [r0] 42 strgtb r3, [r0]
43 subs r2, r2, ip 43 subs r2, r2, ip
44 bne .outsb_aligned 44 bne .Loutsb_aligned
45 45
46ENTRY(__raw_writesb) 46ENTRY(__raw_writesb)
47 teq r2, #0 @ do we have to check for the zero len? 47 teq r2, #0 @ do we have to check for the zero len?
48 moveq pc, lr 48 moveq pc, lr
49 ands ip, r1, #3 49 ands ip, r1, #3
50 bne .outsb_align 50 bne .Loutsb_align
51 51
52.outsb_aligned: stmfd sp!, {r4, r5, lr} 52.Loutsb_aligned:
53 stmfd sp!, {r4, r5, lr}
53 54
54 subs r2, r2, #16 55 subs r2, r2, #16
55 bmi .outsb_no_16 56 bmi .Loutsb_no_16
56 57
57.outsb_16_lp: ldmia r1!, {r3, r4, r5, ip} 58.Loutsb_16_lp: ldmia r1!, {r3, r4, r5, ip}
58 outword r3 59 outword r3
59 outword r4 60 outword r4
60 outword r5 61 outword r5
61 outword ip 62 outword ip
62 subs r2, r2, #16 63 subs r2, r2, #16
63 bpl .outsb_16_lp 64 bpl .Loutsb_16_lp
64 65
65 tst r2, #15 66 tst r2, #15
66 LOADREGS(eqfd, sp!, {r4, r5, pc}) 67 LOADREGS(eqfd, sp!, {r4, r5, pc})
67 68
68.outsb_no_16: tst r2, #8 69.Loutsb_no_16: tst r2, #8
69 beq .outsb_no_8 70 beq .Loutsb_no_8
70 71
71 ldmia r1!, {r3, r4} 72 ldmia r1!, {r3, r4}
72 outword r3 73 outword r3
73 outword r4 74 outword r4
74 75
75.outsb_no_8: tst r2, #4 76.Loutsb_no_8: tst r2, #4
76 beq .outsb_no_4 77 beq .Loutsb_no_4
77 78
78 ldr r3, [r1], #4 79 ldr r3, [r1], #4
79 outword r3 80 outword r3
80 81
81.outsb_no_4: ands r2, r2, #3 82.Loutsb_no_4: ands r2, r2, #3
82 LOADREGS(eqfd, sp!, {r4, r5, pc}) 83 LOADREGS(eqfd, sp!, {r4, r5, pc})
83 84
84 cmp r2, #2 85 cmp r2, #2
diff --git a/arch/arm/lib/io-writesw-armv3.S b/arch/arm/lib/io-writesw-armv3.S
index 950e7e310f1a..52d62b481295 100644
--- a/arch/arm/lib/io-writesw-armv3.S
+++ b/arch/arm/lib/io-writesw-armv3.S
@@ -11,16 +11,16 @@
11#include <asm/assembler.h> 11#include <asm/assembler.h>
12#include <asm/hardware.h> 12#include <asm/hardware.h>
13 13
14.outsw_bad_alignment: 14.Loutsw_bad_alignment:
15 adr r0, .outsw_bad_align_msg 15 adr r0, .Loutsw_bad_align_msg
16 mov r2, lr 16 mov r2, lr
17 b panic 17 b panic
18.outsw_bad_align_msg: 18.Loutsw_bad_align_msg:
19 .asciz "outsw: bad buffer alignment (0x%p, lr=0x%08lX)\n" 19 .asciz "outsw: bad buffer alignment (0x%p, lr=0x%08lX)\n"
20 .align 20 .align
21 21
22.outsw_align: tst r1, #1 22.Loutsw_align: tst r1, #1
23 bne .outsw_bad_alignment 23 bne .Loutsw_bad_alignment
24 24
25 add r1, r1, #2 25 add r1, r1, #2
26 26
@@ -35,14 +35,14 @@ ENTRY(__raw_writesw)
35 teq r2, #0 @ do we have to check for the zero len? 35 teq r2, #0 @ do we have to check for the zero len?
36 moveq pc, lr 36 moveq pc, lr
37 tst r1, #3 37 tst r1, #3
38 bne .outsw_align 38 bne .Loutsw_align
39 39
40.outsw_aligned: stmfd sp!, {r4, r5, r6, lr} 40 stmfd sp!, {r4, r5, r6, lr}
41 41
42 subs r2, r2, #8 42 subs r2, r2, #8
43 bmi .no_outsw_8 43 bmi .Lno_outsw_8
44 44
45.outsw_8_lp: ldmia r1!, {r3, r4, r5, r6} 45.Loutsw_8_lp: ldmia r1!, {r3, r4, r5, r6}
46 46
47 mov ip, r3, lsl #16 47 mov ip, r3, lsl #16
48 orr ip, ip, ip, lsr #16 48 orr ip, ip, ip, lsr #16
@@ -77,13 +77,13 @@ ENTRY(__raw_writesw)
77 str ip, [r0] 77 str ip, [r0]
78 78
79 subs r2, r2, #8 79 subs r2, r2, #8
80 bpl .outsw_8_lp 80 bpl .Loutsw_8_lp
81 81
82 tst r2, #7 82 tst r2, #7
83 LOADREGS(eqfd, sp!, {r4, r5, r6, pc}) 83 LOADREGS(eqfd, sp!, {r4, r5, r6, pc})
84 84
85.no_outsw_8: tst r2, #4 85.Lno_outsw_8: tst r2, #4
86 beq .no_outsw_4 86 beq .Lno_outsw_4
87 87
88 ldmia r1!, {r3, r4} 88 ldmia r1!, {r3, r4}
89 89
@@ -103,8 +103,8 @@ ENTRY(__raw_writesw)
103 orr ip, ip, ip, lsl #16 103 orr ip, ip, ip, lsl #16
104 str ip, [r0] 104 str ip, [r0]
105 105
106.no_outsw_4: tst r2, #2 106.Lno_outsw_4: tst r2, #2
107 beq .no_outsw_2 107 beq .Lno_outsw_2
108 108
109 ldr r3, [r1], #4 109 ldr r3, [r1], #4
110 110
@@ -116,7 +116,7 @@ ENTRY(__raw_writesw)
116 orr ip, ip, ip, lsl #16 116 orr ip, ip, ip, lsl #16
117 str ip, [r0] 117 str ip, [r0]
118 118
119.no_outsw_2: tst r2, #1 119.Lno_outsw_2: tst r2, #1
120 120
121 ldrne r3, [r1] 121 ldrne r3, [r1]
122 122
diff --git a/arch/arm/lib/io-writesw-armv4.S b/arch/arm/lib/io-writesw-armv4.S
index 5e240e452af6..c8e85bd653b7 100644
--- a/arch/arm/lib/io-writesw-armv4.S
+++ b/arch/arm/lib/io-writesw-armv4.S
@@ -22,8 +22,8 @@
22#endif 22#endif
23 .endm 23 .endm
24 24
25.outsw_align: movs ip, r1, lsl #31 25.Loutsw_align: movs ip, r1, lsl #31
26 bne .outsw_noalign 26 bne .Loutsw_noalign
27 27
28 ldrh r3, [r1], #2 28 ldrh r3, [r1], #2
29 sub r2, r2, #1 29 sub r2, r2, #1
@@ -33,35 +33,35 @@ ENTRY(__raw_writesw)
33 teq r2, #0 33 teq r2, #0
34 moveq pc, lr 34 moveq pc, lr
35 ands r3, r1, #3 35 ands r3, r1, #3
36 bne .outsw_align 36 bne .Loutsw_align
37 37
38 stmfd sp!, {r4, r5, lr} 38 stmfd sp!, {r4, r5, lr}
39 39
40 subs r2, r2, #8 40 subs r2, r2, #8
41 bmi .no_outsw_8 41 bmi .Lno_outsw_8
42 42
43.outsw_8_lp: ldmia r1!, {r3, r4, r5, ip} 43.Loutsw_8_lp: ldmia r1!, {r3, r4, r5, ip}
44 subs r2, r2, #8 44 subs r2, r2, #8
45 outword r3 45 outword r3
46 outword r4 46 outword r4
47 outword r5 47 outword r5
48 outword ip 48 outword ip
49 bpl .outsw_8_lp 49 bpl .Loutsw_8_lp
50 50
51.no_outsw_8: tst r2, #4 51.Lno_outsw_8: tst r2, #4
52 beq .no_outsw_4 52 beq .Lno_outsw_4
53 53
54 ldmia r1!, {r3, ip} 54 ldmia r1!, {r3, ip}
55 outword r3 55 outword r3
56 outword ip 56 outword ip
57 57
58.no_outsw_4: movs r2, r2, lsl #31 58.Lno_outsw_4: movs r2, r2, lsl #31
59 bcc .no_outsw_2 59 bcc .Lno_outsw_2
60 60
61 ldr r3, [r1], #4 61 ldr r3, [r1], #4
62 outword r3 62 outword r3
63 63
64.no_outsw_2: ldrneh r3, [r1] 64.Lno_outsw_2: ldrneh r3, [r1]
65 strneh r3, [r0] 65 strneh r3, [r0]
66 66
67 ldmfd sp!, {r4, r5, pc} 67 ldmfd sp!, {r4, r5, pc}
@@ -74,7 +74,8 @@ ENTRY(__raw_writesw)
74#define push_hbyte1 lsl #8 74#define push_hbyte1 lsl #8
75#endif 75#endif
76 76
77.outsw_noalign: ldr r3, [r1, -r3]! 77.Loutsw_noalign:
78 ldr r3, [r1, -r3]!
78 subcs r2, r2, #1 79 subcs r2, r2, #1
79 bcs 2f 80 bcs 2f
80 subs r2, r2, #2 81 subs r2, r2, #2
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
38USER( strgtbt r3, [r0], #1) @ May fault 38USER( 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
42ENTRY(__arch_copy_to_user) 42ENTRY(__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
61USER( strt r3, [r0], #4) @ May fault 61USER( 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
97USER( strbt r3, [r0], #1) @ May fault 97USER( strbt r3, [r0], #1) @ May fault
98 ldrgeb r3, [r1], #1 98 ldrgeb r3, [r1], #1
99USER( strgebt r3, [r0], #1) @ May fault 99USER( strgebt r3, [r0], #1) @ May fault
100 ldrgtb r3, [r1], #1 100 ldrgtb r3, [r1], #1
101USER( strgtbt r3, [r0], #1) @ May fault 101USER( 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
164USER( strbt r3, [r0], #1) @ May fault 164USER( strbt r3, [r0], #1) @ May fault
165 movge r3, r7, get_byte_2 165 movge r3, r7, get_byte_2
166USER( strgebt r3, [r0], #1) @ May fault 166USER( strgebt r3, [r0], #1) @ May fault
167 movgt r3, r7, get_byte_3 167 movgt r3, r7, get_byte_3
168USER( strgtbt r3, [r0], #1) @ May fault 168USER( 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
219USER( strbt r3, [r0], #1) @ May fault 219USER( strbt r3, [r0], #1) @ May fault
220 movge r3, r7, get_byte_3 220 movge r3, r7, get_byte_3
221USER( strgebt r3, [r0], #1) @ May fault 221USER( strgebt r3, [r0], #1) @ May fault
222 ldrgtb r3, [r1], #0 222 ldrgtb r3, [r1], #0
223USER( strgtbt r3, [r0], #1) @ May fault 223USER( 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
274USER( strbt r3, [r0], #1) @ May fault 274USER( strbt r3, [r0], #1) @ May fault
275 ldrgeb r3, [r1], #1 275 ldrgeb r3, [r1], #1
276USER( strgebt r3, [r0], #1) @ May fault 276USER( strgebt r3, [r0], #1) @ May fault
277 ldrgtb r3, [r1], #0 277 ldrgtb r3, [r1], #0
278USER( strgtbt r3, [r0], #1) @ May fault 278USER( 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
296USER( ldrbt r3, [r1], #1) @ May fault 296USER( ldrbt r3, [r1], #1) @ May fault
@@ -300,31 +300,32 @@ USER( ldrgebt r3, [r1], #1) @ May fault
300USER( ldrgtbt r3, [r1], #1) @ May fault 300USER( 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
305ENTRY(__arch_copy_from_user) 305ENTRY(__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
322USER( ldrt r3, [r1], #4) 323USER( 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
358USER( ldrbt r3, [r1], #1) @ May fault 359USER( ldrbt r3, [r1], #1) @ May fault
359 strb r3, [r0], #1 360 strb r3, [r0], #1
360USER( ldrgebt r3, [r1], #1) @ May fault 361USER( ldrgebt r3, [r1], #1) @ May fault
361 strgeb r3, [r0], #1 362 strgeb r3, [r0], #1
362USER( ldrgtbt r3, [r1], #1) @ May fault 363USER( 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
375USER( ldrt r7, [r1], #4) @ May fault 376USER( 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
383USER( ldrt r7, [r1], #4) @ May fault 384USER( 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
438USER( ldrt r7, [r1], #4) @ May fault 439USER( 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
485USER( ldrgtbt r3, [r1], #0) @ May fault 487USER( 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
493USER( ldrt r7, [r1], #4) @ May fault 495USER( 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
538USER( ldrgebt r3, [r1], #1) @ May fault 540USER( ldrgebt r3, [r1], #1) @ May fault
539 strgeb r3, [r0], #1 541 strgeb r3, [r0], #1
540USER( ldrgtbt r3, [r1], #1) @ May fault 542USER( 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