copypage_64.S 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. * Copyright (C) 2008 Mark Nelson, IBM Corp.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version
  7. * 2 of the License, or (at your option) any later version.
  8. */
  9. #include <asm/processor.h>
  10. #include <asm/ppc_asm.h>
  11. #include <asm/asm-offsets.h>
  12. .section ".toc","aw"
  13. PPC64_CACHES:
  14. .tc ppc64_caches[TC],ppc64_caches
  15. .section ".text"
  16. _GLOBAL(copy_4K_page)
  17. li r5,4096 /* 4K page size */
  18. BEGIN_FTR_SECTION
  19. ld r10,PPC64_CACHES@toc(r2)
  20. lwz r11,DCACHEL1LOGLINESIZE(r10) /* log2 of cache line size */
  21. lwz r12,DCACHEL1LINESIZE(r10) /* get cache line size */
  22. li r9,0
  23. srd r8,r5,r11
  24. mtctr r8
  25. setup:
  26. dcbt r9,r4
  27. dcbz r9,r3
  28. add r9,r9,r12
  29. bdnz setup
  30. END_FTR_SECTION_IFSET(CPU_FTR_CP_USE_DCBTZ)
  31. addi r3,r3,-8
  32. srdi r8,r5,7 /* page is copied in 128 byte strides */
  33. addi r8,r8,-1 /* one stride copied outside loop */
  34. mtctr r8
  35. ld r5,0(r4)
  36. ld r6,8(r4)
  37. ld r7,16(r4)
  38. ldu r8,24(r4)
  39. 1: std r5,8(r3)
  40. ld r9,8(r4)
  41. std r6,16(r3)
  42. ld r10,16(r4)
  43. std r7,24(r3)
  44. ld r11,24(r4)
  45. std r8,32(r3)
  46. ld r12,32(r4)
  47. std r9,40(r3)
  48. ld r5,40(r4)
  49. std r10,48(r3)
  50. ld r6,48(r4)
  51. std r11,56(r3)
  52. ld r7,56(r4)
  53. std r12,64(r3)
  54. ld r8,64(r4)
  55. std r5,72(r3)
  56. ld r9,72(r4)
  57. std r6,80(r3)
  58. ld r10,80(r4)
  59. std r7,88(r3)
  60. ld r11,88(r4)
  61. std r8,96(r3)
  62. ld r12,96(r4)
  63. std r9,104(r3)
  64. ld r5,104(r4)
  65. std r10,112(r3)
  66. ld r6,112(r4)
  67. std r11,120(r3)
  68. ld r7,120(r4)
  69. stdu r12,128(r3)
  70. ldu r8,128(r4)
  71. bdnz 1b
  72. std r5,8(r3)
  73. ld r9,8(r4)
  74. std r6,16(r3)
  75. ld r10,16(r4)
  76. std r7,24(r3)
  77. ld r11,24(r4)
  78. std r8,32(r3)
  79. ld r12,32(r4)
  80. std r9,40(r3)
  81. ld r5,40(r4)
  82. std r10,48(r3)
  83. ld r6,48(r4)
  84. std r11,56(r3)
  85. ld r7,56(r4)
  86. std r12,64(r3)
  87. ld r8,64(r4)
  88. std r5,72(r3)
  89. ld r9,72(r4)
  90. std r6,80(r3)
  91. ld r10,80(r4)
  92. std r7,88(r3)
  93. ld r11,88(r4)
  94. std r8,96(r3)
  95. ld r12,96(r4)
  96. std r9,104(r3)
  97. std r10,112(r3)
  98. std r11,120(r3)
  99. std r12,128(r3)
  100. blr