Enhance tool to support PI SMM, SMM_CORE FV file type and PI SMM_DEPEX section type.
authorlgao4 <lgao4@7335b38e-4728-0410-8992-fb3ffe349368>
Mon, 2 Nov 2009 01:59:32 +0000 (01:59 +0000)
committerlgao4 <lgao4@7335b38e-4728-0410-8992-fb3ffe349368>
Mon, 2 Nov 2009 01:59:32 +0000 (01:59 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1735 7335b38e-4728-0410-8992-fb3ffe349368

16 files changed:
Source/Python/AutoGen/AutoGen.py
Source/Python/AutoGen/GenC.py
Source/Python/AutoGen/GenDepex.py
Source/Python/Common/DataType.py
Source/Python/Common/FdfParserLite.py
Source/Python/Common/InfClassObject.py
Source/Python/CommonDataClass/CommonClass.py
Source/Python/CommonDataClass/ModuleClass.py
Source/Python/CommonDataClass/PackageClass.py
Source/Python/GenFds/DepexSection.py
Source/Python/GenFds/FdfParser.py
Source/Python/GenFds/Ffs.py
Source/Python/GenFds/FfsInfStatement.py
Source/Python/GenFds/GenFdsGlobalVariable.py
Source/Python/GenFds/Section.py
Source/Python/Workspace/WorkspaceDatabase.py

index ba459af..444f1e4 100755 (executable)
@@ -51,7 +51,6 @@ gAutoGenHeaderFileName = "AutoGen.h"
 gAutoGenStringFileName = "%(module_name)sStrDefs.h"
 gAutoGenStringFormFileName = "%(module_name)sStrDefs.hpk"
 gAutoGenDepexFileName = "%(module_name)s.depex"
-gAutoGenSmmDepexFileName = "%(module_name)s.smm"
 
 ## Base class for AutoGen
 #
@@ -1761,11 +1760,7 @@ class ModuleAutoGen(AutoGen):
             if self.IsLibrary or TAB_DEPENDENCY_EXPRESSION_FILE in self.FileTypes:
                 return self._DepexList
 
-            if self.ModuleType == "DXE_SMM_DRIVER":
-                self._DepexList["DXE_DRIVER"] = []
-                self._DepexList["SMM_DRIVER"] = []
-            else:
-                self._DepexList[self.ModuleType] = []
+            self._DepexList[self.ModuleType] = []
 
             for ModuleType in self._DepexList:
                 DepexList = self._DepexList[ModuleType]
@@ -1963,7 +1958,8 @@ class ModuleAutoGen(AutoGen):
 
             # stop at STATIC_LIBRARY for library
             if self.IsLibrary and FileType == TAB_STATIC_LIBRARY:
-                self._FinalBuildTargetList.add(LastTarget)
+                if LastTarget:
+                    self._FinalBuildTargetList.add(LastTarget)
                 break
 
             Target = RuleObject.Apply(Source)
@@ -2231,10 +2227,7 @@ class ModuleAutoGen(AutoGen):
             if len(self.DepexList[ModuleType]) == 0:
                 continue
             Dpx = GenDepex.DependencyExpression(self.DepexList[ModuleType], ModuleType, True)
-            if ModuleType == 'SMM_DRIVER':
-                DpxFile = gAutoGenSmmDepexFileName % {"module_name" : self.Name}
-            else:
-                DpxFile = gAutoGenDepexFileName % {"module_name" : self.Name}
+            DpxFile = gAutoGenDepexFileName % {"module_name" : self.Name}
 
             if Dpx.Generate(path.join(self.OutputDir, DpxFile)):
                 AutoGenList.append(str(DpxFile))
index 3cdb0df..0a2bb62 100644 (file)
@@ -383,28 +383,6 @@ ${Function} (
 ${END}
 """)
 
-## SMM_CORE Entry Point Templates
-gSmmCoreEntryPointString = TemplateString("""
-const UINT32 _gUefiDriverRevision = 0;
-${BEGIN}
-EFI_STATUS
-${Function} (
-  IN EFI_HANDLE         ImageHandle,
-  IN EFI_SYSTEM_TABLE   *SystemTable
-  );
-
-EFI_STATUS
-EFIAPI
-ProcessModuleEntryPointList (
-  IN EFI_HANDLE         ImageHandle,
-  IN EFI_SYSTEM_TABLE   *SystemTable
-  )
-{
-  return ${Function} (ImageHandle, SystemTable);
-}
-${END}
-""")
-
 gPeimEntryPointString = [
 TemplateString("""
 GLOBAL_REMOVE_IF_UNREFERENCED const UINT32 _gPeimRevision = ${PiSpecVersion};
@@ -461,6 +439,35 @@ ${END}
 """)
 ]
 
+## SMM_CORE Entry Point Templates
+gSmmCoreEntryPointPrototype = TemplateString("""
+${BEGIN}
+EFI_STATUS
+EFIAPI
+${Function} (
+  IN EFI_HANDLE         ImageHandle,
+  IN EFI_SYSTEM_TABLE   *SystemTable
+  );
+${END}
+""")
+
+gSmmCoreEntryPointString = TemplateString("""
+${BEGIN}
+const UINT32 _gUefiDriverRevision = ${EfiSpecVersion};
+const UINT32 _gDxeRevision = ${PiSpecVersion};
+
+EFI_STATUS
+EFIAPI
+ProcessModuleEntryPointList (
+  IN EFI_HANDLE         ImageHandle,
+  IN EFI_SYSTEM_TABLE   *SystemTable
+  )
+{
+  return ${Function} (ImageHandle, SystemTable);
+}
+${END}
+""")
+
 ## DXE SMM Entry Point Templates
 gDxeSmmEntryPointPrototype = TemplateString("""
 ${BEGIN}
@@ -890,8 +897,7 @@ gModuleTypeHeaderFile = {
     "DXE_SAL_DRIVER"    :   ["PiDxe.h", "Library/BaseLib.h", "Library/DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiDriverEntryPoint.h"],
     "UEFI_DRIVER"       :   ["Uefi.h",  "Library/BaseLib.h", "Library/DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiDriverEntryPoint.h"],
     "UEFI_APPLICATION"  :   ["Uefi.h",  "Library/BaseLib.h", "Library/DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiApplicationEntryPoint.h"],
-    "SMM_DRIVER"        :   ["PiDxe.h", "Library/BaseLib.h", "Library/DebugLib.h", "Library/SmmDriverEntryPoint.h"],
-    "SMM_CORE"          :   ["PiDxe.h", "Library/DebugLib.h"],
+    "SMM_CORE"          :   ["PiDxe.h", "Library/BaseLib.h", "Library/DebugLib.h", "Library/UefiDriverEntryPoint.h"],
     "USER_DEFINED"      :   [gBasicHeaderFile]
 }
 
@@ -1504,7 +1510,7 @@ def CreateLibraryConstructorCode(Info, AutoGenC, AutoGenH):
             ConstructorPrototypeString.Append(gLibraryStructorPrototype['PEI'].Replace(Dict))
             ConstructorCallingString.Append(gLibraryStructorCall['PEI'].Replace(Dict))
         elif Lib.ModuleType in ['DXE_CORE','DXE_DRIVER','DXE_SMM_DRIVER','DXE_RUNTIME_DRIVER',
-                                'DXE_SAL_DRIVER','UEFI_DRIVER','UEFI_APPLICATION', 'SMM_DRIVER', 'SMM_CORE']:
+                                'DXE_SAL_DRIVER','UEFI_DRIVER','UEFI_APPLICATION','SMM_CORE']:
             ConstructorPrototypeString.Append(gLibraryStructorPrototype['DXE'].Replace(Dict))
             ConstructorCallingString.Append(gLibraryStructorCall['DXE'].Replace(Dict))
 
@@ -1530,7 +1536,7 @@ def CreateLibraryConstructorCode(Info, AutoGenC, AutoGenH):
         elif Info.ModuleType in ['PEI_CORE','PEIM']:
             AutoGenC.Append(gLibraryString['PEI'].Replace(Dict))
         elif Info.ModuleType in ['DXE_CORE','DXE_DRIVER','DXE_SMM_DRIVER','DXE_RUNTIME_DRIVER',
-                                 'DXE_SAL_DRIVER','UEFI_DRIVER','UEFI_APPLICATION', 'SMM_DRIVER', 'SMM_CORE']:
+                                 'DXE_SAL_DRIVER','UEFI_DRIVER','UEFI_APPLICATION','SMM_CORE']:
             AutoGenC.Append(gLibraryString['DXE'].Replace(Dict))
 
 ## Create code for library destructor
