From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.81]) by mx.groups.io with SMTP id smtpd.web09.15782.1636723636345102696 for ; Fri, 12 Nov 2021 05:27:16 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=biRlAXjr; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.220.81, mailfrom: abdullateef.attar@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b12ha4r775isb78i0pBzA8oGC0j5tAPvJ1byVimANSV2M4yRdclOR073hNjNo0uAdDQnN6OQHsZtyQ20BJt5P0/+bypYu1tG8BXtc4+FW6xaOU2YnRJRfS+mTZxmEcOp9eKS4HE/vgx1Vy/d5Di+6QVk98zOZTwe9yB1AwUAq9r7ayKEJAvBHdUFmHWJn5yqgKjRy8THVx9CItYkxA5KBdY4hTGOzlbaq+1tqg7n7eyE/ZRqy41IqOCjKDHFcCxSoboEF/vWBckY7Dwxz0FmLis2IEYiJ7dUPbkNP8fGjReg0rwFfT0PoGUxY3WJtUBUxqUYOWFOCLddHk7qcKdhcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QXRsF+tKueUOeIGkwK4BfODFk1gWzETHoGJj5QY/4Oo=; b=Gg0LECZb6xHt+0bfQU5qcW6hg3KfhGxW8uorDln2xqoxMZaK/JpdNn83agLHNUO2nGEQ4pg0CKYsYB0OSq7LkIV489+Ti5p3TRmrCnDaXNqm4xya1BQjjACBUrqUtLzzYmte+rFd24F4aW5N6VpnW/H2v+91cu4d5+f33eahZO6eK9YWgwOFWp0ZI/uE/ghjGYQq5YLGEpIDhZYG+I3cAS94EWY8XaVdKP076jNAn5RqWZftyAQ9X0Q0dWnNqz3KEcltkcKsD5qVqGrVUXrOEv9gtdtkaLGIjdOh6uecCvriKXpXFc4Jn+EBZd1rNkAlQtQx9gyU5yQyxV/vC085ZQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QXRsF+tKueUOeIGkwK4BfODFk1gWzETHoGJj5QY/4Oo=; b=biRlAXjrsJiuT6VkSfRCJ6H8DQcRnRPgYxlmOBHDyVLCn6OK9WdTDQu/xHr+vQwOFy0vZ1X8KTueaW87O2K59Cr4WzvRN8Vsn0ySB+5gERYm2x9Ug9lzNOhi14kgYk4G2k7mvb5MabArplO/EY2O+8wftB2uyLYlH4v2a9eJODE= Received: from MW4PR04CA0123.namprd04.prod.outlook.com (2603:10b6:303:84::8) by SA0PR12MB4575.namprd12.prod.outlook.com (2603:10b6:806:73::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15; Fri, 12 Nov 2021 13:27:07 +0000 Received: from CO1NAM11FT028.eop-nam11.prod.protection.outlook.com (2603:10b6:303:84:cafe::9f) by MW4PR04CA0123.outlook.office365.com (2603:10b6:303:84::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13 via Frontend Transport; Fri, 12 Nov 2021 13:27:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; Received: from SATLEXMB03.amd.com (165.204.84.17) by CO1NAM11FT028.mail.protection.outlook.com (10.13.175.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4690.15 via Frontend Transport; Fri, 12 Nov 2021 13:27:06 +0000 Received: from SATLEXMB07.amd.com (10.181.41.45) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Fri, 12 Nov 2021 07:27:05 -0600 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB07.amd.com (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Fri, 12 Nov 2021 05:27:05 -0800 Received: from BLR-LAB-SFW01.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Fri, 12 Nov 2021 07:27:04 -0600 From: "Abdul Lateef Attar" To: CC: Ray Ni , Zhichao Gao , "Sami Mujawar" Subject: [edk2-devel] [PATCH v1] ShellPkg/AcpiView: PrintFormatter for FADT Flags field Date: Fri, 12 Nov 2021 18:57:25 +0530 Message-ID: <20211112132725.13810-1-abdattar@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Return-Path: AbdulLateef.Attar@amd.com X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: db54da14-4954-4849-38f9-08d9a5e01f6d X-MS-TrafficTypeDiagnostic: SA0PR12MB4575: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1091; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IZjUBDQTqxTspqHsRa9UajKRI/i1Rp8b2XDxTmwu5R51ShlE8o+IrGyLyJMbCCE0kZBWU28ZMTpSD+nbewaABCKxVB5JuWT2fFXmOknL9inO+RBKZXPeJdq7GrvG4hrfuQ7NGG5MahmU34IRLfRcATrCN+1MP1TZT4ow0Qze8UC4V71Fyk/wXNEyLmAARDuJNsZoTmAVQuFhlzp9nFHhNOIIzsy2kzZ17kxwQzsvJL1ryD0U9opV92t2RPyY9kBWXJ7Qow4toG6JO47luhyJsUlp2yTPxPZa/h00B21nkp1JDFYoZwrHDt8US/0uvFlnw42IIFAAA99bVZIjA6GElMxioae25DzBu6NtYcryU7Vd14V//k4DEvHWR451oRWxYPKWzLp39arufszT3EDE33YZArYswE1qyWudaz5a4utNtX7hNf/Y03kE1bi6iXyOv7XgDOmeZzOUnGEm4AwKCJ253HZGeolW38uLU3kfQOMhwJDA6uVJ0/XDMhIgGFT9qybuE3LmMrOcyU1jYAkcRZjORTh0KxtvozgQOP2/AGzyUSzc048qVtWyRq3kKLNTByAg2oUYnnN5a2DdH/d+1xkd+tAVx11sf7OfxXSDjn6Hk7uz2l/oKs53UO9fsrPvJ2lHz4+9UjaLZJHydjmYT+snFJv0apSG+EJdvcfr3Rba8AovoPtvA3+XrQZmQwUB6UJi6BDCrcbMvgXub7JwrTCo9XmRc17zr78U0cl5Cs8= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(426003)(508600001)(82310400003)(81166007)(70586007)(8676002)(36860700001)(83380400001)(2616005)(6916009)(2906002)(4326008)(26005)(36756003)(70206006)(54906003)(186003)(316002)(1076003)(336012)(7696005)(47076005)(6666004)(5660300002)(8936002)(356005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2021 13:27:06.6585 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: db54da14-4954-4849-38f9-08d9a5e01f6d X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT028.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4575 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain Adds PrintFormatter function to the FADT flags field. Prints indivisual flag name along with flag value. Cc: Ray Ni Cc: Zhichao Gao Cc: Sami Mujawar Signed-off-by: Abdul Lateef Attar --- ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c | 2= 08 +++++++++++++++++++- 1 file changed, 207 insertions(+), 1 deletion(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/Fadt= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtPa= rser.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=0D =0D Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.=0D + Copyright (c) 2021, AMD Incorporated. All rights reserved.
=0D SPDX-License-Identifier: BSD-2-Clause-Patent=0D =0D @par Reference(s):=0D @@ -127,6 +128,211 @@ ValidateFlags ( #endif=0D }=0D =0D +/**=0D + This function traces FADT Flags field.=0D +=0D + @param [in] Format Optional format string for tracing the data.=0D + @param [in] Ptr Pointer to the start of the buffer.=0D +**/=0D +VOID=0D +EFIAPI=0D +DumpFadtFlags (=0D + IN CONST CHAR16* Format OPTIONAL,=0D + IN UINT8* Ptr=0D + )=0D +{=0D + if (Format !=3D NULL) {=0D + Print (Format, *(UINT32*)Ptr);=0D + return;=0D + }=0D +=0D + Print (L"0x%X\n", *(UINT32*)Ptr);=0D + Print (=0D + L"%*a%-*s : %d\n",=0D + 4,=0D + "",=0D + (OUTPUT_FIELD_COLUMN_WIDTH - 4),=0D + L"WBINVD",=0D + *(UINT32*)Ptr & BIT0 ? 1 : 0=0D + );=0D + Print (=0D + L"%*a%-*s : %d\n",=0D + 4,=0D + "",=0D + (OUTPUT_FIELD_COLUMN_WIDTH - 4),=0D + L"WBINVD_FLUSH",=0D + *(UINT32*)Ptr & BIT1 ? 1 : 0=0D + );=0D + Print (=0D + L"%*a%-*s : %d\n",=0D + 4,=0D + "",=0D + (OUTPUT_FIELD_COLUMN_WIDTH - 4),=0D + L"PROC_C1",=0D + *(UINT32*)Ptr & BIT2 ? 1 : 0=0D + );=0D + Print (=0D + L"%*a%-*s : %d\n",=0D + 4,=0D + "",=0D + (OUTPUT_FIELD_COLUMN_WIDTH - 4),=0D + L"P_LVL2_UP",=0D + *(UINT32*)Ptr & BIT3 ? 1 : 0=0D + );=0D + Print (=0D + L"%*a%-*s : %d\n",=0D + 4,=0D + "",=0D + (OUTPUT_FIELD_COLUMN_WIDTH - 4),=0D + L"PWR_BUTTON",=0D + *(UINT32*)Ptr & BIT4 ? 1 : 0=0D + );=0D + Print (=0D + L"%*a%-*s : %d\n",=0D + 4,=0D + "",=0D + (OUTPUT_FIELD_COLUMN_WIDTH - 4),=0D + L"SLP_BUTTON",=0D + *(UINT32*)Ptr & BIT5 ? 1 : 0=0D + );=0D + Print (=0D + L"%*a%-*s : %d\n",=0D + 4,=0D + "",=0D + (OUTPUT_FIELD_COLUMN_WIDTH - 4),=0D + L"FIX_RTC",=0D + *(UINT32*)Ptr & BIT6 ? 1 : 0=0D + );=0D + Print (=0D + L"%*a%-*s : %d\n",=0D + 4,=0D + "",=0D + (OUTPUT_FIELD_COLUMN_WIDTH - 4),=0D + L"RTC_S4",=0D + *(UINT32*)Ptr & BIT7 ? 1 : 0=0D + );=0D + Print (=0D + L"%*a%-*s : %d\n",=0D + 4,=0D + "",=0D + (OUTPUT_FIELD_COLUMN_WIDTH - 4),=0D + L"TMR_VAL_EXT",=0D + *(UINT32*)Ptr & BIT8 ? 1 : 0=0D + );=0D + Print (=0D + L"%*a%-*s : %d\n",=0D + 4,=0D + "",=0D + (OUTPUT_FIELD_COLUMN_WIDTH - 4),=0D + L"DCK_CAP",=0D + *(UINT32*)Ptr & BIT9 ? 1 : 0=0D + );=0D + Print (=0D + L"%*a%-*s : %d\n",=0D + 4,=0D + "",=0D + (OUTPUT_FIELD_COLUMN_WIDTH - 4),=0D + L"RESET_REG_SUP",=0D + *(UINT32*)Ptr & BIT10 ? 1 : 0=0D + );=0D + Print (=0D + L"%*a%-*s : %d\n",=0D + 4,=0D + "",=0D + (OUTPUT_FIELD_COLUMN_WIDTH - 4),=0D + L"SEALED_CASE",=0D + *(UINT32*)Ptr & BIT11 ? 1 : 0=0D + );=0D + Print (=0D + L"%*a%-*s : %d\n",=0D + 4,=0D + "",=0D + (OUTPUT_FIELD_COLUMN_WIDTH - 4),=0D + L"HEADLESS",=0D + *(UINT32*)Ptr & BIT12 ? 1 : 0=0D + );=0D + Print (=0D + L"%*a%-*s : %d\n",=0D + 4,=0D + "",=0D + (OUTPUT_FIELD_COLUMN_WIDTH - 4),=0D + L"CPU_SW_SLP",=0D + *(UINT32*)Ptr & BIT13 ? 1 : 0=0D + );=0D + Print (=0D + L"%*a%-*s : %d\n",=0D + 4,=0D + "",=0D + (OUTPUT_FIELD_COLUMN_WIDTH - 4),=0D + L"PCI_EXP_WAK",=0D + *(UINT32*)Ptr & BIT14 ? 1 : 0=0D + );=0D + Print (=0D + L"%*a%-*s : %d\n",=0D + 4,=0D + "",=0D + (OUTPUT_FIELD_COLUMN_WIDTH - 4),=0D + L"USE_PLATFORM_CLOCK",=0D + *(UINT32*)Ptr & BIT15 ? 1 : 0=0D + );=0D + Print (=0D + L"%*a%-*s : %d\n",=0D + 4,=0D + "",=0D + (OUTPUT_FIELD_COLUMN_WIDTH - 4),=0D + L"S4_RTC_STS_VALID",=0D + *(UINT32*)Ptr & BIT16 ? 1 : 0=0D + );=0D + Print (=0D + L"%*a%-*s : %d\n",=0D + 4,=0D + "",=0D + (OUTPUT_FIELD_COLUMN_WIDTH - 4),=0D + L"REMOTE_POWER_ON_CAPABLE",=0D + *(UINT32*)Ptr & BIT17 ? 1 : 0=0D + );=0D + Print (=0D + L"%*a%-*s : %d\n",=0D + 4,=0D + "",=0D + (OUTPUT_FIELD_COLUMN_WIDTH - 4),=0D + L"FORCE_APIC_CLUSTER_MODEL",=0D + *(UINT32*)Ptr & BIT18 ? 1 : 0=0D + );=0D + Print (=0D + L"%*a%-*s : %d\n",=0D + 4,=0D + "",=0D + (OUTPUT_FIELD_COLUMN_WIDTH - 4),=0D + L"FORCE_APIC_PHYSICAL_DESTINATION_MODE",=0D + *(UINT32*)Ptr & BIT19 ? 1 : 0=0D + );=0D + Print (=0D + L"%*a%-*s : %d\n",=0D + 4,=0D + "",=0D + (OUTPUT_FIELD_COLUMN_WIDTH - 4),=0D + L"HW_REDUCED_ACPI",=0D + *(UINT32*)Ptr & BIT20 ? 1 : 0=0D + );=0D + Print (=0D + L"%*a%-*s : %d\n",=0D + 4,=0D + "",=0D + (OUTPUT_FIELD_COLUMN_WIDTH - 4),=0D + L"LOW_POWER_S0_IDLE_CAPABLE",=0D + *(UINT32*)Ptr & BIT21 ? 1 : 0=0D + );=0D + Print (=0D + L"%*a%-*s : %d\n",=0D + 4,=0D + "",=0D + (OUTPUT_FIELD_COLUMN_WIDTH - 4),=0D + L"Reserved",=0D + *(UINT32*)Ptr & BIT22 ? 1 : 0=0D + );=0D +}=0D +=0D /**=0D An ACPI_PARSER array describing the ACPI FADT Table.=0D **/=0D @@ -170,7 +376,7 @@ STATIC CONST ACPI_PARSER FadtParser[] =3D { {L"CENTURY", 1, 108, L"0x%x", NULL, NULL, NULL, NULL},=0D {L"IAPC_BOOT_ARCH", 2, 109, L"0x%x", NULL, NULL, NULL, NULL},=0D {L"Reserved", 1, 111, L"0x%x", NULL, NULL, NULL, NULL},=0D - {L"Flags", 4, 112, L"0x%x", NULL, (VOID**)&Flags, ValidateFlags, NULL},= =0D + {L"Flags", 4, 112, NULL, DumpFadtFlags, (VOID**)&Flags, ValidateFlags, N= ULL},=0D {L"RESET_REG", 12, 116, NULL, DumpGas, NULL, NULL, NULL},=0D {L"RESET_VALUE", 1, 128, L"0x%x", NULL, NULL, NULL, NULL},=0D {L"ARM_BOOT_ARCH", 2, 129, L"0x%x", NULL, NULL, NULL, NULL},=0D --=20 2.25.1