1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copy from user space to user space
5 * Copyright (C) 2012 ARM Ltd.
8 #include <linux/linkage.h>
10 #include <asm/asm-uaccess.h>
11 #include <asm/assembler.h>
12 #include <asm/cache.h>
15 * Copy from user space to user space (alignment handled by the hardware)
22 * x0 - bytes not copied
24 .macro ldrb1 ptr, regB, val
25 uao_user_alternative 9998f, ldrb, ldtrb, \ptr, \regB, \val
28 .macro strb1 ptr, regB, val
29 uao_user_alternative 9998f, strb, sttrb, \ptr, \regB, \val
32 .macro ldrh1 ptr, regB, val
33 uao_user_alternative 9998f, ldrh, ldtrh, \ptr, \regB, \val
36 .macro strh1 ptr, regB, val
37 uao_user_alternative 9998f, strh, sttrh, \ptr, \regB, \val
40 .macro ldr1 ptr, regB, val
41 uao_user_alternative 9998f, ldr, ldtr, \ptr, \regB, \val
44 .macro str1 ptr, regB, val
45 uao_user_alternative 9998f, str, sttr, \ptr, \regB, \val
48 .macro ldp1 ptr, regB, regC, val
49 uao_ldp 9998f, \ptr, \regB, \regC, \val
52 .macro stp1 ptr, regB, regC, val
53 uao_stp 9998f, \ptr, \regB, \regC, \val
58 ENTRY(__arch_copy_in_user)
59 uaccess_enable_not_uao x3, x4, x5
61 #include "copy_template.S"
62 uaccess_disable_not_uao x3, x4
65 ENDPROC(__arch_copy_in_user)
66 EXPORT_SYMBOL(__arch_copy_in_user)
70 9998: sub x0, end, dst // bytes not copied