1//
2// Licensed to the .NET Foundation under one or more agreements.
3// The .NET Foundation licenses this file to you under the MIT license.
4// See the LICENSE file in the project root for more information.
5//
6
7#ifndef __CRST_TYPES_INCLUDED
8#define __CRST_TYPES_INCLUDED
9
10// **** THIS IS AN AUTOMATICALLY GENERATED HEADER FILE -- DO NOT EDIT!!! ****
11
12// This file describes the range of Crst types available and their mapping to a numeric level (used by the
13// runtime in debug mode to validate we're deadlock free). To modify these settings edit the
14// file:CrstTypes.def file and run the clr\bin\CrstTypeTool utility to generate a new version of this file.
15
16// Each Crst type is declared as a value in the following CrstType enum.
17enum CrstType
18{
19 CrstAllowedFiles = 0,
20 CrstAppDomainCache = 1,
21 CrstAppDomainHandleTable = 2,
22 CrstArgBasedStubCache = 3,
23 CrstAssemblyDependencyGraph = 4,
24 CrstAssemblyIdentityCache = 5,
25 CrstAssemblyList = 6,
26 CrstAssemblyLoader = 7,
27 CrstAvailableClass = 8,
28 CrstAvailableParamTypes = 9,
29 CrstBaseDomain = 10,
30 CrstCCompRC = 11,
31 CrstCer = 12,
32 CrstClassFactInfoHash = 13,
33 CrstClassInit = 14,
34 CrstClrNotification = 15,
35 CrstCLRPrivBinderMaps = 16,
36 CrstCLRPrivBinderMapsAdd = 17,
37 CrstCodeFragmentHeap = 18,
38 CrstCOMCallWrapper = 19,
39 CrstCOMWrapperCache = 20,
40 CrstConnectionNameTable = 21,
41 CrstContexts = 22,
42 CrstCoreCLRBinderLog = 23,
43 CrstCrstCLRPrivBinderLocalWinMDPath = 24,
44 CrstCSPCache = 25,
45 CrstDataTest1 = 26,
46 CrstDataTest2 = 27,
47 CrstDbgTransport = 28,
48 CrstDeadlockDetection = 29,
49 CrstDebuggerController = 30,
50 CrstDebuggerFavorLock = 31,
51 CrstDebuggerHeapExecMemLock = 32,
52 CrstDebuggerHeapLock = 33,
53 CrstDebuggerJitInfo = 34,
54 CrstDebuggerMutex = 35,
55 CrstDelegateToFPtrHash = 36,
56 CrstDomainLocalBlock = 37,
57 CrstDynamicIL = 38,
58 CrstDynamicMT = 39,
59 CrstDynLinkZapItems = 40,
60 CrstEtwTypeLogHash = 41,
61 CrstEventPipe = 42,
62 CrstEventStore = 43,
63 CrstException = 44,
64 CrstExecuteManLock = 45,
65 CrstExecuteManRangeLock = 46,
66 CrstFCall = 47,
67 CrstFriendAccessCache = 48,
68 CrstFuncPtrStubs = 49,
69 CrstFusionAppCtx = 50,
70 CrstGCCover = 51,
71 CrstGCMemoryPressure = 52,
72 CrstGlobalStrLiteralMap = 53,
73 CrstHandleTable = 54,
74 CrstHostAssemblyMap = 55,
75 CrstHostAssemblyMapAdd = 56,
76 CrstIbcProfile = 57,
77 CrstIJWFixupData = 58,
78 CrstIJWHash = 59,
79 CrstILStubGen = 60,
80 CrstInlineTrackingMap = 61,
81 CrstInstMethodHashTable = 62,
82 CrstInterfaceVTableMap = 63,
83 CrstInterop = 64,
84 CrstInteropData = 65,
85 CrstIOThreadpoolWorker = 66,
86 CrstIsJMCMethod = 67,
87 CrstISymUnmanagedReader = 68,
88 CrstJit = 69,
89 CrstJitGenericHandleCache = 70,
90 CrstJitPerf = 71,
91 CrstJumpStubCache = 72,
92 CrstLeafLock = 73,
93 CrstListLock = 74,
94 CrstLoaderAllocator = 75,
95 CrstLoaderAllocatorReferences = 76,
96 CrstLoaderHeap = 77,
97 CrstMda = 78,
98 CrstMetadataTracker = 79,
99 CrstModIntPairList = 80,
100 CrstModule = 81,
101 CrstModuleFixup = 82,
102 CrstModuleLookupTable = 83,
103 CrstMulticoreJitHash = 84,
104 CrstMulticoreJitManager = 85,
105 CrstMUThunkHash = 86,
106 CrstNativeBinderInit = 87,
107 CrstNativeImageCache = 88,
108 CrstNls = 89,
109 CrstNotifyGdb = 90,
110 CrstObjectList = 91,
111 CrstOnEventManager = 92,
112 CrstPatchEntryPoint = 93,
113 CrstPEImage = 94,
114 CrstPEImagePDBStream = 95,
115 CrstPendingTypeLoadEntry = 96,
116 CrstPinHandle = 97,
117 CrstPinnedByrefValidation = 98,
118 CrstProfilerGCRefDataFreeList = 99,
119 CrstProfilingAPIStatus = 100,
120 CrstPublisherCertificate = 101,
121 CrstRCWCache = 102,
122 CrstRCWCleanupList = 103,
123 CrstRCWRefCache = 104,
124 CrstReadyToRunEntryPointToMethodDescMap = 105,
125 CrstReDacl = 106,
126 CrstReflection = 107,
127 CrstReJITDomainTable = 108,
128 CrstReJITGlobalRequest = 109,
129 CrstRemoting = 110,
130 CrstRetThunkCache = 111,
131 CrstRWLock = 112,
132 CrstSavedExceptionInfo = 113,
133 CrstSaveModuleProfileData = 114,
134 CrstSecurityStackwalkCache = 115,
135 CrstSharedAssemblyCreate = 116,
136 CrstSigConvert = 117,
137 CrstSingleUseLock = 118,
138 CrstSpecialStatics = 119,
139 CrstSqmManager = 120,
140 CrstStackSampler = 121,
141 CrstStressLog = 122,
142 CrstStrongName = 123,
143 CrstStubCache = 124,
144 CrstStubDispatchCache = 125,
145 CrstStubUnwindInfoHeapSegments = 126,
146 CrstSyncBlockCache = 127,
147 CrstSyncHashLock = 128,
148 CrstSystemBaseDomain = 129,
149 CrstSystemDomain = 130,
150 CrstSystemDomainDelayedUnloadList = 131,
151 CrstThreadIdDispenser = 132,
152 CrstThreadpoolEventCache = 133,
153 CrstThreadpoolTimerQueue = 134,
154 CrstThreadpoolWaitThreads = 135,
155 CrstThreadpoolWorker = 136,
156 CrstThreadStaticDataHashTable = 137,
157 CrstThreadStore = 138,
158 CrstTieredCompilation = 139,
159 CrstTPMethodTable = 140,
160 CrstTypeEquivalenceMap = 141,
161 CrstTypeIDMap = 142,
162 CrstUMEntryThunkCache = 143,
163 CrstUMThunkHash = 144,
164 CrstUniqueStack = 145,
165 CrstUnresolvedClassLock = 146,
166 CrstUnwindInfoTableLock = 147,
167 CrstVSDIndirectionCellLock = 148,
168 CrstWinRTFactoryCache = 149,
169 CrstWrapperTemplate = 150,
170 kNumberOfCrstTypes = 151
171};
172
173#endif // __CRST_TYPES_INCLUDED
174
175// Define some debug data in one module only -- vm\crst.cpp.
176#if defined(__IN_CRST_CPP) && defined(_DEBUG)
177
178// An array mapping CrstType to level.
179int g_rgCrstLevelMap[] =
180{
181 9, // CrstAllowedFiles
182 9, // CrstAppDomainCache
183 12, // CrstAppDomainHandleTable
184 0, // CrstArgBasedStubCache
185 0, // CrstAssemblyDependencyGraph
186 0, // CrstAssemblyIdentityCache
187 0, // CrstAssemblyList
188 7, // CrstAssemblyLoader
189 3, // CrstAvailableClass
190 3, // CrstAvailableParamTypes
191 7, // CrstBaseDomain
192 -1, // CrstCCompRC
193 9, // CrstCer
194 11, // CrstClassFactInfoHash
195 8, // CrstClassInit
196 -1, // CrstClrNotification
197 0, // CrstCLRPrivBinderMaps
198 3, // CrstCLRPrivBinderMapsAdd
199 6, // CrstCodeFragmentHeap
200 0, // CrstCOMCallWrapper
201 4, // CrstCOMWrapperCache
202 0, // CrstConnectionNameTable
203 15, // CrstContexts
204 -1, // CrstCoreCLRBinderLog
205 0, // CrstCrstCLRPrivBinderLocalWinMDPath
206 7, // CrstCSPCache
207 3, // CrstDataTest1
208 0, // CrstDataTest2
209 0, // CrstDbgTransport
210 0, // CrstDeadlockDetection
211 -1, // CrstDebuggerController
212 3, // CrstDebuggerFavorLock
213 0, // CrstDebuggerHeapExecMemLock
214 0, // CrstDebuggerHeapLock
215 4, // CrstDebuggerJitInfo
216 9, // CrstDebuggerMutex
217 0, // CrstDelegateToFPtrHash
218 14, // CrstDomainLocalBlock
219 0, // CrstDynamicIL
220 3, // CrstDynamicMT
221 3, // CrstDynLinkZapItems
222 7, // CrstEtwTypeLogHash
223 17, // CrstEventPipe
224 0, // CrstEventStore
225 0, // CrstException
226 7, // CrstExecuteManLock
227 0, // CrstExecuteManRangeLock
228 3, // CrstFCall
229 7, // CrstFriendAccessCache
230 7, // CrstFuncPtrStubs
231 5, // CrstFusionAppCtx
232 9, // CrstGCCover
233 0, // CrstGCMemoryPressure
234 11, // CrstGlobalStrLiteralMap
235 1, // CrstHandleTable
236 0, // CrstHostAssemblyMap
237 3, // CrstHostAssemblyMapAdd
238 0, // CrstIbcProfile
239 9, // CrstIJWFixupData
240 0, // CrstIJWHash
241 7, // CrstILStubGen
242 3, // CrstInlineTrackingMap
243 15, // CrstInstMethodHashTable
244 0, // CrstInterfaceVTableMap
245 17, // CrstInterop
246 4, // CrstInteropData
247 11, // CrstIOThreadpoolWorker
248 0, // CrstIsJMCMethod
249 7, // CrstISymUnmanagedReader
250 8, // CrstJit
251 0, // CrstJitGenericHandleCache
252 -1, // CrstJitPerf
253 6, // CrstJumpStubCache
254 0, // CrstLeafLock
255 -1, // CrstListLock
256 13, // CrstLoaderAllocator
257 14, // CrstLoaderAllocatorReferences
258 0, // CrstLoaderHeap
259 0, // CrstMda
260 -1, // CrstMetadataTracker
261 0, // CrstModIntPairList
262 4, // CrstModule
263 13, // CrstModuleFixup
264 3, // CrstModuleLookupTable
265 0, // CrstMulticoreJitHash
266 11, // CrstMulticoreJitManager
267 0, // CrstMUThunkHash
268 -1, // CrstNativeBinderInit
269 -1, // CrstNativeImageCache
270 0, // CrstNls
271 0, // CrstNotifyGdb
272 2, // CrstObjectList
273 0, // CrstOnEventManager
274 0, // CrstPatchEntryPoint
275 4, // CrstPEImage
276 0, // CrstPEImagePDBStream
277 16, // CrstPendingTypeLoadEntry
278 0, // CrstPinHandle
279 0, // CrstPinnedByrefValidation
280 0, // CrstProfilerGCRefDataFreeList
281 0, // CrstProfilingAPIStatus
282 0, // CrstPublisherCertificate
283 3, // CrstRCWCache
284 0, // CrstRCWCleanupList
285 3, // CrstRCWRefCache
286 4, // CrstReadyToRunEntryPointToMethodDescMap
287 0, // CrstReDacl
288 9, // CrstReflection
289 7, // CrstReJITDomainTable
290 12, // CrstReJITGlobalRequest
291 17, // CrstRemoting
292 3, // CrstRetThunkCache
293 0, // CrstRWLock
294 3, // CrstSavedExceptionInfo
295 0, // CrstSaveModuleProfileData
296 0, // CrstSecurityStackwalkCache
297 4, // CrstSharedAssemblyCreate
298 3, // CrstSigConvert
299 5, // CrstSingleUseLock
300 0, // CrstSpecialStatics
301 0, // CrstSqmManager
302 0, // CrstStackSampler
303 -1, // CrstStressLog
304 0, // CrstStrongName
305 5, // CrstStubCache
306 0, // CrstStubDispatchCache
307 4, // CrstStubUnwindInfoHeapSegments
308 3, // CrstSyncBlockCache
309 0, // CrstSyncHashLock
310 4, // CrstSystemBaseDomain
311 11, // CrstSystemDomain
312 0, // CrstSystemDomainDelayedUnloadList
313 0, // CrstThreadIdDispenser
314 0, // CrstThreadpoolEventCache
315 7, // CrstThreadpoolTimerQueue
316 7, // CrstThreadpoolWaitThreads
317 11, // CrstThreadpoolWorker
318 4, // CrstThreadStaticDataHashTable
319 10, // CrstThreadStore
320 9, // CrstTieredCompilation
321 9, // CrstTPMethodTable
322 3, // CrstTypeEquivalenceMap
323 7, // CrstTypeIDMap
324 3, // CrstUMEntryThunkCache
325 0, // CrstUMThunkHash
326 3, // CrstUniqueStack
327 7, // CrstUnresolvedClassLock
328 3, // CrstUnwindInfoTableLock
329 3, // CrstVSDIndirectionCellLock
330 3, // CrstWinRTFactoryCache
331 3, // CrstWrapperTemplate
332};
333
334// An array mapping CrstType to a stringized name.
335LPCSTR g_rgCrstNameMap[] =
336{
337 "CrstAllowedFiles",
338 "CrstAppDomainCache",
339 "CrstAppDomainHandleTable",
340 "CrstArgBasedStubCache",
341 "CrstAssemblyDependencyGraph",
342 "CrstAssemblyIdentityCache",
343 "CrstAssemblyList",
344 "CrstAssemblyLoader",
345 "CrstAvailableClass",
346 "CrstAvailableParamTypes",
347 "CrstBaseDomain",
348 "CrstCCompRC",
349 "CrstCer",
350 "CrstClassFactInfoHash",
351 "CrstClassInit",
352 "CrstClrNotification",
353 "CrstCLRPrivBinderMaps",
354 "CrstCLRPrivBinderMapsAdd",
355 "CrstCodeFragmentHeap",
356 "CrstCOMCallWrapper",
357 "CrstCOMWrapperCache",
358 "CrstConnectionNameTable",
359 "CrstContexts",
360 "CrstCoreCLRBinderLog",
361 "CrstCrstCLRPrivBinderLocalWinMDPath",
362 "CrstCSPCache",
363 "CrstDataTest1",
364 "CrstDataTest2",
365 "CrstDbgTransport",
366 "CrstDeadlockDetection",
367 "CrstDebuggerController",
368 "CrstDebuggerFavorLock",
369 "CrstDebuggerHeapExecMemLock",
370 "CrstDebuggerHeapLock",
371 "CrstDebuggerJitInfo",
372 "CrstDebuggerMutex",
373 "CrstDelegateToFPtrHash",
374 "CrstDomainLocalBlock",
375 "CrstDynamicIL",
376 "CrstDynamicMT",
377 "CrstDynLinkZapItems",
378 "CrstEtwTypeLogHash",
379 "CrstEventPipe",
380 "CrstEventStore",
381 "CrstException",
382 "CrstExecuteManLock",
383 "CrstExecuteManRangeLock",
384 "CrstFCall",
385 "CrstFriendAccessCache",
386 "CrstFuncPtrStubs",
387 "CrstFusionAppCtx",
388 "CrstGCCover",
389 "CrstGCMemoryPressure",
390 "CrstGlobalStrLiteralMap",
391 "CrstHandleTable",
392 "CrstHostAssemblyMap",
393 "CrstHostAssemblyMapAdd",
394 "CrstIbcProfile",
395 "CrstIJWFixupData",
396 "CrstIJWHash",
397 "CrstILStubGen",
398 "CrstInlineTrackingMap",
399 "CrstInstMethodHashTable",
400 "CrstInterfaceVTableMap",
401 "CrstInterop",
402 "CrstInteropData",
403 "CrstIOThreadpoolWorker",
404 "CrstIsJMCMethod",
405 "CrstISymUnmanagedReader",
406 "CrstJit",
407 "CrstJitGenericHandleCache",
408 "CrstJitPerf",
409 "CrstJumpStubCache",
410 "CrstLeafLock",
411 "CrstListLock",
412 "CrstLoaderAllocator",
413 "CrstLoaderAllocatorReferences",
414 "CrstLoaderHeap",
415 "CrstMda",
416 "CrstMetadataTracker",
417 "CrstModIntPairList",
418 "CrstModule",
419 "CrstModuleFixup",
420 "CrstModuleLookupTable",
421 "CrstMulticoreJitHash",
422 "CrstMulticoreJitManager",
423 "CrstMUThunkHash",
424 "CrstNativeBinderInit",
425 "CrstNativeImageCache",
426 "CrstNls",
427 "CrstNotifyGdb",
428 "CrstObjectList",
429 "CrstOnEventManager",
430 "CrstPatchEntryPoint",
431 "CrstPEImage",
432 "CrstPEImagePDBStream",
433 "CrstPendingTypeLoadEntry",
434 "CrstPinHandle",
435 "CrstPinnedByrefValidation",
436 "CrstProfilerGCRefDataFreeList",
437 "CrstProfilingAPIStatus",
438 "CrstPublisherCertificate",
439 "CrstRCWCache",
440 "CrstRCWCleanupList",
441 "CrstRCWRefCache",
442 "CrstReadyToRunEntryPointToMethodDescMap",
443 "CrstReDacl",
444 "CrstReflection",
445 "CrstReJITDomainTable",
446 "CrstReJITGlobalRequest",
447 "CrstRemoting",
448 "CrstRetThunkCache",
449 "CrstRWLock",
450 "CrstSavedExceptionInfo",
451 "CrstSaveModuleProfileData",
452 "CrstSecurityStackwalkCache",
453 "CrstSharedAssemblyCreate",
454 "CrstSigConvert",
455 "CrstSingleUseLock",
456 "CrstSpecialStatics",
457 "CrstSqmManager",
458 "CrstStackSampler",
459 "CrstStressLog",
460 "CrstStrongName",
461 "CrstStubCache",
462 "CrstStubDispatchCache",
463 "CrstStubUnwindInfoHeapSegments",
464 "CrstSyncBlockCache",
465 "CrstSyncHashLock",
466 "CrstSystemBaseDomain",
467 "CrstSystemDomain",
468 "CrstSystemDomainDelayedUnloadList",
469 "CrstThreadIdDispenser",
470 "CrstThreadpoolEventCache",
471 "CrstThreadpoolTimerQueue",
472 "CrstThreadpoolWaitThreads",
473 "CrstThreadpoolWorker",
474 "CrstThreadStaticDataHashTable",
475 "CrstThreadStore",
476 "CrstTieredCompilation",
477 "CrstTPMethodTable",
478 "CrstTypeEquivalenceMap",
479 "CrstTypeIDMap",
480 "CrstUMEntryThunkCache",
481 "CrstUMThunkHash",
482 "CrstUniqueStack",
483 "CrstUnresolvedClassLock",
484 "CrstUnwindInfoTableLock",
485 "CrstVSDIndirectionCellLock",
486 "CrstWinRTFactoryCache",
487 "CrstWrapperTemplate",
488};
489
490// Define a special level constant for unordered locks.
491#define CRSTUNORDERED (-1)
492
493// Define inline helpers to map Crst types to names and levels.
494inline static int GetCrstLevel(CrstType crstType)
495{
496 LIMITED_METHOD_CONTRACT;
497 _ASSERTE(crstType >= 0 && crstType < kNumberOfCrstTypes);
498 return g_rgCrstLevelMap[crstType];
499}
500inline static LPCSTR GetCrstName(CrstType crstType)
501{
502 LIMITED_METHOD_CONTRACT;
503 _ASSERTE(crstType >= 0 && crstType < kNumberOfCrstTypes);
504 return g_rgCrstNameMap[crstType];
505}
506
507#endif // defined(__IN_CRST_CPP) && defined(_DEBUG)
508