From nobody Wed May 15 18:53:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+83695+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=pass(p=none dis=none) header.from=groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 163672363807454.551920067227; Fri, 12 Nov 2021 05:27:18 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 77afYY1788612xLWZRqLkyGW; Fri, 12 Nov 2021 05:27:17 -0800 X-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 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 X-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 X-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 (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+83695+1787277+3901457@groups.io; helo=mail02.groups.io; 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; X-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 X-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 X-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 X-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 via groups.io" 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> MIME-Version: 1.0 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-Message-Info: IZjUBDQTqxTspqHsRa9UajKRI/i1Rp8b2XDxTmwu5R51ShlE8o+IrGyLyJMbCCE0kZBWU28ZMTpSD+nbewaABCKxVB5JuWT2fFXmOknL9inO+RBKZXPeJdq7GrvG4hrfuQ7NGG5MahmU34IRLfRcATrCN+1MP1TZT4ow0Qze8UC4V71Fyk/wXNEyLmAARDuJNsZoTmAVQuFhlzp9nFHhNOIIzsy2kzZ17kxwQzsvJL1ryD0U9opV92t2RPyY9kBWXJ7Qow4toG6JO47luhyJsUlp2yTPxPZa/h00B21nkp1JDFYoZwrHDt8US/0uvFlnw42IIFAAA99bVZIjA6GElMxioae25DzBu6NtYcryU7Vd14V//k4DEvHWR451oRWxYPKWzLp39arufszT3EDE33YZArYswE1qyWudaz5a4utNtX7hNf/Y03kE1bi6iXyOv7XgDOmeZzOUnGEm4AwKCJ253HZGeolW38uLU3kfQOMhwJDA6uVJ0/XDMhIgGFT9qybuE3LmMrOcyU1jYAkcRZjORTh0KxtvozgQOP2/AGzyUSzc048qVtWyRq3kKLNTByAg2oUYnnN5a2DdH/d+1xkd+tAVx11sf7OfxXSDjn6Hk7uz2l/oKs53UO9fsrPvJ2lHz4+9UjaLZJHydjmYT+snFJv0apSG+EJdvcfr3Rba8AovoPtvA3+XrQZmQwUB6UJi6BDCrcbMvgXub7JwrTCo9XmRc17zr78U0cl5Cs8= 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 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,abdattar@amd.com X-Gm-Message-State: NV1otW9XBx0Z9U7W11koPTxPx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1636723637; bh=yfWa7KRd0DZlYvNlEQgdPoMRI1cQj/yKYFBIiE0dLAs=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=HvsbRjaV6Dq45fN6KqWz2Fev38P0hN0HNIO6WZZmrF6/zmgDVrX4fUkEhOTDCtaTr8r gqXY8jhOtiWOrKYp3GVqN+q3R+8R9X2bPBdh3v+MoPMmWPyZvpXvvqg8arrT7sGLIuJUD 3BJA8VZqcPVXmo72UeitzVvDtmuV6bz72o8= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1636723640482100001 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Zhichao Gao --- 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 =20 Copyright (c) 2016 - 2020, ARM Limited. All rights reserved. + Copyright (c) 2021, AMD Incorporated. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 @par Reference(s): @@ -127,6 +128,211 @@ ValidateFlags ( #endif } =20 +/** + 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 !=3D 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[] =3D { {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, N= ULL}, {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}, --=20 2.25.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#83695): https://edk2.groups.io/g/devel/message/83695 Mute This Topic: https://groups.io/mt/87005813/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-