cache-v3.S 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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_icache_all()
  16. *
  17. * Unconditionally clean and invalidate the entire icache.
  18. */
  19. ENTRY(v3_flush_icache_all)
  20. mov pc, lr
  21. ENDPROC(v3_flush_icache_all)
  22. /*
  23. * flush_user_cache_all()
  24. *
  25. * Invalidate all cache entries in a particular address
  26. * space.
  27. *
  28. * - mm - mm_struct describing address space
  29. */
  30. ENTRY(v3_flush_user_cache_all)
  31. /* FALLTHROUGH */
  32. /*
  33. * flush_kern_cache_all()
  34. *
  35. * Clean and invalidate the entire cache.
  36. */
  37. ENTRY(v3_flush_kern_cache_all)
  38. /* FALLTHROUGH */
  39. /*
  40. * flush_user_cache_range(start, end, flags)
  41. *
  42. * Invalidate a range of cache entries in the specified
  43. * address space.
  44. *
  45. * - start - start address (may not be aligned)
  46. * - end - end address (exclusive, may not be aligned)
  47. * - flags - vma_area_struct flags describing address space
  48. */
  49. ENTRY(v3_flush_user_cache_range)
  50. mov ip, #0
  51. mcreq p15, 0, ip, c7, c0, 0 @ flush ID cache
  52. mov pc, lr
  53. /*
  54. * coherent_kern_range(start, end)
  55. *
  56. * Ensure coherency between the Icache and the Dcache in the
  57. * region described by start. If you have non-snooping
  58. * Harvard caches, you need to implement this function.
  59. *
  60. * - start - virtual start address
  61. * - end - virtual end address
  62. */
  63. ENTRY(v3_coherent_kern_range)
  64. /* FALLTHROUGH */
  65. /*
  66. * coherent_user_range(start, end)
  67. *
  68. * Ensure coherency between the Icache and the Dcache in the
  69. * region described by start. If you have non-snooping
  70. * Harvard caches, you need to implement this function.
  71. *
  72. * - start - virtual start address
  73. * - end - virtual end address
  74. */
  75. ENTRY(v3_coherent_user_range)
  76. mov pc, lr
  77. /*
  78. * flush_kern_dcache_area(void *page, size_t size)
  79. *
  80. * Ensure no D cache aliasing occurs, either with itself or
  81. * the I cache
  82. *
  83. * - addr - kernel address
  84. * - size - region size
  85. */
  86. ENTRY(v3_flush_kern_dcache_area)
  87. /* FALLTHROUGH */
  88. /*
  89. * dma_flush_range(start, end)
  90. *
  91. * Clean and invalidate the specified virtual address range.
  92. *
  93. * - start - virtual start address
  94. * - end - virtual end address
  95. */
  96. ENTRY(v3_dma_flush_range)
  97. mov r0, #0
  98. mcr p15, 0, r0, c7, c0, 0 @ flush ID cache
  99. mov pc, lr
  100. /*
  101. * dma_unmap_area(start, size, dir)
  102. * - start - kernel virtual start address
  103. * - size - size of region
  104. * - dir - DMA direction
  105. */
  106. ENTRY(v3_dma_unmap_area)
  107. teq r2, #DMA_TO_DEVICE
  108. bne v3_dma_flush_range
  109. /* FALLTHROUGH */
  110. /*
  111. * dma_map_area(start, size, dir)
  112. * - start - kernel virtual start address
  113. * - size - size of region
  114. * - dir - DMA direction
  115. */
  116. ENTRY(v3_dma_map_area)
  117. mov pc, lr
  118. ENDPROC(v3_dma_unmap_area)
  119. ENDPROC(v3_dma_map_area)
  120. .globl v3_flush_kern_cache_louis
  121. .equ v3_flush_kern_cache_louis, v3_flush_kern_cache_all
  122. __INITDATA
  123. @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
  124. define_cache_functions v3