[edk2-devel] [PATCH v2 2/2] ShellPkg/Dp: Allow dp command to work without ACPI

Gao, Zhichao zhichao.gao at intel.com
Thu Jul 27 02:49:32 UTC 2023


Reviewed-by: Zhichao Gao <zhichao.gao at intel.com>

Thanks,
Zhichao

> -----Original Message-----
> From: devel at edk2.groups.io <devel at edk2.groups.io> On Behalf Of Jeff
> Brasen via groups.io
> Sent: Saturday, July 1, 2023 1:30 AM
> To: devel at edk2.groups.io
> Cc: Wang, Jian J <jian.j.wang at intel.com>; Gao, Liming
> <gaoliming at byosoft.com.cn>; Bi, Dandan <dandan.bi at intel.com>; Gao,
> Zhichao <zhichao.gao at intel.com>; Jeff Brasen <jbrasen at nvidia.com>
> Subject: [edk2-devel] [PATCH v2 2/2] 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 at nvidia.com>
> ---
>  ShellPkg/DynamicCommand/DpDynamicCommand/DpApp.inf    |  1 +
>  .../DpDynamicCommand/DpDynamicCommand.inf             |  1 +
>  ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c         | 11 ++++++++-
> --
>  3 files changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/DpApp.inf
> b/ShellPkg/DynamicCommand/DpDynamicCommand/DpApp.inf
> index 4a58286b8c1a..d9e1c23a1ee7 100644
> --- a/ShellPkg/DynamicCommand/DpDynamicCommand/DpApp.inf
> +++ b/ShellPkg/DynamicCommand/DpDynamicCommand/DpApp.inf
> @@ -54,6 +54,7 @@ [LibraryClasses]
> 
>  [Guids]
>    gPerformanceProtocolGuid                                ## CONSUMES ## SystemTable
> +  gEdkiiFpdtExtendedFirmwarePerformanceGuid               ## CONSUMES ##
> SystemTable
> 
>  [Protocols]
>    gEfiLoadedImageProtocolGuid                             ## CONSUMES
> diff --git
> a/ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.i
> nf
> b/ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.i
> nf
> index 013bdbd4a07e..2723fee7066e 100644
> ---
> a/ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.i
> nf
> +++
> b/ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.i
> nf
> @@ -55,6 +55,7 @@ [LibraryClasses]
> 
>  [Guids]
>    gPerformanceProtocolGuid                                ## CONSUMES ## SystemTable
> +  gEdkiiFpdtExtendedFirmwarePerformanceGuid               ## CONSUMES ##
> SystemTable
> 
>  [Protocols]
>    gEfiLoadedImageProtocolGuid                             ## CONSUMES
> diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c
> b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c
> index 512a146da6dd..98c84d2ef938 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.BootPerformanceTa
> + blePointer;
>    }
> 
> -  mBootPerformanceTable     = (UINT8
> *)(UINTN)FirmwarePerformanceTable-
> >BootPointerRecord.BootPerformanceTablePointer;
>    mBootPerformanceTableSize = ((BOOT_PERFORMANCE_TABLE
> *)mBootPerformanceTable)->Header.Length;
> 
>    return EFI_SUCCESS;
> --
> 2.25.1
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107288): https://edk2.groups.io/g/devel/message/107288
Mute This Topic: https://groups.io/mt/99877763/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list