Skip to content

Commit 778134e

Browse files
jbrasenmergify[bot]
authored andcommitted
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>
1 parent ee942c5 commit 778134e

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,22 @@ EFI_STATUS
129129
GetBootPerformanceTable (
130130
)
131131
{
132+
EFI_STATUS Status;
132133
FIRMWARE_PERFORMANCE_TABLE *FirmwarePerformanceTable;
133134

134135
FirmwarePerformanceTable = (FIRMWARE_PERFORMANCE_TABLE *)EfiLocateFirstAcpiTable (
135136
EFI_ACPI_5_0_FIRMWARE_PERFORMANCE_DATA_TABLE_SIGNATURE
136137
);
137138
if (FirmwarePerformanceTable == NULL) {
138-
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DP_GET_ACPI_FPDT_FAIL), mDpHiiHandle);
139-
return EFI_NOT_FOUND;
139+
Status = EfiGetSystemConfigurationTable (&gEdkiiFpdtExtendedFirmwarePerformanceGuid, (VOID **)&mBootPerformanceTable);
140+
if (EFI_ERROR (Status)) {
141+
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DP_GET_ACPI_FPDT_FAIL), mDpHiiHandle);
142+
return EFI_NOT_FOUND;
143+
}
144+
} else {
145+
mBootPerformanceTable = (UINT8 *)(UINTN)FirmwarePerformanceTable->BootPointerRecord.BootPerformanceTablePointer;
140146
}
141147

142-
mBootPerformanceTable = (UINT8 *)(UINTN)FirmwarePerformanceTable->BootPointerRecord.BootPerformanceTablePointer;
143148
mBootPerformanceTableSize = ((BOOT_PERFORMANCE_TABLE *)mBootPerformanceTable)->Header.Length;
144149

145150
return EFI_SUCCESS;

ShellPkg/DynamicCommand/DpDynamicCommand/DpApp.inf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454

5555
[Guids]
5656
gPerformanceProtocolGuid ## CONSUMES ## SystemTable
57+
gEdkiiFpdtExtendedFirmwarePerformanceGuid ## CONSUMES ## SystemTable
5758

5859
[Protocols]
5960
gEfiLoadedImageProtocolGuid ## CONSUMES

ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555

5656
[Guids]
5757
gPerformanceProtocolGuid ## CONSUMES ## SystemTable
58+
gEdkiiFpdtExtendedFirmwarePerformanceGuid ## CONSUMES ## SystemTable
5859

5960
[Protocols]
6061
gEfiLoadedImageProtocolGuid ## CONSUMES

0 commit comments

Comments
 (0)