]>
git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/Python/UPT/Object/POM/ModuleObject.py
2 # This file is used to define a class object to describe a module
4 # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
6 # SPDX-License-Identifier: BSD-2-Clause-Patent
15 from Object
.POM
.CommonObject
import CommonPropertiesObject
16 from Object
.POM
.CommonObject
import IdentificationObject
17 from Object
.POM
.CommonObject
import CommonHeaderObject
18 from Object
.POM
.CommonObject
import BinaryHeaderObject
19 from Object
.POM
.CommonObject
import HelpTextListObject
20 from Object
.POM
.CommonObject
import GuidVersionObject
26 class BootModeObject(CommonPropertiesObject
, HelpTextListObject
):
28 self
.SupportedBootModes
= ''
29 CommonPropertiesObject
.__init
__(self
)
30 HelpTextListObject
.__init
__(self
)
32 def SetSupportedBootModes(self
, SupportedBootModes
):
33 self
.SupportedBootModes
= SupportedBootModes
35 def GetSupportedBootModes(self
):
36 return self
.SupportedBootModes
41 class EventObject(CommonPropertiesObject
, HelpTextListObject
):
44 CommonPropertiesObject
.__init
__(self
)
45 HelpTextListObject
.__init
__(self
)
47 def SetEventType(self
, EventType
):
48 self
.EventType
= EventType
50 def GetEventType(self
):
56 class HobObject(CommonPropertiesObject
, HelpTextListObject
):
59 CommonPropertiesObject
.__init
__(self
)
60 HelpTextListObject
.__init
__(self
)
62 def SetHobType(self
, HobType
):
63 self
.HobType
= HobType
71 class SpecObject(object):
76 def SetSpec(self
, Spec
):
82 def SetVersion(self
, Version
):
83 self
.Version
= Version
90 # This class defined header items used in Module file
92 class ModuleHeaderObject(IdentificationObject
, CommonHeaderObject
, BinaryHeaderObject
):
94 self
.IsLibrary
= False
95 self
.IsLibraryModList
= []
97 self
.BinaryModule
= False
99 self
.PiSpecificationVersion
= ''
100 self
.UefiSpecificationVersion
= ''
102 self
.ModuleUniFile
= ''
110 self
.BootModeList
= []
122 self
.LibraryClassList
= []
123 self
.SupArchList
= []
124 IdentificationObject
.__init
__(self
)
125 CommonHeaderObject
.__init
__(self
)
126 BinaryHeaderObject
.__init
__(self
)
128 def SetIsLibrary(self
, IsLibrary
):
129 self
.IsLibrary
= IsLibrary
131 def GetIsLibrary(self
):
132 return self
.IsLibrary
134 def SetIsLibraryModList(self
, IsLibraryModList
):
135 self
.IsLibraryModList
= IsLibraryModList
137 def GetIsLibraryModList(self
):
138 return self
.IsLibraryModList
140 def SetModuleType(self
, ModuleType
):
141 self
.ModuleType
= ModuleType
143 def GetModuleType(self
):
144 return self
.ModuleType
146 def SetBinaryModule(self
, BinaryModule
):
147 self
.BinaryModule
= BinaryModule
149 def GetBinaryModule(self
):
150 return self
.BinaryModule
152 def SetPcdIsDriver(self
, PcdIsDriver
):
153 self
.PcdIsDriver
= PcdIsDriver
155 def GetPcdIsDriver(self
):
156 return self
.PcdIsDriver
158 def SetPiSpecificationVersion(self
, PiSpecificationVersion
):
159 self
.PiSpecificationVersion
= PiSpecificationVersion
161 def GetPiSpecificationVersion(self
):
162 return self
.PiSpecificationVersion
164 def SetUefiSpecificationVersion(self
, UefiSpecificationVersion
):
165 self
.UefiSpecificationVersion
= UefiSpecificationVersion
167 def GetUefiSpecificationVersion(self
):
168 return self
.UefiSpecificationVersion
170 def SetSpecList(self
, SpecList
):
171 self
.SpecList
= SpecList
173 def GetSpecList(self
):
176 def SetBootModeList(self
, BootModeList
):
177 self
.BootModeList
= BootModeList
179 def GetBootModeList(self
):
180 return self
.BootModeList
182 def SetEventList(self
, EventList
):
183 self
.EventList
= EventList
185 def GetEventList(self
):
186 return self
.EventList
188 def SetHobList(self
, HobList
):
189 self
.HobList
= HobList
191 def GetHobList(self
):
194 def SetLibraryClassList(self
, LibraryClassList
):
195 self
.LibraryClassList
= LibraryClassList
197 def GetLibraryClassList(self
):
198 return self
.LibraryClassList
200 def SetSupArchList(self
, SupArchList
):
201 self
.SupArchList
= SupArchList
203 def GetSupArchList(self
):
204 return self
.SupArchList
206 def SetModuleUniFile(self
, ModuleUniFile
):
207 self
.ModuleUniFile
= ModuleUniFile
209 def GetModuleUniFile(self
):
210 return self
.ModuleUniFile
214 class SourceFileObject(CommonPropertiesObject
):
216 CommonPropertiesObject
.__init
__(self
)
223 def SetSourceFile(self
, SourceFile
):
224 self
.SourceFile
= SourceFile
226 def GetSourceFile(self
):
227 return self
.SourceFile
229 def SetTagName(self
, TagName
):
230 self
.TagName
= TagName
232 def GetTagName(self
):
235 def SetToolCode(self
, ToolCode
):
236 self
.ToolCode
= ToolCode
238 def GetToolCode(self
):
241 def SetFamily(self
, Family
):
247 def SetFileType(self
, FileType
):
248 self
.FileType
= FileType
250 def GetFileType(self
):
257 class BinaryFileObject(CommonPropertiesObject
):
259 self
.FileNamList
= []
260 self
.AsBuiltList
= []
261 CommonPropertiesObject
.__init
__(self
)
263 def SetFileNameList(self
, FileNamList
):
264 self
.FileNamList
= FileNamList
266 def GetFileNameList(self
):
267 return self
.FileNamList
269 def SetAsBuiltList(self
, AsBuiltList
):
270 self
.AsBuiltList
= AsBuiltList
272 def GetAsBuiltList(self
):
273 return self
.AsBuiltList
277 # AsBuildLibraryClassObject
279 class AsBuildLibraryClassObject(object):
283 self
.SupArchList
= []
285 def SetLibGuid(self
, LibGuid
):
286 self
.LibGuid
= LibGuid
287 def GetLibGuid(self
):
290 def SetLibVersion(self
, LibVersion
):
291 self
.LibVersion
= LibVersion
292 def GetLibVersion(self
):
293 return self
.LibVersion
295 def SetSupArchList(self
, SupArchList
):
296 self
.SupArchList
= SupArchList
297 def GetSupArchList(self
):
298 return self
.SupArchList
303 class AsBuiltObject(object):
308 self
.PatchPcdList
= []
312 self
.PcdExValueList
= []
314 # list of GuidVersionObject
316 self
.LibraryInstancesList
= []
318 # List of BinaryBuildFlag object
320 self
.BinaryBuildFlagList
= []
322 def SetPatchPcdList(self
, PatchPcdList
):
323 self
.PatchPcdList
= PatchPcdList
325 def GetPatchPcdList(self
):
326 return self
.PatchPcdList
328 def SetPcdExList(self
, PcdExValueList
):
329 self
.PcdExValueList
= PcdExValueList
331 def GetPcdExList(self
):
332 return self
.PcdExValueList
334 def SetLibraryInstancesList(self
, LibraryInstancesList
):
335 self
.LibraryInstancesList
= LibraryInstancesList
337 def GetLibraryInstancesList(self
):
338 return self
.LibraryInstancesList
340 def SetBuildFlagsList(self
, BinaryBuildFlagList
):
341 self
.BinaryBuildFlagList
= BinaryBuildFlagList
343 def GetBuildFlagsList(self
):
344 return self
.BinaryBuildFlagList
347 # BinaryBuildFlag, this object will include those fields that are not
348 # covered by the UPT Spec BinaryFile field
350 class BinaryBuildFlagObject(object):
355 self
.AsBuiltOptionFlags
= ''
357 def SetTarget(self
, Target
):
363 def SetTagName(self
, TagName
):
364 self
.TagName
= TagName
366 def GetTagName(self
):
369 def SetFamily(self
, Family
):
375 def SetAsBuiltOptionFlags(self
, AsBuiltOptionFlags
):
376 self
.AsBuiltOptionFlags
= AsBuiltOptionFlags
377 def GetAsBuiltOptionFlags(self
):
378 return self
.AsBuiltOptionFlags
383 class ExternObject(CommonPropertiesObject
):
386 self
.UnloadImage
= ''
387 self
.Constructor
= ''
390 CommonPropertiesObject
.__init
__(self
)
392 def SetEntryPoint(self
, EntryPoint
):
393 self
.EntryPoint
= EntryPoint
395 def GetEntryPoint(self
):
396 return self
.EntryPoint
398 def SetUnloadImage(self
, UnloadImage
):
399 self
.UnloadImage
= UnloadImage
401 def GetUnloadImage(self
):
402 return self
.UnloadImage
404 def SetConstructor(self
, Constructor
):
405 self
.Constructor
= Constructor
407 def GetConstructor(self
):
408 return self
.Constructor
410 def SetDestructor(self
, Destructor
):
411 self
.Destructor
= Destructor
413 def GetDestructor(self
):
414 return self
.Destructor
416 def SetSupModList(self
, SupModList
):
417 self
.SupModList
= SupModList
418 def GetSupModList(self
):
419 return self
.SupModList
424 class DepexObject(CommonPropertiesObject
):
428 CommonPropertiesObject
.__init
__(self
)
430 def SetDepex(self
, Depex
):
436 def SetModuleType(self
, ModuleType
):
437 self
.ModuelType
= ModuleType
439 def GetModuleType(self
):
440 return self
.ModuelType
443 # PackageDependencyObject
445 class PackageDependencyObject(GuidVersionObject
, CommonPropertiesObject
):
448 self
.PackageFilePath
= ''
449 GuidVersionObject
.__init
__(self
)
450 CommonPropertiesObject
.__init
__(self
)
452 def SetPackageFilePath(self
, PackageFilePath
):
453 self
.PackageFilePath
= PackageFilePath
455 def GetPackageFilePath(self
):
456 return self
.PackageFilePath
458 def SetPackage(self
, Package
):
459 self
.Package
= Package
461 def GetPackage(self
):
467 class BuildOptionObject(CommonPropertiesObject
):
469 CommonPropertiesObject
.__init
__(self
)
470 self
.BuildOption
= ''
472 def SetBuildOption(self
, BuildOption
):
473 self
.BuildOption
= BuildOption
475 def GetBuildOption(self
):
476 return self
.BuildOption
481 class ModuleObject(ModuleHeaderObject
):
484 # {Arch : ModuleHeaderObject}
490 self
.LibraryClassList
= []
494 self
.SourceFileList
= []
498 self
.BinaryFileList
= []
500 # PackageDependencyObject
502 self
.PackageDependencyList
= []
518 self
.ProtocolList
= []
538 self
.BuildOptionList
= []
540 # UserExtensionObject
542 self
.UserExtensionList
= []
546 self
.MiscFileList
= []
550 self
.ClonedFrom
= None
552 ModuleHeaderObject
.__init
__(self
)
554 def SetHeaderDict(self
, HeaderDict
):
555 self
.HeaderDict
= HeaderDict
557 def GetHeaderDict(self
):
558 return self
.HeaderDict
560 def SetLibraryClassList(self
, LibraryClassList
):
561 self
.LibraryClassList
= LibraryClassList
563 def GetLibraryClassList(self
):
564 return self
.LibraryClassList
566 def SetSourceFileList(self
, SourceFileList
):
567 self
.SourceFileList
= SourceFileList
569 def GetSourceFileList(self
):
570 return self
.SourceFileList
572 def SetBinaryFileList(self
, BinaryFileList
):
573 self
.BinaryFileList
= BinaryFileList
575 def GetBinaryFileList(self
):
576 return self
.BinaryFileList
578 def SetPackageDependencyList(self
, PackageDependencyList
):
579 self
.PackageDependencyList
= PackageDependencyList
581 def GetPackageDependencyList(self
):
582 return self
.PackageDependencyList
584 def SetPeiDepex(self
, PeiDepex
):
585 self
.PeiDepex
= PeiDepex
587 def GetPeiDepex(self
):
590 def SetDxeDepex(self
, DxeDepex
):
591 self
.DxeDepex
= DxeDepex
593 def GetDxeDepex(self
):
596 def SetSmmDepex(self
, SmmDepex
):
597 self
.SmmDepex
= SmmDepex
599 def GetSmmDepex(self
):
602 def SetPpiList(self
, PpiList
):
603 self
.PpiList
= PpiList
605 def GetPpiList(self
):
608 def SetProtocolList(self
, ProtocolList
):
609 self
.ProtocolList
= ProtocolList
611 def GetProtocolList(self
):
612 return self
.ProtocolList
614 def SetPcdList(self
, PcdList
):
615 self
.PcdList
= PcdList
617 def GetPcdList(self
):
620 def SetGuidList(self
, GuidList
):
621 self
.GuidList
= GuidList
623 def GetGuidList(self
):
626 def SetExternList(self
, ExternList
):
627 self
.ExternList
= ExternList
629 def GetExternList(self
):
630 return self
.ExternList
632 def SetBuildOptionList(self
, BuildOptionList
):
633 self
.BuildOptionList
= BuildOptionList
635 def GetBuildOptionList(self
):
636 return self
.BuildOptionList
638 def SetUserExtensionList(self
, UserExtensionList
):
639 self
.UserExtensionList
= UserExtensionList
641 def GetUserExtensionList(self
):
642 return self
.UserExtensionList
644 def SetMiscFileList(self
, MiscFileList
):
645 self
.MiscFileList
= MiscFileList
647 def GetMiscFileList(self
):
648 return self
.MiscFileList
650 def SetClonedFrom(self
, ClonedFrom
):
651 self
.ClonedFrom
= ClonedFrom
653 def GetClonedFrom(self
):
654 return self
.ClonedFrom