@@ -1561,7 +1567,7 @@ def CreateLibraryDestructorCode(Info, AutoGenC, AutoGenH):
             DestructorPrototypeString.Append(gLibraryStructorPrototype['PEI'].Replace(Dict))
             DestructorCallingString.Append(gLibraryStructorCall['PEI'].Replace(Dict))
         elif Lib.ModuleType in ['DXE_CORE','DXE_DRIVER','DXE_SMM_DRIVER','DXE_RUNTIME_DRIVER',
-                                'DXE_SAL_DRIVER','UEFI_DRIVER','UEFI_APPLICATION', 'SMM_DRIVER', 'SMM_CORE']:
+                                'DXE_SAL_DRIVER','UEFI_DRIVER','UEFI_APPLICATION', 'SMM_CORE']:
             DestructorPrototypeString.Append(gLibraryStructorPrototype['DXE'].Replace(Dict))
             DestructorCallingString.Append(gLibraryStructorCall['DXE'].Replace(Dict))
 
@@ -1587,7 +1593,7 @@ def CreateLibraryDestructorCode(Info, AutoGenC, AutoGenH):
         elif Info.ModuleType in ['PEI_CORE','PEIM']:
             AutoGenC.Append(gLibraryString['PEI'].Replace(Dict))
         elif Info.ModuleType in ['DXE_CORE','DXE_DRIVER','DXE_SMM_DRIVER','DXE_RUNTIME_DRIVER',
-                                 'DXE_SAL_DRIVER','UEFI_DRIVER','UEFI_APPLICATION', 'SMM_DRIVER', 'SMM_CORE']:
+                                 'DXE_SAL_DRIVER','UEFI_DRIVER','UEFI_APPLICATION','SMM_CORE']:
             AutoGenC.Append(gLibraryString['DXE'].Replace(Dict))
 
 
