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
	.macro ldr1w ptr reg abort
	ldr \reg, [\ptr], #4
	.endm
L
Linus Torvalds 已提交
19

20 21 22
	.macro ldr4w ptr reg1 reg2 reg3 reg4 abort
	ldmia \ptr!, {\reg1, \reg2, \reg3, \reg4}
	.endm
L
Linus Torvalds 已提交
23

24 25 26
	.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 已提交
27

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

32 33 34
	.macro str1w ptr reg abort
	str \reg, [\ptr], #4
	.endm
L
Linus Torvalds 已提交
35

36 37 38
	.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 已提交
39

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

44 45 46
	.macro enter reg1 reg2
	stmdb sp!, {r0, \reg1, \reg2}
	.endm
L
Linus Torvalds 已提交
47

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

52
	.text
L
Linus Torvalds 已提交
53

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

56
ENTRY(memcpy)
L
Linus Torvalds 已提交
57

58
#include "copy_template.S"
L
Linus Torvalds 已提交
59

60
ENDPROC(memcpy)