Commit | Line | Data |
---|---|---|
4a899227 CM |
1 | /* |
2 | * Copyright (C) 2013 ARM Ltd. | |
808dbac6 | 3 | * Copyright (C) 2013 Linaro. |
4 | * | |
5 | * This code is based on glibc cortex strings work originally authored by Linaro | |
6 | * and re-licensed under GPLv2 for the Linux kernel. The original code can | |
7 | * be found @ | |
8 | * | |
9 | * http://bazaar.launchpad.net/~linaro-toolchain-dev/cortex-strings/trunk/ | |
10 | * files/head:/src/aarch64/ | |
4a899227 CM |
11 | * |
12 | * This program is free software; you can redistribute it and/or modify | |
13 | * it under the terms of the GNU General Public License version 2 as | |
14 | * published by the Free Software Foundation. | |
15 | * | |
16 | * This program is distributed in the hope that it will be useful, | |
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 | * GNU General Public License for more details. | |
20 | * | |
21 | * You should have received a copy of the GNU General Public License | |
22 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
23 | */ | |
24 | ||
25 | #include <linux/linkage.h> | |
26 | #include <asm/assembler.h> | |
808dbac6 | 27 | #include <asm/cache.h> |
4a899227 CM |
28 | |
29 | /* | |
30 | * Copy a buffer from src to dest (alignment handled by the hardware) | |
31 | * | |
32 | * Parameters: | |
33 | * x0 - dest | |
34 | * x1 - src | |
35 | * x2 - n | |
36 | * Returns: | |
37 | * x0 - dest | |
38 | */ | |
e5c88e3f FK |
39 | .macro ldrb1 ptr, regB, val |
40 | ldrb \ptr, [\regB], \val | |
41 | .endm | |
808dbac6 | 42 | |
e5c88e3f FK |
43 | .macro strb1 ptr, regB, val |
44 | strb \ptr, [\regB], \val | |
45 | .endm | |
808dbac6 | 46 | |
e5c88e3f FK |
47 | .macro ldrh1 ptr, regB, val |
48 | ldrh \ptr, [\regB], \val | |
49 | .endm | |
808dbac6 | 50 | |
e5c88e3f FK |
51 | .macro strh1 ptr, regB, val |
52 | strh \ptr, [\regB], \val | |
53 | .endm | |
808dbac6 | 54 | |
e5c88e3f FK |
55 | .macro ldr1 ptr, regB, val |
56 | ldr \ptr, [\regB], \val | |
57 | .endm | |
808dbac6 | 58 | |
e5c88e3f FK |
59 | .macro str1 ptr, regB, val |
60 | str \ptr, [\regB], \val | |
61 | .endm | |
808dbac6 | 62 | |
e5c88e3f FK |
63 | .macro ldp1 ptr, regB, regC, val |
64 | ldp \ptr, \regB, [\regC], \val | |
65 | .endm | |
808dbac6 | 66 | |
e5c88e3f FK |
67 | .macro stp1 ptr, regB, regC, val |
68 | stp \ptr, \regB, [\regC], \val | |
69 | .endm | |
808dbac6 | 70 | |
39d114dd AR |
71 | .weak memcpy |
72 | ENTRY(__memcpy) | |
e5c88e3f FK |
73 | ENTRY(memcpy) |
74 | #include "copy_template.S" | |
808dbac6 | 75 | ret |
20791846 | 76 | ENDPIPROC(memcpy) |
39d114dd | 77 | ENDPROC(__memcpy) |