]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/Python/Common/GlobalData.py
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / BaseTools / Source / Python / Common / GlobalData.py
1 ## @file
2 # This file is used to define common static strings used by INF/DEC/DSC files
3 #
4 # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
5 # SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 import re
8
9 gIsWindows = None
10 gWorkspace = "."
11 gOptions = None
12 gCaseInsensitive = False
13 gAllFiles = None
14 gCommand = None
15 gSKUID_CMD = None
16
17 gGlobalDefines = {}
18 gPlatformDefines = {}
19 # PCD name and value pair for fixed at build and feature flag
20 gPlatformPcds = {}
21 gPlatformFinalPcds = {}
22 # PCDs with type that are not fixed at build and feature flag
23 gPlatformOtherPcds = {}
24 gActivePlatform = None
25 gCommandLineDefines = {}
26 gEdkGlobal = {}
27 gCommandMaxLength = 4096
28 # for debug trace purpose when problem occurs
29 gProcessingFile = ''
30 gBuildingModule = ''
31 gSkuids = []
32 gDefaultStores = []
33 gGuidDict = {}
34
35 # definition for a MACRO name. used to create regular expressions below.
36 _MacroNamePattern = "[A-Z][A-Z0-9_]*"
37
38 ## Regular expression for matching macro used in DSC/DEC/INF file inclusion
39 gMacroRefPattern = re.compile("\$\(({})\)".format(_MacroNamePattern), re.UNICODE)
40 gMacroDefPattern = re.compile("^(DEFINE|EDK_GLOBAL)[ \t]+")
41 gMacroNamePattern = re.compile("^{}$".format(_MacroNamePattern))
42
43 # definition for a GUID. used to create regular expressions below.
44 _HexChar = r"[0-9a-fA-F]"
45 _GuidPattern = r"{Hex}{{8}}-{Hex}{{4}}-{Hex}{{4}}-{Hex}{{4}}-{Hex}{{12}}".format(Hex=_HexChar)
46
47 ## Regular expressions for GUID matching
48 gGuidPattern = re.compile(r'{}'.format(_GuidPattern))
49 gGuidPatternEnd = re.compile(r'{}$'.format(_GuidPattern))
50
51 ## Regular expressions for HEX matching
52 g4HexChar = re.compile(r'{}{{4}}'.format(_HexChar))
53 gHexPattern = re.compile(r'0[xX]{}+'.format(_HexChar))
54 gHexPatternAll = re.compile(r'0[xX]{}+$'.format(_HexChar))
55
56 ## Regular expressions for string identifier checking
57 gIdentifierPattern = re.compile('^[a-zA-Z][a-zA-Z0-9_]*$', re.UNICODE)
58 ## Regular expression for GUID c structure format
59 _GuidCFormatPattern = r"{{\s*0[xX]{Hex}{{1,8}}\s*,\s*0[xX]{Hex}{{1,4}}\s*,\s*0[xX]{Hex}{{1,4}}" \
60 r"\s*,\s*{{\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}" \
61 r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}" \
62 r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}" \
63 r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}\s*}}\s*}}".format(Hex=_HexChar)
64 gGuidCFormatPattern = re.compile(r"{}".format(_GuidCFormatPattern))
65
66 #
67 # A global variable for whether current build in AutoGen phase or not.
68 #
69 gAutoGenPhase = False
70
71 #
72 # The Conf dir outside the workspace dir
73 #
74 gConfDirectory = ''
75 gCmdConfDir = ''
76 gBuildDirectory = ''
77 #
78 # The relative default database file path
79 #
80 gDatabasePath = ".cache/build.db"
81
82 #
83 # Build flag for binary build
84 #
85 gIgnoreSource = False
86
87 #
88 # FDF parser
89 #
90 gFdfParser = None
91
92 BuildOptionPcd = []
93
94 #
95 # Mixed PCD name dict
96 #
97 MixedPcd = {}
98
99 # Structure Pcd dict
100 gStructurePcd = {}
101 gPcdSkuOverrides={}
102 # Pcd name for the Pcd which used in the Conditional directives
103 gConditionalPcds = []
104
105 gUseHashCache = None
106 gBinCacheDest = None
107 gBinCacheSource = None
108 gPlatformHash = None
109 gPlatformHashFile = None
110 gPackageHash = None
111 gPackageHashFile = None
112 gModuleHashFile = None
113 gCMakeHashFile = None
114 gHashChainStatus = None
115 gModulePreMakeCacheStatus = None
116 gModuleMakeCacheStatus = None
117 gFileHashDict = None
118 gModuleAllCacheStatus = None
119 gModuleCacheHit = None
120
121 gEnableGenfdsMultiThread = True
122 gSikpAutoGenCache = set()
123 # Common lock for the file access in multiple process AutoGens
124 file_lock = None
125