From: "Gao, Zhichao" <zhichao.gao@intel.com>
To: Abdul Lateef Attar <abdattar@amd.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Ni, Ray" <ray.ni@intel.com>, Sami Mujawar <sami.mujawar@arm.com>
Subject: Re: [edk2-devel] [PATCH v1] ShellPkg/AcpiView: PrintFormatter for FADT Flags field
Date: Mon, 15 Nov 2021 05:49:42 +0000 [thread overview]
Message-ID: <BN9PR11MB527535E712425DD87F751060F6989@BN9PR11MB5275.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20211112132725.13810-1-abdattar@amd.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Thanks,
Zhichao
> -----Original Message-----
> From: Abdul Lateef Attar <abdattar@amd.com>
> Sent: Friday, November 12, 2021 9:27 PM
> To: devel@edk2.groups.io
> Cc: Ni, Ray <ray.ni@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>; Sami
> Mujawar <sami.mujawar@arm.com>
> Subject: [edk2-devel] [PATCH v1] ShellPkg/AcpiView: PrintFormatter for
> FADT Flags field
>
> Adds PrintFormatter function to the FADT flags field.
> Prints indivisual flag name along with flag value.
>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Zhichao Gao <zhichao.gao@intel.com>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
> Signed-off-by: Abdul Lateef Attar <abdattar@amd.com>
> ---
> ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c
> | 208 +++++++++++++++++++-
> 1 file changed, 207 insertions(+), 1 deletion(-)
>
> diff --git
> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.
> c
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.
> c
> index d86718bab67d..7f01412f1a9b 100644
> ---
> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.
> c
> +++
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.
> c
> @@ -2,6 +2,7 @@
> FADT table parser
>
>
>
> Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.
>
> + Copyright (c) 2021, AMD Incorporated. All rights reserved.<BR>
>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
>
>
> @par Reference(s):
>
> @@ -127,6 +128,211 @@ ValidateFlags (
> #endif
>
> }
>
>
>
> +/**
>
> + This function traces FADT Flags field.
>
> +
>
> + @param [in] Format Optional format string for tracing the data.
>
> + @param [in] Ptr Pointer to the start of the buffer.
>
> +**/
>
> +VOID
>
> +EFIAPI
>
> +DumpFadtFlags (
>
> + IN CONST CHAR16* Format OPTIONAL,
>
> + IN UINT8* Ptr
>
> + )
>
> +{
>
> + if (Format != NULL) {
>
> + Print (Format, *(UINT32*)Ptr);
>
> + return;
>
> + }
>
> +
>
> + Print (L"0x%X\n", *(UINT32*)Ptr);
>
> + Print (
>
> + L"%*a%-*s : %d\n",
>
> + 4,
>
> + "",
>
> + (OUTPUT_FIELD_COLUMN_WIDTH - 4),
>
> + L"WBINVD",
>
> + *(UINT32*)Ptr & BIT0 ? 1 : 0
>
> + );
>
> + Print (
>
> + L"%*a%-*s : %d\n",
>
> + 4,
>
> + "",
>
> + (OUTPUT_FIELD_COLUMN_WIDTH - 4),
>
> + L"WBINVD_FLUSH",
>
> + *(UINT32*)Ptr & BIT1 ? 1 : 0
>
> + );
>
> + Print (
>
> + L"%*a%-*s : %d\n",
>
> + 4,
>
> + "",
>
> + (OUTPUT_FIELD_COLUMN_WIDTH - 4),
>
> + L"PROC_C1",
>
> + *(UINT32*)Ptr & BIT2 ? 1 : 0
>
> + );
>
> + Print (
>
> + L"%*a%-*s : %d\n",
>
> + 4,
>
> + "",
>
> + (OUTPUT_FIELD_COLUMN_WIDTH - 4),
>
> + L"P_LVL2_UP",
>
> + *(UINT32*)Ptr & BIT3 ? 1 : 0
>
> + );
>
> + Print (
>
> + L"%*a%-*s : %d\n",
>
> + 4,
>
> + "",
>
> + (OUTPUT_FIELD_COLUMN_WIDTH - 4),
>
> + L"PWR_BUTTON",
>
> + *(UINT32*)Ptr & BIT4 ? 1 : 0
>
> + );
>
> + Print (
>
> + L"%*a%-*s : %d\n",
>
> + 4,
>
> + "",
>
> + (OUTPUT_FIELD_COLUMN_WIDTH - 4),
>
> + L"SLP_BUTTON",
>
> + *(UINT32*)Ptr & BIT5 ? 1 : 0
>
> + );
>
> + Print (
>
> + L"%*a%-*s : %d\n",
>
> + 4,
>
> + "",
>
> + (OUTPUT_FIELD_COLUMN_WIDTH - 4),
>
> + L"FIX_RTC",
>
> + *(UINT32*)Ptr & BIT6 ? 1 : 0
>
> + );
>
> + Print (
>
> + L"%*a%-*s : %d\n",
>
> + 4,
>
> + "",
>
> + (OUTPUT_FIELD_COLUMN_WIDTH - 4),
>
> + L"RTC_S4",
>
> + *(UINT32*)Ptr & BIT7 ? 1 : 0
>
> + );
>
> + Print (
>
> + L"%*a%-*s : %d\n",
>
> + 4,
>
> + "",
>
> + (OUTPUT_FIELD_COLUMN_WIDTH - 4),
>
> + L"TMR_VAL_EXT",
>
> + *(UINT32*)Ptr & BIT8 ? 1 : 0
>
> + );
>
> + Print (
>
> + L"%*a%-*s : %d\n",
>
> + 4,
>
> + "",
>
> + (OUTPUT_FIELD_COLUMN_WIDTH - 4),
>
> + L"DCK_CAP",
>
> + *(UINT32*)Ptr & BIT9 ? 1 : 0
>
> + );
>
> + Print (
>
> + L"%*a%-*s : %d\n",
>
> + 4,
>
> + "",
>
> + (OUTPUT_FIELD_COLUMN_WIDTH - 4),
>
> + L"RESET_REG_SUP",
>
> + *(UINT32*)Ptr & BIT10 ? 1 : 0
>
> + );
>
> + Print (
>
> + L"%*a%-*s : %d\n",
>
> + 4,
>
> + "",
>
> + (OUTPUT_FIELD_COLUMN_WIDTH - 4),
>
> + L"SEALED_CASE",
>
> + *(UINT32*)Ptr & BIT11 ? 1 : 0
>
> + );
>
> + Print (
>
> + L"%*a%-*s : %d\n",
>
> + 4,
>
> + "",
>
> + (OUTPUT_FIELD_COLUMN_WIDTH - 4),
>
> + L"HEADLESS",
>
> + *(UINT32*)Ptr & BIT12 ? 1 : 0
>
> + );
>
> + Print (
>
> + L"%*a%-*s : %d\n",
>
> + 4,
>
> + "",
>
> + (OUTPUT_FIELD_COLUMN_WIDTH - 4),
>
> + L"CPU_SW_SLP",
>
> + *(UINT32*)Ptr & BIT13 ? 1 : 0
>
> + );
>
> + Print (
>
> + L"%*a%-*s : %d\n",
>
> + 4,
>
> + "",
>
> + (OUTPUT_FIELD_COLUMN_WIDTH - 4),
>
> + L"PCI_EXP_WAK",
>
> + *(UINT32*)Ptr & BIT14 ? 1 : 0
>
> + );
>
> + Print (
>
> + L"%*a%-*s : %d\n",
>
> + 4,
>
> + "",
>
> + (OUTPUT_FIELD_COLUMN_WIDTH - 4),
>
> + L"USE_PLATFORM_CLOCK",
>
> + *(UINT32*)Ptr & BIT15 ? 1 : 0
>
> + );
>
> + Print (
>
> + L"%*a%-*s : %d\n",
>
> + 4,
>
> + "",
>
> + (OUTPUT_FIELD_COLUMN_WIDTH - 4),
>
> + L"S4_RTC_STS_VALID",
>
> + *(UINT32*)Ptr & BIT16 ? 1 : 0
>
> + );
>
> + Print (
>
> + L"%*a%-*s : %d\n",
>
> + 4,
>
> + "",
>
> + (OUTPUT_FIELD_COLUMN_WIDTH - 4),
>
> + L"REMOTE_POWER_ON_CAPABLE",
>
> + *(UINT32*)Ptr & BIT17 ? 1 : 0
>
> + );
>
> + Print (
>
> + L"%*a%-*s : %d\n",
>
> + 4,
>
> + "",
>
> + (OUTPUT_FIELD_COLUMN_WIDTH - 4),
>
> + L"FORCE_APIC_CLUSTER_MODEL",
>
> + *(UINT32*)Ptr & BIT18 ? 1 : 0
>
> + );
>
> + Print (
>
> + L"%*a%-*s : %d\n",
>
> + 4,
>
> + "",
>
> + (OUTPUT_FIELD_COLUMN_WIDTH - 4),
>
> + L"FORCE_APIC_PHYSICAL_DESTINATION_MODE",
>
> + *(UINT32*)Ptr & BIT19 ? 1 : 0
>
> + );
>
> + Print (
>
> + L"%*a%-*s : %d\n",
>
> + 4,
>
> + "",
>
> + (OUTPUT_FIELD_COLUMN_WIDTH - 4),
>
> + L"HW_REDUCED_ACPI",
>
> + *(UINT32*)Ptr & BIT20 ? 1 : 0
>
> + );
>
> + Print (
>
> + L"%*a%-*s : %d\n",
>
> + 4,
>
> + "",
>
> + (OUTPUT_FIELD_COLUMN_WIDTH - 4),
>
> + L"LOW_POWER_S0_IDLE_CAPABLE",
>
> + *(UINT32*)Ptr & BIT21 ? 1 : 0
>
> + );
>
> + Print (
>
> + L"%*a%-*s : %d\n",
>
> + 4,
>
> + "",
>
> + (OUTPUT_FIELD_COLUMN_WIDTH - 4),
>
> + L"Reserved",
>
> + *(UINT32*)Ptr & BIT22 ? 1 : 0
>
> + );
>
> +}
>
> +
>
> /**
>
> An ACPI_PARSER array describing the ACPI FADT Table.
>
> **/
>
> @@ -170,7 +376,7 @@ STATIC CONST ACPI_PARSER FadtParser[] = {
> {L"CENTURY", 1, 108, L"0x%x", NULL, NULL, NULL, NULL},
>
> {L"IAPC_BOOT_ARCH", 2, 109, L"0x%x", NULL, NULL, NULL, NULL},
>
> {L"Reserved", 1, 111, L"0x%x", NULL, NULL, NULL, NULL},
>
> - {L"Flags", 4, 112, L"0x%x", NULL, (VOID**)&Flags, ValidateFlags, NULL},
>
> + {L"Flags", 4, 112, NULL, DumpFadtFlags, (VOID**)&Flags, ValidateFlags,
> NULL},
>
> {L"RESET_REG", 12, 116, NULL, DumpGas, NULL, NULL, NULL},
>
> {L"RESET_VALUE", 1, 128, L"0x%x", NULL, NULL, NULL, NULL},
>
> {L"ARM_BOOT_ARCH", 2, 129, L"0x%x", NULL, NULL, NULL, NULL},
>
> --
> 2.25.1
next prev parent reply other threads:[~2021-11-15 5:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-12 13:27 [edk2-devel] [PATCH v1] ShellPkg/AcpiView: PrintFormatter for FADT Flags field Abdul Lateef Attar
2021-11-15 5:49 ` Gao, Zhichao [this message]
2021-11-15 17:59 ` Sami Mujawar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BN9PR11MB527535E712425DD87F751060F6989@BN9PR11MB5275.namprd11.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox