]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Remove GetBootMode() at FirmwarePerformancePeiEntryPoint
authorHao Wu <hao.a.wu@intel.com>
Wed, 6 May 2015 03:31:28 +0000 (03:31 +0000)
committerhwu1225 <hwu1225@Edk2>
Wed, 6 May 2015 03:31:28 +0000 (03:31 +0000)
Boot mode maybe changed at any point during the PEI phase, therefore, boot
mode should be checked later rather at entry point.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17323 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.c

index 70592cbc3c71a66c5c75f455e60fb35be02836d0..396462e7aa975822effc1075cec85f3b14e6229b 100644 (file)
@@ -7,7 +7,7 @@
   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 - 2015, 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
@@ -156,57 +156,51 @@ 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
+  //\r
+  // Normal boot - build Hob for SEC performance data.\r
+  //\r
+  Status = PeiServicesLocatePpi (\r
+             &gPeiSecPerformancePpiGuid,\r
+             0,\r
+             NULL,\r
+             (VOID **) &SecPerf\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
 \r
   return EFI_SUCCESS;\r