]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.c
MdeModulePkg FirmwarePerfPei: Remove SEC performance data getting code
[mirror_edk2.git] / MdeModulePkg / Universal / Acpi / FirmwarePerformanceDataTablePei / FirmwarePerformancePei.c
index 70592cbc3c71a66c5c75f455e60fb35be02836d0..e4800b7bdd8ab18f3d96b5ed9c33420bcc15821d 100644 (file)
@@ -1,13 +1,11 @@
 /** @file\r
   This module updates S3 Resume Performance Record in ACPI Firmware Performance\r
-  Data Table in S3 resume boot mode. In normal boot mode, this module consumes\r
-  SecPerformance PPI produced by SEC phase and build Hob to convey the SEC\r
-  performance data to DXE phase.\r
+  Data Table in S3 resume boot mode.\r
 \r
   This module register report status code listener to collect performance data\r
   for S3 Resume Performance Record on S3 resume boot path.\r
 \r
-  Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2011 - 2017, 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
@@ -21,7 +19,6 @@
 #include <PiPei.h>\r
 \r
 #include <Ppi/ReportStatusCodeHandler.h>\r
-#include <Ppi/SecPerformance.h>\r
 \r
 #include <Guid/FirmwarePerformance.h>\r
 \r
@@ -31,7 +28,6 @@
 #include <Library/TimerLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/LockBoxLib.h>\r
-#include <Library/HobLib.h>\r
 #include <Library/PcdLib.h>\r
 \r
 /**\r
@@ -79,7 +75,7 @@ FpdtStatusCodeListenerPei (
   // Check whether status code is what we are interested in.\r
   //\r
   if (((CodeType & EFI_STATUS_CODE_TYPE_MASK) != EFI_PROGRESS_CODE) ||\r
-         (Value != (EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_PC_OS_WAKE))) {\r
+      (Value != (EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_PC_OS_WAKE))) {\r
     return EFI_UNSUPPORTED;\r
   }\r
 \r
@@ -156,57 +152,22 @@ FirmwarePerformancePeiEntryPoint (
   )\r
 {\r
   EFI_STATUS               Status;\r
-  EFI_BOOT_MODE            BootMode;\r
   EFI_PEI_RSC_HANDLER_PPI  *RscHandler;\r
-  PEI_SEC_PERFORMANCE_PPI  *SecPerf;\r
-  FIRMWARE_SEC_PERFORMANCE Performance;\r
 \r
-  Status = PeiServicesGetBootMode(&BootMode);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  if (BootMode == BOOT_ON_S3_RESUME) {\r
-    if (FeaturePcdGet (PcdFirmwarePerformanceDataTableS3Support)) {\r
-      //\r
-      // S3 resume - register status code listener for OS wake vector.\r
-      //\r
-      Status = PeiServicesLocatePpi (\r
-                 &gEfiPeiRscHandlerPpiGuid,\r
-                 0,\r
-                 NULL,\r
-                 (VOID **) &RscHandler\r
-                 );\r
-      ASSERT_EFI_ERROR (Status);\r
-\r
-      Status = RscHandler->Register (FpdtStatusCodeListenerPei);\r
-      ASSERT_EFI_ERROR (Status);\r
-    }\r
-  } else {\r
+  if (FeaturePcdGet (PcdFirmwarePerformanceDataTableS3Support)) {\r
     //\r
-    // Normal boot - build Hob for SEC performance data.\r
+    // S3 resume - register status code listener for OS wake vector.\r
     //\r
     Status = PeiServicesLocatePpi (\r
-               &gPeiSecPerformancePpiGuid,\r
+               &gEfiPeiRscHandlerPpiGuid,\r
                0,\r
                NULL,\r
-               (VOID **) &SecPerf\r
+               (VOID **) &RscHandler\r
                );\r
-    if (!EFI_ERROR (Status)) {\r
-      Status = SecPerf->GetPerformance (PeiServices, SecPerf, &Performance);\r
-    }\r
-    if (!EFI_ERROR (Status)) {\r
-      BuildGuidDataHob (\r
-        &gEfiFirmwarePerformanceGuid,\r
-        &Performance,\r
-        sizeof (FIRMWARE_SEC_PERFORMANCE)\r
-      );\r
-      DEBUG ((EFI_D_INFO, "FPDT: SEC Performance Hob ResetEnd = %ld\n", Performance.ResetEnd));\r
-    } else {\r
-      //\r
-      // SEC performance PPI is not installed or fail to get performance data\r
-      // from SEC Performance PPI.\r
-      //\r
-      DEBUG ((EFI_D_ERROR, "FPDT: WARNING: SEC Performance PPI not installed or failed!\n"));\r
-    }\r
+    ASSERT_EFI_ERROR (Status);\r
+\r
+    Status = RscHandler->Register (FpdtStatusCodeListenerPei);\r
+    ASSERT_EFI_ERROR (Status);\r
   }\r
 \r
   return EFI_SUCCESS;\r