]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Pei/FwVol/FwVol.c
MdeModulePkg/SecurityPkg: Update TreePei to handle FvInfo2 and update FwVol of PeiCor...
[mirror_edk2.git] / MdeModulePkg / Core / Pei / FwVol / FwVol.c
index ec855a8df4d70bd962698e12d9e605d9141e4233..fe876ed393a9357bca3d689ab4be8401637ff3b1 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Pei Core Firmware File System service routines.\r
   \r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
 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
@@ -525,6 +525,7 @@ FirmwareVolmeInfoPpiNotifyCallback (
   UINTN                                 FvIndex;\r
   EFI_PEI_FILE_HANDLE                   FileHandle;\r
   VOID                                  *DepexData;\r
+  BOOLEAN                               IsFvInfo2;\r
   \r
   Status       = EFI_SUCCESS;\r
   PrivateData  = PEI_CORE_INSTANCE_FROM_PS_THIS (PeiServices);\r
@@ -540,12 +541,14 @@ FirmwareVolmeInfoPpiNotifyCallback (
     // It is FvInfo2PPI.\r
     //\r
     CopyMem (&FvInfo2Ppi, Ppi, sizeof (EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI));\r
+    IsFvInfo2 = TRUE;\r
   } else {\r
     //\r
     // It is FvInfoPPI.\r
     //\r
     CopyMem (&FvInfo2Ppi, Ppi, sizeof (EFI_PEI_FIRMWARE_VOLUME_INFO_PPI));\r
     FvInfo2Ppi.AuthenticationStatus = 0;\r
+    IsFvInfo2 = FALSE;\r
   }\r
 \r
   //\r
@@ -572,6 +575,10 @@ FirmwareVolmeInfoPpiNotifyCallback (
     //\r
     for (FvIndex = 0; FvIndex < PrivateData->FvCount; FvIndex ++) {\r
       if (PrivateData->Fv[FvIndex].FvHandle == FvHandle) {\r
+        if (IsFvInfo2 && (FvInfo2Ppi.AuthenticationStatus != PrivateData->Fv[FvIndex].AuthenticationStatus)) {\r
+          PrivateData->Fv[FvIndex].AuthenticationStatus = FvInfo2Ppi.AuthenticationStatus;\r
+          DEBUG ((EFI_D_INFO, "Update AuthenticationStatus of the %dth FV to 0x%x!\n", FvIndex, FvInfo2Ppi.AuthenticationStatus));          \r
+        }\r
         DEBUG ((EFI_D_INFO, "The Fv %p has already been processed!\n", FvInfo2Ppi.FvInfo));\r
         return EFI_SUCCESS;\r
       }\r
@@ -1337,8 +1344,16 @@ ProcessFvFile (
   ASSERT_EFI_ERROR (Status);\r
   \r
   //\r
-  // Install FvInfo2 Ppi and Build FvHob\r
+  // Install FvInfo(2) Ppi\r
   //\r
+  PeiServicesInstallFvInfoPpi (\r
+    &FvHeader->FileSystemGuid,\r
+    (VOID**) FvHeader,\r
+    (UINT32) FvHeader->FvLength,\r
+    &ParentFvImageInfo.FvName,\r
+    &FileInfo.FileName\r
+    );\r
+\r
   PeiServicesInstallFvInfo2Ppi (\r
     &FvHeader->FileSystemGuid,\r
     (VOID**) FvHeader,\r