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.

369 lines
8.5 KiB

  1. title "Global SpinLock declerations"
  2. ;++
  3. ;
  4. ;Copyright (c) 1991 Microsoft Corporation
  5. ;
  6. ;Module Name:
  7. ;
  8. ; splocks.asm
  9. ;
  10. ;Abstract:
  11. ;
  12. ; All global spinlocks in the kernel image are declared in this
  13. ; module. This is done so that each spinlock can be spaced out
  14. ; sufficiently to guaarantee that the L2 cache does not thrash
  15. ; by having a spinlock and another high use variable in the same
  16. ; cache line.
  17. ;
  18. ;Author:
  19. ;
  20. ; Ken Reneris (kenr) 13-Jan-1992
  21. ;
  22. ;Revision History:
  23. ;
  24. ;--
  25. .386p
  26. .xlist
  27. ifdef NT_UP
  28. PADLOCKS equ 4
  29. _DATA SEGMENT PARA PUBLIC 'DATA'
  30. else
  31. PADLOCKS equ 128
  32. _DATA SEGMENT PAGE PUBLIC 'DATA'
  33. endif
  34. SPINLOCK macro SpinLockName
  35. align PADLOCKS
  36. public SpinLockName
  37. SpinLockName dd 0
  38. endm
  39. ULONG macro VariableName
  40. align PADLOCKS
  41. public VariableName
  42. VariableName dd 0
  43. endm
  44. ;
  45. ; Static SpinLocks from ntos\cc\cachedat.c
  46. ;
  47. SPINLOCK _CcMasterSpinLock
  48. SPINLOCK _CcWorkQueueSpinLock
  49. SPINLOCK _CcVacbSpinLock
  50. SPINLOCK _CcDeferredWriteSpinLock
  51. SPINLOCK _CcDebugTraceLock
  52. SPINLOCK _CcBcbSpinLock
  53. ;
  54. ; Static SpinLocks from ntos\ex
  55. ;
  56. SPINLOCK _NonPagedPoolLock ; pool.c
  57. SPINLOCK _ExpResourceSpinLock ; resource.c
  58. ;
  59. ; Static SpinLocks from ntos\io\iodata.c
  60. ;
  61. SPINLOCK _IopCompletionLock
  62. SPINLOCK _IopCancelSpinLock
  63. SPINLOCK _IopVpbSpinLock
  64. SPINLOCK _IopDatabaseLock
  65. SPINLOCK _IopErrorLogLock
  66. SPINLOCK _IopTimerLock
  67. SPINLOCK _IoStatisticsLock
  68. ;
  69. ; Static SpinLocks from ntos\kd\kdlock.c
  70. ;
  71. SPINLOCK _KdpDebuggerLock
  72. ;
  73. ; Static SpinLocks from ntos\ke\kernldat.c
  74. ;
  75. SPINLOCK _KiDispatcherLock
  76. SPINLOCK _KiFreezeExecutionLock
  77. SPINLOCK _KiFreezeLockBackup
  78. ULONG _KiHardwareTrigger
  79. SPINLOCK _KiProfileLock
  80. ;
  81. ; Static SpinLocks from ntos\mm\miglobal.c
  82. ;
  83. SPINLOCK _MmPfnLock
  84. SPINLOCK _MmSystemSpaceLock
  85. SPINLOCK _MmNonPagedPoolLock
  86. ;
  87. ; Static SpinLocks from ntos\ps\psinit.c
  88. ;
  89. SPINLOCK _PspEventPairLock
  90. SPINLOCK _PsLoadedModuleSpinLock
  91. ;
  92. ; Static SpinLocks from ntos\fsrtl\fsrtlp.c
  93. ;
  94. SPINLOCK _FsRtlStrucSupSpinLock ; fsrtlp.c
  95. ;
  96. ; Static SpinLocks from base\fs\ntfs
  97. ;
  98. SPINLOCK _NtfsStructLock
  99. ;
  100. ; Static SpinLocks from net\sockets\winsock2\wsp\afdsys
  101. ;
  102. SPINLOCK _AfdWorkQueueSpinLock
  103. ;
  104. ; These variables are updated frequently and under control of the dispatcher
  105. ; database lock. They are defined in a single cache line to reduce false
  106. ; sharing in MP systems.
  107. ;
  108. ; KiIdleSummary - This is the set of processors which are idle. It is
  109. ; used by the ready thread code to speed up the search for a thread
  110. ; to preempt when a thread becomes runnable.
  111. ;
  112. align PADLOCKS
  113. public _KiIdleSummary
  114. _KiIdleSummary dd 0
  115. ;
  116. ; KiIdleSMTSummary - In multi threaded processors, this is the set of
  117. ; idle processors in which all the logical processors that make up a
  118. ; physical processor are idle. That is, this is the set of logical
  119. ; processors in completely idle physical processors.
  120. ;
  121. public _KiIdleSMTSummary
  122. _KiIdleSMTSummary dd 0
  123. ;
  124. ; PoSleepingSummary - Set of processors which currently sleep (ie stop)
  125. ; when idle.
  126. ;
  127. public _PoSleepingSummary
  128. _PoSleepingSummary dd 0
  129. ;
  130. ; KiTbFlushTimeStamp - This is the TB flush entire time stamp counter.
  131. ;
  132. ; This variable is in it own cache line to reduce false sharing on MP systems.
  133. ;
  134. align PADLOCKS
  135. public _KiTbFlushTimeStamp
  136. _KiTbFlushTimeStamp dd 0
  137. ;
  138. ; These variables are referenced together and are defined in a single cache
  139. ; line to reduce sharing on MP systems.
  140. ;
  141. ; KeTickCount - This is the number of clock ticks that have occurred since
  142. ; the system was booted. This count is used to compute a millisecond
  143. ; tick counter.
  144. ;
  145. align PADLOCKS
  146. public _KeTickCount
  147. _KeTickCount dd 0, 0, 0
  148. ;
  149. ; KeMaximumIncrement - This is the maximum time between clock interrupts
  150. ; in 100ns units that is supported by the host HAL.
  151. ;
  152. public _KeMaximumIncrement
  153. _KeMaximumIncrement dd 0
  154. ;
  155. ; KiSlotZeroTime - This is a cached time thats close to the current time.
  156. ; This time always reduces to a time that fits into slot zero so we can use
  157. ; this value via subtract to get absolute times into an easy range for modular
  158. ; reduction.
  159. ;
  160. public _KiSlotZeroTime
  161. _KiSlotZeroTime dd 0,0
  162. ;
  163. ; KiMaximumIncrementReciprocal - This is the 32 bit reciprocal of KeMaximumIncrement
  164. ;
  165. public _KiMaximumIncrementReciprocal
  166. _KiMaximumIncrementReciprocal dd 0
  167. ;
  168. ; KiLog2MaximumIncrement - This is FLOOR (log2 (KeMaximumIncrement))
  169. ;
  170. public _KiLog2MaximumIncrement
  171. _KiLog2MaximumIncrement dd 0
  172. ;
  173. ; KiUpperModMul - This is (2^32) % (KeMaximumIncrement * TIMER_TABLE_SIZE).
  174. ; This value is used to reduce an absolute time to a 32 bit number by multiplying
  175. ; the high DWORD.
  176. ;
  177. public _KiUpperModMul
  178. _KiUpperModMul dd 0
  179. ;
  180. ; _KeTimerReductionModulus - This is KeMaximumIncrement * TIMER_TABLE_SIZE.
  181. ; We can add or sobtract this value froma time without affecting its slot number.
  182. ;
  183. public _KeTimerReductionModulus
  184. _KeTimerReductionModulus dd 0
  185. ;
  186. ; KeTimeAdjustment - This is the actual number of 100ns units that are to
  187. ; be added to the system time at each interval timer interupt. This
  188. ; value is copied from KeTimeIncrement at system start up and can be
  189. ; later modified via the set system information service.
  190. ; timer table entries.
  191. ;
  192. public _KeTimeAdjustment
  193. _KeTimeAdjustment dd 0
  194. ;
  195. ; KiTickOffset - This is the number of 100ns units remaining before a tick
  196. ; is added to the tick count and the system time is updated.
  197. ;
  198. public _KiTickOffset
  199. _KiTickOffset dd 0
  200. ;
  201. ; These variables are referenced together and are defined in a single cache
  202. ; line to reduce sharing on MP systems.
  203. ;
  204. ; KiMaximumDpcQueueDepth - This is used to control how many DPCs can be
  205. ; queued before a DPC of medium importance will trigger a dispatch
  206. ; interrupt.
  207. ;
  208. align PADLOCKS
  209. public _KiMaximumDpcQueueDepth
  210. _KiMaximumDpcQueueDepth dd 4
  211. ;
  212. ; KiMinimumDpcRate - This is the rate of DPC requests per clock tick that
  213. ; must be exceeded before DPC batching of medium importance DPCs
  214. ; will occur.
  215. ;
  216. public _KiMinimumDpcRate
  217. _KiMinimumDpcRate dd 3
  218. ;
  219. ; KiAdjustDpcThreshold - This is the threshold used by the clock interrupt
  220. ; routine to control the rate at which the processor's DPC queue depth
  221. ; is dynamically adjusted.
  222. ;
  223. public _KiAdjustDpcThreshold
  224. _KiAdjustDpcThreshold dd 20
  225. ;
  226. ; KiIdealDpcRate - This is used to control the aggressiveness of the DPC
  227. ; rate adjusting algorithm when decrementing the queue depth. As long
  228. ; as the DPC rate for the last tick is greater than this rate, the
  229. ; DPC queue depth will not be decremented.
  230. ;
  231. public _KiIdealDpcRate
  232. _KiIdealDpcRate dd 20
  233. ;
  234. ; These variables are referenced together and are defined in a single cache
  235. ; line to reduce sharing on MP systems.
  236. ;
  237. ; KeErrorMask - This is the value used to mask the error code passed to
  238. ; memory management on page faults.
  239. ;
  240. align PADLOCKS
  241. public _KeErrorMask
  242. _KeErrorMask dd 1
  243. ;
  244. ; MmPaeErrMask - This is the value used to mask upper bits of a PAE error.
  245. ;
  246. public _MmPaeErrMask
  247. _MmPaeErrMask dd 0
  248. ;
  249. ; MmPaeMask - This is the value used to mask upper bits of a PAE PTE.
  250. ;
  251. public _MmPaeMask
  252. _MmPaeMask dq 0
  253. ;
  254. ; MmPfnDereferenceSListHead - This is used to store free blocks used for
  255. ; deferred PFN reference count releasing.
  256. ;
  257. align PADLOCKS
  258. public _MmPfnDereferenceSListHead
  259. _MmPfnDereferenceSListHead dq 0
  260. ;
  261. ; MmPfnDeferredList - This is used to queue items that need reference count
  262. ; decrement processing.
  263. ;
  264. align PADLOCKS
  265. public _MmPfnDeferredList
  266. _MmPfnDeferredList dd 0
  267. ;
  268. ; MmSystemLockPagesCount - This is the count of the number of locked pages
  269. ; in the system.
  270. ;
  271. align PADLOCKS
  272. public _MmSystemLockPagesCount
  273. _MmSystemLockPagesCount dd 0
  274. align PADLOCKS
  275. _DATA ends
  276. end