hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/arch/arm64/lib/copy_in_user.S
....@@ -1,25 +1,15 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Copy from user space to user space
34 *
45 * Copyright (C) 2012 ARM Ltd.
5
- *
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
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
176 */
187
198 #include <linux/linkage.h>
209
21
-#include <asm/cache.h>
2210 #include <asm/asm-uaccess.h>
11
+#include <asm/assembler.h>
12
+#include <asm/cache.h>
2313
2414 /*
2515 * Copy from user space to user space (alignment handled by the hardware)
....@@ -31,50 +21,48 @@
3121 * Returns:
3222 * x0 - bytes not copied
3323 */
34
- .macro ldrb1 ptr, regB, val
35
- uao_user_alternative 9998f, ldrb, ldtrb, \ptr, \regB, \val
24
+ .macro ldrb1 reg, ptr, val
25
+ uao_user_alternative 9998f, ldrb, ldtrb, \reg, \ptr, \val
3626 .endm
3727
38
- .macro strb1 ptr, regB, val
39
- uao_user_alternative 9998f, strb, sttrb, \ptr, \regB, \val
28
+ .macro strb1 reg, ptr, val
29
+ uao_user_alternative 9998f, strb, sttrb, \reg, \ptr, \val
4030 .endm
4131
42
- .macro ldrh1 ptr, regB, val
43
- uao_user_alternative 9997f, ldrh, ldtrh, \ptr, \regB, \val
32
+ .macro ldrh1 reg, ptr, val
33
+ uao_user_alternative 9997f, ldrh, ldtrh, \reg, \ptr, \val
4434 .endm
4535
46
- .macro strh1 ptr, regB, val
47
- uao_user_alternative 9997f, strh, sttrh, \ptr, \regB, \val
36
+ .macro strh1 reg, ptr, val
37
+ uao_user_alternative 9997f, strh, sttrh, \reg, \ptr, \val
4838 .endm
4939
50
- .macro ldr1 ptr, regB, val
51
- uao_user_alternative 9997f, ldr, ldtr, \ptr, \regB, \val
40
+ .macro ldr1 reg, ptr, val
41
+ uao_user_alternative 9997f, ldr, ldtr, \reg, \ptr, \val
5242 .endm
5343
54
- .macro str1 ptr, regB, val
55
- uao_user_alternative 9997f, str, sttr, \ptr, \regB, \val
44
+ .macro str1 reg, ptr, val
45
+ uao_user_alternative 9997f, str, sttr, \reg, \ptr, \val
5646 .endm
5747
58
- .macro ldp1 ptr, regB, regC, val
59
- uao_ldp 9997f, \ptr, \regB, \regC, \val
48
+ .macro ldp1 reg1, reg2, ptr, val
49
+ uao_ldp 9997f, \reg1, \reg2, \ptr, \val
6050 .endm
6151
62
- .macro stp1 ptr, regB, regC, val
63
- uao_stp 9997f, \ptr, \regB, \regC, \val
52
+ .macro stp1 reg1, reg2, ptr, val
53
+ uao_stp 9997f, \reg1, \reg2, \ptr, \val
6454 .endm
6555
6656 end .req x5
6757 srcin .req x15
68
-
69
-ENTRY(__arch_copy_in_user)
70
- uaccess_enable_not_uao x3, x4, x5
58
+SYM_FUNC_START(__arch_copy_in_user)
7159 add end, x0, x2
7260 mov srcin, x1
7361 #include "copy_template.S"
74
- uaccess_disable_not_uao x3, x4
7562 mov x0, #0
7663 ret
77
-ENDPROC(__arch_copy_in_user)
64
+SYM_FUNC_END(__arch_copy_in_user)
65
+EXPORT_SYMBOL(__arch_copy_in_user)
7866
7967 .section .fixup,"ax"
8068 .align 2
....@@ -85,6 +73,5 @@
8573 USER(9998f, sttrb tmp1w, [dst])
8674 add dst, dst, #1
8775 9998: sub x0, end, dst // bytes not copied
88
- uaccess_disable_not_uao x3, x4
8976 ret
9077 .previous