diff options
author | Jeff Brasen <jbrasen@nvidia.com> | 2023-07-01 01:30:15 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-11-06 01:33:49 +0000 |
commit | 778134e491a9f53abc903f6fa730d8389f27697d (patch) | |
tree | dd44212235ef6b473346c67398eb800583cf5458 /ShellPkg | |
parent | ee942c5360dad560d5fc0f6758bed502fd1be4c7 (diff) | |
download | edk2-778134e491a9f53abc903f6fa730d8389f27697d.tar.gz |
ShellPkg/Dp: Allow dp command to work without ACPI
If the system does not have ACPI setup use the configuration table
to get the performance info.
Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Diffstat (limited to 'ShellPkg')
-rw-r--r-- | ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c | 11 | ||||
-rw-r--r-- | ShellPkg/DynamicCommand/DpDynamicCommand/DpApp.inf | 1 | ||||
-rw-r--r-- | ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf | 1 |
3 files changed, 10 insertions, 3 deletions
diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c index 512a146da6..98c84d2ef9 100644 --- a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c +++ b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c @@ -129,17 +129,22 @@ EFI_STATUS GetBootPerformanceTable (
)
{
+ EFI_STATUS Status;
FIRMWARE_PERFORMANCE_TABLE *FirmwarePerformanceTable;
FirmwarePerformanceTable = (FIRMWARE_PERFORMANCE_TABLE *)EfiLocateFirstAcpiTable (
EFI_ACPI_5_0_FIRMWARE_PERFORMANCE_DATA_TABLE_SIGNATURE
);
if (FirmwarePerformanceTable == NULL) {
- ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DP_GET_ACPI_FPDT_FAIL), mDpHiiHandle);
- return EFI_NOT_FOUND;
+ Status = EfiGetSystemConfigurationTable (&gEdkiiFpdtExtendedFirmwarePerformanceGuid, (VOID **)&mBootPerformanceTable);
+ if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DP_GET_ACPI_FPDT_FAIL), mDpHiiHandle);
+ return EFI_NOT_FOUND;
+ }
+ } else {
+ mBootPerformanceTable = (UINT8 *)(UINTN)FirmwarePerformanceTable->BootPointerRecord.BootPerformanceTablePointer;
}
- mBootPerformanceTable = (UINT8 *)(UINTN)FirmwarePerformanceTable->BootPointerRecord.BootPerformanceTablePointer;
mBootPerformanceTableSize = ((BOOT_PERFORMANCE_TABLE *)mBootPerformanceTable)->Header.Length;
return EFI_SUCCESS;
diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/DpApp.inf b/ShellPkg/DynamicCommand/DpDynamicCommand/DpApp.inf index 4a58286b8c..d9e1c23a1e 100644 --- a/ShellPkg/DynamicCommand/DpDynamicCommand/DpApp.inf +++ b/ShellPkg/DynamicCommand/DpDynamicCommand/DpApp.inf @@ -54,6 +54,7 @@ [Guids]
gPerformanceProtocolGuid ## CONSUMES ## SystemTable
+ gEdkiiFpdtExtendedFirmwarePerformanceGuid ## CONSUMES ## SystemTable
[Protocols]
gEfiLoadedImageProtocolGuid ## CONSUMES
diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf b/ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf index 013bdbd4a0..2723fee706 100644 --- a/ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf +++ b/ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf @@ -55,6 +55,7 @@ [Guids]
gPerformanceProtocolGuid ## CONSUMES ## SystemTable
+ gEdkiiFpdtExtendedFirmwarePerformanceGuid ## CONSUMES ## SystemTable
[Protocols]
gEfiLoadedImageProtocolGuid ## CONSUMES
|