BaseTools/GenFds: register MM Modules and MM FV file types.
authorSupreeth Venkatesh <supreeth.venkatesh@arm.com>
Mon, 26 Jun 2017 16:47:43 +0000 (00:47 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Fri, 7 Jul 2017 02:52:08 +0000 (10:52 +0800)
This patch verifies MM_CORE_STANDALONE module compatibility with PI
specification version.
Also, it registers MM_STANDALONE/MM_CORE_STANDALONE modules with
FdfParser class and provides mapping between MM_STANDALONE and
MM_CORE_STANDALONE module type in FDF with
EFI_FV_FILETYPE_MM_STANDALONE and EFI_FV_FILETYPE_MM_CORE_STANDALONE file types
in GenFfs.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/Python/GenFds/FdfParser.py
BaseTools/Source/Python/GenFds/Ffs.py
BaseTools/Source/Python/GenFds/FfsInfStatement.py

index a1825ba..2782be4 100644 (file)
@@ -3672,7 +3672,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_CORE"):\r
+                                        "PE32_PEIM", "BS_DRIVER", "RT_DRIVER", "SAL_RT_DRIVER", "APPLICATION", "ACPITABLE", "SMM_CORE", "MM_STANDALONE", "MM_CORE_STANDALONE"):\r
             raise Warning("Unknown Module type '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
         return self.__Token\r
 \r
@@ -3716,7 +3716,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", "SMM_CORE"):\r
+                             "PEI_DXE_COMBO", "DRIVER", "DXE_CORE", "APPLICATION", "FV_IMAGE", "SMM", "SMM_CORE", "MM_STANDALONE", "MM_CORE_STANDALONE"):\r
             raise Warning("Unknown FV type '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)\r
 \r
         if not self.__IsToken("="):\r
index c8c5a6e..a417812 100644 (file)
@@ -34,7 +34,9 @@ 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_CORE'          : 'EFI_FV_FILETYPE_SMM_CORE'\r
+        'SMM_CORE'          : 'EFI_FV_FILETYPE_SMM_CORE',\r
+        'MM_STANDALONE'     : 'EFI_FV_FILETYPE_MM_STANDALONE',\r
+        'MM_CORE_STANDALONE' : 'EFI_FV_FILETYPE_MM_CORE_STANDALONE'\r
     }\r
     \r
     # mapping between FILE type in FDF and file type for GenFfs\r
@@ -50,7 +52,9 @@ class Ffs(FDClassObject):
         'RAW'               : 'EFI_FV_FILETYPE_RAW',\r
         'PEI_DXE_COMBO'     : 'EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER',\r
         'SMM'               : 'EFI_FV_FILETYPE_SMM',\r
-        'SMM_CORE'          : 'EFI_FV_FILETYPE_SMM_CORE'\r
+        'SMM_CORE'          : 'EFI_FV_FILETYPE_SMM_CORE',\r
+        'MM_STANDALONE'     : 'EFI_FV_FILETYPE_MM_STANDALONE',\r
+        'MM_CORE_STANDALONE' : 'EFI_FV_FILETYPE_MM_CORE_STANDALONE'\r
     }\r
     \r
     # mapping between section type in FDF and file suffix\r
index e9517a4..c61c227 100644 (file)
@@ -224,6 +224,9 @@ class FfsInfStatement(FfsInfStatementClassObject):
         if self.ModuleType == 'SMM_CORE' and int(self.PiSpecVersion, 16) < 0x0001000A:\r
             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 self.ModuleType == 'MM_CORE_STANDALONE' and int(self.PiSpecVersion, 16) < 0x00010032:\r
+            EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED, "MM_CORE_STANDALONE module type can't be used in the module with PI_SPECIFICATION_VERSION less than 0x00010032", File=self.InfFileName)\r
+\r
         if Inf._Defs != None and len(Inf._Defs) > 0:\r
             self.OptRomDefs.update(Inf._Defs)\r
 \r