MdeModulePkg: Remove GetBootMode() at FirmwarePerformancePeiEntryPoint
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
This commit is contained in:
parent
693bebd98a
commit
04f4c2d6a4
|
@ -7,7 +7,7 @@
|
||||||
This module register report status code listener to collect performance data
|
This module register report status code listener to collect performance data
|
||||||
for S3 Resume Performance Record on S3 resume boot path.
|
for S3 Resume Performance Record on S3 resume boot path.
|
||||||
|
|
||||||
Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -156,57 +156,51 @@ FirmwarePerformancePeiEntryPoint (
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
EFI_BOOT_MODE BootMode;
|
|
||||||
EFI_PEI_RSC_HANDLER_PPI *RscHandler;
|
EFI_PEI_RSC_HANDLER_PPI *RscHandler;
|
||||||
PEI_SEC_PERFORMANCE_PPI *SecPerf;
|
PEI_SEC_PERFORMANCE_PPI *SecPerf;
|
||||||
FIRMWARE_SEC_PERFORMANCE Performance;
|
FIRMWARE_SEC_PERFORMANCE Performance;
|
||||||
|
|
||||||
Status = PeiServicesGetBootMode(&BootMode);
|
if (FeaturePcdGet (PcdFirmwarePerformanceDataTableS3Support)) {
|
||||||
ASSERT_EFI_ERROR (Status);
|
|
||||||
|
|
||||||
if (BootMode == BOOT_ON_S3_RESUME) {
|
|
||||||
if (FeaturePcdGet (PcdFirmwarePerformanceDataTableS3Support)) {
|
|
||||||
//
|
|
||||||
// S3 resume - register status code listener for OS wake vector.
|
|
||||||
//
|
|
||||||
Status = PeiServicesLocatePpi (
|
|
||||||
&gEfiPeiRscHandlerPpiGuid,
|
|
||||||
0,
|
|
||||||
NULL,
|
|
||||||
(VOID **) &RscHandler
|
|
||||||
);
|
|
||||||
ASSERT_EFI_ERROR (Status);
|
|
||||||
|
|
||||||
Status = RscHandler->Register (FpdtStatusCodeListenerPei);
|
|
||||||
ASSERT_EFI_ERROR (Status);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
//
|
//
|
||||||
// Normal boot - build Hob for SEC performance data.
|
// S3 resume - register status code listener for OS wake vector.
|
||||||
//
|
//
|
||||||
Status = PeiServicesLocatePpi (
|
Status = PeiServicesLocatePpi (
|
||||||
&gPeiSecPerformancePpiGuid,
|
&gEfiPeiRscHandlerPpiGuid,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
(VOID **) &SecPerf
|
(VOID **) &RscHandler
|
||||||
);
|
);
|
||||||
if (!EFI_ERROR (Status)) {
|
ASSERT_EFI_ERROR (Status);
|
||||||
Status = SecPerf->GetPerformance (PeiServices, SecPerf, &Performance);
|
|
||||||
}
|
Status = RscHandler->Register (FpdtStatusCodeListenerPei);
|
||||||
if (!EFI_ERROR (Status)) {
|
ASSERT_EFI_ERROR (Status);
|
||||||
BuildGuidDataHob (
|
}
|
||||||
&gEfiFirmwarePerformanceGuid,
|
|
||||||
&Performance,
|
//
|
||||||
sizeof (FIRMWARE_SEC_PERFORMANCE)
|
// Normal boot - build Hob for SEC performance data.
|
||||||
);
|
//
|
||||||
DEBUG ((EFI_D_INFO, "FPDT: SEC Performance Hob ResetEnd = %ld\n", Performance.ResetEnd));
|
Status = PeiServicesLocatePpi (
|
||||||
} else {
|
&gPeiSecPerformancePpiGuid,
|
||||||
//
|
0,
|
||||||
// SEC performance PPI is not installed or fail to get performance data
|
NULL,
|
||||||
// from SEC Performance PPI.
|
(VOID **) &SecPerf
|
||||||
//
|
);
|
||||||
DEBUG ((EFI_D_ERROR, "FPDT: WARNING: SEC Performance PPI not installed or failed!\n"));
|
if (!EFI_ERROR (Status)) {
|
||||||
}
|
Status = SecPerf->GetPerformance (PeiServices, SecPerf, &Performance);
|
||||||
|
}
|
||||||
|
if (!EFI_ERROR (Status)) {
|
||||||
|
BuildGuidDataHob (
|
||||||
|
&gEfiFirmwarePerformanceGuid,
|
||||||
|
&Performance,
|
||||||
|
sizeof (FIRMWARE_SEC_PERFORMANCE)
|
||||||
|
);
|
||||||
|
DEBUG ((EFI_D_INFO, "FPDT: SEC Performance Hob ResetEnd = %ld\n", Performance.ResetEnd));
|
||||||
|
} else {
|
||||||
|
//
|
||||||
|
// SEC performance PPI is not installed or fail to get performance data
|
||||||
|
// from SEC Performance PPI.
|
||||||
|
//
|
||||||
|
DEBUG ((EFI_D_ERROR, "FPDT: WARNING: SEC Performance PPI not installed or failed!\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
|
|
Loading…
Reference in New Issue