]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add more checks for Dxe Report status code library to access boot service.
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 10 Mar 2009 07:54:11 +0000 (07:54 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 10 Mar 2009 07:54:11 +0000 (07:54 +0000)
Add measure to GPT boot table.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7846 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeSupport.c
IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
IntelFrameworkModulePkg/Library/GenericBdsLib/InternalBdsLib.h

index 42f7699e225b4b9d2e71b2fb2a4c7e6c4e6c8642..602e42b1824298d0b0a175febb3bd291cfbc87c0 100644 (file)
@@ -30,7 +30,7 @@ InternalGetReportStatusCode (
 \r
   if (gRT->Hdr.Revision < 0x20000) {\r
     return ((FRAMEWORK_EFI_RUNTIME_SERVICES*)gRT)->ReportStatusCode;\r
 \r
   if (gRT->Hdr.Revision < 0x20000) {\r
     return ((FRAMEWORK_EFI_RUNTIME_SERVICES*)gRT)->ReportStatusCode;\r
-  } else if (gBS != NULL) {\r
+  } else if (gBS != NULL && gBS->LocateProtocol != NULL) {\r
     Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID**)&StatusCodeProtocol);\r
     if (!EFI_ERROR (Status) && StatusCodeProtocol != NULL) {\r
       return StatusCodeProtocol->ReportStatusCode;\r
     Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID**)&StatusCodeProtocol);\r
     if (!EFI_ERROR (Status) && StatusCodeProtocol != NULL) {\r
       return StatusCodeProtocol->ReportStatusCode;\r
@@ -99,7 +99,7 @@ InternalReportStatusCodeEx (
   ASSERT (!((ExtendedData == NULL) && (ExtendedDataSize != 0)));\r
   ASSERT (!((ExtendedData != NULL) && (ExtendedDataSize == 0)));\r
 \r
   ASSERT (!((ExtendedData == NULL) && (ExtendedDataSize != 0)));\r
   ASSERT (!((ExtendedData != NULL) && (ExtendedDataSize == 0)));\r
 \r
-  if (gBS == NULL) {\r
+  if (gBS == NULL || gBS->AllocatePool == NULL || gBS->FreePool == NULL) {\r
     return EFI_UNSUPPORTED;\r
   }\r
 \r
     return EFI_UNSUPPORTED;\r
   }\r
 \r
index df8be070e7a2567219071714799b4672d8372ce1..0cb21c169235820025f8f867bc505b9d895d05d1 100644 (file)
@@ -146,6 +146,7 @@ BdsLibBootViaBootOption (
   EFI_DEVICE_PATH_PROTOCOL  *WorkingDevicePath;\r
   EFI_ACPI_S3_SAVE_PROTOCOL *AcpiS3Save;\r
   LIST_ENTRY                TempBootLists;\r
   EFI_DEVICE_PATH_PROTOCOL  *WorkingDevicePath;\r
   EFI_ACPI_S3_SAVE_PROTOCOL *AcpiS3Save;\r
   LIST_ENTRY                TempBootLists;\r
+  EFI_SECURITY_ARCH_PROTOCOL *SecurityProtocol;\r
 \r
   //\r
   // Record the performance data for End of BDS\r
 \r
   //\r
   // Record the performance data for End of BDS\r
@@ -241,6 +242,18 @@ BdsLibBootViaBootOption (
     DevicePath = Option->DevicePath;\r
   }\r
 \r
     DevicePath = Option->DevicePath;\r
   }\r
 \r
+  //\r
+  // Measure GPT Table by SAP protocol.\r
+  //\r
+  Status = gBS->LocateProtocol (\r
+                  &gEfiSecurityArchProtocolGuid,\r
+                  NULL,\r
+                  &SecurityProtocol\r
+                  );\r
+  if (!EFI_ERROR (Status)) {\r
+    Status = SecurityProtocol->FileAuthenticationState (SecurityProtocol, 0, DevicePath);\r
+  }\r
+\r
   DEBUG ((DEBUG_INFO | DEBUG_LOAD, "Booting %S\n", Option->Description));\r
 \r
   Status = gBS->LoadImage (\r
   DEBUG ((DEBUG_INFO | DEBUG_LOAD, "Booting %S\n", Option->Description));\r
 \r
   Status = gBS->LoadImage (\r
index e9d4befe3df22331733336f97a7c4ee1a27f1d7c..983280a666bdeeadd1c70cd8abe48d3bb60fe2e7 100644 (file)
   gEfiConsoleControlProtocolGuid                # PROTOCOL CONSUMES\r
   gEfiOEMBadgingProtocolGuid                    # PROTOCOL CONSUMES\r
   gEfiHiiFontProtocolGuid                       # PROTOCOL CONSUMES\r
   gEfiConsoleControlProtocolGuid                # PROTOCOL CONSUMES\r
   gEfiOEMBadgingProtocolGuid                    # PROTOCOL CONSUMES\r
   gEfiHiiFontProtocolGuid                       # PROTOCOL CONSUMES\r
+  gEfiSecurityArchProtocolGuid\r
 \r
 [FeaturePcd.common]\r
   gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport\r
 \r
 [FeaturePcd.common]\r
   gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport\r
index f1a977ae1cb7b0aff17948697bac4aef995cd1c7..61d5227c0910a8463b1003cb263841a230dca81f 100644 (file)
@@ -39,6 +39,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Protocol/UgaDraw.h>\r
 #include <Protocol/HiiFont.h>\r
 #include <Protocol/HiiImage.h>\r
 #include <Protocol/UgaDraw.h>\r
 #include <Protocol/HiiFont.h>\r
 #include <Protocol/HiiImage.h>\r
+#include <Protocol/Security.h>\r
 \r
 #include <Guid/MemoryTypeInformation.h>\r
 #include <Guid/FileInfo.h>\r
 \r
 #include <Guid/MemoryTypeInformation.h>\r
 #include <Guid/FileInfo.h>\r