]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Measure ExitBootServices failure case
authorczhang46 <czhang46@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 2 Aug 2012 06:33:10 +0000 (06:33 +0000)
committerczhang46 <czhang46@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 2 Aug 2012 06:33:10 +0000 (06:33 +0000)
Signed-off-by: Chao Zhang<chao.b.zhang@intel.com>
Reviewed-by: Dong Guo<guo.dong@intel.com>
Reviewed-by: Gao Liming<liming.gao@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13580 6f19259b-4bc3-4df7-8a09-765794883524

SecurityPkg/Tcg/TcgDxe/TcgDxe.c
SecurityPkg/Tcg/TcgDxe/TcgDxe.inf

index 4b5380ba87fb5b4031ca2f4995d8f87d8b860669..75c6a8978f45c4ac1778802a76d5b29e57866748 100644 (file)
@@ -23,6 +23,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Guid/HobList.h>\r
 #include <Guid/TcgEventHob.h>\r
 #include <Guid/EventGroup.h>\r
+#include <Guid/EventExitBootServiceFailed.h>\r
 #include <Protocol/DevicePath.h>\r
 #include <Protocol/TcgService.h>\r
 #include <Protocol/AcpiTable.h>\r
@@ -1103,6 +1104,34 @@ OnExitBootServices (
   ASSERT_EFI_ERROR (Status);\r
 }\r
 \r
+/**\r
+  Exit Boot Services Failed Event notification handler.\r
+\r
+  Measure Failure of ExitBootServices.\r
+\r
+  @param[in]  Event     Event whose notification function is being invoked\r
+  @param[in]  Context   Pointer to the notification function's context\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+OnExitBootServicesFailed (\r
+  IN      EFI_EVENT                 Event,\r
+  IN      VOID                      *Context\r
+  )\r
+{\r
+  EFI_STATUS    Status;\r
+\r
+  //\r
+  // Measure Failure of ExitBootServices,\r
+  //\r
+  Status = TcgMeasureAction (\r
+             EFI_EXIT_BOOT_SERVICES_FAILED\r
+             );\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+}\r
+\r
 /**\r
   Get TPM Deactivated state.\r
 \r
@@ -1205,6 +1234,18 @@ DriverEntry (
                     &gEfiEventExitBootServicesGuid,\r
                     &Event\r
                     );\r
+\r
+    //\r
+    // Measure Exit Boot Service failed \r
+    //\r
+    Status = gBS->CreateEventEx (\r
+                    EVT_NOTIFY_SIGNAL,\r
+                    TPL_NOTIFY,\r
+                    OnExitBootServicesFailed,\r
+                    NULL,\r
+                    &gEventExitBootServicesFailedGuid,\r
+                    &Event\r
+                    );\r
   }\r
 \r
   //\r
index 95f37737c4ecbec43c7ba9cb91bc275b337cb491..239997db7dd4f7e8f0058868b7df635d0735042c 100644 (file)
@@ -56,6 +56,7 @@
   gTcgEventEntryHobGuid\r
   gEfiEventReadyToBootGuid\r
   gEfiEventExitBootServicesGuid\r
+  gEventExitBootServicesFailedGuid              # ALWAYS_CONSUMED\r
 \r
 [Protocols]\r
   gEfiTcgProtocolGuid                           ## PRODUCES\r