@@ -1635,26 +1641,25 @@ def CreateModuleEntryPointCode(Info, AutoGenC, AutoGenH):
         AutoGenH.Append(gDxeCoreEntryPointPrototype.Replace(Dict))
     elif Info.ModuleType == 'SMM_CORE':
         AutoGenC.Append(gSmmCoreEntryPointString.Replace(Dict))
+        AutoGenH.Append(gSmmCoreEntryPointPrototype.Replace(Dict))
     elif Info.ModuleType == 'PEIM':
         if NumEntryPoints < 2:
             AutoGenC.Append(gPeimEntryPointString[NumEntryPoints].Replace(Dict))
         else:
             AutoGenC.Append(gPeimEntryPointString[2].Replace(Dict))
         AutoGenH.Append(gPeimEntryPointPrototype.Replace(Dict))
-    elif Info.ModuleType in ['DXE_RUNTIME_DRIVER','DXE_DRIVER','DXE_SMM_DRIVER',
-                             'DXE_SAL_DRIVER','UEFI_DRIVER', 'SMM_DRIVER']:
-        if Info.ModuleType in ['DXE_SMM_DRIVER', 'SMM_DRIVER']:
-            if NumEntryPoints == 0:
-                AutoGenC.Append(gDxeSmmEntryPointString[0].Replace(Dict))
-            else:
-                AutoGenC.Append(gDxeSmmEntryPointString[1].Replace(Dict))
-            AutoGenH.Append(gDxeSmmEntryPointPrototype.Replace(Dict))
+    elif Info.ModuleType in ['DXE_RUNTIME_DRIVER','DXE_DRIVER','DXE_SAL_DRIVER','UEFI_DRIVER']:
+        if NumEntryPoints < 2:
+            AutoGenC.Append(gUefiDriverEntryPointString[NumEntryPoints].Replace(Dict))
         else:
-            if NumEntryPoints < 2:
-                AutoGenC.Append(gUefiDriverEntryPointString[NumEntryPoints].Replace(Dict))
-            else:
-                AutoGenC.Append(gUefiDriverEntryPointString[2].Replace(Dict))
-            AutoGenH.Append(gUefiDriverEntryPointPrototype.Replace(Dict))
+            AutoGenC.Append(gUefiDriverEntryPointString[2].Replace(Dict))
+        AutoGenH.Append(gUefiDriverEntryPointPrototype.Replace(Dict))
+    elif Info.ModuleType == 'DXE_SMM_DRIVER':
+        if NumEntryPoints == 0:
+            AutoGenC.Append(gDxeSmmEntryPointString[0].Replace(Dict))
+        else:
+            AutoGenC.Append(gDxeSmmEntryPointString[1].Replace(Dict))
+        AutoGenH.Append(gDxeSmmEntryPointPrototype.Replace(Dict))    
     elif Info.ModuleType == 'UEFI_APPLICATION':
         if NumEntryPoints < 2:
             AutoGenC.Append(gUefiApplicationEntryPointString[NumEntryPoints].Replace(Dict))
index a3d07b8..9ee615c 100644 (file)
@@ -41,7 +41,7 @@ gType2Phase = {
     "DXE_SAL_DRIVER"    :   "DXE",\r
     "UEFI_DRIVER"       :   "DXE",\r
     "UEFI_APPLICATION"  :   "DXE",\r
-    "SMM_DRIVER"        :   "DXE",\r
+    "SMM_CORE"          :   "DXE",\r
 }\r
 \r
 ## Convert dependency expression string into EFI internal representation\r
index 8b6c4e4..c2da992 100644 (file)
@@ -56,12 +56,11 @@ SUP_MODULE_DXE_SMM_DRIVER = 'DXE_SMM_DRIVER'
 SUP_MODULE_UEFI_DRIVER = 'UEFI_DRIVER'\r
 SUP_MODULE_UEFI_APPLICATION = 'UEFI_APPLICATION'\r
 SUP_MODULE_USER_DEFINED = 'USER_DEFINED'\r
-SUP_MODULE_SMM_DRIVER = 'SMM_DRIVER'\r
 SUP_MODULE_SMM_CORE = 'SMM_CORE'\r
 \r
 SUP_MODULE_LIST = [SUP_MODULE_BASE, SUP_MODULE_SEC, SUP_MODULE_PEI_CORE, SUP_MODULE_PEIM, SUP_MODULE_DXE_CORE, SUP_MODULE_DXE_DRIVER, \\r
                    SUP_MODULE_DXE_RUNTIME_DRIVER, SUP_MODULE_DXE_SAL_DRIVER, SUP_MODULE_DXE_SMM_DRIVER, SUP_MODULE_UEFI_DRIVER, \\r
-                   SUP_MODULE_UEFI_APPLICATION, SUP_MODULE_USER_DEFINED, SUP_MODULE_SMM_DRIVER, SUP_MODULE_SMM_CORE]\r
+                   SUP_MODULE_UEFI_APPLICATION, SUP_MODULE_USER_DEFINED, SUP_MODULE_SMM_CORE]\r
 SUP_MODULE_LIST_STRING = TAB_VALUE_SPLIT.join(l for l in SUP_MODULE_LIST)\r
 \r
 EDK_COMPONENT_TYPE_LIBRARY = 'LIBRARY'\r
