--*/\r
{\r
EFI_STATUS Status;\r
+ EFI_STATUS StatusTemp;\r
+ EFI_TCG_PLATFORM_PROTOCOL *TcgPlatformProtocol;\r
+\r
+ //\r
+ // Measure invocation of ExitBootServices, \r
+ // which is defined by TCG_EFI_Platform_1_20_Final Specification\r
+ //\r
+ TcgPlatformProtocol = NULL;\r
+ Status = CoreLocateProtocol (\r
+ &gEfiTcgPlatformProtocolGuid,\r
+ NULL,\r
+ (VOID **) &TcgPlatformProtocol\r
+ );\r
+ if (!EFI_ERROR (Status)) {\r
+ Status = TcgPlatformProtocol->MeasureAction (EFI_EXIT_BOOT_SERVICES_INVOCATION);\r
+ ASSERT_EFI_ERROR (Status);\r
+ }\r
\r
//\r
// Terminate memory services if the MapKey matches\r
//\r
Status = CoreTerminateMemoryMap (MapKey);\r
if (EFI_ERROR (Status)) {\r
+ //\r
+ // Measure failure of ExitBootServices\r
+ //\r
+ if (TcgPlatformProtocol != NULL) {\r
+ StatusTemp = TcgPlatformProtocol->MeasureAction (EFI_EXIT_BOOT_SERVICES_FAILED);\r
+ ASSERT_EFI_ERROR (StatusTemp);\r
+ }\r
+\r
return Status;\r
}\r
\r
//\r
gRuntime->AtRuntime = TRUE;\r
\r
+ //\r
+ // Measure success of ExitBootServices\r
+ //\r
+ if (TcgPlatformProtocol != NULL) {\r
+ StatusTemp = TcgPlatformProtocol->MeasureAction (EFI_EXIT_BOOT_SERVICES_SUCCEEDED);\r
+ ASSERT_EFI_ERROR (StatusTemp);\r
+ }\r
+ \r
return Status;\r
}\r
\r