xref: /linux/arch/arm/lib/memcpy.S (revision 4413e16d9d21673bb5048a2e542f1aaa00015c2e)
1/*
2 *  linux/arch/arm/lib/memcpy.S
3 *
4 *  Author:	Nicolas Pitre
5 *  Created:	Sep 28, 2005
6 *  Copyright:	MontaVista Software, Inc.
7 *
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.
11 */
12
13#include <linux/linkage.h>
14#include <asm/assembler.h>
15
16#define LDR1W_SHIFT	0
17#define STR1W_SHIFT	0
18
19	.macro ldr1w ptr reg abort
20	W(ldr) \reg, [\ptr], #4
21	.endm
22
23	.macro ldr4w ptr reg1 reg2 reg3 reg4 abort
24	ldmia \ptr!, {\reg1, \reg2, \reg3, \reg4}
25	.endm
26
27	.macro ldr8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
28	ldmia \ptr!, {\reg1, \reg2, \reg3, \reg4, \reg5, \reg6, \reg7, \reg8}
29	.endm
30
31	.macro ldr1b ptr reg cond=al abort
32	ldr\cond\()b \reg, [\ptr], #1
33	.endm
34
35	.macro str1w ptr reg abort
36	W(str) \reg, [\ptr], #4
37	.endm
38
39	.macro str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
40	stmia \ptr!, {\reg1, \reg2, \reg3, \reg4, \reg5, \reg6, \reg7, \reg8}
41	.endm
42
43	.macro str1b ptr reg cond=al abort
44	str\cond\()b \reg, [\ptr], #1
45	.endm
46
47	.macro enter reg1 reg2
48	stmdb sp!, {r0, \reg1, \reg2}
49	.endm
50
51	.macro exit reg1 reg2
52	ldmfd sp!, {r0, \reg1, \reg2}
53	.endm
54
55	.text
56
57/* Prototype: void *memcpy(void *dest, const void *src, size_t n); */
58
59ENTRY(memcpy)
60
61#include "copy_template.S"
62
63ENDPROC(memcpy)
64