.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * Copy from user space to user space |
---|
3 | 4 | * |
---|
4 | 5 | * 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/>. |
---|
17 | 6 | */ |
---|
18 | 7 | |
---|
19 | 8 | #include <linux/linkage.h> |
---|
20 | 9 | |
---|
21 | | -#include <asm/cache.h> |
---|
22 | 10 | #include <asm/asm-uaccess.h> |
---|
| 11 | +#include <asm/assembler.h> |
---|
| 12 | +#include <asm/cache.h> |
---|
23 | 13 | |
---|
24 | 14 | /* |
---|
25 | 15 | * Copy from user space to user space (alignment handled by the hardware) |
---|
.. | .. |
---|
31 | 21 | * Returns: |
---|
32 | 22 | * x0 - bytes not copied |
---|
33 | 23 | */ |
---|
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 |
---|
36 | 26 | .endm |
---|
37 | 27 | |
---|
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 |
---|
40 | 30 | .endm |
---|
41 | 31 | |
---|
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 |
---|
44 | 34 | .endm |
---|
45 | 35 | |
---|
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 |
---|
48 | 38 | .endm |
---|
49 | 39 | |
---|
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 |
---|
52 | 42 | .endm |
---|
53 | 43 | |
---|
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 |
---|
56 | 46 | .endm |
---|
57 | 47 | |
---|
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 |
---|
60 | 50 | .endm |
---|
61 | 51 | |
---|
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 |
---|
64 | 54 | .endm |
---|
65 | 55 | |
---|
66 | 56 | end .req x5 |
---|
67 | 57 | 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) |
---|
71 | 59 | add end, x0, x2 |
---|
72 | 60 | mov srcin, x1 |
---|
73 | 61 | #include "copy_template.S" |
---|
74 | | - uaccess_disable_not_uao x3, x4 |
---|
75 | 62 | mov x0, #0 |
---|
76 | 63 | ret |
---|
77 | | -ENDPROC(__arch_copy_in_user) |
---|
| 64 | +SYM_FUNC_END(__arch_copy_in_user) |
---|
| 65 | +EXPORT_SYMBOL(__arch_copy_in_user) |
---|
78 | 66 | |
---|
79 | 67 | .section .fixup,"ax" |
---|
80 | 68 | .align 2 |
---|
.. | .. |
---|
85 | 73 | USER(9998f, sttrb tmp1w, [dst]) |
---|
86 | 74 | add dst, dst, #1 |
---|
87 | 75 | 9998: sub x0, end, dst // bytes not copied |
---|
88 | | - uaccess_disable_not_uao x3, x4 |
---|
89 | 76 | ret |
---|
90 | 77 | .previous |
---|