hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/arch/arm64/lib/copy_from_user.S
....@@ -1,23 +1,13 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Copyright (C) 2012 ARM Ltd.
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
7
- *
8
- * This program is distributed in the hope that it will be useful,
9
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
- * GNU General Public License for more details.
12
- *
13
- * You should have received a copy of the GNU General Public License
14
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
154 */
165
176 #include <linux/linkage.h>
187
19
-#include <asm/cache.h>
208 #include <asm/asm-uaccess.h>
9
+#include <asm/assembler.h>
10
+#include <asm/cache.h>
2111
2212 /*
2313 * Copy from user space to a kernel buffer (alignment handled by the hardware)
....@@ -30,49 +20,48 @@
3020 * x0 - bytes not copied
3121 */
3222
33
- .macro ldrb1 ptr, regB, val
34
- uao_user_alternative 9998f, ldrb, ldtrb, \ptr, \regB, \val
23
+ .macro ldrb1 reg, ptr, val
24
+ uao_user_alternative 9998f, ldrb, ldtrb, \reg, \ptr, \val
3525 .endm
3626
37
- .macro strb1 ptr, regB, val
38
- strb \ptr, [\regB], \val
27
+ .macro strb1 reg, ptr, val
28
+ strb \reg, [\ptr], \val
3929 .endm
4030
41
- .macro ldrh1 ptr, regB, val
42
- uao_user_alternative 9997f, ldrh, ldtrh, \ptr, \regB, \val
31
+ .macro ldrh1 reg, ptr, val
32
+ uao_user_alternative 9997f, ldrh, ldtrh, \reg, \ptr, \val
4333 .endm
4434
45
- .macro strh1 ptr, regB, val
46
- strh \ptr, [\regB], \val
35
+ .macro strh1 reg, ptr, val
36
+ strh \reg, [\ptr], \val
4737 .endm
4838
49
- .macro ldr1 ptr, regB, val
50
- uao_user_alternative 9997f, ldr, ldtr, \ptr, \regB, \val
39
+ .macro ldr1 reg, ptr, val
40
+ uao_user_alternative 9997f, ldr, ldtr, \reg, \ptr, \val
5141 .endm
5242
53
- .macro str1 ptr, regB, val
54
- str \ptr, [\regB], \val
43
+ .macro str1 reg, ptr, val
44
+ str \reg, [\ptr], \val
5545 .endm
5646
57
- .macro ldp1 ptr, regB, regC, val
58
- uao_ldp 9997f, \ptr, \regB, \regC, \val
47
+ .macro ldp1 reg1, reg2, ptr, val
48
+ uao_ldp 9997f, \reg1, \reg2, \ptr, \val
5949 .endm
6050
61
- .macro stp1 ptr, regB, regC, val
62
- stp \ptr, \regB, [\regC], \val
51
+ .macro stp1 reg1, reg2, ptr, val
52
+ stp \reg1, \reg2, [\ptr], \val
6353 .endm
6454
6555 end .req x5
6656 srcin .req x15
67
-ENTRY(__arch_copy_from_user)
68
- uaccess_enable_not_uao x3, x4, x5
57
+SYM_FUNC_START(__arch_copy_from_user)
6958 add end, x0, x2
7059 mov srcin, x1
7160 #include "copy_template.S"
72
- uaccess_disable_not_uao x3, x4
7361 mov x0, #0 // Nothing to copy
7462 ret
75
-ENDPROC(__arch_copy_from_user)
63
+SYM_FUNC_END(__arch_copy_from_user)
64
+EXPORT_SYMBOL(__arch_copy_from_user)
7665
7766 .section .fixup,"ax"
7867 .align 2
....@@ -82,6 +71,5 @@
8271 USER(9998f, ldtrb tmp1w, [srcin])
8372 strb tmp1w, [dst], #1
8473 9998: sub x0, end, dst // bytes not copied
85
- uaccess_disable_not_uao x3, x4
8674 ret
8775 .previous