memcpy.S 1.3 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 15
#include <linux/linkage.h>
#include <asm/assembler.h>

16 17 18
#define LDR1W_SHIFT	0
#define STR1W_SHIFT	0

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

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

27 28 29
	.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 已提交
30

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

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

39 40 41
	.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 已提交
42

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

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

51 52 53
	.macro exit reg1 reg2
	ldmfd sp!, {r0, \reg1, \reg2}
	.endm
L
Linus Torvalds 已提交
54

55
	.text
L
Linus Torvalds 已提交
56

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

59
ENTRY(memcpy)
L
Linus Torvalds 已提交
60

61
#include "copy_template.S"
L
Linus Torvalds 已提交
62

63
ENDPROC(memcpy)