copy_page.S 748 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // SPDX-License-Identifier: GPL-2.0
  2. // Copyright (C) 2005-2017 Andes Technology Corporation
  3. #include <linux/linkage.h>
  4. #include <asm/export.h>
  5. #include <asm/page.h>
  6. .text
  7. ENTRY(copy_page)
  8. pushm $r2, $r10
  9. movi $r2, PAGE_SIZE >> 5
  10. .Lcopy_loop:
  11. lmw.bim $r3, [$r1], $r10
  12. smw.bim $r3, [$r0], $r10
  13. subi45 $r2, #1
  14. bnez38 $r2, .Lcopy_loop
  15. popm $r2, $r10
  16. ret
  17. ENDPROC(copy_page)
  18. EXPORT_SYMBOL(copy_page)
  19. ENTRY(clear_page)
  20. pushm $r1, $r9
  21. movi $r1, PAGE_SIZE >> 5
  22. movi55 $r2, #0
  23. movi55 $r3, #0
  24. movi55 $r4, #0
  25. movi55 $r5, #0
  26. movi55 $r6, #0
  27. movi55 $r7, #0
  28. movi55 $r8, #0
  29. movi55 $r9, #0
  30. .Lclear_loop:
  31. smw.bim $r2, [$r0], $r9
  32. subi45 $r1, #1
  33. bnez38 $r1, .Lclear_loop
  34. popm $r1, $r9
  35. ret
  36. ENDPROC(clear_page)
  37. EXPORT_SYMBOL(clear_page)