Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

277 lines
5.8 KiB

  1. // TITLE("Flush Translation Buffers")
  2. //++
  3. //
  4. // Copyright (c) 1992 Digital Equipment Corporation
  5. //
  6. // Module Name:
  7. //
  8. // tb.s
  9. //
  10. // Abstract:
  11. //
  12. // This module implements the code to flush the tbs on the current
  13. // processor.
  14. //
  15. // Author:
  16. //
  17. // Joe Notarangelo 21-apr-1992
  18. //
  19. // Environment:
  20. //
  21. // Kernel mode only.
  22. //
  23. // Revision History:
  24. //
  25. //--
  26. #include "ksalpha.h"
  27. SBTTL("Flush All Translation Buffers")
  28. //++
  29. //
  30. // VOID
  31. // KiFlushEntireTb(
  32. // )
  33. //
  34. // Routine Description:
  35. //
  36. // This function flushes the data and instruction tbs on the current
  37. // processor. All entries are flushed with the exception of any entries
  38. // that are fixed in the tb (either in hdw or via sfw).
  39. //
  40. // Arguments:
  41. //
  42. // None.
  43. //
  44. // Return Value:
  45. //
  46. // None.
  47. //
  48. //--
  49. LEAF_ENTRY(KiFlushEntireTb)
  50. TB_INVALIDATE_ALL // invalidate all tb entries
  51. ret zero, (ra) // return
  52. .end KiFlushEntireTb
  53. SBTTL("Flush All Translation Buffers")
  54. //++
  55. //
  56. // VOID
  57. // KeFlushCurrentTb(
  58. // )
  59. //
  60. // Routine Description:
  61. //
  62. // This function flushes the data and instruction tbs on the current
  63. // processor. All entries are flushed with the exception of any entries
  64. // that are fixed in the tb (either in hdw or via sfw).
  65. //
  66. // Arguments:
  67. //
  68. // None.
  69. //
  70. // Return Value:
  71. //
  72. // None.
  73. //
  74. //--
  75. LEAF_ENTRY(KeFlushCurrentTb)
  76. TB_INVALIDATE_ALL // invalidate all tb entries
  77. ret zero, (ra) // return
  78. .end KeFlushCurrentTb
  79. SBTTL("Flush Single 32-bit Translation Buffer")
  80. //++
  81. //
  82. // VOID
  83. // KiFlushSingleTb
  84. // IN BOOLEAN Invalid,
  85. // IN PVOID Virtual
  86. //
  87. // Routine Description:
  88. //
  89. // This function flushes a single entry from both the instruction
  90. // and data translation buffers. Note: it may flush more that just
  91. // the single entry.
  92. //
  93. // Arguments:
  94. //
  95. // Invalid (a0) - Supplies a boolean variable that determines the reason that
  96. // that the TB entry is being flushed.
  97. //
  98. // Virtual (a1) - Supplies the virtual address of the entry that is to be
  99. // flushed from the buffers.
  100. //
  101. // Return Value:
  102. //
  103. // None.
  104. //
  105. //--
  106. LEAF_ENTRY(KiFlushSingleTb)
  107. bis a1, zero, a0 // set virtual address to flush
  108. TB_INVALIDATE_SINGLE // flush va(a0) from tbs
  109. ret zero, (ra) // return
  110. .end KiFlushSingleTb
  111. SBTTL("Flush Single 64-bit Translation Buffer")
  112. //++
  113. //
  114. // VOID
  115. // KiFlushSingleTb64
  116. // IN BOOLEAN Invalid,
  117. // IN PVOID Virtual
  118. //
  119. // Routine Description:
  120. //
  121. // This function flushes a single entry from both the instruction
  122. // and data translation buffers. Note: it may flush more that just
  123. // the single entry.
  124. //
  125. // Arguments:
  126. //
  127. // Invalid (a0) - Supplies a boolean variable that determines the reason that
  128. // that the TB entry is being flushed.
  129. //
  130. // Virtual (a1) - Supplies the virtual page number of the entry that is to be
  131. // flushed from the buffers.
  132. //
  133. // Return Value:
  134. //
  135. // None.
  136. //
  137. //--
  138. LEAF_ENTRY(KiFlushSingleTb64)
  139. bis a1, zero, a0 // a0 = va to flush
  140. TB_INVALIDATE_SINGLE64 // flush va(a0) from tbs
  141. ret zero, (ra) // return
  142. .end KiFlushSingleTb64
  143. SBTTL("Flush Multiple 32-bit Translation Buffer")
  144. //++
  145. //
  146. // VOID
  147. // KiFlushMultipleTb (
  148. // IN BOOLEAN Invalid,
  149. // IN PVOID *Virtual,
  150. // IN ULONG Count
  151. // )
  152. //
  153. // Routine Description:
  154. //
  155. // This function flushes multiple entries from the translation buffer.
  156. //
  157. // Arguments:
  158. //
  159. // Invalid (a0) - Supplies a boolean variable that determines the reason
  160. // that the TB entry is being flushed.
  161. //
  162. // Virtual (a1) - Supplies a pointer to an array of virtual addresses of
  163. // the entries that are flushed from the translation buffer.
  164. //
  165. // Count (a2) - Supplies the number of TB entries to flush.
  166. //
  167. // Return Value:
  168. //
  169. // None.
  170. //
  171. //--
  172. LEAF_ENTRY(KiFlushMultipleTb)
  173. bis a1, zero, a0 // a0 = pointer to array
  174. bis a2, zero, a1 // a1 = count
  175. TB_INVALIDATE_MULTIPLE // invalidate the entries
  176. ret zero, (ra) // return
  177. .end KiFlushMultipleTb
  178. SBTTL("Flush Multiple 64-bit Translation Buffer")
  179. //++
  180. //
  181. // VOID
  182. // KiFlushMultipleTb64 (
  183. // IN BOOLEAN Invalid,
  184. // IN PVOID *Virtual,
  185. // IN ULONG Count
  186. // )
  187. //
  188. // Routine Description:
  189. //
  190. // This function flushes multiple entries from the translation buffer.
  191. //
  192. // Arguments:
  193. //
  194. // Invalid (a0) - Supplies a boolean variable that determines the reason
  195. // that the TB entry is being flushed.
  196. //
  197. // Virtual (a1) - Supplies a pointer to an array of virtual page numbers
  198. // for the entries that are flushed from the translation buffer.
  199. //
  200. // Count (a2) - Supplies the number of TB entries to flush.
  201. //
  202. // Return Value:
  203. //
  204. // None.
  205. //
  206. //--
  207. LEAF_ENTRY(KiFlushMultipleTb64)
  208. bis a1, zero, a0 // a0 = pointer to array
  209. bis a2, zero, a1 // a1 = count
  210. TB_INVALIDATE_MULTIPLE64 // invalidate the entries
  211. ret zero, (ra) // return
  212. .end KiFlushMultipleTb64
  213. SBTTL("Flush Single Data Translation Buffer")
  214. //++
  215. //
  216. // VOID
  217. // KiFlushSingleDataTb(
  218. // )
  219. //
  220. // Routine Description:
  221. //
  222. // This function flushes a single entry for the data tb only.
  223. //
  224. // Arguments:
  225. //
  226. // VirtualAddress(a0) - Supplies the virtual address of the entry
  227. // that is to be flushed from the data translations.
  228. //
  229. // Return Value:
  230. //
  231. // None.
  232. //
  233. //--
  234. LEAF_ENTRY(KiFlushSingleDataTb)
  235. DATA_TB_INVALIDATE_SINGLE // flush va(a0) from data tbs
  236. ret zero, (ra) // return
  237. .end KiFlushSingleDataTb
  238.