Leaked source code of windows server 2003
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.

305 lines
7.7 KiB

  1. // TITLE("High Frequency Spin Locks")
  2. //++
  3. //
  4. // Module Name:
  5. //
  6. // hifreqlk.s
  7. //
  8. // Abstract:
  9. //
  10. // This module contains storage for high frequency spin locks. Each
  11. // is allocated to a separate cache line.
  12. //
  13. // Author:
  14. //
  15. // William K. Cheung (wcheung) 29-Sep-1995
  16. //
  17. // based on David N. Cutler (davec) 25-Jun-1993
  18. //
  19. // Environment:
  20. //
  21. // Kernel mode.
  22. //
  23. // Revision History:
  24. //
  25. //--
  26. #include "ksia64.h"
  27. #if defined(NT_UP)
  28. #define ALIGN .##align 8
  29. #define ALIGN_SLIST .##align 16
  30. #else
  31. #define ALIGN .##align 128
  32. #define ALIGN_SLIST ALIGN
  33. #endif
  34. #define SPIN_LOCK data8 0
  35. .sdata
  36. ALIGN
  37. SPIN_LOCK
  38. .global AfdWorkQueueSpinLock
  39. ALIGN
  40. AfdWorkQueueSpinLock: // AFD work queue lock
  41. SPIN_LOCK
  42. .global CcBcbSpinLock
  43. ALIGN
  44. CcBcbSpinLock: // cache manager BCB lock
  45. SPIN_LOCK
  46. .global CcMasterSpinLock
  47. ALIGN
  48. CcMasterSpinLock: // cache manager master lock
  49. SPIN_LOCK
  50. .global CcVacbSpinLock
  51. ALIGN
  52. CcVacbSpinLock: // cache manager VACB lock
  53. SPIN_LOCK
  54. .global ExpResourceSpinLock
  55. ALIGN
  56. ExpResourceSpinLock: // resource package lock
  57. SPIN_LOCK
  58. .global IopCancelSpinLock
  59. ALIGN
  60. IopCancelSpinLock: // I/O cancel lock
  61. SPIN_LOCK
  62. .global IopCompletionLock
  63. ALIGN
  64. IopCompletionLock: // I/O completion lock
  65. SPIN_LOCK
  66. .global IopDatabaseLock
  67. ALIGN
  68. IopDatabaseLock: // I/O database lock
  69. SPIN_LOCK
  70. .global IopVpbSpinLock
  71. ALIGN
  72. IopVpbSpinLock: // I/O VPB lock
  73. SPIN_LOCK
  74. .global IoStatisticsLock
  75. ALIGN
  76. IoStatisticsLock: // I/O statistics lock
  77. SPIN_LOCK
  78. .global KiDispatcherLock
  79. ALIGN
  80. KiDispatcherLock: // dispatcher database lock
  81. SPIN_LOCK
  82. .global MmPfnLock
  83. ALIGN
  84. MmPfnLock: // page frame database lock
  85. SPIN_LOCK
  86. .global NonPagedPoolLock
  87. ALIGN
  88. NonPagedPoolLock: // nonpage pool allocation lock
  89. SPIN_LOCK
  90. .global MmNonPagedPoolLock
  91. ALIGN
  92. MmNonPagedPoolLock: // Mm nonpage pool allocation lock
  93. SPIN_LOCK
  94. .global NtfsStructLock
  95. ALIGN
  96. NtfsStructLock: // NTFS structure lock
  97. SPIN_LOCK
  98. //
  99. // The following fields are updated rarely.
  100. //
  101. ALIGN
  102. .global KiMasterSequence // master sequence number
  103. KiMasterSequence:
  104. data8 START_SEQUENCE
  105. .global KiMasterRid // master region ID
  106. KiMasterRid:
  107. data4 START_PROCESS_RID
  108. //
  109. // KeTickCount - This is the number of clock ticks that have occurred since
  110. // the system was booted. This count is used to compute a millisecond
  111. // tick counter.
  112. //
  113. ALIGN
  114. .global KeTickCount
  115. KeTickCount:
  116. data8 0
  117. //
  118. // KiTickOffset - This is the number of 100ns units remaining before a tick
  119. // is added to the tick count and the system time is updated.
  120. //
  121. .global KiTickOffset
  122. KiTickOffset:
  123. data4 0
  124. //
  125. // The following fields are static for the life of the system.
  126. //
  127. .global KiSynchIrql
  128. KiSynchIrql: // synchronization IRQL
  129. data4 SYNCH_LEVEL //
  130. //
  131. // KiTimeIncrementReciprocal - This is the reciprocal fraction of the time
  132. // increment value that is specified by the HAL when the system is
  133. // booted.
  134. //
  135. .global KiTimeIncrementReciprocal
  136. KiTimeIncrementReciprocal:
  137. data8 0
  138. //
  139. // KiTimeIncrementShiftCount - This is the shift count that corresponds to
  140. // the time increment reciprocal value.
  141. //
  142. .global KiTimeIncrementShiftCount
  143. KiTimeIncrementShiftCount:
  144. data4 0
  145. //
  146. // KeMaximumIncrement - This is the maximum time between clock interrupts
  147. // in 100ns units that is supported by the host HAL.
  148. //
  149. .global KeMaximumIncrement
  150. KeMaximumIncrement: //
  151. data4 0
  152. //
  153. // KeTimeAdjustment - This is the actual number of 100ns units that are to
  154. // be added to the system time at each interval timer interupt. This
  155. // value is copied from KeTimeIncrement at system start up and can be
  156. // later modified via the set system information service.
  157. // timer table entries.
  158. //
  159. .global KeTimeAdjustment
  160. KeTimeAdjustment: //
  161. data4 0
  162. //
  163. // KiMaximumDpcQueueDepth - This is used to control how many DPCs can be
  164. // queued before a DPC of medium importance will trigger a dispatch
  165. // interrupt.
  166. //
  167. ALIGN
  168. .global KiMaximumDpcQueueDepth
  169. KiMaximumDpcQueueDepth: //
  170. data4 4
  171. //
  172. // KiMinimumDpcRate - This is the rate of DPC requests per clock tick that
  173. // must be exceeded before DPC batching of medium importance DPCs
  174. // will occur.
  175. //
  176. .global KiMinimumDpcRate
  177. KiMinimumDpcRate: //
  178. data4 3
  179. //
  180. // KiAdjustDpcThreshold - This is the threshold used by the clock interrupt
  181. // routine to control the rate at which the processor's DPC queue depth
  182. // is dynamically adjusted.
  183. //
  184. .global KiAdjustDpcThreshold
  185. KiAdjustDpcThreshold: //
  186. data4 20
  187. //
  188. // KiIdealDpcRate - This is used to control the aggressiveness of the DPC
  189. // rate adjusting algorithm when decrementing the queue depth. As long
  190. // as the DPC rate for the last tick is greater than this rate, the
  191. // DPC queue depth will not be decremented.
  192. //
  193. .global KiIdealDpcRate
  194. KiIdealDpcRate: //
  195. data4 20
  196. //
  197. // KiTbFlushTimeStamp - This is the TB flush entire time stamp counter.
  198. //
  199. ALIGN
  200. .global KiTbFlushTimeStamp
  201. KiTbFlushTimeStamp: //
  202. data4 0
  203. //
  204. // The following data is frequently updated together and always
  205. // under the ownership of the dispatcher database lock.
  206. //
  207. ALIGN
  208. .global KiIdleSummary
  209. KiIdleSummary:
  210. data8 0
  211. .global PoSleepingSummary
  212. PoSleepingSummary:
  213. data8 0
  214. //
  215. // MmPfnDereferenceSListHead - This is used to store free blocks used for
  216. // deferred PFN reference count releasing.
  217. //
  218. ALIGN_SLIST
  219. .global MmPfnDereferenceSListHead
  220. MmPfnDereferenceSListHead:
  221. data8 0
  222. data8 0
  223. //
  224. // MmPfnDeferredList - This is used to queue items that need reference count
  225. // decrement processing.
  226. //
  227. ALIGN
  228. .global MmPfnDeferredList
  229. MmPfnDeferredList:
  230. data8 0
  231. //
  232. // MmSystemLockPagesCount - This is the count of the number of locked pages
  233. // in the system.
  234. //
  235. ALIGN
  236. .global MmSystemLockPagesCount
  237. MmSystemLockPagesCount:
  238. data8 0
  239. ALIGN
  240. data8 0