hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/arch/powerpc/lib/checksum_64.S
....@@ -1,13 +1,9 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * This file contains assembly-language implementations
34 * of IP-style 1's complement checksum routines.
45 *
56 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
6
- *
7
- * This program is free software; you can redistribute it and/or
8
- * modify it under the terms of the GNU General Public License
9
- * as published by the Free Software Foundation; either version
10
- * 2 of the License, or (at your option) any later version.
117 *
128 * Severely hacked about by Paul Mackerras (paulus@cs.anu.edu.au).
139 */
....@@ -186,34 +182,33 @@
186182
187183 .macro srcnr
188184 100:
189
- EX_TABLE(100b,.Lsrc_error_nr)
185
+ EX_TABLE(100b,.Lerror_nr)
190186 .endm
191187
192188 .macro source
193189 150:
194
- EX_TABLE(150b,.Lsrc_error)
190
+ EX_TABLE(150b,.Lerror)
195191 .endm
196192
197193 .macro dstnr
198194 200:
199
- EX_TABLE(200b,.Ldest_error_nr)
195
+ EX_TABLE(200b,.Lerror_nr)
200196 .endm
201197
202198 .macro dest
203199 250:
204
- EX_TABLE(250b,.Ldest_error)
200
+ EX_TABLE(250b,.Lerror)
205201 .endm
206202
207203 /*
208204 * Computes the checksum of a memory block at src, length len,
209
- * and adds in "sum" (32-bit), while copying the block to dst.
210
- * If an access exception occurs on src or dst, it stores -EFAULT
211
- * to *src_err or *dst_err respectively. The caller must take any action
212
- * required in this case (zeroing memory, recalculating partial checksum etc).
205
+ * and adds in 0xffffffff (32-bit), while copying the block to dst.
206
+ * If an access exception occurs, it returns 0.
213207 *
214
- * csum_partial_copy_generic(r3=src, r4=dst, r5=len, r6=sum, r7=src_err, r8=dst_err)
208
+ * csum_partial_copy_generic(r3=src, r4=dst, r5=len)
215209 */
216210 _GLOBAL(csum_partial_copy_generic)
211
+ li r6,-1
217212 addic r0,r6,0 /* clear carry */
218213
219214 srdi. r6,r5,3 /* less than 8 bytes? */
....@@ -405,29 +400,15 @@
405400 srdi r3,r3,32
406401 blr
407402
408
-.Lsrc_error:
403
+.Lerror:
409404 ld r14,STK_REG(R14)(r1)
410405 ld r15,STK_REG(R15)(r1)
411406 ld r16,STK_REG(R16)(r1)
412407 addi r1,r1,STACKFRAMESIZE
413
-.Lsrc_error_nr:
414
- cmpdi 0,r7,0
415
- beqlr
416
- li r6,-EFAULT
417
- stw r6,0(r7)
408
+.Lerror_nr:
409
+ li r3,0
418410 blr
419411
420
-.Ldest_error:
421
- ld r14,STK_REG(R14)(r1)
422
- ld r15,STK_REG(R15)(r1)
423
- ld r16,STK_REG(R16)(r1)
424
- addi r1,r1,STACKFRAMESIZE
425
-.Ldest_error_nr:
426
- cmpdi 0,r8,0
427
- beqlr
428
- li r6,-EFAULT
429
- stw r6,0(r8)
430
- blr
431412 EXPORT_SYMBOL(csum_partial_copy_generic)
432413
433414 /*