BaseTools: move PCD size calculation functions to PcdClassObject
[mirror_edk2.git] / BaseTools / Source / Python / Common / DataType.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 # Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
6 # This program and the accompanying materials
7 # are licensed and made available under the terms and conditions of the BSD License
8 # which accompanies this distribution. The full text of the license may be found at
9 # http://opensource.org/licenses/bsd-license.php
10 #
11 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 ##
15 # Common Definitions
16 #
17 TAB_SPLIT = '.'
18 TAB_COMMENT_EDK_START = '/*'
19 TAB_COMMENT_EDK_END = '*/'
20 TAB_COMMENT_EDK_SPLIT = '//'
21 TAB_COMMENT_SPLIT = '#'
22 TAB_SPECIAL_COMMENT = '##'
23 TAB_EQUAL_SPLIT = '='
24 TAB_VALUE_SPLIT = '|'
25 TAB_COMMA_SPLIT = ','
26 TAB_SPACE_SPLIT = ' '
27 TAB_SEMI_COLON_SPLIT = ';'
28 TAB_SECTION_START = '['
29 TAB_SECTION_END = ']'
30 TAB_OPTION_START = '<'
31 TAB_OPTION_END = '>'
32 TAB_SLASH = '\\'
33 TAB_BACK_SLASH = '/'
34 TAB_LINE_BREAK = '\n'
35 TAB_PRINTCHAR_VT = '\x0b'
36 TAB_PRINTCHAR_BS = '\b'
37 TAB_PRINTCHAR_NUL = '\0'
38 TAB_UINT8 = 'UINT8'
39 TAB_UINT16 = 'UINT16'
40 TAB_UINT32 = 'UINT32'
41 TAB_UINT64 = 'UINT64'
42 TAB_VOID = 'VOID*'
43 TAB_GUID = 'GUID'
44
45 TAB_PCD_CLEAN_NUMERIC_TYPES = {TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_UINT64}
46 TAB_PCD_NUMERIC_TYPES = {TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_UINT64, 'BOOLEAN'}
47 TAB_PCD_NUMERIC_TYPES_VOID = {TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_UINT64, 'BOOLEAN', TAB_VOID}
48
49 TAB_EDK_SOURCE = '$(EDK_SOURCE)'
50 TAB_EFI_SOURCE = '$(EFI_SOURCE)'
51 TAB_WORKSPACE = '$(WORKSPACE)'
52 TAB_FV_DIRECTORY = 'FV'
53
54 TAB_ARCH_NULL = ''
55 TAB_ARCH_COMMON = 'COMMON'
56 TAB_ARCH_IA32 = 'IA32'
57 TAB_ARCH_X64 = 'X64'
58 TAB_ARCH_IPF = 'IPF'
59 TAB_ARCH_ARM = 'ARM'
60 TAB_ARCH_EBC = 'EBC'
61 TAB_ARCH_AARCH64 = 'AARCH64'
62
63 ARCH_SET_FULL = {TAB_ARCH_IA32, TAB_ARCH_X64, TAB_ARCH_IPF, TAB_ARCH_ARM, TAB_ARCH_EBC, TAB_ARCH_AARCH64, TAB_ARCH_COMMON}
64
65 SUP_MODULE_BASE = 'BASE'
66 SUP_MODULE_SEC = 'SEC'
67 SUP_MODULE_PEI_CORE = 'PEI_CORE'
68 SUP_MODULE_PEIM = 'PEIM'
69 SUP_MODULE_DXE_CORE = 'DXE_CORE'
70 SUP_MODULE_DXE_DRIVER = 'DXE_DRIVER'
71 SUP_MODULE_DXE_RUNTIME_DRIVER = 'DXE_RUNTIME_DRIVER'
72 SUP_MODULE_DXE_SAL_DRIVER = 'DXE_SAL_DRIVER'
73 SUP_MODULE_DXE_SMM_DRIVER = 'DXE_SMM_DRIVER'
74 SUP_MODULE_UEFI_DRIVER = 'UEFI_DRIVER'
75 SUP_MODULE_UEFI_APPLICATION = 'UEFI_APPLICATION'
76 SUP_MODULE_USER_DEFINED = 'USER_DEFINED'
77 SUP_MODULE_SMM_CORE = 'SMM_CORE'
78 SUP_MODULE_MM_STANDALONE = 'MM_STANDALONE'
79 SUP_MODULE_MM_CORE_STANDALONE = 'MM_CORE_STANDALONE'
80
81 SUP_MODULE_LIST = [SUP_MODULE_BASE, SUP_MODULE_SEC, SUP_MODULE_PEI_CORE, SUP_MODULE_PEIM, SUP_MODULE_DXE_CORE, SUP_MODULE_DXE_DRIVER, \
82 SUP_MODULE_DXE_RUNTIME_DRIVER, SUP_MODULE_DXE_SAL_DRIVER, SUP_MODULE_DXE_SMM_DRIVER, SUP_MODULE_UEFI_DRIVER, \
83 SUP_MODULE_UEFI_APPLICATION, SUP_MODULE_USER_DEFINED, SUP_MODULE_SMM_CORE, SUP_MODULE_MM_STANDALONE, SUP_MODULE_MM_CORE_STANDALONE]
84 SUP_MODULE_LIST_STRING = TAB_VALUE_SPLIT.join(SUP_MODULE_LIST)
85 SUP_MODULE_SET_PEI = {SUP_MODULE_PEIM, SUP_MODULE_PEI_CORE}
86
87 EDK_COMPONENT_TYPE_LIBRARY = 'LIBRARY'
88 EDK_COMPONENT_TYPE_SECURITY_CORE = 'SECURITY_CORE'
89 EDK_COMPONENT_TYPE_PEI_CORE = SUP_MODULE_PEI_CORE
90 EDK_COMPONENT_TYPE_COMBINED_PEIM_DRIVER = 'COMBINED_PEIM_DRIVER'
91 EDK_COMPONENT_TYPE_PIC_PEIM = 'PIC_PEIM'
92 EDK_COMPONENT_TYPE_RELOCATABLE_PEIM = 'RELOCATABLE_PEIM'
93 EDK_COMPONENT_TYPE_BS_DRIVER = 'BS_DRIVER'
94 EDK_COMPONENT_TYPE_RT_DRIVER = 'RT_DRIVER'
95 EDK_COMPONENT_TYPE_SAL_RT_DRIVER = 'SAL_RT_DRIVER'
96 EDK_COMPONENT_TYPE_APPLICATION = 'APPLICATION'
97 EDK_NAME = 'EDK'
98 EDKII_NAME = 'EDKII'
99
100 COMPONENT_TO_MODULE_MAP_DICT = {
101 EDK_COMPONENT_TYPE_LIBRARY : SUP_MODULE_BASE,
102 EDK_COMPONENT_TYPE_SECURITY_CORE : SUP_MODULE_SEC,
103 EDK_COMPONENT_TYPE_PEI_CORE : SUP_MODULE_PEI_CORE,
104 EDK_COMPONENT_TYPE_COMBINED_PEIM_DRIVER : SUP_MODULE_PEIM,
105 EDK_COMPONENT_TYPE_PIC_PEIM : SUP_MODULE_PEIM,
106 EDK_COMPONENT_TYPE_RELOCATABLE_PEIM : SUP_MODULE_PEIM,
107 "PE32_PEIM" : SUP_MODULE_PEIM,
108 EDK_COMPONENT_TYPE_BS_DRIVER : SUP_MODULE_DXE_DRIVER,
109 EDK_COMPONENT_TYPE_RT_DRIVER : SUP_MODULE_DXE_RUNTIME_DRIVER,
110 EDK_COMPONENT_TYPE_SAL_RT_DRIVER : SUP_MODULE_DXE_SAL_DRIVER,
111 EDK_COMPONENT_TYPE_APPLICATION : SUP_MODULE_UEFI_APPLICATION,
112 "LOGO" : SUP_MODULE_BASE,
113 }
114
115 BINARY_FILE_TYPE_FW = 'FW'
116 BINARY_FILE_TYPE_GUID = 'GUID'
117 BINARY_FILE_TYPE_PREEFORM = 'PREEFORM'
118 BINARY_FILE_TYPE_UEFI_APP = 'UEFI_APP'
119 BINARY_FILE_TYPE_UNI_UI = 'UNI_UI'
120 BINARY_FILE_TYPE_UNI_VER = 'UNI_VER'
121 BINARY_FILE_TYPE_LIB = 'LIB'
122 BINARY_FILE_TYPE_PE32 = 'PE32'
123 BINARY_FILE_TYPE_PIC = 'PIC'
124 BINARY_FILE_TYPE_PEI_DEPEX = 'PEI_DEPEX'
125 BINARY_FILE_TYPE_DXE_DEPEX = 'DXE_DEPEX'
126 BINARY_FILE_TYPE_SMM_DEPEX = 'SMM_DEPEX'
127 BINARY_FILE_TYPE_TE = 'TE'
128 BINARY_FILE_TYPE_VER = 'VER'
129 BINARY_FILE_TYPE_UI = 'UI'
130 BINARY_FILE_TYPE_BIN = 'BIN'
131 BINARY_FILE_TYPE_FV = 'FV'
132
133 PLATFORM_COMPONENT_TYPE_LIBRARY = EDK_COMPONENT_TYPE_LIBRARY
134 PLATFORM_COMPONENT_TYPE_LIBRARY_CLASS = 'LIBRARY_CLASS'
135 PLATFORM_COMPONENT_TYPE_MODULE = 'MODULE'
136
137 TAB_SOURCES = 'Sources'
138 TAB_SOURCES_COMMON = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_COMMON
139 TAB_SOURCES_IA32 = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_IA32
140 TAB_SOURCES_X64 = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_X64
141 TAB_SOURCES_IPF = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_IPF
142 TAB_SOURCES_ARM = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_ARM
143 TAB_SOURCES_EBC = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_EBC
144 TAB_SOURCES_AARCH64 = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_AARCH64
145
146 TAB_BINARIES = 'Binaries'
147 TAB_BINARIES_COMMON = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_COMMON
148 TAB_BINARIES_IA32 = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_IA32
149 TAB_BINARIES_X64 = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_X64
150 TAB_BINARIES_IPF = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_IPF
151 TAB_BINARIES_ARM = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_ARM
152 TAB_BINARIES_EBC = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_EBC
153 TAB_BINARIES_AARCH64 = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_AARCH64
154
155 TAB_INCLUDES = 'Includes'
156 TAB_INCLUDES_COMMON = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_COMMON
157 TAB_INCLUDES_IA32 = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_IA32
158 TAB_INCLUDES_X64 = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_X64
159 TAB_INCLUDES_IPF = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_IPF
160 TAB_INCLUDES_ARM = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_ARM
161 TAB_INCLUDES_EBC = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_EBC
162 TAB_INCLUDES_AARCH64 = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_AARCH64
163
164 TAB_GUIDS = 'Guids'
165 TAB_GUIDS_COMMON = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_COMMON
166 TAB_GUIDS_IA32 = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_IA32
167 TAB_GUIDS_X64 = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_X64
168 TAB_GUIDS_IPF = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_IPF
169 TAB_GUIDS_ARM = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_ARM
170 TAB_GUIDS_EBC = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_EBC
171 TAB_GUIDS_AARCH64 = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_AARCH64
172
173 TAB_PROTOCOLS = 'Protocols'
174 TAB_PROTOCOLS_COMMON = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_COMMON
175 TAB_PROTOCOLS_IA32 = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_IA32
176 TAB_PROTOCOLS_X64 = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_X64
177 TAB_PROTOCOLS_IPF = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_IPF
178 TAB_PROTOCOLS_ARM = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_ARM
179 TAB_PROTOCOLS_EBC = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_EBC
180 TAB_PROTOCOLS_AARCH64 = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_AARCH64
181
182 TAB_PPIS = 'Ppis'
183 TAB_PPIS_COMMON = TAB_PPIS + TAB_SPLIT + TAB_ARCH_COMMON
184 TAB_PPIS_IA32 = TAB_PPIS + TAB_SPLIT + TAB_ARCH_IA32
185 TAB_PPIS_X64 = TAB_PPIS + TAB_SPLIT + TAB_ARCH_X64
186 TAB_PPIS_IPF = TAB_PPIS + TAB_SPLIT + TAB_ARCH_IPF
187 TAB_PPIS_ARM = TAB_PPIS + TAB_SPLIT + TAB_ARCH_ARM
188 TAB_PPIS_EBC = TAB_PPIS + TAB_SPLIT + TAB_ARCH_EBC
189 TAB_PPIS_AARCH64 = TAB_PPIS + TAB_SPLIT + TAB_ARCH_AARCH64
190
191 TAB_LIBRARY_CLASSES = 'LibraryClasses'
192 TAB_LIBRARY_CLASSES_COMMON = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_COMMON
193 TAB_LIBRARY_CLASSES_IA32 = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_IA32
194 TAB_LIBRARY_CLASSES_X64 = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_X64
195 TAB_LIBRARY_CLASSES_IPF = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_IPF
196 TAB_LIBRARY_CLASSES_ARM = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_ARM
197 TAB_LIBRARY_CLASSES_EBC = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_EBC
198 TAB_LIBRARY_CLASSES_AARCH64 = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_AARCH64
199
200 TAB_PACKAGES = 'Packages'
201 TAB_PACKAGES_COMMON = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_COMMON
202 TAB_PACKAGES_IA32 = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_IA32
203 TAB_PACKAGES_X64 = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_X64
204 TAB_PACKAGES_IPF = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_IPF
205 TAB_PACKAGES_ARM = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_ARM
206 TAB_PACKAGES_EBC = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_EBC
207 TAB_PACKAGES_AARCH64 = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_AARCH64
208
209 TAB_PCDS = 'Pcds'
210 TAB_PCDS_FIXED_AT_BUILD = 'FixedAtBuild'
211 TAB_PCDS_PATCHABLE_IN_MODULE = 'PatchableInModule'
212 TAB_PCDS_FEATURE_FLAG = 'FeatureFlag'
213 TAB_PCDS_DYNAMIC_EX = 'DynamicEx'
214 TAB_PCDS_DYNAMIC_EX_DEFAULT = 'DynamicExDefault'
215 TAB_PCDS_DYNAMIC_EX_VPD = 'DynamicExVpd'
216 TAB_PCDS_DYNAMIC_EX_HII = 'DynamicExHii'
217 TAB_PCDS_DYNAMIC = 'Dynamic'
218 TAB_PCDS_DYNAMIC_DEFAULT = 'DynamicDefault'
219 TAB_PCDS_DYNAMIC_VPD = 'DynamicVpd'
220 TAB_PCDS_DYNAMIC_HII = 'DynamicHii'
221
222 PCD_DYNAMIC_TYPE_SET = {TAB_PCDS_DYNAMIC, TAB_PCDS_DYNAMIC_DEFAULT, TAB_PCDS_DYNAMIC_VPD, TAB_PCDS_DYNAMIC_HII}
223 PCD_DYNAMIC_EX_TYPE_SET = {TAB_PCDS_DYNAMIC_EX, TAB_PCDS_DYNAMIC_EX_DEFAULT, TAB_PCDS_DYNAMIC_EX_VPD, TAB_PCDS_DYNAMIC_EX_HII}
224
225 # leave as a list for order
226 PCD_TYPE_LIST = [TAB_PCDS_FIXED_AT_BUILD, TAB_PCDS_PATCHABLE_IN_MODULE, TAB_PCDS_FEATURE_FLAG, TAB_PCDS_DYNAMIC, TAB_PCDS_DYNAMIC_EX]
227
228 TAB_PCDS_FIXED_AT_BUILD_NULL = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD
229 TAB_PCDS_FIXED_AT_BUILD_COMMON = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + TAB_ARCH_COMMON
230 TAB_PCDS_FIXED_AT_BUILD_IA32 = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + TAB_ARCH_IA32
231 TAB_PCDS_FIXED_AT_BUILD_X64 = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + TAB_ARCH_X64
232 TAB_PCDS_FIXED_AT_BUILD_IPF = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + TAB_ARCH_IPF
233 TAB_PCDS_FIXED_AT_BUILD_ARM = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + TAB_ARCH_ARM
234 TAB_PCDS_FIXED_AT_BUILD_EBC = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + TAB_ARCH_EBC
235 TAB_PCDS_FIXED_AT_BUILD_AARCH64 = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + TAB_ARCH_AARCH64
236
237 TAB_PCDS_PATCHABLE_IN_MODULE_NULL = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE
238 TAB_PCDS_PATCHABLE_IN_MODULE_COMMON = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT + TAB_ARCH_COMMON
239 TAB_PCDS_PATCHABLE_IN_MODULE_IA32 = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT + TAB_ARCH_IA32
240 TAB_PCDS_PATCHABLE_IN_MODULE_X64 = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT + TAB_ARCH_X64
241 TAB_PCDS_PATCHABLE_IN_MODULE_IPF = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT + TAB_ARCH_IPF
242 TAB_PCDS_PATCHABLE_IN_MODULE_ARM = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT + TAB_ARCH_ARM
243 TAB_PCDS_PATCHABLE_IN_MODULE_EBC = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT + TAB_ARCH_EBC
244 TAB_PCDS_PATCHABLE_IN_MODULE_AARCH64 = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT + TAB_ARCH_AARCH64
245
246 TAB_PCDS_FEATURE_FLAG_NULL = TAB_PCDS + TAB_PCDS_FEATURE_FLAG
247 TAB_PCDS_FEATURE_FLAG_COMMON = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_ARCH_COMMON
248 TAB_PCDS_FEATURE_FLAG_IA32 = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_ARCH_IA32
249 TAB_PCDS_FEATURE_FLAG_X64 = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_ARCH_X64
250 TAB_PCDS_FEATURE_FLAG_IPF = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_ARCH_IPF
251 TAB_PCDS_FEATURE_FLAG_ARM = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_ARCH_ARM
252 TAB_PCDS_FEATURE_FLAG_EBC = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_ARCH_EBC
253 TAB_PCDS_FEATURE_FLAG_AARCH64 = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_ARCH_AARCH64
254
255 TAB_PCDS_DYNAMIC_EX_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_EX
256 TAB_PCDS_DYNAMIC_EX_DEFAULT_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_EX_DEFAULT
257 TAB_PCDS_DYNAMIC_EX_HII_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_EX_HII
258 TAB_PCDS_DYNAMIC_EX_VPD_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_EX_VPD
259 TAB_PCDS_DYNAMIC_EX_COMMON = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_COMMON
260 TAB_PCDS_DYNAMIC_EX_IA32 = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_IA32
261 TAB_PCDS_DYNAMIC_EX_X64 = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_X64
262 TAB_PCDS_DYNAMIC_EX_IPF = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_IPF
263 TAB_PCDS_DYNAMIC_EX_ARM = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_ARM
264 TAB_PCDS_DYNAMIC_EX_EBC = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_EBC
265 TAB_PCDS_DYNAMIC_EX_AARCH64 = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_AARCH64
266
267 TAB_PCDS_DYNAMIC_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC
268 TAB_PCDS_DYNAMIC_DEFAULT_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_DEFAULT
269 TAB_PCDS_DYNAMIC_HII_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_HII
270 TAB_PCDS_DYNAMIC_VPD_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_VPD
271 TAB_PCDS_DYNAMIC_COMMON = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_COMMON
272 TAB_PCDS_DYNAMIC_IA32 = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_IA32
273 TAB_PCDS_DYNAMIC_X64 = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_X64
274 TAB_PCDS_DYNAMIC_IPF = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_IPF
275 TAB_PCDS_DYNAMIC_ARM = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_ARM
276 TAB_PCDS_DYNAMIC_EBC = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_EBC
277 TAB_PCDS_DYNAMIC_AARCH64 = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_AARCH64
278
279 TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_PEI_PAGE_SIZE = 'PcdLoadFixAddressPeiCodePageNumber'
280 TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_PEI_PAGE_SIZE_DATA_TYPE = 'UINT32'
281 TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_DXE_PAGE_SIZE = 'PcdLoadFixAddressBootTimeCodePageNumber'
282 TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_DXE_PAGE_SIZE_DATA_TYPE = 'UINT32'
283 TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_RUNTIME_PAGE_SIZE = 'PcdLoadFixAddressRuntimeCodePageNumber'
284 TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_RUNTIME_PAGE_SIZE_DATA_TYPE = 'UINT32'
285 TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_SMM_PAGE_SIZE = 'PcdLoadFixAddressSmmCodePageNumber'
286 TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_SMM_PAGE_SIZE_DATA_TYPE = 'UINT32'
287 TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_SET = {TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_PEI_PAGE_SIZE, \
288 TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_DXE_PAGE_SIZE, \
289 TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_RUNTIME_PAGE_SIZE, \
290 TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_SMM_PAGE_SIZE}
291
292 ## The mapping dictionary from datum type to its maximum number.
293 MAX_VAL_TYPE = {"BOOLEAN":0x01, TAB_UINT8:0xFF, TAB_UINT16:0xFFFF, TAB_UINT32:0xFFFFFFFF, TAB_UINT64:0xFFFFFFFFFFFFFFFF}
294 ## The mapping dictionary from datum type to size string.
295 MAX_SIZE_TYPE = {"BOOLEAN":1, TAB_UINT8:1, TAB_UINT16:2, TAB_UINT32:4, TAB_UINT64:8}
296
297 TAB_DEPEX = 'Depex'
298 TAB_DEPEX_COMMON = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_COMMON
299 TAB_DEPEX_IA32 = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_IA32
300 TAB_DEPEX_X64 = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_X64
301 TAB_DEPEX_IPF = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_IPF
302 TAB_DEPEX_ARM = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_ARM
303 TAB_DEPEX_EBC = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_EBC
304 TAB_DEPEX_AARCH64 = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_AARCH64
305
306 TAB_SKUIDS = 'SkuIds'
307 TAB_DEFAULT_STORES = 'DefaultStores'
308 TAB_DEFAULT_STORES_DEFAULT = 'STANDARD'
309
310 TAB_LIBRARIES = 'Libraries'
311 TAB_LIBRARIES_COMMON = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_COMMON
312 TAB_LIBRARIES_IA32 = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_IA32
313 TAB_LIBRARIES_X64 = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_X64
314 TAB_LIBRARIES_IPF = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_IPF
315 TAB_LIBRARIES_ARM = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_ARM
316 TAB_LIBRARIES_EBC = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_EBC
317 TAB_LIBRARIES_AARCH64 = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_AARCH64
318
319 TAB_COMPONENTS = 'Components'
320 TAB_COMPONENTS_COMMON = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_COMMON
321 TAB_COMPONENTS_IA32 = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_IA32
322 TAB_COMPONENTS_X64 = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_X64
323 TAB_COMPONENTS_IPF = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_IPF
324 TAB_COMPONENTS_ARM = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_ARM
325 TAB_COMPONENTS_EBC = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_EBC
326 TAB_COMPONENTS_AARCH64 = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_AARCH64
327
328 TAB_COMPONENTS_SOURCE_OVERRIDE_PATH = 'SOURCE_OVERRIDE_PATH'
329
330 TAB_BUILD_OPTIONS = 'BuildOptions'
331
332 TAB_DEFINE = 'DEFINE'
333 TAB_NMAKE = 'Nmake'
334 TAB_USER_EXTENSIONS = 'UserExtensions'
335 TAB_INCLUDE = '!include'
336 TAB_DEFAULT = 'DEFAULT'
337 TAB_COMMON = 'COMMON'
338
339 #
340 # Common Define
341 #
342 TAB_COMMON_DEFINES = 'Defines'
343
344 #
345 # Inf Definitions
346 #
347 TAB_INF_DEFINES = TAB_COMMON_DEFINES
348 TAB_INF_DEFINES_INF_VERSION = 'INF_VERSION'
349 TAB_INF_DEFINES_BASE_NAME = 'BASE_NAME'
350 TAB_INF_DEFINES_FILE_GUID = 'FILE_GUID'
351 TAB_INF_DEFINES_MODULE_TYPE = 'MODULE_TYPE'
352 TAB_INF_DEFINES_EFI_SPECIFICATION_VERSION = 'EFI_SPECIFICATION_VERSION'
353 TAB_INF_DEFINES_UEFI_SPECIFICATION_VERSION = 'UEFI_SPECIFICATION_VERSION'
354 TAB_INF_DEFINES_PI_SPECIFICATION_VERSION = 'PI_SPECIFICATION_VERSION'
355 TAB_INF_DEFINES_EDK_RELEASE_VERSION = 'EDK_RELEASE_VERSION'
356 TAB_INF_DEFINES_BINARY_MODULE = 'BINARY_MODULE'
357 TAB_INF_DEFINES_LIBRARY_CLASS = 'LIBRARY_CLASS'
358 TAB_INF_DEFINES_COMPONENT_TYPE = 'COMPONENT_TYPE'
359 TAB_INF_DEFINES_MAKEFILE_NAME = 'MAKEFILE_NAME'
360 TAB_INF_DEFINES_DPX_SOURCE = 'DPX_SOURCE'
361 TAB_INF_DEFINES_BUILD_NUMBER = 'BUILD_NUMBER'
362 TAB_INF_DEFINES_BUILD_TYPE = 'BUILD_TYPE'
363 TAB_INF_DEFINES_FFS_EXT = 'FFS_EXT'
364 TAB_INF_DEFINES_FV_EXT = 'FV_EXT'
365 TAB_INF_DEFINES_SOURCE_FV = 'SOURCE_FV'
366 TAB_INF_DEFINES_VERSION_NUMBER = 'VERSION_NUMBER'
367 TAB_INF_DEFINES_VERSION = 'VERSION' # for Edk inf, the same as VERSION_NUMBER
368 TAB_INF_DEFINES_VERSION_STRING = 'VERSION_STRING'
369 TAB_INF_DEFINES_PCD_IS_DRIVER = 'PCD_IS_DRIVER'
370 TAB_INF_DEFINES_TIANO_EDK_FLASHMAP_H = 'TIANO_EDK_FLASHMAP_H'
371 TAB_INF_DEFINES_ENTRY_POINT = 'ENTRY_POINT'
372 TAB_INF_DEFINES_UNLOAD_IMAGE = 'UNLOAD_IMAGE'
373 TAB_INF_DEFINES_CONSTRUCTOR = 'CONSTRUCTOR'
374 TAB_INF_DEFINES_DESTRUCTOR = 'DESTRUCTOR'
375 TAB_INF_DEFINES_DEFINE = 'DEFINE'
376 TAB_INF_DEFINES_SPEC = 'SPEC'
377 TAB_INF_DEFINES_CUSTOM_MAKEFILE = 'CUSTOM_MAKEFILE'
378 TAB_INF_DEFINES_MACRO = '__MACROS__'
379 TAB_INF_DEFINES_SHADOW = 'SHADOW'
380 TAB_INF_FIXED_PCD = 'FixedPcd'
381 TAB_INF_FEATURE_PCD = 'FeaturePcd'
382 TAB_INF_PATCH_PCD = 'PatchPcd'
383 TAB_INF_PCD = 'Pcd'
384 TAB_INF_PCD_EX = 'PcdEx'
385 TAB_INF_USAGE_PRO = 'PRODUCES'
386 TAB_INF_USAGE_SOME_PRO = 'SOMETIMES_PRODUCES'
387 TAB_INF_USAGE_CON = 'CONSUMES'
388 TAB_INF_USAGE_SOME_CON = 'SOMETIMES_CONSUMES'
389 TAB_INF_USAGE_NOTIFY = 'NOTIFY'
390 TAB_INF_USAGE_TO_START = 'TO_START'
391 TAB_INF_USAGE_BY_START = 'BY_START'
392 TAB_INF_GUIDTYPE_EVENT = 'Event'
393 TAB_INF_GUIDTYPE_FILE = 'File'
394 TAB_INF_GUIDTYPE_FV = 'FV'
395 TAB_INF_GUIDTYPE_GUID = 'GUID'
396 TAB_INF_GUIDTYPE_HII = 'HII'
397 TAB_INF_GUIDTYPE_HOB = 'HOB'
398 TAB_INF_GUIDTYPE_ST = 'SystemTable'
399 TAB_INF_GUIDTYPE_TSG = 'TokenSpaceGuid'
400 TAB_INF_GUIDTYPE_VAR = 'Variable'
401 TAB_INF_GUIDTYPE_PROTOCOL = 'PROTOCOL'
402 TAB_INF_GUIDTYPE_PPI = 'PPI'
403 TAB_INF_USAGE_UNDEFINED = 'UNDEFINED'
404
405 #
406 # Dec Definitions
407 #
408 TAB_DEC_DEFINES = TAB_COMMON_DEFINES
409 TAB_DEC_DEFINES_DEC_SPECIFICATION = 'DEC_SPECIFICATION'
410 TAB_DEC_DEFINES_PACKAGE_NAME = 'PACKAGE_NAME'
411 TAB_DEC_DEFINES_PACKAGE_GUID = 'PACKAGE_GUID'
412 TAB_DEC_DEFINES_PACKAGE_VERSION = 'PACKAGE_VERSION'
413 TAB_DEC_DEFINES_PKG_UNI_FILE = 'PKG_UNI_FILE'
414
415 #
416 # Dsc Definitions
417 #
418 TAB_DSC_DEFINES = TAB_COMMON_DEFINES
419 TAB_DSC_DEFINES_PLATFORM_NAME = 'PLATFORM_NAME'
420 TAB_DSC_DEFINES_PLATFORM_GUID = 'PLATFORM_GUID'
421 TAB_DSC_DEFINES_PLATFORM_VERSION = 'PLATFORM_VERSION'
422 TAB_DSC_DEFINES_DSC_SPECIFICATION = 'DSC_SPECIFICATION'
423 TAB_DSC_DEFINES_OUTPUT_DIRECTORY = 'OUTPUT_DIRECTORY'
424 TAB_DSC_DEFINES_SUPPORTED_ARCHITECTURES = 'SUPPORTED_ARCHITECTURES'
425 TAB_DSC_DEFINES_BUILD_TARGETS = 'BUILD_TARGETS'
426 TAB_DSC_DEFINES_SKUID_IDENTIFIER = 'SKUID_IDENTIFIER'
427 TAB_DSC_DEFINES_PCD_INFO_GENERATION = 'PCD_INFO_GENERATION'
428 TAB_DSC_DEFINES_PCD_VAR_CHECK_GENERATION = 'PCD_VAR_CHECK_GENERATION'
429 TAB_DSC_DEFINES_FLASH_DEFINITION = 'FLASH_DEFINITION'
430 TAB_DSC_DEFINES_BUILD_NUMBER = 'BUILD_NUMBER'
431 TAB_DSC_DEFINES_MAKEFILE_NAME = 'MAKEFILE_NAME'
432 TAB_DSC_DEFINES_BS_BASE_ADDRESS = 'BsBaseAddress'
433 TAB_DSC_DEFINES_RT_BASE_ADDRESS = 'RtBaseAddress'
434 TAB_DSC_DEFINES_RFC_LANGUAGES = 'RFC_LANGUAGES'
435 TAB_DSC_DEFINES_ISO_LANGUAGES = 'ISO_LANGUAGES'
436 TAB_DSC_DEFINES_DEFINE = 'DEFINE'
437 TAB_DSC_DEFINES_VPD_TOOL_GUID = 'VPD_TOOL_GUID'
438 TAB_FIX_LOAD_TOP_MEMORY_ADDRESS = 'FIX_LOAD_TOP_MEMORY_ADDRESS'
439 TAB_DSC_DEFINES_EDKGLOBAL = 'EDK_GLOBAL'
440 TAB_DSC_PREBUILD = 'PREBUILD'
441 TAB_DSC_POSTBUILD = 'POSTBUILD'
442 #
443 # TargetTxt Definitions
444 #
445 TAB_TAT_DEFINES_ACTIVE_PLATFORM = 'ACTIVE_PLATFORM'
446 TAB_TAT_DEFINES_ACTIVE_MODULE = 'ACTIVE_MODULE'
447 TAB_TAT_DEFINES_TOOL_CHAIN_CONF = 'TOOL_CHAIN_CONF'
448 TAB_TAT_DEFINES_MAX_CONCURRENT_THREAD_NUMBER = 'MAX_CONCURRENT_THREAD_NUMBER'
449 TAB_TAT_DEFINES_TARGET = 'TARGET'
450 TAB_TAT_DEFINES_TOOL_CHAIN_TAG = 'TOOL_CHAIN_TAG'
451 TAB_TAT_DEFINES_TARGET_ARCH = 'TARGET_ARCH'
452 TAB_TAT_DEFINES_BUILD_RULE_CONF = "BUILD_RULE_CONF"
453
454 #
455 # ToolDef Definitions
456 #
457 TAB_TOD_DEFINES_TARGET = 'TARGET'
458 TAB_TOD_DEFINES_TOOL_CHAIN_TAG = 'TOOL_CHAIN_TAG'
459 TAB_TOD_DEFINES_TARGET_ARCH = 'TARGET_ARCH'
460 TAB_TOD_DEFINES_COMMAND_TYPE = 'COMMAND_TYPE'
461 TAB_TOD_DEFINES_FAMILY = 'FAMILY'
462 TAB_TOD_DEFINES_BUILDRULEFAMILY = 'BUILDRULEFAMILY'
463 TAB_TOD_DEFINES_BUILDRULEORDER = 'BUILDRULEORDER'
464
465 #
466 # Conditional Statements
467 #
468 TAB_IF = '!if'
469 TAB_END_IF = '!endif'
470 TAB_ELSE_IF = '!elseif'
471 TAB_ELSE = '!else'
472 TAB_IF_DEF = '!ifdef'
473 TAB_IF_N_DEF = '!ifndef'
474 TAB_IF_EXIST = '!if exist'
475 TAB_ERROR = '!ERROR'
476
477 #
478 # Unknown section
479 #
480 TAB_UNKNOWN = 'UNKNOWN'
481
482 #
483 # Build database path
484 #
485 DATABASE_PATH = ":memory:" #"BuildDatabase.db"
486
487 # used by ECC
488 MODIFIER_SET = {'IN', 'OUT', 'OPTIONAL', 'UNALIGNED', 'EFI_RUNTIMESERVICE', 'EFI_BOOTSERVICE', 'EFIAPI'}
489
490 # Dependency Expression
491 DEPEX_SUPPORTED_OPCODE_SET = {"BEFORE", "AFTER", "PUSH", "AND", "OR", "NOT", "END", "SOR", "TRUE", "FALSE", '(', ')'}
492
493 TAB_STATIC_LIBRARY = "STATIC-LIBRARY-FILE"
494 TAB_DYNAMIC_LIBRARY = "DYNAMIC-LIBRARY-FILE"
495 TAB_FRAMEWORK_IMAGE = "EFI-IMAGE-FILE"
496 TAB_C_CODE_FILE = "C-CODE-FILE"
497 TAB_C_HEADER_FILE = "C-HEADER-FILE"
498 TAB_UNICODE_FILE = "UNICODE-TEXT-FILE"
499 TAB_IMAGE_FILE = "IMAGE-DEFINITION-FILE"
500 TAB_DEPENDENCY_EXPRESSION_FILE = "DEPENDENCY-EXPRESSION-FILE"
501 TAB_UNKNOWN_FILE = "UNKNOWN-TYPE-FILE"
502 TAB_DEFAULT_BINARY_FILE = "_BINARY_FILE_"
503 TAB_OBJECT_FILE = "OBJECT-FILE"
504 TAB_VFR_FILE = 'VISUAL-FORM-REPRESENTATION-FILE'
505
506 # used by BRG
507 TAB_BRG_PCD = 'PCD'
508 TAB_BRG_LIBRARY = 'Library'
509
510 #
511 # Build Rule File Version Definition
512 #
513 TAB_BUILD_RULE_VERSION = "build_rule_version"
514
515 # section name for PCDs
516 PCDS_DYNAMIC_DEFAULT = "PcdsDynamicDefault"
517 PCDS_DYNAMIC_VPD = "PcdsDynamicVpd"
518 PCDS_DYNAMIC_HII = "PcdsDynamicHii"
519 PCDS_DYNAMICEX_DEFAULT = "PcdsDynamicExDefault"
520 PCDS_DYNAMICEX_VPD = "PcdsDynamicExVpd"
521 PCDS_DYNAMICEX_HII = "PcdsDynamicExHii"
522
523 SECTIONS_HAVE_ITEM_PCD_SET = {PCDS_DYNAMIC_DEFAULT.upper(),PCDS_DYNAMIC_VPD.upper(),PCDS_DYNAMIC_HII.upper(), \
524 PCDS_DYNAMICEX_DEFAULT.upper(),PCDS_DYNAMICEX_VPD.upper(),PCDS_DYNAMICEX_HII.upper()}
525 # Section allowed to have items after arch
526 SECTIONS_HAVE_ITEM_AFTER_ARCH_SET = {TAB_LIBRARY_CLASSES.upper(), TAB_DEPEX.upper(), TAB_USER_EXTENSIONS.upper(),
527 PCDS_DYNAMIC_DEFAULT.upper(),
528 PCDS_DYNAMIC_VPD.upper(),
529 PCDS_DYNAMIC_HII.upper(),
530 PCDS_DYNAMICEX_DEFAULT.upper(),
531 PCDS_DYNAMICEX_VPD.upper(),
532 PCDS_DYNAMICEX_HII.upper(),
533 TAB_BUILD_OPTIONS.upper(),
534 TAB_INCLUDES.upper()}