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