copy_page.S 833 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * linux/arch/unicore32/lib/copy_page.S
  3. *
  4. * Code specific to PKUnity SoC and UniCore ISA
  5. *
  6. * Copyright (C) 2001-2010 GUAN Xue-tao
  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. * ASM optimised string functions
  13. */
  14. #include <linux/linkage.h>
  15. #include <asm/assembler.h>
  16. #include <generated/asm-offsets.h>
  17. #include <asm/cache.h>
  18. #define COPY_COUNT (PAGE_SZ/256)
  19. .text
  20. .align 5
  21. /*
  22. * UniCore optimised copy_page routine
  23. */
  24. ENTRY(copy_page)
  25. stm.w (r17 - r19, lr), [sp-]
  26. mov r17, r0
  27. mov r18, r1
  28. mov r19, #COPY_COUNT
  29. 1:
  30. .rept 4
  31. ldm.w (r0 - r15), [r18]+
  32. stm.w (r0 - r15), [r17]+
  33. .endr
  34. sub.a r19, r19, #1
  35. bne 1b
  36. ldm.w (r17 - r19, pc), [sp]+
  37. ENDPROC(copy_page)