blob: d79f48994dbb2c5564b6387dad106839e9b24796 [file] [log] [blame]
Thomas Gleixnercaab2772019-06-03 07:44:50 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Catalin Marinas4a899222013-03-21 16:16:43 +00002/*
3 * Copyright (C) 2013 ARM Ltd.
zhichang.yuan808dbac2014-04-28 06:11:29 +01004 * Copyright (C) 2013 Linaro.
5 *
6 * This code is based on glibc cortex strings work originally authored by Linaro
zhichang.yuan808dbac2014-04-28 06:11:29 +01007 * be found @
8 *
9 * http://bazaar.launchpad.net/~linaro-toolchain-dev/cortex-strings/trunk/
10 * files/head:/src/aarch64/
Catalin Marinas4a899222013-03-21 16:16:43 +000011 */
12
13#include <linux/linkage.h>
14#include <asm/assembler.h>
zhichang.yuan808dbac2014-04-28 06:11:29 +010015#include <asm/cache.h>
Catalin Marinas4a899222013-03-21 16:16:43 +000016
17/*
18 * Copy a buffer from src to dest (alignment handled by the hardware)
19 *
20 * Parameters:
21 * x0 - dest
22 * x1 - src
23 * x2 - n
24 * Returns:
25 * x0 - dest
26 */
Feng Kane5c88e32015-09-23 11:55:38 -070027 .macro ldrb1 ptr, regB, val
28 ldrb \ptr, [\regB], \val
29 .endm
zhichang.yuan808dbac2014-04-28 06:11:29 +010030
Feng Kane5c88e32015-09-23 11:55:38 -070031 .macro strb1 ptr, regB, val
32 strb \ptr, [\regB], \val
33 .endm
34
35 .macro ldrh1 ptr, regB, val
36 ldrh \ptr, [\regB], \val
37 .endm
38
39 .macro strh1 ptr, regB, val
40 strh \ptr, [\regB], \val
41 .endm
42
43 .macro ldr1 ptr, regB, val
44 ldr \ptr, [\regB], \val
45 .endm
46
47 .macro str1 ptr, regB, val
48 str \ptr, [\regB], \val
49 .endm
50
51 .macro ldp1 ptr, regB, regC, val
52 ldp \ptr, \regB, [\regC], \val
53 .endm
54
55 .macro stp1 ptr, regB, regC, val
56 stp \ptr, \regB, [\regC], \val
57 .endm
zhichang.yuan808dbac2014-04-28 06:11:29 +010058
Andrey Ryabinin39d114d2015-10-12 18:52:58 +030059 .weak memcpy
60ENTRY(__memcpy)
Catalin Marinas4a899222013-03-21 16:16:43 +000061ENTRY(memcpy)
Feng Kane5c88e32015-09-23 11:55:38 -070062#include "copy_template.S"
zhichang.yuan808dbac2014-04-28 06:11:29 +010063 ret
Ard Biesheuvel20791842015-10-08 20:02:03 +010064ENDPIPROC(memcpy)
Mark Rutlandac0e8c72018-12-07 18:08:21 +000065EXPORT_SYMBOL(memcpy)
Andrey Ryabinin39d114d2015-10-12 18:52:58 +030066ENDPROC(__memcpy)
Mark Rutlandac0e8c72018-12-07 18:08:21 +000067EXPORT_SYMBOL(__memcpy)