From 9e945f785238fe3bb72bbc66f162b68938898c31 Mon Sep 17 00:00:00 2001 From: czhang46 Date: Thu, 2 Aug 2012 06:33:10 +0000 Subject: Measure ExitBootServices failure case Signed-off-by: Chao Zhang Reviewed-by: Dong Guo Reviewed-by: Gao Liming git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13580 6f19259b-4bc3-4df7-8a09-765794883524 --- SecurityPkg/Tcg/TcgDxe/TcgDxe.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'SecurityPkg/Tcg/TcgDxe/TcgDxe.c') diff --git a/SecurityPkg/Tcg/TcgDxe/TcgDxe.c b/SecurityPkg/Tcg/TcgDxe/TcgDxe.c index 4b5380ba87..75c6a8978f 100644 --- a/SecurityPkg/Tcg/TcgDxe/TcgDxe.c +++ b/SecurityPkg/Tcg/TcgDxe/TcgDxe.c @@ -23,6 +23,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include +#include #include #include #include @@ -1103,6 +1104,34 @@ OnExitBootServices ( ASSERT_EFI_ERROR (Status); } +/** + Exit Boot Services Failed Event notification handler. + + Measure Failure of ExitBootServices. + + @param[in] Event Event whose notification function is being invoked + @param[in] Context Pointer to the notification function's context + +**/ +VOID +EFIAPI +OnExitBootServicesFailed ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + EFI_STATUS Status; + + // + // Measure Failure of ExitBootServices, + // + Status = TcgMeasureAction ( + EFI_EXIT_BOOT_SERVICES_FAILED + ); + ASSERT_EFI_ERROR (Status); + +} + /** Get TPM Deactivated state. @@ -1205,6 +1234,18 @@ DriverEntry ( &gEfiEventExitBootServicesGuid, &Event ); + + // + // Measure Exit Boot Service failed + // + Status = gBS->CreateEventEx ( + EVT_NOTIFY_SIGNAL, + TPL_NOTIFY, + OnExitBootServicesFailed, + NULL, + &gEventExitBootServicesFailedGuid, + &Event + ); } // -- cgit v1.2.3