memcpy.S 1.4 KB
Newer Older
L
Linus Torvalds 已提交
1 2 3
/*
 *  linux/arch/arm/lib/memcpy.S
 *
4 5 6
 *  Author:	Nicolas Pitre
 *  Created:	Sep 28, 2005
 *  Copyright:	MontaVista Software, Inc.
L
Linus Torvalds 已提交
7
 *
8 9 10
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License version 2 as
 *  published by the Free Software Foundation.
L
Linus Torvalds 已提交
11
 */
12

L
Linus Torvalds 已提交
13 14
#include <linux/linkage.h>
#include <asm/assembler.h>
15
#include <asm/unwind.h>
L
Linus Torvalds 已提交
16

17 18 19
#define LDR1W_SHIFT	0
#define STR1W_SHIFT	0

20
	.macro ldr1w ptr reg abort
21
	W(ldr) \reg, [\ptr], #4
22
	.endm
L
Linus Torvalds 已提交
23

24 25 26
	.macro ldr4w ptr reg1 reg2 reg3 reg4 abort
	ldmia \ptr!, {\reg1, \reg2, \reg3, \reg4}
	.endm
L
Linus Torvalds 已提交
27

28 29 30
	.macro ldr8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
	ldmia \ptr!, {\reg1, \reg2, \reg3, \reg4, \reg5, \reg6, \reg7, \reg8}
	.endm
L
Linus Torvalds 已提交
31

32 33 34
	.macro ldr1b ptr reg cond=al abort
	ldr\cond\()b \reg, [\ptr], #1
	.endm
L
Linus Torvalds 已提交
35

36
	.macro str1w ptr reg abort
37
	W(str) \reg, [\ptr], #4
38
	.endm
L
Linus Torvalds 已提交
39

40 41 42
	.macro str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
	stmia \ptr!, {\reg1, \reg2, \reg3, \reg4, \reg5, \reg6, \reg7, \reg8}
	.endm
L
Linus Torvalds 已提交
43

44 45 46
	.macro str1b ptr reg cond=al abort
	str\cond\()b \reg, [\ptr], #1
	.endm
L
Linus Torvalds 已提交
47

48 49 50
	.macro enter reg1 reg2
	stmdb sp!, {r0, \reg1, \reg2}
	.endm
L
Linus Torvalds 已提交
51

52 53 54 55
	.macro usave reg1 reg2
	UNWIND(	.save	{r0, \reg1, \reg2}	)
	.endm

56 57 58
	.macro exit reg1 reg2
	ldmfd sp!, {r0, \reg1, \reg2}
	.endm
L
Linus Torvalds 已提交
59

60
	.text
L
Linus Torvalds 已提交
61

62
/* Prototype: void *memcpy(void *dest, const void *src, size_t n); */
L
Linus Torvalds 已提交
63

64
ENTRY(mmiocpy)
65
ENTRY(memcpy)
L
Linus Torvalds 已提交
66

67
#include "copy_template.S"
L
Linus Torvalds 已提交
68

69
ENDPROC(memcpy)
70
ENDPROC(mmiocpy)