Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

655 lines
16 KiB
Python
Raw Permalink Normal View History

## @file
# This file is used to define a class object to describe a module
#
2018-07-05 17:40:04 +08:00
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
'''
ModuleObject
'''
##
# Import Modules
2018-07-05 17:40:04 +08:00
#
from Object.POM.CommonObject import CommonPropertiesObject
from Object.POM.CommonObject import IdentificationObject
from Object.POM.CommonObject import CommonHeaderObject
2014-08-26 05:58:02 +00:00
from Object.POM.CommonObject import BinaryHeaderObject
from Object.POM.CommonObject import HelpTextListObject
from Object.POM.CommonObject import GuidVersionObject
2018-07-05 17:40:04 +08:00
##
# BootModeObject
#
class BootModeObject(CommonPropertiesObject, HelpTextListObject):
def __init__(self):
self.SupportedBootModes = ''
CommonPropertiesObject.__init__(self)
HelpTextListObject.__init__(self)
2018-07-05 17:40:04 +08:00
def SetSupportedBootModes(self, SupportedBootModes):
self.SupportedBootModes = SupportedBootModes
2018-07-05 17:40:04 +08:00
def GetSupportedBootModes(self):
return self.SupportedBootModes
##
# EventObject
#
class EventObject(CommonPropertiesObject, HelpTextListObject):
def __init__(self):
self.EventType = ''
CommonPropertiesObject.__init__(self)
HelpTextListObject.__init__(self)
2018-07-05 17:40:04 +08:00
def SetEventType(self, EventType):
self.EventType = EventType
2018-07-05 17:40:04 +08:00
def GetEventType(self):
return self.EventType
##
# HobObject
#
class HobObject(CommonPropertiesObject, HelpTextListObject):
def __init__(self):
self.HobType = ''
CommonPropertiesObject.__init__(self)
HelpTextListObject.__init__(self)
2018-07-05 17:40:04 +08:00
def SetHobType(self, HobType):
self.HobType = HobType
2018-07-05 17:40:04 +08:00
def GetHobType(self):
return self.HobType
##
# SpecObject
#
class SpecObject(object):
def __init__(self):
self.Spec = ''
self.Version = ''
2018-07-05 17:40:04 +08:00
def SetSpec(self, Spec):
self.Spec = Spec
2018-07-05 17:40:04 +08:00
def GetSpec(self):
return self.Spec
2018-07-05 17:40:04 +08:00
def SetVersion(self, Version):
self.Version = Version
2018-07-05 17:40:04 +08:00
def GetVersion(self):
return self.Version
## ModuleHeaderObject
#
# This class defined header items used in Module file
2018-07-05 17:40:04 +08:00
#
2014-08-26 05:58:02 +00:00
class ModuleHeaderObject(IdentificationObject, CommonHeaderObject, BinaryHeaderObject):
def __init__(self):
self.IsLibrary = False
self.IsLibraryModList = []
self.ModuleType = ''
self.BinaryModule = False
self.PcdIsDriver = ''
self.PiSpecificationVersion = ''
self.UefiSpecificationVersion = ''
2014-08-26 05:58:02 +00:00
self.UNIFlag = False
2017-08-23 13:53:36 +08:00
self.ModuleUniFile = ''
#
# SpecObject
#
2018-07-05 17:40:04 +08:00
self.SpecList = []
#
# BootModeObject
#
2018-07-05 17:40:04 +08:00
self.BootModeList = []
#
# EventObject
#
2018-07-05 17:40:04 +08:00
self.EventList = []
#
# HobObject
#
self.HobList = []
2018-07-05 17:40:04 +08:00
#
# LibraryClassObject
#
2018-07-05 17:40:04 +08:00
self.LibraryClassList = []
self.SupArchList = []
IdentificationObject.__init__(self)
CommonHeaderObject.__init__(self)
2014-08-26 05:58:02 +00:00
BinaryHeaderObject.__init__(self)
2018-07-05 17:40:04 +08:00
def SetIsLibrary(self, IsLibrary):
self.IsLibrary = IsLibrary
2018-07-05 17:40:04 +08:00
def GetIsLibrary(self):
return self.IsLibrary
2018-07-05 17:40:04 +08:00
def SetIsLibraryModList(self, IsLibraryModList):
self.IsLibraryModList = IsLibraryModList
2018-07-05 17:40:04 +08:00
def GetIsLibraryModList(self):
return self.IsLibraryModList
2018-07-05 17:40:04 +08:00
def SetModuleType(self, ModuleType):
self.ModuleType = ModuleType
2018-07-05 17:40:04 +08:00
def GetModuleType(self):
return self.ModuleType
2018-07-05 17:40:04 +08:00
def SetBinaryModule(self, BinaryModule):
self.BinaryModule = BinaryModule
2018-07-05 17:40:04 +08:00
def GetBinaryModule(self):
return self.BinaryModule
2018-07-05 17:40:04 +08:00
def SetPcdIsDriver(self, PcdIsDriver):
self.PcdIsDriver = PcdIsDriver
2018-07-05 17:40:04 +08:00
def GetPcdIsDriver(self):
return self.PcdIsDriver
2018-07-05 17:40:04 +08:00
def SetPiSpecificationVersion(self, PiSpecificationVersion):
self.PiSpecificationVersion = PiSpecificationVersion
2018-07-05 17:40:04 +08:00
def GetPiSpecificationVersion(self):
return self.PiSpecificationVersion
2018-07-05 17:40:04 +08:00
def SetUefiSpecificationVersion(self, UefiSpecificationVersion):
self.UefiSpecificationVersion = UefiSpecificationVersion
2018-07-05 17:40:04 +08:00
def GetUefiSpecificationVersion(self):
return self.UefiSpecificationVersion
2018-07-05 17:40:04 +08:00
def SetSpecList(self, SpecList):
self.SpecList = SpecList
2018-07-05 17:40:04 +08:00
def GetSpecList(self):
return self.SpecList
2018-07-05 17:40:04 +08:00
def SetBootModeList(self, BootModeList):
self.BootModeList = BootModeList
2018-07-05 17:40:04 +08:00
def GetBootModeList(self):
return self.BootModeList
2018-07-05 17:40:04 +08:00
def SetEventList(self, EventList):
self.EventList = EventList
2018-07-05 17:40:04 +08:00
def GetEventList(self):
return self.EventList
2018-07-05 17:40:04 +08:00
def SetHobList(self, HobList):
self.HobList = HobList
2018-07-05 17:40:04 +08:00
def GetHobList(self):
return self.HobList
def SetLibraryClassList(self, LibraryClassList):
self.LibraryClassList = LibraryClassList
2018-07-05 17:40:04 +08:00
def GetLibraryClassList(self):
return self.LibraryClassList
def SetSupArchList(self, SupArchList):
self.SupArchList = SupArchList
def GetSupArchList(self):
return self.SupArchList
2017-08-23 13:53:36 +08:00
def SetModuleUniFile(self, ModuleUniFile):
self.ModuleUniFile = ModuleUniFile
def GetModuleUniFile(self):
return self.ModuleUniFile
##
# SourceFileObject
#
class SourceFileObject(CommonPropertiesObject):
def __init__(self):
CommonPropertiesObject.__init__(self)
self.SourceFile = ''
self.TagName = ''
self.ToolCode = ''
self.Family = ''
self.FileType = ''
2018-07-05 17:40:04 +08:00
def SetSourceFile(self, SourceFile):
self.SourceFile = SourceFile
2018-07-05 17:40:04 +08:00
def GetSourceFile(self):
return self.SourceFile
2018-07-05 17:40:04 +08:00
def SetTagName(self, TagName):
self.TagName = TagName
2018-07-05 17:40:04 +08:00
def GetTagName(self):
return self.TagName
2018-07-05 17:40:04 +08:00
def SetToolCode(self, ToolCode):
self.ToolCode = ToolCode
2018-07-05 17:40:04 +08:00
def GetToolCode(self):
return self.ToolCode
2018-07-05 17:40:04 +08:00
def SetFamily(self, Family):
self.Family = Family
2018-07-05 17:40:04 +08:00
def GetFamily(self):
return self.Family
2018-07-05 17:40:04 +08:00
def SetFileType(self, FileType):
self.FileType = FileType
2018-07-05 17:40:04 +08:00
def GetFileType(self):
return self.FileType
2018-07-05 17:40:04 +08:00
##
# BinaryFileObject
#
class BinaryFileObject(CommonPropertiesObject):
def __init__(self):
self.FileNamList = []
self.AsBuiltList = []
CommonPropertiesObject.__init__(self)
2018-07-05 17:40:04 +08:00
def SetFileNameList(self, FileNamList):
self.FileNamList = FileNamList
def GetFileNameList(self):
return self.FileNamList
def SetAsBuiltList(self, AsBuiltList):
self.AsBuiltList = AsBuiltList
def GetAsBuiltList(self):
return self.AsBuiltList
2018-07-05 17:40:04 +08:00
##
# AsBuildLibraryClassObject
#
class AsBuildLibraryClassObject(object):
def __init__(self):
self.LibGuid = ''
self.LibVersion = ''
2014-08-26 05:58:02 +00:00
self.SupArchList = []
2018-07-05 17:40:04 +08:00
def SetLibGuid(self, LibGuid):
self.LibGuid = LibGuid
def GetLibGuid(self):
return self.LibGuid
2018-07-05 17:40:04 +08:00
def SetLibVersion(self, LibVersion):
self.LibVersion = LibVersion
def GetLibVersion(self):
return self.LibVersion
2014-08-26 05:58:02 +00:00
def SetSupArchList(self, SupArchList):
self.SupArchList = SupArchList
def GetSupArchList(self):
return self.SupArchList
##
# AsBuiltObject
#
class AsBuiltObject(object):
def __init__(self):
#
# list of PcdObject
#
self.PatchPcdList = []
#
# list of PcdObject
#
self.PcdExValueList = []
#
# list of GuidVersionObject
#
self.LibraryInstancesList = []
#
# List of BinaryBuildFlag object
#
2014-08-26 05:58:02 +00:00
self.BinaryBuildFlagList = []
def SetPatchPcdList(self, PatchPcdList):
self.PatchPcdList = PatchPcdList
def GetPatchPcdList(self):
return self.PatchPcdList
def SetPcdExList(self, PcdExValueList):
self.PcdExValueList = PcdExValueList
def GetPcdExList(self):
return self.PcdExValueList
def SetLibraryInstancesList(self, LibraryInstancesList):
self.LibraryInstancesList = LibraryInstancesList
def GetLibraryInstancesList(self):
return self.LibraryInstancesList
2018-07-05 17:40:04 +08:00
def SetBuildFlagsList(self, BinaryBuildFlagList):
self.BinaryBuildFlagList = BinaryBuildFlagList
def GetBuildFlagsList(self):
return self.BinaryBuildFlagList
##
# BinaryBuildFlag, this object will include those fields that are not
2018-07-05 17:40:04 +08:00
# covered by the UPT Spec BinaryFile field
#
class BinaryBuildFlagObject(object):
def __init__(self):
self.Target = ''
self.TagName = ''
self.Family = ''
self.AsBuiltOptionFlags = ''
2018-07-05 17:40:04 +08:00
def SetTarget(self, Target):
self.Target = Target
def GetTarget(self):
2018-07-05 17:40:04 +08:00
return self.Target
def SetTagName(self, TagName):
self.TagName = TagName
2018-07-05 17:40:04 +08:00
def GetTagName(self):
return self.TagName
2018-07-05 17:40:04 +08:00
def SetFamily(self, Family):
self.Family = Family
2018-07-05 17:40:04 +08:00
def GetFamily(self):
return self.Family
2018-07-05 17:40:04 +08:00
def SetAsBuiltOptionFlags(self, AsBuiltOptionFlags):
self.AsBuiltOptionFlags = AsBuiltOptionFlags
def GetAsBuiltOptionFlags(self):
return self.AsBuiltOptionFlags
2018-07-05 17:40:04 +08:00
##
# ExternObject
#
class ExternObject(CommonPropertiesObject):
def __init__(self):
self.EntryPoint = ''
self.UnloadImage = ''
self.Constructor = ''
self.Destructor = ''
self.SupModList = []
CommonPropertiesObject.__init__(self)
2018-07-05 17:40:04 +08:00
def SetEntryPoint(self, EntryPoint):
self.EntryPoint = EntryPoint
2018-07-05 17:40:04 +08:00
def GetEntryPoint(self):
return self.EntryPoint
2018-07-05 17:40:04 +08:00
def SetUnloadImage(self, UnloadImage):
self.UnloadImage = UnloadImage
2018-07-05 17:40:04 +08:00
def GetUnloadImage(self):
return self.UnloadImage
2018-07-05 17:40:04 +08:00
def SetConstructor(self, Constructor):
self.Constructor = Constructor
2018-07-05 17:40:04 +08:00
def GetConstructor(self):
return self.Constructor
2018-07-05 17:40:04 +08:00
def SetDestructor(self, Destructor):
self.Destructor = Destructor
2018-07-05 17:40:04 +08:00
def GetDestructor(self):
return self.Destructor
2018-07-05 17:40:04 +08:00
def SetSupModList(self, SupModList):
self.SupModList = SupModList
def GetSupModList(self):
return self.SupModList
##
# DepexObject
#
class DepexObject(CommonPropertiesObject):
def __init__(self):
self.Depex = ''
2024-12-09 18:42:33 +00:00
self.ModuleType = ''
CommonPropertiesObject.__init__(self)
2018-07-05 17:40:04 +08:00
def SetDepex(self, Depex):
self.Depex = Depex
2018-07-05 17:40:04 +08:00
def GetDepex(self):
return self.Depex
2018-07-05 17:40:04 +08:00
def SetModuleType(self, ModuleType):
2024-12-09 18:42:33 +00:00
self.ModuleType = ModuleType
2018-07-05 17:40:04 +08:00
def GetModuleType(self):
2024-12-09 18:42:33 +00:00
return self.ModuleType
##
# PackageDependencyObject
#
class PackageDependencyObject(GuidVersionObject, CommonPropertiesObject):
def __init__(self):
self.Package = ''
self.PackageFilePath = ''
GuidVersionObject.__init__(self)
CommonPropertiesObject.__init__(self)
2018-07-05 17:40:04 +08:00
def SetPackageFilePath(self, PackageFilePath):
self.PackageFilePath = PackageFilePath
2018-07-05 17:40:04 +08:00
def GetPackageFilePath(self):
return self.PackageFilePath
def SetPackage(self, Package):
self.Package = Package
2018-07-05 17:40:04 +08:00
def GetPackage(self):
return self.Package
##
# BuildOptionObject
#
class BuildOptionObject(CommonPropertiesObject):
def __init__(self):
CommonPropertiesObject.__init__(self)
self.BuildOption = ''
2018-07-05 17:40:04 +08:00
def SetBuildOption(self, BuildOption):
self.BuildOption = BuildOption
2018-07-05 17:40:04 +08:00
def GetBuildOption(self):
return self.BuildOption
2018-07-05 17:40:04 +08:00
##
# ModuleObject
#
class ModuleObject(ModuleHeaderObject):
def __init__(self):
#
# {Arch : ModuleHeaderObject}
#
2018-07-05 17:40:04 +08:00
self.HeaderDict = {}
#
# LibraryClassObject
#
2018-07-05 17:40:04 +08:00
self.LibraryClassList = []
#
# SourceFileObject
#
2018-07-05 17:40:04 +08:00
self.SourceFileList = []
#
# BinaryFileObject
#
2018-07-05 17:40:04 +08:00
self.BinaryFileList = []
#
# PackageDependencyObject
#
2018-07-05 17:40:04 +08:00
self.PackageDependencyList = []
#
# DepexObject
#
2018-07-05 17:40:04 +08:00
self.PeiDepex = []
#
# DepexObject
#
2018-07-05 17:40:04 +08:00
self.DxeDepex = []
#
# DepexObject
#
2018-07-05 17:40:04 +08:00
self.SmmDepex = []
#
# ProtocolObject
#
2018-07-05 17:40:04 +08:00
self.ProtocolList = []
#
# PpiObject
#
2018-07-05 17:40:04 +08:00
self.PpiList = []
#
# GuidObject
#
2018-07-05 17:40:04 +08:00
self.GuidList = []
#
# PcdObject
#
2018-07-05 17:40:04 +08:00
self.PcdList = []
#
# ExternObject
#
2018-07-05 17:40:04 +08:00
self.ExternList = []
#
# BuildOptionObject
#
2018-07-05 17:40:04 +08:00
self.BuildOptionList = []
#
# UserExtensionObject
#
2018-07-05 17:40:04 +08:00
self.UserExtensionList = []
#
# MiscFileObject
#
2018-07-05 17:40:04 +08:00
self.MiscFileList = []
#
# ClonedFromObject
#
2018-07-05 17:40:04 +08:00
self.ClonedFrom = None
ModuleHeaderObject.__init__(self)
2018-07-05 17:40:04 +08:00
def SetHeaderDict(self, HeaderDict):
self.HeaderDict = HeaderDict
2018-07-05 17:40:04 +08:00
def GetHeaderDict(self):
return self.HeaderDict
2018-07-05 17:40:04 +08:00
def SetLibraryClassList(self, LibraryClassList):
self.LibraryClassList = LibraryClassList
2018-07-05 17:40:04 +08:00
def GetLibraryClassList(self):
return self.LibraryClassList
2018-07-05 17:40:04 +08:00
def SetSourceFileList(self, SourceFileList):
self.SourceFileList = SourceFileList
2018-07-05 17:40:04 +08:00
def GetSourceFileList(self):
return self.SourceFileList
2018-07-05 17:40:04 +08:00
def SetBinaryFileList(self, BinaryFileList):
self.BinaryFileList = BinaryFileList
def GetBinaryFileList(self):
return self.BinaryFileList
2018-07-05 17:40:04 +08:00
def SetPackageDependencyList(self, PackageDependencyList):
self.PackageDependencyList = PackageDependencyList
2018-07-05 17:40:04 +08:00
def GetPackageDependencyList(self):
return self.PackageDependencyList
2018-07-05 17:40:04 +08:00
def SetPeiDepex(self, PeiDepex):
self.PeiDepex = PeiDepex
2018-07-05 17:40:04 +08:00
def GetPeiDepex(self):
return self.PeiDepex
2018-07-05 17:40:04 +08:00
def SetDxeDepex(self, DxeDepex):
self.DxeDepex = DxeDepex
2018-07-05 17:40:04 +08:00
def GetDxeDepex(self):
return self.DxeDepex
2018-07-05 17:40:04 +08:00
def SetSmmDepex(self, SmmDepex):
self.SmmDepex = SmmDepex
2018-07-05 17:40:04 +08:00
def GetSmmDepex(self):
return self.SmmDepex
2018-07-05 17:40:04 +08:00
def SetPpiList(self, PpiList):
self.PpiList = PpiList
2018-07-05 17:40:04 +08:00
def GetPpiList(self):
return self.PpiList
def SetProtocolList(self, ProtocolList):
self.ProtocolList = ProtocolList
2018-07-05 17:40:04 +08:00
def GetProtocolList(self):
return self.ProtocolList
def SetPcdList(self, PcdList):
self.PcdList = PcdList
2018-07-05 17:40:04 +08:00
def GetPcdList(self):
return self.PcdList
2018-07-05 17:40:04 +08:00
def SetGuidList(self, GuidList):
self.GuidList = GuidList
2018-07-05 17:40:04 +08:00
def GetGuidList(self):
return self.GuidList
2018-07-05 17:40:04 +08:00
def SetExternList(self, ExternList):
self.ExternList = ExternList
def GetExternList(self):
return self.ExternList
2018-07-05 17:40:04 +08:00
def SetBuildOptionList(self, BuildOptionList):
self.BuildOptionList = BuildOptionList
2018-07-05 17:40:04 +08:00
def GetBuildOptionList(self):
return self.BuildOptionList
2018-07-05 17:40:04 +08:00
def SetUserExtensionList(self, UserExtensionList):
self.UserExtensionList = UserExtensionList
2018-07-05 17:40:04 +08:00
def GetUserExtensionList(self):
return self.UserExtensionList
2018-07-05 17:40:04 +08:00
def SetMiscFileList(self, MiscFileList):
self.MiscFileList = MiscFileList
2018-07-05 17:40:04 +08:00
def GetMiscFileList(self):
return self.MiscFileList
2018-07-05 17:40:04 +08:00
def SetClonedFrom(self, ClonedFrom):
self.ClonedFrom = ClonedFrom
2018-07-05 17:40:04 +08:00
def GetClonedFrom(self):
return self.ClonedFrom