cache-v3.S 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /*
  2. * linux/arch/arm/mm/cache-v3.S
  3. *
  4. * Copyright (C) 1997-2002 Russell king
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #include <linux/linkage.h>
  11. #include <linux/init.h>
  12. #include <asm/page.h>
  13. #include "proc-macros.S"
  14. /*
  15. * flush_user_cache_all()
  16. *
  17. * Invalidate all cache entries in a particular address
  18. * space.
  19. *
  20. * - mm - mm_struct describing address space
  21. */
  22. ENTRY(v3_flush_user_cache_all)
  23. /* FALLTHROUGH */
  24. /*
  25. * flush_kern_cache_all()
  26. *
  27. * Clean and invalidate the entire cache.
  28. */
  29. ENTRY(v3_flush_kern_cache_all)
  30. /* FALLTHROUGH */
  31. /*
  32. * flush_user_cache_range(start, end, flags)
  33. *
  34. * Invalidate a range of cache entries in the specified
  35. * address space.
  36. *
  37. * - start - start address (may not be aligned)
  38. * - end - end address (exclusive, may not be aligned)
  39. * - flags - vma_area_struct flags describing address space
  40. */
  41. ENTRY(v3_flush_user_cache_range)
  42. mov ip, #0
  43. mcreq p15, 0, ip, c7, c0, 0 @ flush ID cache
  44. mov pc, lr
  45. /*
  46. * coherent_kern_range(start, end)
  47. *
  48. * Ensure coherency between the Icache and the Dcache in the
  49. * region described by start. If you have non-snooping
  50. * Harvard caches, you need to implement this function.
  51. *
  52. * - start - virtual start address
  53. * - end - virtual end address
  54. */
  55. ENTRY(v3_coherent_kern_range)
  56. /* FALLTHROUGH */
  57. /*
  58. * coherent_user_range(start, end)
  59. *
  60. * Ensure coherency between the Icache and the Dcache in the
  61. * region described by start. If you have non-snooping
  62. * Harvard caches, you need to implement this function.
  63. *
  64. * - start - virtual start address
  65. * - end - virtual end address
  66. */
  67. ENTRY(v3_coherent_user_range)
  68. mov pc, lr
  69. /*
  70. * flush_kern_dcache_page(void *page)
  71. *
  72. * Ensure no D cache aliasing occurs, either with itself or
  73. * the I cache
  74. *
  75. * - addr - page aligned address
  76. */
  77. ENTRY(v3_flush_kern_dcache_page)
  78. /* FALLTHROUGH */
  79. /*
  80. * dma_inv_range(start, end)
  81. *
  82. * Invalidate (discard) the specified virtual address range.
  83. * May not write back any entries. If 'start' or 'end'
  84. * are not cache line aligned, those lines must be written
  85. * back.
  86. *
  87. * - start - virtual start address
  88. * - end - virtual end address
  89. */
  90. ENTRY(v3_dma_inv_range)
  91. /* FALLTHROUGH */
  92. /*
  93. * dma_flush_range(start, end)
  94. *
  95. * Clean and invalidate the specified virtual address range.
  96. *
  97. * - start - virtual start address
  98. * - end - virtual end address
  99. */
  100. ENTRY(v3_dma_flush_range)
  101. mov r0, #0
  102. mcr p15, 0, r0, c7, c0, 0 @ flush ID cache
  103. /* FALLTHROUGH */
  104. /*
  105. * dma_clean_range(start, end)
  106. *
  107. * Clean (write back) the specified virtual address range.
  108. *
  109. * - start - virtual start address
  110. * - end - virtual end address
  111. */
  112. ENTRY(v3_dma_clean_range)
  113. mov pc, lr
  114. __INITDATA
  115. .type v3_cache_fns, #object
  116. ENTRY(v3_cache_fns)
  117. .long v3_flush_kern_cache_all
  118. .long v3_flush_user_cache_all
  119. .long v3_flush_user_cache_range
  120. .long v3_coherent_kern_range
  121. .long v3_coherent_user_range
  122. .long v3_flush_kern_dcache_page
  123. .long v3_dma_inv_range
  124. .long v3_dma_clean_range
  125. .long v3_dma_flush_range
  126. .size v3_cache_fns, . - v3_cache_fns