aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/lib/csumpartial.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/lib/csumpartial.S')
-rw-r--r--arch/arm/lib/csumpartial.S28
1 files changed, 14 insertions, 14 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