ShellPkg/DpDynamicCommand: Add ResetEnd support in DP command

DP command should be able to parse the FPDT ACPI table and dump
the ResetEnd which was logged at the beginning of the firmware
image execution. So that DP can calculate SEC phase time duration
start from the beginning of firmware image execution.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Signed-off-by: zhenhuay <zhenhua.yang@intel.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
This commit is contained in:
zhenhuay
2022-11-21 17:34:56 +08:00
committed by mergify[bot]
parent ae3bc559f9
commit c8c978d328
4 changed files with 25 additions and 0 deletions

View File

@ -57,6 +57,7 @@ UINT8 *mBootPerformanceTable;
UINTN mBootPerformanceTableSize;
BOOLEAN mPeiPhase = FALSE;
BOOLEAN mDxePhase = FALSE;
UINT64 mResetEnd = 0;
PERF_SUMMARY_DATA SummaryData = { 0 }; ///< Create the SummaryData structure and init. to ZERO.
MEASUREMENT_RECORD *mMeasurementList = NULL;
@ -542,6 +543,8 @@ BuildMeasurementList (
{
EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER *RecordHeader;
UINT8 *PerformanceTablePtr;
UINT8 *BasicBootTablePtr;
UINT64 ResetEnd;
UINT16 StartProgressId;
UINTN TableLength;
UINT8 *StartRecordEvent;
@ -552,6 +555,17 @@ BuildMeasurementList (
return EFI_OUT_OF_RESOURCES;
}
//
// Update the ResetEnd which was logged at the beginning of firmware image execution
//
TableLength = sizeof (EFI_ACPI_5_0_FPDT_PERFORMANCE_TABLE_HEADER);
BasicBootTablePtr = (mBootPerformanceTable + TableLength);
ResetEnd = ((EFI_ACPI_5_0_FPDT_FIRMWARE_BASIC_BOOT_RECORD *)BasicBootTablePtr)->ResetEnd;
if (ResetEnd > 0) {
mResetEnd = ResetEnd;
}
TableLength = sizeof (BOOT_PERFORMANCE_TABLE);
PerformanceTablePtr = (mBootPerformanceTable + TableLength);