memcpy.S 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. #include <linux/linkage.h>
  13. #include <asm/assembler.h>
  14. #define LDR1W_SHIFT 0
  15. #define STR1W_SHIFT 0
  16. .macro ldr1w ptr reg abort
  17. W(ldr) \reg, [\ptr], #4
  18. .endm
  19. .macro ldr4w ptr reg1 reg2 reg3 reg4 abort
  20. ldmia \ptr!, {\reg1, \reg2, \reg3, \reg4}
  21. .endm
  22. .macro ldr8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
  23. ldmia \ptr!, {\reg1, \reg2, \reg3, \reg4, \reg5, \reg6, \reg7, \reg8}
  24. .endm
  25. .macro ldr1b ptr reg cond=al abort
  26. ldr\cond\()b \reg, [\ptr], #1
  27. .endm
  28. .macro str1w ptr reg abort
  29. W(str) \reg, [\ptr], #4
  30. .endm
  31. .macro str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
  32. stmia \ptr!, {\reg1, \reg2, \reg3, \reg4, \reg5, \reg6, \reg7, \reg8}
  33. .endm
  34. .macro str1b ptr reg cond=al abort
  35. str\cond\()b \reg, [\ptr], #1
  36. .endm
  37. .macro enter reg1 reg2
  38. stmdb sp!, {r0, \reg1, \reg2}
  39. .endm
  40. .macro exit reg1 reg2
  41. ldmfd sp!, {r0, \reg1, \reg2}
  42. .endm
  43. .text
  44. /* Prototype: void *memcpy(void *dest, const void *src, size_t n); */
  45. ENTRY(memcpy)
  46. #include "copy_template.S"
  47. ENDPROC(memcpy)