@@ -86,6 +85,7 @@ BINARY_FILE_TYPE_PE32 = 'PE32'
 BINARY_FILE_TYPE_PIC = 'PIC'\r
 BINARY_FILE_TYPE_PEI_DEPEX = 'PEI_DEPEX'\r
 BINARY_FILE_TYPE_DXE_DEPEX = 'DXE_DEPEX'\r
+BINARY_FILE_TYPE_SMM_DEPEX = 'SMM_DEPEX'\r
 BINARY_FILE_TYPE_TE = 'TE'\r
 BINARY_FILE_TYPE_VER = 'VER'\r
 BINARY_FILE_TYPE_UI = 'UI'\r
index 5099ed6..b397b16 100644 (file)
@@ -2408,7 +2408,7 @@ class FdfParser(object):
                 \r
             Obj.SectionList.append(FvImageSectionObj) \r
            \r
-        elif self.__IsKeyword("PEI_DEPEX_EXP") or self.__IsKeyword("DXE_DEPEX_EXP"):\r
+        elif self.__IsKeyword("PEI_DEPEX_EXP") or self.__IsKeyword("DXE_DEPEX_EXP") or self.__IsKeyword("SMM_DEPEX_EXP"):\r
             DepexSectionObj = CommonDataClass.FdfClass.DepexSectionClassObject()\r
             DepexSectionObj.Alignment = AlignValue\r
             DepexSectionObj.DepexType = self.__Token\r
@@ -2798,7 +2798,7 @@ class FdfParser(object):
                              "DXE_SMM_DRIVER", "DXE_RUNTIME_DRIVER", \\r
                              "UEFI_DRIVER", "UEFI_APPLICATION", "USER_DEFINED", "DEFAULT", "BASE", \\r
                              "SECURITY_CORE", "COMBINED_PEIM_DRIVER", "PIC_PEIM", "RELOCATABLE_PEIM", \\r
-                             "PE32_PEIM", "BS_DRIVER", "RT_DRIVER", "SAL_RT_DRIVER", "APPLICATION", "ACPITABLE", "SMM_DRIVER", "SMM_CORE"):\r
+                             "PE32_PEIM", "BS_DRIVER", "RT_DRIVER", "SAL_RT_DRIVER", "APPLICATION", "ACPITABLE", "SMM_CORE"):\r
             raise Warning("Unknown Module type At line ", self.FileName, self.CurrentLineNumber)\r
         return self.__Token\r
     \r
@@ -2842,7 +2842,7 @@ class FdfParser(object):
         \r
         Type = self.__Token.strip().upper()\r
         if Type not in ("RAW", "FREEFORM", "SEC", "PEI_CORE", "PEIM",\\r
-                             "PEI_DXE_COMBO", "DRIVER", "DXE_CORE", "APPLICATION", "FV_IMAGE", "SMM_DXE_COMBO", "SMM", "SMM_CORE"):\r
+                             "PEI_DXE_COMBO", "DRIVER", "DXE_CORE", "APPLICATION", "FV_IMAGE", "SMM", "SMM_CORE"):\r
             raise Warning("Unknown FV type At line ", self.FileName, self.CurrentLineNumber)\r
 \r
         if not self.__IsToken("="):\r
@@ -3221,8 +3221,8 @@ class FdfParser(object):
         elif SectionType == "RAW":\r
             if FileType not in ("BIN", "SEC_BIN", "RAW", "ASL", "ACPI"):\r
                 raise Warning("Incorrect section file type At Line ", self.FileName, self.CurrentLineNumber)\r
-        elif SectionType == "DXE_DEPEX":\r
-            if FileType not in ("DXE_DEPEX", "SEC_DXE_DEPEX"):\r
+        elif SectionType == "DXE_DEPEX" or SectionType == "SMM_DEPEX":\r
+            if FileType not in ("DXE_DEPEX", "SEC_DXE_DEPEX", "SMM_DEPEX"):\r
                 raise Warning("Incorrect section file type At Line ", self.FileName, self.CurrentLineNumber)\r
         elif SectionType == "UI":\r
             if FileType not in ("UI", "SEC_UI"):\r
index a772840..27e67f3 100755 (executable)
@@ -66,8 +66,6 @@ gComponentType2ModuleType = {
     "BS_DRIVER"             :   "DXE_DRIVER",\r
     "RT_DRIVER"             :   "DXE_RUNTIME_DRIVER",\r
     "SAL_RT_DRIVER"         :   "DXE_SAL_DRIVER",\r
-#    "BS_DRIVER"             :   "DXE_SMM_DRIVER",\r
-#    "BS_DRIVER"             :   "UEFI_DRIVER",\r
     "APPLICATION"           :   "UEFI_APPLICATION",\r
     "LOGO"                  :   "BASE",\r
 }\r
index 763550f..e226f1b 100644 (file)
@@ -174,7 +174,7 @@ class IncludeStatementClass(object):
 # @var GuidTypeList:   To store value for GuidTypeList, selection scope is in below list\r
 #                      DATA_HUB_RECORD | EFI_EVENT | EFI_SYSTEM_CONFIGURATION_TABLE | EFI_VARIABLE | GUID | HII_PACKAGE_LIST | HOB | TOKEN_SPACE_GUID\r
 # @var SupModuleList:  To store value for SupModuleList, selection scope is in below list\r
