1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * linux/arch/arm/lib/memcpy.S
5 * Author: Nicolas Pitre
6 * Created: Sep 28, 2005
7 * Copyright: MontaVista Software, Inc.
10 #include <linux/linkage.h>
11 #include <asm/assembler.h>
12 #include <asm/unwind.h>
17 .macro ldr1w ptr reg abort
18 W(ldr) \reg, [\ptr], #4
21 .macro ldr4w ptr reg1 reg2 reg3 reg4 abort
22 ldmia \ptr!, {\reg1, \reg2, \reg3, \reg4}
25 .macro ldr8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
26 ldmia \ptr!, {\reg1, \reg2, \reg3, \reg4, \reg5, \reg6, \reg7, \reg8}
29 .macro ldr1b ptr reg cond=al abort
30 ldrb\cond \reg, [\ptr], #1
33 .macro str1w ptr reg abort
34 W(str) \reg, [\ptr], #4
37 .macro str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
38 stmia \ptr!, {\reg1, \reg2, \reg3, \reg4, \reg5, \reg6, \reg7, \reg8}
41 .macro str1b ptr reg cond=al abort
42 strb\cond \reg, [\ptr], #1
45 .macro enter reg1 reg2
46 stmdb sp!, {r0, \reg1, \reg2}
49 .macro usave reg1 reg2
50 UNWIND( .save {r0, \reg1, \reg2} )
54 ldmfd sp!, {r0, \reg1, \reg2}
59 /* Prototype: void *memcpy(void *dest, const void *src, size_t n); */
65 #include "copy_template.S"