forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/arch/arm/lib/csumpartialcopyuser.S
....@@ -1,14 +1,10 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * linux/arch/arm/lib/csumpartialcopyuser.S
34 *
45 * Copyright (C) 1995-1998 Russell King
56 *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License version 2 as
8
- * published by the Free Software Foundation.
9
- *
107 * 27/03/03 Ian Molton Clean up CONFIG_CPU
11
- *
128 */
139 #include <linux/linkage.h>
1410 #include <asm/assembler.h>
....@@ -66,9 +62,9 @@
6662
6763 /*
6864 * unsigned int
69
- * csum_partial_copy_from_user(const char *src, char *dst, int len, int sum, int *err_ptr)
70
- * r0 = src, r1 = dst, r2 = len, r3 = sum, [sp] = *err_ptr
71
- * Returns : r0 = checksum, [[sp, #0], #0] = 0 or -EFAULT
65
+ * csum_partial_copy_from_user(const char *src, char *dst, int len)
66
+ * r0 = src, r1 = dst, r2 = len
67
+ * Returns : r0 = checksum or 0
7268 */
7369
7470 #define FN_ENTRY ENTRY(csum_partial_copy_from_user)
....@@ -77,25 +73,11 @@
7773 #include "csumpartialcopygeneric.S"
7874
7975 /*
80
- * FIXME: minor buglet here
81
- * We don't return the checksum for the data present in the buffer. To do
82
- * so properly, we would have to add in whatever registers were loaded before
83
- * the fault, which, with the current asm above is not predictable.
76
+ * We report fault by returning 0 csum - impossible in normal case, since
77
+ * we start with 0xffffffff for initial sum.
8478 */
8579 .pushsection .text.fixup,"ax"
8680 .align 4
87
-9001: mov r4, #-EFAULT
88
-#ifdef CONFIG_CPU_SW_DOMAIN_PAN
89
- ldr r5, [sp, #9*4] @ *err_ptr
90
-#else
91
- ldr r5, [sp, #8*4] @ *err_ptr
92
-#endif
93
- str r4, [r5]
94
- ldmia sp, {r1, r2} @ retrieve dst, len
95
- add r2, r2, r1
96
- mov r0, #0 @ zero the buffer
97
-9002: teq r2, r1
98
- strneb r0, [r1], #1
99
- bne 9002b
81
+9001: mov r0, #0
10082 load_regs
10183 .popsection