1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2013 ARM Ltd.
4 * Copyright (C) 2013 Linaro.
6 * This code is based on glibc cortex strings work originally authored by Linaro
9 * http://bazaar.launchpad.net/~linaro-toolchain-dev/cortex-strings/trunk/
10 * files/head:/src/aarch64/
13 #include <linux/linkage.h>
14 #include <asm/assembler.h>
15 #include <asm/cache.h>
18 * Copy a buffer from src to dest (alignment handled by the hardware)
27 .macro ldrb1 reg, ptr, val
28 ldrb \reg, [\ptr], \val
31 .macro strb1 reg, ptr, val
32 strb \reg, [\ptr], \val
35 .macro ldrh1 reg, ptr, val
36 ldrh \reg, [\ptr], \val
39 .macro strh1 reg, ptr, val
40 strh \reg, [\ptr], \val
43 .macro ldr1 reg, ptr, val
44 ldr \reg, [\ptr], \val
47 .macro str1 reg, ptr, val
48 str \reg, [\ptr], \val
51 .macro ldp1 reg1, reg2, ptr, val
52 ldp \reg1, \reg2, [\ptr], \val
55 .macro stp1 reg1, reg2, ptr, val
56 stp \reg1, \reg2, [\ptr], \val
60 SYM_FUNC_START_ALIAS(__memcpy)
61 SYM_FUNC_START_PI(memcpy)
62 #include "copy_template.S"
64 SYM_FUNC_END_PI(memcpy)
66 SYM_FUNC_END_ALIAS(__memcpy)
67 EXPORT_SYMBOL(__memcpy)