git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@137 7335b...
authorhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Wed, 13 Jun 2007 08:42:30 +0000 (08:42 +0000)
committerhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Wed, 13 Jun 2007 08:42:30 +0000 (08:42 +0000)
Source/Python/ClassObjects/CommonClassObject.py [new file with mode: 0644]
Source/Python/ClassObjects/ModuleClassObject.py [new file with mode: 0644]
Source/Python/ClassObjects/PackageClassObject.py [new file with mode: 0644]
Source/Python/ClassObjects/PlatformClassObject.py [new file with mode: 0644]

diff --git a/Source/Python/ClassObjects/CommonClassObject.py b/Source/Python/ClassObjects/CommonClassObject.py
new file mode 100644 (file)
index 0000000..c41be45
--- /dev/null
@@ -0,0 +1,118 @@
+# Copyright (c) 2007, Intel Corporation\r
+# All rights reserved. This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution.  The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+#\r
+# This file is used to define common items of class object\r
+#\r
+\r
+class CommonClassObject(object):\r
+  def __init__(self):\r
+    self.Usage = []                          #ALWAYS_CONSUMED | SOMETIMES_CONSUMED | ALWAYS_PRODUCED | SOMETIMES_PRODUCED | TO_START | BY_START | PRIVATE\r
+    self.FetureFlag = ''\r
+    self.SupArchList = []                    #EBC | IA32 | X64 | IPF | ARM | PPC\r
+    self.HelpText = ''\r
+    \r
+class CommonHeaderClassObject(object):\r
+  def __init__(self):\r
+    self.Abstract = ''\r
+    self.Description = ''\r
+    self.Copyright = ''\r
+    self.License = ''\r
+    self.Specification = ''\r
+    \r
+class ClonedRecordClassObject(object):\r
+  def __init__(self):\r
+    self.Id = 0\r
+    self.FarGuid = ''\r
+    self.PackageGuid = ''\r
+    self.PackageVersion = ''\r
+    self.ModuleGuid = ''\r
+    self.ModuleVersion = ''\r
+\r
+class IdentificationClassObject(object):\r
+  def __init__(self):\r
+    self.Name = ''                                     #ModuleName(BaseName) / PackageName / PlatformName\r
+    self.Guid = ''\r
+    self.Version = ''\r
+    self.FileName = ''\r
+    self.FullPath = ''\r
+\r
+class GuidProtocolPpiCommonClassObject(CommonClassObject):\r
+  def __init__(self):\r
+    self.Name = ''\r
+    self.CName = ''\r
+    self.Guid = ''\r
+    self.Notify = False\r
+    self.GuidTypeList = []                             #DATA_HUB_RECORD | EFI_EVENT | EFI_SYSTEM_CONFIGURATION_TABLE | EFI_VARIABLE | GUID | HII_PACKAGE_LIST | HOB | TOKEN_SPACE_GUID\r
+    self.SupModuleList = []                            #BASE | SEC | PEI_CORE | PEIM | DXE_CORE | DXE_DRIVER | DXE_RUNTIME_DRIVER | DXE_SAL_DRIVER | DXE_SMM_DRIVER | UEFI_DRIVER | UEFI_APPLICATION | USER_DEFINED\r
+    CommonClassObject.__init__(self)\r
+    \r
+class LibraryClassClassObject(CommonClassObject):\r
+  def __init__(self):\r
+    self.LibraryClass = ''\r
+    self.IncludeHeader = ''\r
+    self.RecommendedInstanceVersion = ''\r
+    self.RecommendedInstanceGuid = ''\r
+    self.SupModuleList = []                             #BASE | SEC | PEI_CORE | PEIM | DXE_CORE | DXE_DRIVER | DXE_RUNTIME_DRIVER | DXE_SAL_DRIVER | DXE_SMM_DRIVER | UEFI_DRIVER | UEFI_APPLICATION | USER_DEFINED\r
+    CommonClassObject.__init__(self)\r
+\r
+class GuidClassObject(GuidProtocolPpiCommonClassObject):\r
+  def __init__(self):\r
+    GuidProtocolPpiCommonClassObject.__init__(self)\r
+\r
+class ProtocolClassObject(GuidProtocolPpiCommonClassObject):\r
+  def __init__(self):\r
+    GuidProtocolPpiCommonClassObject.__init__(self)\r
+    \r
+class PpiClassObject(GuidProtocolPpiCommonClassObject):    \r
+  def __init__(self):\r
+    GuidProtocolPpiCommonClassObject.__init__(self)\r
+    \r
+class SkuInfoClassObject(object):\r
+  def __init__(self):\r
+    self.SkuId = ''\r
+    #Used by Hii\r
+    self.VariableName = ''\r
+    self.VariableGuid = ''\r
+    self.VariableOffset = ''\r
+    self.HiiDefaultValue = ''\r
+    \r
+    #Used by Vpd\r
+    self.VpdOffset = ''\r
+    \r
+    #Used by Default\r
+    self.DefaultValue = ''\r
+\r
+class PcdClassObject(CommonClassObject):\r
+  def __init__(self):\r
+    self.CName = ''\r
+    self.Token = ''\r
+    self.TokenSpaceGuidCName = ''\r
+    self.DatumType = ''                                 #UINT8 | UINT16 | UINT32 | UINT64 | VOID* | BOOLEAN \r
+    self.MaxDatumSize = ''\r
+    self.DefaultValue = ''\r
+    self.ItemType = ''                                  #FEATURE_FLAG | FIXED_AT_BUILD | PATCHABLE_IN_MODULE | DYNAMIC | DYNAMIC_EX\r
+    self.SkuInfoList = {}                               #{ [SkuId] : SkuInfoClassObject } \r
+    self.SupModuleList = []                             #BASE | SEC | PEI_CORE | PEIM | DXE_CORE | DXE_DRIVER | DXE_RUNTIME_DRIVER | DXE_SAL_DRIVER | DXE_SMM_DRIVER | UEFI_DRIVER | UEFI_APPLICATION | USER_DEFINED\r
+    CommonClassObject.__init__(self)\r
+\r
+class BuildOptionClassObject(object):\r
+  def __init__(self):\r
+    self.Option = ''\r
+    self.BuildTarget = ''\r
+    self.ToolChainFamily = ''\r
+    self.TagName = ''\r
+    self.ToolCode = ''\r
+    self.SupArchList = []                               #EBC | IA32 | X64 | IPF | ARM | PPC\r
+    \r
+class UserExtensionsClassObject(object):\r
+  def __init__(self):\r
+    self.UserID = ''\r
+    self.Identifier = 0\r
+    self.Content = ''\r
diff --git a/Source/Python/ClassObjects/ModuleClassObject.py b/Source/Python/ClassObjects/ModuleClassObject.py
new file mode 100644 (file)
index 0000000..cdd7300
--- /dev/null
@@ -0,0 +1,131 @@
+# Copyright (c) 2007, Intel Corporation\r
+# All rights reserved. This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution.  The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+#\r
+# This file is used to define a class object to describe a module\r
+#\r
+\r
+from CommonClassObject import *\r
+\r
+class ModuleHeaderClassObject(IdentificationClassObject, CommonHeaderClassObject):\r
+  def __init__(self):\r
+    IdentificationClassObject.__init__(self)\r
+    CommonHeaderClassObject.__init__(self)\r
+    self.ModuleType = ''\r
+    self.SupArchList = []                             #EBC | IA32 | X64 | IPF | ARM | PPC\r
+    self.BinaryModule = False\r
+    self.OutputFileBasename = ''\r
+    self.ClonedFrom = []                              #[ ClonedRecordClassObject, ...]\r
+    self.PcdIsDriver = ''                             #PEI_PCD_DRIVER | DXE_PCD_DRIVER\r
+    self.TianoR8FlashMap_h = False\r
+    \r
+class ModuleSourceFileClassObject(CommonClassObject):\r
+  def __init__(self):\r
+    self.SourceFile = ''\r
+    self.TagName = ''\r
+    self.ToolCode = ''\r
+    self.ToolChainFamily = ''\r
+    CommonClassObject.__init__(self)\r
+    \r
+class ModulePackageDependencyClassObject(CommonClassObject):\r
+  def __init__(self):\r
+    self.FilePath = ''\r
+    self.PackageName = ''\r
+    self.PackageVersion = ''\r
+    self.PackageGuid = ''\r
+    CommonClassObject.__init__(self)\r
+    \r
+class ModuleEventClassObject(CommonClassObject):    \r
+  def __init__(self):\r
+    self.CName = ''\r
+    self.GuidCName = ''\r
+    self.Type = ''                                     #CREATE_EVENT | SIGNAL_EVENT\r
+    CommonClassObject.__init__(self)\r
+    \r
+class ModuleHobClassObject(CommonClassObject):\r
+  def __init__(self):\r
+    self.Type = ''                                     #PHIT | MEMORY_ALLOCATION | RESOURCE_DESCRIPTOR | GUID_EXTENSION | FIRMWARE_VOLUME | CPU | POOL | CAPSULE_VOLUME\r
+    self.GuidCName = ''\r
+    CommonClassObject.__init__(self)\r
+    \r
+class ModuleVariableClassObject(CommonClassObject):\r
+  def __init__(self):\r
+    self.Name = ''\r
+    self.GuidCName = ''\r
+    CommonClassObject.__init__(self)\r
+\r
+class ModuleBootModeClassObject(CommonClassObject):\r
+  def __init__(self):\r
+    self.Name = ''                                     #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
+    CommonClassObject.__init__(self)\r
+    \r
+class ModuleSystemTableClassObject(CommonClassObject):\r
+  def __init__(self):\r
+    self.CName = ''\r
+    CommonClassObject.__init__(self)\r
+\r
+class ModuleDataHubClassObject(CommonClassObject):\r
+  def __init__(self):\r
+    self.CName = ''\r
+    CommonClassObject.__init__(self)    \r
+\r
+class ModuleHiiPackageClassObject(CommonClassObject):\r
+  def __init__(self):\r
+    self.CName = ''\r
+    CommonClassObject.__init__(self)\r
+    \r
+class ModuleExternImageClassObject(object):\r
+  def __init__(self):\r
+    self.ModuleEntryPoint = ''\r
+    self.ModuleUnloadImage = ''\r
+\r
+class ModuleExternLibraryClassObject(object):\r
+  def __init__(self):\r
+    self.Constructor = ''\r
+    self.Destructor = ''\r
+\r
+class ModuleExternDriverClassObject(object):\r
+  def __init__(self):\r
+    self.DriverBinding= ''\r
+    self.ComponentName = ''\r
+    self.DriverConfig = ''\r
+    self.DriverDiag = ''\r
+\r
+class ModuleExternCallBackClassObject(object):\r
+  def __init__(self):\r
+    self.SetVirtualAddressMapCallBack = ''\r
+    self.ExitBootServicesCallBack = ''\r
+    \r
+class ModuleClassObject(object):\r
+  def __init__(self):\r
+    self.Header = ModuleHeaderClassObject()\r
+    self.LibraryClasses = []                           #[ LibraryClassClassObject, ...]\r
+    self.Sources = []                                  #[ ModuleSourceFileClassObject, ...]\r
+    self.NonProcessedFiles = []                        #[ '', '', ...]\r
+    self.PackageDependencies = []                      #[ PackageDependencyClassObject, ...]\r
+    self.Protocols = []                                #[ ProtocolClassObject, ...]\r
+    self.Ppis = []                                     #[ PpiClassObject, ...]\r
+    self.Events = []                                   #[ ModuleEventClassObject, ...]\r
+    self.Hobs = []                                     #[ ModuleHobClassObject, ...] \r
+    self.Variables = []                                #[ ModuleVariableClassObject, ...]\r
+    self.BootModes = []                                #[ ModuleBootModeClassObject, ...]\r
+    self.SystemTables = []                             #[ ModuleSystemTableClassObject, ...]\r
+    self.DataHubs = []                                 #[ ModuleDataHubClassObject, ...]\r
+    self.HiiPackages = []                              #[ ModuleHiiPackageClassObject, ...]\r
+    self.Guids = []                                    #[ GuidClassObject, ...]\r
+    self.PcdCodes = []                                 #[ TokenSpaceGuidCName)] : PcdClassObject, ...]\r
+    self.ExternImages = []                             #[ ModuleExternImageClassObject, ...]\r
+    self.ExternLibraries = []                          #[ ModuleExternLibraryClassObject, ...]\r
+    self.ExternDrivers = []                            #[ ModuleExternDriverClassObject, ...]\r
+    self.ExternCallBacks = []                          #[ ModuleExternCallBackClassObject, ...]        \r
+    self.BuildOptions = []                             #[ BuildOptionClassObject, ...]\r
+    self.UserExtensions = []                           #[ UserExtensionsClassObject, ...]\r
+\r
+if __name__ == '__main__':\r
+  m = ModuleClassObject()\r
diff --git a/Source/Python/ClassObjects/PackageClassObject.py b/Source/Python/ClassObjects/PackageClassObject.py
new file mode 100644 (file)
index 0000000..ac860ba
--- /dev/null
@@ -0,0 +1,49 @@
+# Copyright (c) 2007, Intel Corporation\r
+# All rights reserved. This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution.  The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+#\r
+# This file is used to define a class object to describe a package\r
+#\r
+\r
+from CommonClassObject import *\r
+\r
+class PackageHeaderClassObject(IdentificationClassObject, CommonHeaderClassObject):\r
+  def __init__(self):\r
+    IdentificationClassObject.__init__(self)\r
+    CommonHeaderClassObject.__init__(self)\r
+    self.ReadOnly = False\r
+    self.RePackage = False\r
+    self.ClonedFrom = []                               #[ ClonedRecordClassObject, ...]\r
+    \r
+class PackageIndustryStdHeader(CommonClassObject):\r
+  def __init__(self):\r
+    self.Name = ''\r
+    self.IncludeHeader = ''\r
+    CommonClassObject.__init__(self)\r
+    \r
+class PackageIncludePkgHeader(object):\r
+  def __init__(self):\r
+    self.IncludeHeader = ''\r
+    self.ModuleType = []                               #BASE | SEC | PEI_CORE | PEIM | DXE_CORE | DXE_DRIVER | DXE_RUNTIME_DRIVER | DXE_SAL_DRIVER | DXE_SMM_DRIVER | TOOL | UEFI_DRIVER | UEFI_APPLICATION | USER_DEFINED\r
+\r
+class PackageClassObject(object):\r
+  def __init__(self):\r
+    self.Header = PackageHeaderClassObject()\r
+    self.LibraryClassDeclarations = []                 #[ LibraryClassClassObject, ...]\r
+    self.IndustryStdHeaders = []                       #[ PackageIndustryStdHeader, ...]\r
+    self.ModuleFiles = []                              #[ '', '', ...] \r
+    self.PackageIncludePkgHeaders = []                 #[ PackageIncludePkgHeader, ...]\r
+    self.GuidDeclarations = []                         #[ GuidClassObject, ...]\r
+    self.ProtocolDeclarations = []                     #[ ProtocolClassObject, ...]\r
+    self.PpiDeclarations = []                          #[ PpiClassObject, ...]\r
+    self.PcdDeclarations = []                          #[ PcdClassObject, ...]\r
+    self.UserExtensions = []                           #[ UserExtensionsClassObject, ...]\r
+    \r
+if __name__ == '__main__':\r
+  p = PackageClassObject()\r
diff --git a/Source/Python/ClassObjects/PlatformClassObject.py b/Source/Python/ClassObjects/PlatformClassObject.py
new file mode 100644 (file)
index 0000000..f4558cc
--- /dev/null
@@ -0,0 +1,142 @@
+# Copyright (c) 2007, Intel Corporation\r
+# All rights reserved. This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution.  The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+#\r
+# This file is used to define a class object to describe a platform\r
+#\r
+\r
+from CommonClassObject import *\r
+\r
+class PlatformSkuInfoClassObject(object):\r
+  def __init__(self):\r
+    self.SkuId = ''\r
+    self.String = ''\r
+\r
+class PlatformHeaderClassObject(IdentificationClassObject, CommonHeaderClassObject):\r
+  def __init__(self):\r
+    IdentificationClassObject.__init__(self)\r
+    CommonHeaderClassObject.__init__(self)\r
+    self.SupArchList = []                              #EBC | IA32 | X64 | IPF | ARM | PPC\r
+    self.BuildTargets = []                             #RELEASE | DEBUG\r
+    self.IntermediateDirectories = ''                  #MODULE | UNIFIED\r
+    self.OutputDirectory = ''                          \r
+    self.ForceDebugTarget = ''\r
+    self.ClonedFrom = []                               #[ ClonedRecordClassObject, ...]\r
+\r
+class PlatformFlashDefinitionFileClassObject(object):\r
+  def __init__(self):\r
+    self.Id = ''\r
+    self.UiName = ''\r
+    self.Preferred = False\r
+    self.FilePath = ''\r
+\r
+class PlatformFvImageOption(object):\r
+  def __init__(self):\r
+    self.FvImageOptionName = ''\r
+    self.FvImageOptionValues = []\r
+    \r
+class PlatformFvImageClassObject(object):\r
+  def __init__(self):\r
+    self.Name = ''\r
+    self.Value = ''\r
+    self.Type = ''                                     #Attributes | Options | Components | ImageName \r
+    self.FvImageNames = []\r
+    self.FvImageOptions = []                           #[ PlatformFvImageOption, ...]\r
+\r
+class PlatformFvImageNameClassObject(object):\r
+  def __init__(self):\r
+    self.Name = ''\r
+    self.Type = ''                                     #FV_MAIN | FV_MAIN_COMPACT | NV_STORAGE | FV_RECOVERY | FV_RECOVERY_FLOPPY | FV_FILE | CAPSULE_CARGO | NULL | USER_DEFINED \r
+    self.FvImageOptions = []                           #[ PlatformFvImageOption, ...]\r
+    \r
+class PlatformFvImagesClassObject(object):\r
+  def __init__(self):\r
+    self.FvImages1 = []                                #[ PlatformFvImageClassObject, ...]\r
+    self.FvImages2 = []                                #[ PlatformFvImageNameClassObject, ...]\r
+\r
+class PlatformAntTaskClassObject(object):\r
+  def __init__(self):\r
+    self.Id = ''\r
+    self.AntCmdOptions = ''\r
+    self.FilePath = ''\r
+\r
+class PlatformFfsSectionClassObject(CommonClassObject):\r
+  def __init__(self):\r
+    CommonClassObject.__init__(self)\r
+    self.BindingOrder        = ''\r
+    self.Compressible        = ''\r
+    self.SectionType         = ''\r
+    self.EncapsulationType   = ''\r
+    self.ToolName            = ''\r
+    self.Filenames = []\r
+    self.Args                = ''\r
+    self.OutFile             = ''\r
+    self.OutputFileExtension = ''\r
+    self.ToolNameElement     = ''\r
+    \r
+class PlatformFfsSectionsClassObject(CommonClassObject):\r
+  def __init__(self):\r
+    CommonClassObject.__init__(self)    \r
+    self.BindingOrder      = ''\r
+    self.Compressible      = ''\r
+    self.SectionType       = ''\r
+    self.EncapsulationType = ''\r
+    self.ToolName          = ''\r
+    self.Section = []                                  #[ PlatformFfsSectionClassObject, ... ]\r
+    self.Sections = []                                 #[ PlatformFfsSectionsClassObject, ...]\r
+    \r
+class PlatformFfsClassObject(object):\r
+  def __init__(self):\r
+    self.Attribute = {}                                #{ [(Name, PlatformFfsSectionsClassObject)] : Value}\r
+    self.Sections = []                                 #[ PlatformFfsSectionsClassObject]\r
+\r
+class PlatformBuildOptionClassObject(object):\r
+  def __init__(self):\r
+    self.UserDefinedAntTasks = {}                      #{ [Id] : PlatformAntTaskClassObject, ...}\r
+    self.Options = []                                  #[ BuildOptionClassObject, ...]\r
+    self.UserExtensions = {}                           #{ [(UserID, Identifier)] : UserExtensionsClassObject, ...}\r
+    self.FfsKeyList = {}                               #{ [FfsKey]: PlatformFfsClassObject, ...} \r
+\r
+class PlatformLibraryInstanceClassObject(object):\r
+  def __init__(self):\r
+    self.Name = ''\r
+    self.ModuleGuid = ''\r
+    self.ModuleVersion = ''\r
+    self.PackageGuid = ''\r
+    self.PackageVersion = ''\r
+\r
+class PlatformModuleSaBuildOptionClassObject(object):\r
+  def __init__(self):\r
+    self.FvBinding = ''\r
+    self.FfsFileNameGuid = ''\r
+    self.FfsFormatKey = ''\r
+    self.Options = []                                  #[ BuildOptionClassObject, ...]\r
+        \r
+class PlatformModuleClassObject(object):\r
+  def __init__(self):\r
+    self.Name = ''\r
+    self.FilePath = ''\r
+    self.LibraryInstances = []                         #[ PlatformLibraryInstanceClassObject, ...]\r
+    self.Specifications = []                           #[ '', '', ...]\r
+    self.PcdBuildDefinitions = []                      #[ PcdClassObject, ...]\r
+    self.ModuleSaBuildOption = PlatformModuleSaBuildOptionClassObject()\r
+    \r
+class PlatformClassObject(object):\r
+  def __init__(self):\r
+    self.Header = PlatformHeaderClassObject()\r
+    self.SkuInfoList = {}                              #[ PlatformSkuInfoClassObject ]\r
+    self.FlashDefinitionFile = None                    #PlatformFlashDefinitionFileClassObject()\r
+    self.FvImages = []                                 #[ PlatformFvImagesClassObject, ...]\r
+    self.Modules = []                                  #[ PlatformModuleClassObject, ...]\r
+    self.BuildOptions = []                             #[ PlatformBuildOptionClassObject, ...]\r
+    self.DynamicPcdBuildDefinitions = []               #[ PcdClassObject, ...] \r
+    self.UserExtensions = []                           #[ UserExtensionsClassObject, ...]\r
+\r
+if __name__ == '__main__':\r
+  p = PlatformClassObject()\r