Skip to content

Commit

Permalink
ShellPkg/Dp: Allow dp command to work without ACPI
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
jbrasen authored and mergify[bot] committed Nov 6, 2023
1 parent ee942c5 commit 778134e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions ShellPkg/DynamicCommand/DpDynamicCommand/DpApp.inf
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@

[Guids]
gPerformanceProtocolGuid ## CONSUMES ## SystemTable
gEdkiiFpdtExtendedFirmwarePerformanceGuid ## CONSUMES ## SystemTable

[Protocols]
gEfiLoadedImageProtocolGuid ## CONSUMES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@

[Guids]
gPerformanceProtocolGuid ## CONSUMES ## SystemTable
gEdkiiFpdtExtendedFirmwarePerformanceGuid ## CONSUMES ## SystemTable

[Protocols]
gEfiLoadedImageProtocolGuid ## CONSUMES
Expand Down

0 comments on commit 778134e

Please sign in to comment.