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