2 * linux/arch/arm/lib/memcpy.S
4 * Author: Nicolas Pitre
5 * Created: Sep 28, 2005
6 * Copyright: MontaVista Software, Inc.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
13 #include <linux/linkage.h>
14 #include <asm/assembler.h>
15 #include <asm/unwind.h>
20 .macro ldr1w ptr reg abort
21 W(ldr) \reg, [\ptr], #4
24 .macro ldr4w ptr reg1 reg2 reg3 reg4 abort
25 ldmia \ptr!, {\reg1, \reg2, \reg3, \reg4}
28 .macro ldr8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
29 ldmia \ptr!, {\reg1, \reg2, \reg3, \reg4, \reg5, \reg6, \reg7, \reg8}
32 .macro ldr1b ptr reg cond=al abort
33 ldr\cond\()b \reg, [\ptr], #1
36 .macro str1w ptr reg abort
37 W(str) \reg, [\ptr], #4
40 .macro str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
41 stmia \ptr!, {\reg1, \reg2, \reg3, \reg4, \reg5, \reg6, \reg7, \reg8}
44 .macro str1b ptr reg cond=al abort
45 str\cond\()b \reg, [\ptr], #1
48 .macro enter reg1 reg2
49 stmdb sp!, {r0, \reg1, \reg2}
52 .macro usave reg1 reg2
53 UNWIND( .save {r0, \reg1, \reg2} )
57 ldmfd sp!, {r0, \reg1, \reg2}
62 /* Prototype: void *memcpy(void *dest, const void *src, size_t n); */
67 #include "copy_template.S"