BaseTools: skip updating temporary variable.
[mirror_edk2.git] / BaseTools / Source / Python / CommonDataClass / ModuleClass.py
CommitLineData
30fdf114
LG
1## @file\r
2# This file is used to define a class object to describe a module\r
3#\r
40d841f6
LG
4# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
5# This program and the accompanying materials\r
30fdf114
LG
6# are licensed and made available under the terms and conditions of the BSD License\r
7# which accompanies this distribution. The full text of the license may be found at\r
8# http://opensource.org/licenses/bsd-license.php\r
9#\r
10# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13##\r
14# Import Modules\r
15#\r
16from CommonClass import *\r
17\r
18## ModuleHeaderClass\r
19#\r
20# This class defined header items used in Module file\r
21# \r
22# @param IdentificationClass: Inherited from IdentificationClass class\r
23# @param CommonHeaderClass: Inherited from CommonHeaderClass class\r
24# @param DefineClass: Inherited from DefineClass class\r
25#\r
26# @var ModuleType: To store value for ModuleType\r
27# @var SupArchList: To store value for SupArchList, selection scope is in below list\r
4afd3d04 28# EBC | IA32 | X64 | IPF | ARM | PPC | AARCH64\r
30fdf114
LG
29# @var BinaryModule: To store value for BinaryModule\r
30# @var OutputFileBasename: To store value for OutputFileBasename\r
31# @var ClonedFrom: To store value for ClonedFrom, it is a set structure as\r
32# [ ClonedRecordClass, ... ]\r
33# @var PcdIsDriver: To store value for PcdIsDriver, selection scope is in below list\r
34# PEI_PCD_DRIVER | DXE_PCD_DRIVER\r
b36d134f 35# @var TianoEdkFlashMap_h: To store value for TianoEdkFlashMap_h\r
30fdf114 36# @var InfVersion: To store value for InfVersion\r
52302d4d 37# @var UefiSpecificationVersion: To store value for UefiSpecificationVersion\r
30fdf114
LG
38# @var EdkReleaseVersion: To store value for EdkReleaseVersion\r
39# @var LibraryClass: To store value for LibraryClass, it is a set structure as\r
40# [ LibraryClassClass, ...]\r
41# @var ComponentType: To store value for ComponentType, selection scope is in below list\r
42# LIBRARY | SECURITY_CORE | PEI_CORE | COMBINED_PEIM_DRIVER | PIC_PEIM | RELOCATABLE_PEIM | BS_DRIVER | RT_DRIVER | SAL_RT_DRIVER | APPLICATION\r
43# @var MakefileName: To store value for MakefileName\r
44# @var BuildNumber: To store value for BuildNumber\r
45# @var BuildType: To store value for BuildType\r
46# @var FfsExt: To store value for FfsExt\r
47# @var FvExt: To store value for FvExt\r
48# @var SourceFv: To store value for SourceFv\r
49# @var CustomMakefile: To store value for CustomMakefile, it is a set structure as\r
50# { Family : Filename, ... }\r
51# @var Shadow: To store value for Shadow\r
52# @var MacroDefines To store the defined macros\r
53#\r
54class ModuleHeaderClass(IdentificationClass, CommonHeaderClass, DefineClass):\r
55 def __init__(self):\r
56 IdentificationClass.__init__(self)\r
57 CommonHeaderClass.__init__(self)\r
58 DefineClass.__init__(self)\r
59 self.ModuleType = ''\r
60 self.SupModuleList = []\r
61 self.SupArchList = []\r
62 self.BinaryModule = False\r
63 self.OutputFileBasename = ''\r
64 self.ClonedFrom = []\r
65 self.PcdIsDriver = ''\r
b36d134f 66 self.TianoEdkFlashMap_h = False\r
30fdf114 67 self.InfVersion = ''\r
30fdf114
LG
68 self.PiSpecificationVersion = ''\r
69 self.UefiSpecificationVersion = ''\r
70 self.EdkReleaseVersion = ''\r
71 self.LibraryClass = []\r
72 self.ComponentType = ''\r
73 self.MakefileName = ''\r
74 self.BuildNumber = ''\r
75 self.BuildType = ''\r
76 self.FfsExt = ''\r
77 self.FvExt = ''\r
78 self.SourceFv = ''\r
79 self.CustomMakefile = {}\r
80 self.Shadow = ''\r
81 self.MacroDefines = {}\r
82 self.SourceOverridePath = ''\r
83 self.Specification = []\r
84\r
85## ModuleSourceFileClass\r
86#\r
87# This class defined source file item used in Module file\r
88# \r
89# @param CommonClass: Inherited from CommonClass class\r
90# @param SourceFile: Input value for SourceFile, default is ''\r
91# @param TagName: Input value for TagName, default is ''\r
92# @param ToolCode: Input value for ToolCode, default is ''\r
93# @param ToolChainFamily: Input value for ToolChainFamily, default is ''\r
94# @param FeatureFlag: Input value for FeatureFlag, default is ''\r
95# @param SupArchList: Input value for SupArchList, default is []\r
96#\r
97# @var SourceFile: To store value for SourceFile\r
98# @var TagName: To store value for TagName\r
99# @var ToolCode: To store value for ToolCode\r
100# @var ToolChainFamily: To store value for ToolChainFamily\r
101#\r
102class ModuleSourceFileClass(CommonClass):\r
103 def __init__(self, SourceFile = '', TagName = '', ToolCode = '', ToolChainFamily = '', FeatureFlag = '', SupArchList = None):\r
104 self.SourceFile = SourceFile\r
105 self.TagName = TagName\r
106 self.ToolCode = ToolCode\r
107 self.ToolChainFamily = ToolChainFamily\r
108 self.FileType = ''\r
109 CommonClass.__init__(self, FeatureFlag = FeatureFlag, SupArchList = SupArchList)\r
110\r
111## ModuleBinaryFileClass\r
112#\r
113# This class defined binary file item used in Module file\r
114# \r
115# @param CommonClass: Inherited from CommonClass class\r
116# @param BinaryFile: Input value for BinaryFile, default is ''\r
117# @param FileType: Input value for FileType, default is ''\r
118# @param FeatureFlag: Input value for FeatureFlag, default is ''\r
119# @param SupArchList: Input value for SupArchList, default is []\r
120#\r
121# @var BinaryFile: To store value for BinaryFile\r
122# @var FileType: To store value for FileType, selection scope is in below list\r
b303ea72 123# FW | GUID | PREEFORM | UEFI_APP | UNI_UI | UNI_VER | LIB | PE32 | PIC | PEI_DEPEX | DXE_DEPEX | SMM_DEPEX| TE | VER | UI | BIN | FV\r
30fdf114
LG
124# @var Target: To store value for Target\r
125# @var ToolChainFamily: To store value for ToolChainFamily\r
126#\r
127class ModuleBinaryFileClass(CommonClass):\r
128 def __init__(self, BinaryFile = '', FileType = '', Target = '', FeatureFlag = '', SupArchList = None):\r
129 self.BinaryFile = BinaryFile\r
130 self.FileType = FileType\r
131 self.Target = Target\r
132 CommonClass.__init__(self, FeatureFlag = FeatureFlag, SupArchList = SupArchList)\r
133 self.Filenames = []\r
134 self.PatchPcdValues = []\r
135 self.PcdExValues = []\r
136 self.LibraryInstances = []\r
137 self.BuildFlags = []\r
138\r
139## ModulePackageDependencyClass\r
140#\r
141# This class defined package dependency item used in Module file\r
142# \r
143# @param CommonClass: Inherited from CommonClass class\r
144# @param DefineClass: Input value for DefineClass class\r
145#\r
146# @var FilePath: To store value for FilePath\r
147# @var PackageName: To store value for PackageName\r
148# @var PackageVersion: To store value for PackageVersion\r
149# @var PackageGuid: To store value for PackageGuid\r
150#\r
151class ModulePackageDependencyClass(CommonClass, DefineClass):\r
152 def __init__(self):\r
153 self.FilePath = ''\r
154 self.PackageName = ''\r
155 self.PackageVersion = ''\r
156 self.PackageGuid = ''\r
157 self.Description = ''\r
158 CommonClass.__init__(self)\r
159 DefineClass.__init__(self) \r
160\r
161## ModuleLibraryClass\r
162#\r
163# This class defined library item used in Module file\r
164# \r
165# @param CommonClass: Inherited from CommonClass class\r
166#\r
167# @var Library: To store value for Library\r
168#\r
169class ModuleLibraryClass(CommonClass):\r
170 def __init__(self):\r
171 self.Library = ''\r
172 CommonClass.__init__(self)\r
173\r
174## ModuleEventClass\r
175#\r
176# This class defined event item used in Module file\r
177# \r
178# @param CommonClass: Inherited from CommonClass class\r
179#\r
180# @var CName: To store value for CName\r
181# @var GuidCName: To store value for GuidCName\r
182# @var Type: To store value for Type, selection scope is in below list\r
183# CREATE_EVENT | SIGNAL_EVENT\r
184#\r
185class ModuleEventClass(CommonClass): \r
186 def __init__(self):\r
187 self.CName = ''\r
188 self.GuidCName = ''\r
189 self.Type = '' \r
190 CommonClass.__init__(self)\r
191\r
192## ModuleHobClass\r
193#\r
194# This class defined hob item used in Module file\r
195# \r
196# @param CommonClass: Inherited from CommonClass class\r
197#\r
198# @var GuidCName: To store value for GuidCName\r
199# @var Type: To store value for Type, selection scope is in below list\r
200# PHIT | MEMORY_ALLOCATION | RESOURCE_DESCRIPTOR | GUID_EXTENSION | FIRMWARE_VOLUME | CPU | POOL | CAPSULE_VOLUME\r
201#\r
202class ModuleHobClass(CommonClass):\r
203 def __init__(self):\r
204 self.Type = ''\r
205 self.GuidCName = ''\r
206 CommonClass.__init__(self)\r
207\r
208## ModuleVariableClass\r
209#\r
210# This class defined variable item used in Module file\r
211# \r
212# @param CommonClass: Inherited from CommonClass class\r
213#\r
214# @var GuidCName: To store value for GuidCName\r
215# @var Name: To store value for Name\r
216#\r
217class ModuleVariableClass(CommonClass):\r
218 def __init__(self):\r
219 self.Name = ''\r
220 self.GuidCName = ''\r
221 CommonClass.__init__(self)\r
222\r
223## ModuleBootModeClass\r
224#\r
225# This class defined boot mode item used in Module file\r
226# \r
227# @param CommonClass: Inherited from CommonClass class\r
228#\r
229# @var Name: To store value for Name, selection scope is in below list\r
230# FULL | MINIMAL | NO_CHANGE | DIAGNOSTICS | DEFAULT | S2_RESUME | S3_RESUME | S4_RESUME | S5_RESUME | FLASH_UPDATE | RECOVERY_FULL | RECOVERY_MINIMAL | RECOVERY_NO_CHANGE | RECOVERY_DIAGNOSTICS | RECOVERY_DEFAULT | RECOVERY_S2_RESUME | RECOVERY_S3_RESUME | RECOVERY_S4_RESUME | RECOVERY_S5_RESUME | RECOVERY_FLASH_UPDATE \r
231#\r
232class ModuleBootModeClass(CommonClass):\r
233 def __init__(self):\r
234 self.Name = ''\r
235 CommonClass.__init__(self)\r
236\r
237## ModuleSystemTableClass\r
238#\r
239# This class defined system table item used in Module file\r
240# \r
241# @param CommonClass: Inherited from CommonClass class\r
242#\r
243# @var CName: To store value for CName\r
244#\r
245class ModuleSystemTableClass(CommonClass):\r
246 def __init__(self):\r
247 self.CName = ''\r
248 CommonClass.__init__(self)\r
249\r
250## ModuleDataHubClass\r
251#\r
252# This class defined data hub item used in Module file\r
253# \r
254# @param CommonClass: Inherited from CommonClass class\r
255#\r
256# @var CName: To store value for CName\r
257#\r
258class ModuleDataHubClass(CommonClass):\r
259 def __init__(self):\r
260 self.CName = ''\r
261 CommonClass.__init__(self) \r
262\r
263## ModuleHiiPackageClass\r
264#\r
265# This class defined Hii package item used in Module file\r
266# \r
267# @param CommonClass: Inherited from CommonClass class\r
268#\r
269# @var CName: To store value for CName\r
270#\r
271class ModuleHiiPackageClass(CommonClass):\r
272 def __init__(self):\r
273 self.CName = ''\r
274 CommonClass.__init__(self)\r
275\r
276## ModuleExternImageClass\r
277#\r
278# This class defined Extern Image item used in Module file\r
279# \r
280# @param object: Inherited from object class\r
281#\r
282# @var ModuleEntryPoint: To store value for ModuleEntryPoint\r
283# @var ModuleUnloadImage: To store value for ModuleUnloadImage\r
284#\r
285class ModuleExternImageClass(object):\r
286 def __init__(self):\r
287 self.ModuleEntryPoint = ''\r
288 self.ModuleUnloadImage = ''\r
289\r
290## ModuleExternLibraryClass\r
291#\r
292# This class defined Extern Library item used in Module file\r
293# \r
294# @param object: Inherited from object class\r
295#\r
296# @var Constructor: To store value for Constructor\r
297# @var Destructor: To store value for Destructor\r
298#\r
299class ModuleExternLibraryClass(object):\r
300 def __init__(self):\r
301 self.Constructor = ''\r
302 self.Destructor = ''\r
303\r
304## ModuleExternDriverClass\r
305#\r
306# This class defined Extern Driver item used in Module file\r
307# \r
308# @param object: Inherited from object class\r
309#\r
310# @var DriverBinding: To store value for DriverBinding\r
311# @var ComponentName: To store value for ComponentName\r
312# @var DriverConfig: To store value for DriverConfig\r
313# @var DriverDiag: To store value for DriverDiag\r
314#\r
315class ModuleExternDriverClass(object):\r
316 def __init__(self):\r
317 self.DriverBinding= ''\r
318 self.ComponentName = ''\r
319 self.DriverConfig = ''\r
320 self.DriverDiag = ''\r
321\r
322## ModuleExternCallBackClass\r
323#\r
324# This class defined Extern Call Back item used in Module file\r
325# \r
326# @param object: Inherited from object class\r
327#\r
328# @var SetVirtualAddressMapCallBack: To store value for SetVirtualAddressMapCallBack\r
329# @var ExitBootServicesCallBack: To store value for ExitBootServicesCallBack\r
330#\r
331class ModuleExternCallBackClass(object):\r
332 def __init__(self):\r
333 self.SetVirtualAddressMapCallBack = ''\r
334 self.ExitBootServicesCallBack = ''\r
335\r
336## ModuleExternClass\r
337#\r
338# This class defined Extern used in Module file\r
339# \r
340# @param object: Inherited from object class\r
341#\r
342#\r
343class ModuleExternClass(CommonClass):\r
344 def __init__(self):\r
345 self.EntryPoint = ''\r
346 self.UnloadImage = ''\r
347 self.Constructor = ''\r
348 self.Destructor = ''\r
349 CommonClass.__init__(self)\r
350\r
351## ModuleDepexClass\r
352#\r
353# This class defined depex item used in Module file\r
354# \r
355# @param CommonClass: Inherited from CommonClass class\r
356# @param DefineClass: Input value for DefineClass class\r
357#\r
358# @var Depex: To store value for Depex\r
359#\r
360class ModuleDepexClass(CommonClass, DefineClass):\r
361 def __init__(self):\r
362 CommonClass.__init__(self)\r
363 DefineClass.__init__(self)\r
364 self.Depex = ''\r
365\r
366## ModuleNmakeClass\r
367#\r
368# This class defined nmake item used in Module file\r
369# \r
370# @param CommonClass: Inherited from CommonClass class\r
371#\r
372# @var Name: To store value for Name\r
373# @var Value: To store value for Value\r
374#\r
375class ModuleNmakeClass(CommonClass):\r
376 def __init__(self):\r
377 CommonClass.__init__(self)\r
378 self.Name = ''\r
379 self.Value = ''\r
380\r
381## ModuleClass\r
382#\r
383# This class defined a complete module item\r
384# \r
385# @param object: Inherited from object class\r
386#\r
387# @var Header: To store value for Header, it is a structure as\r
388# {Arch : ModuleHeaderClass}\r
389# @var LibraryClasses: To store value for LibraryClasses, it is a list structure as\r
390# [ LibraryClassClass, ...]\r
391# @var Libraries: To store value for Libraries, it is a list structure as\r
392# [ ModuleLibraryClass, ...]\r
393# @var Sources: To store value for Sources, it is a list structure as\r
394# [ ModuleSourceFileClass, ...]\r
395# @var Binaries: To store value for Binaries, it is a list structure as\r
396# [ ModuleBinaryFileClass, ...]\r
397# @var NonProcessedFiles: To store value for NonProcessedFiles, it is a list structure as\r
398# [ '', '', ...]\r
399# @var PackageDependencies: To store value for PackageDependencies, it is a list structure as\r
400# [ ModulePackageDependencyClass, ... ] \r
401# @var Nmake: To store value for Nmake, it is a list structure as\r
402# [ ModuleNmakeClass, ... ]\r
403# @var Depex: To store value for Depex, it is a list structure as\r
404# [ ModuleDepexClass, ... ]\r
405# @var Includes: To store value for Includes, it is a list structure as\r
406# [ IncludeClass, ...]\r
407# @var Protocols: To store value for Protocols, it is a list structure as\r
408# [ ProtocolClass, ...]\r
409# @var Ppis: To store value for Ppis, it is a list structure as\r
410# [ PpiClass, ...]\r
411# @var Events: To store value for Events, it is a list structure as\r
412# [ ModuleEventClass, ...]\r
413# @var Hobs: To store value for Hobs, it is a list structure as\r
414# [ ModuleHobClass, ...] \r
415# @var Variables: To store value for Variables, it is a list structure as\r
416# [ ModuleVariableClass, ...]\r
417# @var BootModes: To store value for BootModes, it is a list structure as\r
418# [ ModuleBootModeClass, ...]\r
419# @var SystemTables: To store value for SystemTables, it is a list structure as\r
420# [ ModuleSystemTableClass, ...]\r
421# @var DataHubs: To store value for DataHubs, it is a list structure as\r
422# [ ModuleDataHubClass, ...]\r
423# @var HiiPackages: To store value for HiiPackages, it is a list structure as\r
424# [ ModuleHiiPackageClass, ...]\r
425# @var Guids: To store value for Guids, it is a list structure as\r
426# [ GuidClass, ...]\r
427# @var PcdCodes: To store value for PcdCodes, it is a list structure as\r
428# [ PcdClass, ...]\r
429# @var ExternImages: To store value for ExternImages, it is a list structure as\r
430# [ ModuleExternImageClass, ...]\r
431# @var ExternLibraries: To store value for ExternLibraries, it is a list structure as\r
432# [ ModuleExternLibraryClass, ...]\r
433# @var ExternDrivers: To store value for ExternDrivers, it is a list structure as\r
434# [ ModuleExternDriverClass, ...]\r
435# @var ExternCallBacks: To store value for ExternCallBacks, it is a list structure as\r
436# [ ModuleExternCallBackClass, ...]\r
437# @var BuildOptions: To store value for BuildOptions, it is a list structure as\r
438# [ BuildOptionClass, ...]\r
439# @var UserExtensions: To store value for UserExtensions, it is a list structure as\r
440# [ UserExtensionsClass, ...]\r
441#\r
442class ModuleClass(object):\r
443 def __init__(self):\r
444 self.Header = {}\r
445 self.ModuleHeader = ModuleHeaderClass()\r
446 self.LibraryClasses = []\r
447 self.Libraries = []\r
448 self.Sources = []\r
449 self.Binaries = []\r
450 self.NonProcessedFiles = []\r
451 self.PackageDependencies = []\r
452 self.Nmake = []\r
453 self.Depex = []\r
454 self.PeiDepex = None\r
455 self.DxeDepex = None\r
456 self.SmmDepex = None\r
457 self.Includes = []\r
458 self.Protocols = []\r
459 self.Ppis = []\r
460 self.Events = []\r
461 self.Hobs = []\r
462 self.Variables = []\r
463 self.BootModes = []\r
464 self.SystemTables = []\r
465 self.DataHubs = []\r
466 self.HiiPackages = []\r
467 self.Guids = []\r
468 self.PcdCodes = []\r
469 self.ExternImages = []\r
470 self.ExternLibraries = []\r
471 self.ExternDrivers = []\r
472 self.ExternCallBacks = []\r
473 self.Externs = []\r
474 self.BuildOptions = []\r
475 self.UserExtensions = None\r
476 self.MiscFiles = None\r
477 self.FileList = []\r
478\r
479##\r
480#\r
481# This acts like the main() function for the script, unless it is 'import'ed into another\r
482# script.\r
483#\r
484if __name__ == '__main__':\r
485 M = ModuleClass()\r