-#                      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
+#                      BASE | SEC | PEI_CORE | PEIM | DXE_CORE | DXE_DRIVER | DXE_RUNTIME_DRIVER | DXE_SAL_DRIVER | DXE_SMM_DRIVER | UEFI_DRIVER | UEFI_APPLICATION | USER_DEFINED | SMM_CORE\r
 #\r
 class GuidProtocolPpiCommonClass(CommonClass):\r
     def __init__(self):\r
@@ -202,7 +202,7 @@ class GuidProtocolPpiCommonClass(CommonClass):
 # @var RecommendedInstance:         To store value for RecommendedInstance, selection scope is in below list\r
 #                                   DATA_HUB_RECORD | EFI_EVENT | EFI_SYSTEM_CONFIGURATION_TABLE | EFI_VARIABLE | GUID | HII_PACKAGE_LIST | HOB | TOKEN_SPACE_GUID\r
 # @var SupModuleList:               To store value for SupModuleList, selection scope is in below list\r
-#                                   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
+#                                   BASE | SEC | PEI_CORE | PEIM | DXE_CORE | DXE_DRIVER | DXE_RUNTIME_DRIVER | DXE_SAL_DRIVER | DXE_SMM_DRIVER | UEFI_DRIVER | UEFI_APPLICATION | USER_DEFINED | SMM_CORE\r
 #\r
 class LibraryClassClass(CommonClass, DefineClass):\r
     def __init__(self):\r
@@ -353,7 +353,7 @@ class PcdErrorClass(object):
 # @var SkuInfoList:            To store value for SkuInfoList\r
 #                              It is a set structure as { [SkuIdName] : SkuInfoClass } \r
 # @var SupModuleList:          To store value for SupModuleList, selection scope is in below list\r
-#                              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
+#                              BASE | SEC | PEI_CORE | PEIM | DXE_CORE | DXE_DRIVER | DXE_RUNTIME_DRIVER | DXE_SAL_DRIVER | DXE_SMM_DRIVER | UEFI_DRIVER | UEFI_APPLICATION | USER_DEFINED | SMM_CORE\r
 #\r
 class PcdClass(CommonClass):\r
     def __init__(self, CName = '', Token = '', TokenSpaceGuidCName = '', DatumType = '', MaxDatumSize = '', DefaultValue = '', ItemType = '', ValidUsage = None, SkuInfoList = None, SupModuleList = None):\r
index 9d78072..49d052d 100755 (executable)
@@ -121,7 +121,7 @@ class ModuleSourceFileClass(CommonClass):
 #\r
 # @var BinaryFile:       To store value for BinaryFile\r
 # @var FileType:         To store value for FileType, selection scope is in below list\r
-#                        FW | GUID | PREEFORM | UEFI_APP | UNI_UI | UNI_VER | LIB | PE32 | PIC | PEI_DEPEX | DXE_DEPEX | TE | VER | UI | BIN | FV\r
+#                        FW | GUID | PREEFORM | UEFI_APP | UNI_UI | UNI_VER | LIB | PE32 | PIC | PEI_DEPEX | DXE_DEPEX | SMM_DEPEX| TE | VER | UI | BIN | FV\r
 # @var Target:           To store value for Target\r
 # @var ToolChainFamily:  To store value for ToolChainFamily\r
 #\r
index c064f25..1382b80 100755 (executable)
@@ -62,7 +62,7 @@ class PackageIndustryStdHeaderClass(CommonClass):
 #\r
 # @var IncludeHeader:  To store value for IncludeHeader\r
 # @var ModuleType:     To store value for ModuleType, it is a set structure as\r
-#                      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
+#                      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 | SMM_CORE\r
 #\r
 class PackageIncludePkgHeaderClass(object):\r
     def __init__(self):\r
index 1c8c82a..a0a1905 100644 (file)
@@ -80,23 +80,27 @@ class DepexSection (DepexSectionClassObject):
             self.Expression = self.Expression.replace(Item, ExpGuidDict[Item])\r
 \r
         self.Expression = self.Expression.strip()\r
-        ModuleType = (self.DepexType.startswith('PEI') and ['PEIM'] or ['DXE_DRIVER'])[0]\r
-        if self.DepexType.startswith('SMM'):\r
-            ModuleType = 'SMM_DRIVER'\r
-        InputFile = os.path.join (OutputPath, ModuleName + 'SEC' + SecNum + '.dpx')\r
-        InputFile = os.path.normpath(InputFile)\r
+        if self.DepexType == 'PEI_DEPEX_EXP':\r
+            ModuleType = 'PEIM'\r
+            SecType    = 'PEI_DEPEX'\r
+        elif self.DepexType == 'DXE_DEPEX_EXP':\r
+            ModuleType = 'DXE_DRIVER'\r
+            SecType    = 'DXE_DEPEX'\r
+        elif self.DepexType == 'SMM_DEPEX_EXP':\r
+            ModuleType = 'DXE_SMM_DRIVER'\r
+            SecType    = 'SMM_DEPEX'\r
+        else:\r
+            EdkLogger.error("GenFds", FORMAT_INVALID,\r
+                            "Depex type %s is not valid for module %s" % (self.DepexType, ModuleName))\r
 \r
