page.S 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * linux/arch/m32r/mm/page.S
  3. *
  4. * Clear/Copy page with CPU
  5. *
  6. * Copyright (C) 2004 The Free Software Initiative of Japan
  7. *
  8. * Written by Niibe Yutaka
  9. *
  10. * This file is subject to the terms and conditions of the GNU General Public
  11. * License. See the file "COPYING" in the main directory of this archive
  12. * for more details.
  13. *
  14. */
  15. .text
  16. .global copy_page
  17. /*
  18. * copy_page (to, from)
  19. *
  20. * PAGE_SIZE = 4096-byte
  21. * Cache line = 16-byte
  22. * 16 * 256
  23. */
  24. .align 4
  25. copy_page:
  26. ldi r2, #255
  27. ld r3, @r0 /* cache line allocate */
  28. ld r4, @r1+
  29. ld r5, @r1+
  30. ld r6, @r1+
  31. ld r7, @r1+
  32. .fillinsn
  33. 0:
  34. st r4, @r0
  35. st r5, @+r0
  36. st r6, @+r0
  37. st r7, @+r0
  38. ld r4, @r1+
  39. addi r0, #4
  40. ld r5, @r1+
  41. ld r6, @r1+
  42. ld r7, @r1+
  43. ld r3, @r0 /* cache line allocate */
  44. addi r2, #-1
  45. bnez r2, 0b
  46. st r4, @r0
  47. st r5, @+r0
  48. st r6, @+r0
  49. st r7, @+r0
  50. jmp r14
  51. .text
  52. .global clear_page
  53. /*
  54. * clear_page (to)
  55. *
  56. * PAGE_SIZE = 4096-byte
  57. * Cache line = 16-byte
  58. * 16 * 256
  59. */
  60. .align 4
  61. clear_page:
  62. ldi r2, #255
  63. ldi r4, #0
  64. ld r3, @r0 /* cache line allocate */
  65. .fillinsn
  66. 0:
  67. st r4, @r0
  68. st r4, @+r0
  69. st r4, @+r0
  70. st r4, @+r0
  71. addi r0, #4
  72. ld r3, @r0 /* cache line allocate */
  73. addi r2, #-1
  74. bnez r2, 0b
  75. st r4, @r0
  76. st r4, @+r0
  77. st r4, @+r0
  78. st r4, @+r0
  79. jmp r14