memcpy.S 1.4 KB

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