-        Dpx = DependencyExpression(self.Expression, ModuleType)\r
-        Dpx.Generate(InputFile)\r
+        InputFile = os.path.join (OutputPath, ModuleName + 'SEC' + SecNum + '.depex')\r
+        InputFile = os.path.normpath(InputFile)\r
+        Depex = DependencyExpression(self.Expression, ModuleType)\r
+        Depex.Generate(InputFile)\r
 \r
-        OutputFile = os.path.join (OutputPath, ModuleName + 'SEC' + SecNum + '.depex')\r
-        if self.DepexType.startswith('SMM'):\r
-            OutputFile = os.path.join (OutputPath, ModuleName + 'SEC' + SecNum + '.smm')\r
+        OutputFile = os.path.join (OutputPath, ModuleName + 'SEC' + SecNum + '.dpx')\r
         OutputFile = os.path.normpath(OutputFile)\r
-        SecType = (self.DepexType.startswith('PEI') and ['PEI_DEPEX'] or ['DXE_DEPEX'])[0]\r
-        if self.DepexType.startswith('SMM'):\r
-            SecType = 'SMM_DEPEX'\r
-        \r
+\r
         GenFdsGlobalVariable.GenerateSection(OutputFile, [InputFile], Section.Section.SectionType.get (SecType))\r
         FileList = [OutputFile]\r
         return FileList, self.Alignment\r
index ac28e42..24732a0 100644 (file)
@@ -2786,7 +2786,6 @@ class FdfParser:
             else:\r
                 Value = self.__Token.strip()\r
             Obj.TokensDict[Name] = Value  \r
-            print Name, '=', Value\r
             if not self.__GetNextToken():\r
                 return False\r
         self.__UndoToken()\r
@@ -2913,7 +2912,7 @@ class FdfParser:
                              "DXE_SMM_DRIVER", "DXE_RUNTIME_DRIVER", \\r
                              "UEFI_DRIVER", "UEFI_APPLICATION", "USER_DEFINED", "DEFAULT", "BASE", \\r
                              "SECURITY_CORE", "COMBINED_PEIM_DRIVER", "PIC_PEIM", "RELOCATABLE_PEIM", \\r
-                             "PE32_PEIM", "BS_DRIVER", "RT_DRIVER", "SAL_RT_DRIVER", "APPLICATION", "ACPITABLE", "SMM_DRIVER", "SMM_CORE"):\r
+                             "PE32_PEIM", "BS_DRIVER", "RT_DRIVER", "SAL_RT_DRIVER", "APPLICATION", "ACPITABLE", "SMM_CORE"):\r
             raise Warning("Unknown Module type '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
         return self.__Token\r
 \r
@@ -2957,7 +2956,7 @@ class FdfParser:
 \r
         Type = self.__Token.strip().upper()\r
         if Type not in ("RAW", "FREEFORM", "SEC", "PEI_CORE", "PEIM",\\r
-                             "PEI_DXE_COMBO", "DRIVER", "DXE_CORE", "APPLICATION", "FV_IMAGE", "SMM_DXE_COMBO", "SMM", "SMM_CORE"):\r
+                             "PEI_DXE_COMBO", "DRIVER", "DXE_CORE", "APPLICATION", "FV_IMAGE", "SMM", "SMM_CORE"):\r
             raise Warning("Unknown FV type '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
 \r
         if not self.__IsToken("="):\r
@@ -3336,8 +3335,8 @@ class FdfParser:
         elif SectionType == "RAW":\r
             if FileType not in ("BIN", "SEC_BIN", "RAW", "ASL", "ACPI"):\r
                 raise Warning("Incorrect section file type '%s'" % FileType, self.FileName, self.CurrentLineNumber)\r
-        elif SectionType == "DXE_DEPEX":\r
-            if FileType not in ("DXE_DEPEX", "SEC_DXE_DEPEX"):\r
+        elif SectionType == "DXE_DEPEX" or SectionType == "SMM_DEPEX":\r
+            if FileType not in ("DXE_DEPEX", "SEC_DXE_DEPEX", "SMM_DEPEX"):\r
                 raise Warning("Incorrect section file type '%s'" % FileType, self.FileName, self.CurrentLineNumber)\r
         elif SectionType == "UI":\r
             if FileType not in ("UI", "SEC_UI"):\r
index aaa7917..438bd18 100755 (executable)
@@ -34,7 +34,6 @@ class Ffs(FDClassObject):
         'DXE_RUNTIME_DRIVER': 'EFI_FV_FILETYPE_DRIVER',\r
         'UEFI_DRIVER'       : 'EFI_FV_FILETYPE_DRIVER',\r
         'UEFI_APPLICATION'  : 'EFI_FV_FILETYPE_APPLICATION',\r
-        'SMM_DRIVER'        : 'EFI_FV_FILETYPE_SMM',\r
         'SMM_CORE'          : 'EFI_FV_FILETYPE_SMM_CORE'\r
     }\r
     \r
@@ -50,7 +49,6 @@ class Ffs(FDClassObject):
         'FV_IMAGE'          : 'EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE',\r
         'RAW'               : 'EFI_FV_FILETYPE_RAW',\r
         'PEI_DXE_COMBO'     : 'EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER',\r
