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