]>
git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/Python/UPT/Object/POM/ModuleObject.py
e85b8fa010ab6c727d84e0048d4ea5c4b3f671c3
2 # This file is used to define a class object to describe a module
4 # Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
6 # This program and the accompanying materials are licensed and made available
7 # under the terms and conditions of the BSD License which accompanies this
8 # distribution. The full text of the license may be found at
9 # http://opensource.org/licenses/bsd-license.php
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.
21 from Object
.POM
.CommonObject
import CommonPropertiesObject
22 from Object
.POM
.CommonObject
import IdentificationObject
23 from Object
.POM
.CommonObject
import CommonHeaderObject
24 from Object
.POM
.CommonObject
import BinaryHeaderObject
25 from Object
.POM
.CommonObject
import HelpTextListObject
26 from Object
.POM
.CommonObject
import GuidVersionObject
32 class BootModeObject(CommonPropertiesObject
, HelpTextListObject
):
34 self
.SupportedBootModes
= ''
35 CommonPropertiesObject
.__init
__(self
)
36 HelpTextListObject
.__init
__(self
)
38 def SetSupportedBootModes(self
, SupportedBootModes
):
39 self
.SupportedBootModes
= SupportedBootModes
41 def GetSupportedBootModes(self
):
42 return self
.SupportedBootModes
47 class EventObject(CommonPropertiesObject
, HelpTextListObject
):
50 CommonPropertiesObject
.__init
__(self
)
51 HelpTextListObject
.__init
__(self
)
53 def SetEventType(self
, EventType
):
54 self
.EventType
= EventType
56 def GetEventType(self
):
62 class HobObject(CommonPropertiesObject
, HelpTextListObject
):
65 CommonPropertiesObject
.__init
__(self
)
66 HelpTextListObject
.__init
__(self
)
68 def SetHobType(self
, HobType
):
69 self
.HobType
= HobType
77 class SpecObject(object):
82 def SetSpec(self
, Spec
):
88 def SetVersion(self
, Version
):
89 self
.Version
= Version
96 # This class defined header items used in Module file
98 class ModuleHeaderObject(IdentificationObject
, CommonHeaderObject
, BinaryHeaderObject
):
100 self
.IsLibrary
= False
101 self
.IsLibraryModList
= []
103 self
.BinaryModule
= False
104 self
.PcdIsDriver
= ''
105 self
.PiSpecificationVersion
= ''
106 self
.UefiSpecificationVersion
= ''
115 self
.BootModeList
= []
127 self
.LibraryClassList
= []
128 self
.SupArchList
= []
129 IdentificationObject
.__init
__(self
)
130 CommonHeaderObject
.__init
__(self
)
131 BinaryHeaderObject
.__init
__(self
)
133 def SetIsLibrary(self
, IsLibrary
):
134 self
.IsLibrary
= IsLibrary
136 def GetIsLibrary(self
):
137 return self
.IsLibrary
139 def SetIsLibraryModList(self
, IsLibraryModList
):
140 self
.IsLibraryModList
= IsLibraryModList
142 def GetIsLibraryModList(self
):
143 return self
.IsLibraryModList
145 def SetModuleType(self
, ModuleType
):
146 self
.ModuleType
= ModuleType
148 def GetModuleType(self
):
149 return self
.ModuleType
151 def SetBinaryModule(self
, BinaryModule
):
152 self
.BinaryModule
= BinaryModule
154 def GetBinaryModule(self
):
155 return self
.BinaryModule
157 def SetPcdIsDriver(self
, PcdIsDriver
):
158 self
.PcdIsDriver
= PcdIsDriver
160 def GetPcdIsDriver(self
):
161 return self
.PcdIsDriver
163 def SetPiSpecificationVersion(self
, PiSpecificationVersion
):
164 self
.PiSpecificationVersion
= PiSpecificationVersion
166 def GetPiSpecificationVersion(self
):
167 return self
.PiSpecificationVersion
169 def SetUefiSpecificationVersion(self
, UefiSpecificationVersion
):
170 self
.UefiSpecificationVersion
= UefiSpecificationVersion
172 def GetUefiSpecificationVersion(self
):
173 return self
.UefiSpecificationVersion
175 def SetSpecList(self
, SpecList
):
176 self
.SpecList
= SpecList
178 def GetSpecList(self
):
181 def SetBootModeList(self
, BootModeList
):
182 self
.BootModeList
= BootModeList
184 def GetBootModeList(self
):
185 return self
.BootModeList
187 def SetEventList(self
, EventList
):
188 self
.EventList
= EventList
190 def GetEventList(self
):
191 return self
.EventList
193 def SetHobList(self
, HobList
):
194 self
.HobList
= HobList
196 def GetHobList(self
):
199 def SetLibraryClassList(self
, LibraryClassList
):
200 self
.LibraryClassList
= LibraryClassList
202 def GetLibraryClassList(self
):
203 return self
.LibraryClassList
205 def SetSupArchList(self
, SupArchList
):
206 self
.SupArchList
= SupArchList
208 def GetSupArchList(self
):
209 return self
.SupArchList
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