-        'SMM_DXE_COMBO'     : 'EFI_FV_FILETYPE_COMBINED_SMM_DXE',\r
         'SMM'               : 'EFI_FV_FILETYPE_SMM',\r
         'SMM_CORE'          : 'EFI_FV_FILETYPE_SMM_CORE'\r
     }\r
@@ -70,7 +68,7 @@ class Ffs(FDClassObject):
         'COMPRESS'             : '.com',\r
         'GUIDED'               : '.guided',\r
         'PEI_DEPEX'            : '.dpx',\r
-        'SMM_DEPEX'            : '.smm'\r
+        'SMM_DEPEX'            : '.dpx'\r
     }\r
     \r
     ## The constructor\r
index 0dcd96d..ac13e4d 100644 (file)
@@ -47,6 +47,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
         self.KeepRelocFromRule = None\r
         self.InDsc = True\r
         self.OptRomDefs = {}\r
+        self.PiSpecVersion = 0\r
         \r
     ## __InfParse() method\r
     #\r
@@ -89,6 +90,8 @@ class FfsInfStatement(FfsInfStatementClassObject):
             self.BaseName = Inf.BaseName\r
             self.ModuleGuid = Inf.Guid\r
             self.ModuleType = Inf.ModuleType\r
+            if Inf.Specification != None and 'PI_SPECIFICATION_VERSION' in Inf.Specification:
+                self.PiSpecVersion = Inf.Specification['PI_SPECIFICATION_VERSION']\r
             if Inf.AutoGenVersion < 0x00010005:\r
                 self.ModuleType = Inf.ComponentType\r
             self.VersionString = Inf.Version\r
@@ -102,6 +105,8 @@ class FfsInfStatement(FfsInfStatementClassObject):
             self.BaseName = Inf.BaseName\r
             self.ModuleGuid = Inf.Guid\r
             self.ModuleType = Inf.ModuleType\r
+            if Inf.Specification != None and 'PI_SPECIFICATION_VERSION' in Inf.Specification:
+                self.PiSpecVersion = Inf.Specification['PI_SPECIFICATION_VERSION']\r
             self.VersionString = Inf.Version\r
             self.BinFileList = Inf.Binaries\r
             self.SourceFileList = Inf.Sources\r
@@ -113,6 +118,9 @@ class FfsInfStatement(FfsInfStatementClassObject):
         if len(self.SourceFileList) != 0 and not self.InDsc:\r
             EdkLogger.warn("GenFds", GENFDS_ERROR, "Module %s NOT found in DSC file; Is it really a binary module?" % (self.InfFileName))\r
 \r
+        if self.ModuleType == 'SMM_CORE' and self.PiSpecVersion < 0x0001000A:
+            EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED, "SMM_CORE module type can't be used in the module with PI_SPECIFICATION_VERSION less than 0x0001000A", File=self.InfFileName)      \r
+\r
         if Inf._Defs != None and len(Inf._Defs) > 0:\r
             self.OptRomDefs.update(Inf._Defs)\r
             \r
@@ -153,7 +161,18 @@ class FfsInfStatement(FfsInfStatementClassObject):
         #\r
         Rule = self.__GetRule__()\r
         GenFdsGlobalVariable.VerboseLogger( "Packing binaries from inf file : %s" %self.InfFileName)\r
-        #FileType = Ffs.Ffs.ModuleTypeToFileType[Rule.ModuleType]\r
+        #\r
+        # Convert Fv File Type for PI1.1 SMM driver.\r
+        #\r
+        if self.ModuleType == 'DXE_SMM_DRIVER' and self.PiSpecVersion >= 0x0001000A:\r
+            if Rule.FvFileType == 'DRIVER':\r
+                Rule.FvFileType = 'SMM'\r
+        #\r
+        # Framework SMM Driver has no SMM FV file type\r
+        #\r
+        if self.ModuleType == 'DXE_SMM_DRIVER' and self.PiSpecVersion < 0x0001000A:\r
+            if Rule.FvFileType == 'SMM' or Rule.FvFileType == 'SMM_CORE':\r
+                EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED, "Framework SMM module doesn't support SMM or SMM_CORE FV file type", File=self.InfFileName)\r
         #\r
         # For the rule only has simpleFile\r
         #\r
@@ -380,7 +399,19 @@ class FfsInfStatement(FfsInfStatementClassObject):
             FileList, IsSect = Section.Section.GetFileList(self, '', Rule.FileExtension)\r
 \r
         Index = 1\r
-        SectionType     = Rule.SectionType\r
+        SectionType = Rule.SectionType\r
+        #\r
+        # Convert Fv Section Type for PI1.1 SMM driver.\r
+        #\r
+        if self.ModuleType == 'DXE_SMM_DRIVER' and self.PiSpecVersion >= 0x0001000A:\r
+            if SectionType == 'DXE_DEPEX':\r
+                SectionType = 'SMM_DEPEX'\r
+        #\r
+        # Framework SMM Driver has no SMM_DEPEX section type\r
+        #\r
+        if self.ModuleType == 'DXE_SMM_DRIVER' and self.PiSpecVersion < 0x0001000A:\r
+            if SectionType == 'SMM_DEPEX':\r
+                EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED, "Framework SMM module doesn't support SMM_DEPEX section type", File=self.InfFileName)\r
         NoStrip = True\r
         if self.ModuleType in ('SEC', 'PEI_CORE', 'PEIM'):\r
             if self.KeepReloc != None:\r
@@ -517,6 +548,18 @@ class FfsInfStatement(FfsInfStatementClassObject):
         for Sect in Rule.SectionList:\r
             SecIndex = '%d' %Index\r
             SectList  = []\r
+            #\r
+            # Convert Fv Section Type for PI1.1 SMM driver.\r
+            #\r
+            if self.ModuleType == 'DXE_SMM_DRIVER' and self.PiSpecVersion >= 0x0001000A:\r
+                if Sect.SectionType == 'DXE_DEPEX':\r
+                    Sect.SectionType = 'SMM_DEPEX'\r
+            #\r
+            # Framework SMM Driver has no SMM_DEPEX section type\r
+            #\r
+            if self.ModuleType == 'DXE_SMM_DRIVER' and self.PiSpecVersion < 0x0001000A:\r
+                if Sect.SectionType == 'SMM_DEPEX':\r
+                    EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED, "Framework SMM module doesn't support SMM_DEPEX section type", File=self.InfFileName)\r
             if Rule.KeyStringList != []:\r
                 SectList, Align = Sect.GenSection(self.OutputPath , self.ModuleGuid, SecIndex, Rule.KeyStringList, self)\r
             else :\r
index 77c8821..b54e8c8 100644 (file)
@@ -294,10 +294,7 @@ class GenFdsGlobalVariable:
     @staticmethod
     def GenerateOptionRom(Output, EfiInput, BinaryInput, Compress=False, ClassCode=None,
                         Revision=None, DeviceId=None, VendorId=None):
-#        if not GenFdsGlobalVariable.NeedsUpdate(Output, Input):
-#            return
-#        GenFdsGlobalVariable.DebugLogger(EdkLogger.DEBUG_5, "%s needs update because of newer %s" % (Output, Input))
-
+        InputList = []   
         Cmd = ["EfiRom"]
         if len(EfiInput) > 0:
             
@@ -308,11 +305,18 @@ class GenFdsGlobalVariable:
                 
             for EfiFile in EfiInput:
                 Cmd += [EfiFile]
+                InputList.append (EfiFile)
         
         if len(BinaryInput) > 0:
             Cmd += ["-b"]
             for BinFile in BinaryInput:
                 Cmd += [BinFile]
+                InputList.append (BinFile)
+
+        # Check List
+        if not GenFdsGlobalVariable.NeedsUpdate(Output, InputList):
+            return
+        GenFdsGlobalVariable.DebugLogger(EdkLogger.DEBUG_5, "%s needs update because of newer %s" % (Output, InputList))
                         
         if ClassCode != None:
             Cmd += ["-l", ClassCode]
index ffca3a1..1905935 100755 (executable)
@@ -129,7 +129,7 @@ class Section (SectionClassObject):
         if FileType != None:\r
             for File in FfsInf.BinFileList:\r
                 if File.Arch == "COMMON" or FfsInf.CurrentArch == File.Arch:\r
-                    if File.Type == FileType:\r
+                    if File.Type == FileType or (FfsInf.PiSpecVersion >= 0x0001000A and FileType == 'DXE_DPEX'and File.Type == 'SMM_DEPEX'):\r
                         if '*' in FfsInf.TargetOverrideList or File.Target == '*' or File.Target in FfsInf.TargetOverrideList or FfsInf.TargetOverrideList == []:\r
                             FileList.append(File.Path)\r
                         else:\r
index 73e827a..2f2e812 100644 (file)
@@ -1111,7 +1111,7 @@ class InfBuildData(ModuleBuildClassObject):
         "BS_DRIVER"             :   "DXE_DRIVER",
         "RT_DRIVER"             :   "DXE_RUNTIME_DRIVER",
         "SAL_RT_DRIVER"         :   "DXE_SAL_DRIVER",
-        "SMM_DRIVER"            :   "SMM_DRIVER",
+    #    "SMM_DRIVER"            :   "DXE_SMM_DRIVER",
     #    "BS_DRIVER"             :   "DXE_SMM_DRIVER",
     #    "BS_DRIVER"             :   "UEFI_DRIVER",
         "APPLICATION"           :   "UEFI_APPLICATION",
@@ -1318,6 +1318,9 @@ class InfBuildData(ModuleBuildClassObject):
             if not self._ModuleType:
                 EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE,
                                 "MODULE_TYPE is not given", File=self.MetaFile)
+            if (self._Specification == None) or (not 'PI_SPECIFICATION_VERSION' in self._Specification) or (self._Specification['PI_SPECIFICATION_VERSION'] < 0x0001000A):
+                if self._ModuleType == SUP_MODULE_SMM_CORE:
+                    EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "SMM_CORE module type can't be used in the module with PI_SPECIFICATION_VERSION less than 0x0001000A", File=self.MetaFile)                
             if self._Defs and 'PCI_DEVICE_ID' in self._Defs and 'PCI_VENDOR_ID' in self._Defs \
                and 'PCI_CLASS_CODE' in self._Defs:
                 self._BuildType = 'UEFI_OPTIONROM'