From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id DC33A941131 for ; Fri, 8 Mar 2024 05:57:07 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=L411ZfUAtHzPjgMaFAQ8nFIGzawsnxJ5z5oj/hGAE44=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:User-Agent:Subject:To:CC:References:From:In-Reply-To:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20240206; t=1709877426; v=1; b=neE3EE3VInQFMTpyW25fyPmk+3flux41O49AvdVQ42JKPDEgtmFDfSrC29CfvdVzDo8XO6j1 x7+oLLj7V5lIueSRKD5KnqwaIf6DN7xrDGFNe7/S/rPGyvfXl5CmecMkprUzLKV51L2J+DYn15P A8hahb1tAMkuzx0nC+cdzsZHgeat/nxHiG+hCk4oZVWNlHp8/suxX3Ix7LMwGLYmaXr0L3fFmka bK6qHIhy+OTv4Wyb22+8Lmzf+KEv52F+KHIqUqJDinGdSW7Xk1GmgkBPLETGX2doaKVcHC7FrM3 LpU/EcsQtS4w481llIjndK+rowv55iqURjUKyaz81qMVQ== X-Received: by 127.0.0.2 with SMTP id ebyBYY7687511xIYnj9AM5lS; Thu, 07 Mar 2024 21:57:06 -0800 X-Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com [40.107.237.67]) by mx.groups.io with SMTP id smtpd.web10.14827.1709877425718455921 for ; Thu, 07 Mar 2024 21:57:06 -0800 X-Received: from IA1PR12MB6458.namprd12.prod.outlook.com (2603:10b6:208:3aa::22) by CH3PR12MB8188.namprd12.prod.outlook.com (2603:10b6:610:120::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.24; Fri, 8 Mar 2024 05:57:01 +0000 X-Received: from IA1PR12MB6458.namprd12.prod.outlook.com ([fe80::b913:7732:22e1:b71e]) by IA1PR12MB6458.namprd12.prod.outlook.com ([fe80::b913:7732:22e1:b71e%7]) with mapi id 15.20.7362.029; Fri, 8 Mar 2024 05:57:01 +0000 Message-ID: <1d9f6442-4b07-48b1-867a-1c7b6652ab6c@amd.com> Date: Thu, 07 Mar 2024 21:57:06 -0800 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH v1 1/2] ShellPkg/Acpiview: Adds HPET parser To: Pierre Gondois , Abdul Lateef Attar , devel@edk2.groups.io CC: Zhichao Gao References: <6b83014a48c42ae90b28b2261914b437ad1a99b1.1709636501.git.AbdulLateef.Attar@amd.com> From: "Abdul Lateef Attar via groups.io" In-Reply-To: X-ClientProxiedBy: PN3PR01CA0083.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:9a::14) To IA1PR12MB6458.namprd12.prod.outlook.com (2603:10b6:208:3aa::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR12MB6458:EE_|CH3PR12MB8188:EE_ X-MS-Office365-Filtering-Correlation-Id: 1e4b156f-ab3b-4e67-184d-08dc3f349277 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: OodVrPYcVrBbJGV/QH8BG0tuCB57HhCzsKj4A+S7Elhrg+aOfhzXMqCnRKfh0hojFjOPUijH/lDGuqZDh0dYNHxcnkwkPLUQoqtUKwkoJ1hxOLRojzO8AWvoEVXWE1GtQ4gyRUx13wnEhzzbFBCP6sb7sr5YEEUl4xy1kA5HFBx8DuB/+C9NxNcvYvCVP9tmnSDrzVav1BsO/QhhL6kYM+ktvWYLrXZF/UDKRCMc68loRqyGBqvFRym2PZhCz3DcKn3FONUd5tjtTLQtaC46AMHCMn4qwM10HhS5+gMLnYl4rI5v0Gmxz0GwASQ8KmK3GyhQqxYMwoaplvdwJBOEvJWUxcnvSPXW3OucuzofjdtFOqjYhiuMzTcaWB/8SbRpHClqAYtFZIeC4T7E1rVVPLe0/o++JxF+ZUzV2S2WZeGcANWI/ttrwrOFNumHisVCIvzsJHUQ/ntM5UFIm8gDpkzftV+gncHdKUFKKHfUQ7VyZKfl0dOxlC+DOkOL5Wbo8OVT3d1P/tBz6KCgZdSQv3X9JA67Wde3Xb8OpTBllfyd81lUlYznNQV6CV5BinPXjNosaYOJtDWTo3puSUZvZnC/2gRgAI2xBu3HsqJVel3LDBJxFWMojEbLFZpBBAhpw6tfg/3dilnYO7OZ/4v38skQG4RJVIKqTNsgoiu7bJc= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?085w+NDpIIkqf1D8gwCopMSkxA9346/2rsQ6DAIOYKvv75+TfyaTmVYrhUk0?= =?us-ascii?Q?+CjXfPqJEIpjtkNUbsms3cZGqlWf6dfPexUFuEKLvxc+ln6P05gfKowNh6b2?= =?us-ascii?Q?YXsw7q8+4K6PC5QO1PttuXRZf/nuWEYZ6PQfV4MN54rwgAMVBw6WMxiejrjH?= =?us-ascii?Q?Vj+NtHq6i5cgHW6yCRkzIircl2DrEpCMbVJftwhsCopH4m6ThDZdgwrqYh5o?= =?us-ascii?Q?zL8t/9KBvBE86IUYM455Oi8ktNgSYNYsDXDGBY9HOUz/sszlngAATkWCXymz?= =?us-ascii?Q?JbuEPx2MHUEEox/gJMvJSUWdE8gWIIXbwPY0bir/kInhl1SCVtCN1sCSe6CK?= =?us-ascii?Q?YNxdfPo8700mBOTCZIiUY1on+d6YNr2kcA0oXFzlZ+kPlpd2hQ3qFvwKSGnJ?= =?us-ascii?Q?5baGVdmoubwU4E/xSTH0sjno5NDGYV+3dghCSODc9UMWIBwCjTACuN3bEeqL?= =?us-ascii?Q?2fLaUzNp12RqYXPbpO5Xe4xlEnQ42dYSBu6TPd54Z7aK/2R8m0FsnzMugc/C?= =?us-ascii?Q?YijEEsmE/65BzD6LytwOLLHkiRbXI9kplwS2XVWka3EhJ09tiP8ooYZk1t8l?= =?us-ascii?Q?0Kfze4HqLuOlHJvR54ECFhtKn1Edrioxz8Q3/DM/EZxGIJnt3FuJMQML/9iY?= =?us-ascii?Q?WsdMJKlGZBZ6hiaSkjgsv8CNSnvcrAaFqxmfe7IZ4pU7PyAtz3kg+Vm1ZpQb?= =?us-ascii?Q?e9IIUOLkOLotuGzy2OrcKLdWkIwqJWNCoAt982phM2dO7/iq+tX05AP5JBzB?= =?us-ascii?Q?giiie6Ng5TzFACREcm+eZJwEbB2NBF/h/XAX1jkxwSdrvMqFAtgc/ZsRPrUj?= =?us-ascii?Q?cLIlp2qLbSRER4K+CxTcwesICTS2aKj2pkM45XR7qEHoLekMgqz6fIbHzDlv?= =?us-ascii?Q?5gzS9iRh0V/21rUMGdk4cmE1Y/jnsI/GhrtQ6HSENoO2pGHjG7TQzRzGmBOH?= =?us-ascii?Q?HGE9KEMCPQn9xFgWyYtXJp8fOHvfsVXEZRrCc3gyhm0h0gHa0mYBo6E5qlAX?= =?us-ascii?Q?1RBpLHJZ56jux5XCG7qZVFwlrXPO/gDdHxWo+kGS+Pva/2PhQ0fcdyvdK406?= =?us-ascii?Q?JddYE7PD6SDKKF5XOFnnkh86ApUixXfa7b9VMGbBkh9glSvMtJXJCd2GmLER?= =?us-ascii?Q?JYALTdKI1I590miLneviVEicRG2/mQfFgoJascCwjvKIRVglMbIcDJ+9bnKQ?= =?us-ascii?Q?n+HWRueqbzlGjhbuuDReZ/YoZeMSOha74qP//Enze53tv2fFiaNmY4SIk8d4?= =?us-ascii?Q?Z5yOkvTeRIBH02UeNW+PvidSDDrAlgY0RjvM5N6g8BMqlb9c9JiP2j8IBcEe?= =?us-ascii?Q?jN1X28m28ItW+px9iibIZjR6qowOT/nAcHRBi9TGkOIDRS+criqJB2Dflj1d?= =?us-ascii?Q?Cfk7f2yeW7TcJAgKBO6cK4RROb82zKP3zSVzFXKUzoA2FwVu1McE5eVxELsU?= =?us-ascii?Q?Ezz/0m3uKJv7QnX9F7AFW8V+XKVNKU2DrLYtiHKXmoP0NsLOm6tXcQjVPuQN?= =?us-ascii?Q?oiffp9+xMjNnBTgbUb61mFTyuHA+bEdjAUi5F7a3l67W5IkNpLC4qrhfB4B8?= =?us-ascii?Q?fAw9XrzzFa+qkpOwVFDlTvCi61iYqiol5l9bS/xG?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1e4b156f-ab3b-4e67-184d-08dc3f349277 X-MS-Exchange-CrossTenant-AuthSource: IA1PR12MB6458.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2024 05:57:01.1562 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7IKBdJUlESmlHa5zVxmBHHQ2gQ705pBrYuzM2vmi2B4k4f1K18yRGX588ps4tJwGT23z5uZXbb5uz66VBRiz9w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8188 Precedence: Bulk 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,AbdulLateef.Attar@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 1Oa67iX4AZq45nPyXbacJ45bx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=neE3EE3V; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Thanks Pierre for review, I'll address the review comment and submit the=20 V2 patch. On 07-03-2024 16:07, Pierre Gondois wrote: > Caution: This message originated from an External Source. Use proper=20 > caution when opening attachments, clicking links, or responding. > > > Hello Abdul, > > With the comments resolved: > Reviewed-by: Pierre Gondois > > On 3/5/24 12:12, Abdul Lateef Attar wrote: >> From: Abdul Lateef Attar >> >> Adds HPET parse to the UefiShellAcpiViewCommandLib library. >> >> Cc: Zhichao Gao >> Cc: Pierre Gondois=C2=A0 >> Signed-off-by: Abdul Lateef Attar >> --- >> =C2=A0 .../UefiShellAcpiViewCommandLib/AcpiParser.h=C2=A0 |=C2=A0 17 ++ >> =C2=A0 .../Parsers/Hpet/HpetParser.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 221 ++++++++= ++++++++++ >> =C2=A0 .../UefiShellAcpiViewCommandLib.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0 1 + >> =C2=A0 .../UefiShellAcpiViewCommandLib.inf=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0 1 + >> =C2=A0 4 files changed, 240 insertions(+) >> =C2=A0 create mode 100644=20 >> ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Hpet/HpetParser.c >> >> diff --git=20 >> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h=20 >> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h >> index 4b4397961b..ba3364f2c2 100644 >> --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h >> +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h >> @@ -730,6 +730,23 @@ ParseAcpiHmat ( >> =C2=A0=C2=A0=C2=A0 IN UINT8=C2=A0=C2=A0=C2=A0 AcpiTableRevision >> =C2=A0=C2=A0=C2=A0 ); >> >> +/** >> +=C2=A0 This function parses the ACPI HPET table. >> + >> +=C2=A0 @param [in] Trace=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 If TRUE, trace the ACPI fields. >> +=C2=A0 @param [in] Ptr=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Pointer to the start of the buff= er. >> +=C2=A0 @param [in] AcpiTableLength=C2=A0=C2=A0=C2=A0 Length of the ACPI= table. >> +=C2=A0 @param [in] AcpiTableRevision=C2=A0 Revision of the ACPI table. >> +**/ >> +VOID >> +EFIAPI >> +ParseAcpiHpet ( >> +=C2=A0 IN BOOLEAN=C2=A0 Trace, >> +=C2=A0 IN UINT8=C2=A0=C2=A0=C2=A0 *Ptr, >> +=C2=A0 IN UINT32=C2=A0=C2=A0 AcpiTableLength, >> +=C2=A0 IN UINT8=C2=A0=C2=A0=C2=A0 AcpiTableRevision >> +=C2=A0 ); >> + >> =C2=A0 /** >> =C2=A0=C2=A0=C2=A0 This function parses the ACPI IORT table. >> =C2=A0=C2=A0=C2=A0 When trace is enabled this function parses the IORT t= able and >> diff --git=20 >> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Hpet/HpetParser.c= =20 >> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Hpet/HpetParser.c >> new file mode 100644 >> index 0000000000..d1866f91c1 >> --- /dev/null >> +++=20 >> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Hpet/HpetParser.c >> @@ -0,0 +1,221 @@ >> +/** @file >> +=C2=A0 HPET table parser >> + >> +=C2=A0 Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reser= ved. >> +=C2=A0 SPDX-License-Identifier: BSD-2-Clause-Patent >> + >> +=C2=A0 @par Reference(s): >> +=C2=A0=C2=A0=C2=A0 - HPET spec, version 1.0a >> +**/ >> + >> +#include >> +#include "AcpiParser.h" >> + >> +STATIC ACPI_DESCRIPTION_HEADER_INFO=C2=A0 AcpiHdrInfo; >> + >> +/** >> +=C2=A0 This function prints HPET page protection flags. >> +=C2=A0 If no format string is specified the Format must be NULL. >> + >> +=C2=A0 @param [in] Format=C2=A0 Optional format string for tracing the = data. >> +=C2=A0 @param [in] Ptr=C2=A0=C2=A0=C2=A0=C2=A0 Pointer to the start of = the buffer. >> +**/ >> +VOID >> +EFIAPI >> +DumpHpetPageProtectionFlag ( >> +=C2=A0 IN CONST CHAR16=C2=A0 *Format OPTIONAL, >> +=C2=A0 IN UINT8=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *Ptr >> +=C2=A0 ) >> +{ >> +=C2=A0 if (Format !=3D NULL) { >> +=C2=A0=C2=A0=C2=A0 Print (Format, *(UINT8 *)Ptr); >> +=C2=A0=C2=A0=C2=A0 return; >> +=C2=A0 } >> + >> +=C2=A0 Print (L"0x%X ", *(UINT8 *)Ptr); >> +=C2=A0 switch (*Ptr) { >> +=C2=A0=C2=A0=C2=A0 case 0: >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Print (L"(no guarantee for page protecti= on)"); >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; >> +=C2=A0=C2=A0=C2=A0 case 1: >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Print (L"(4K page protection)"); >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; >> +=C2=A0=C2=A0=C2=A0 case 2: >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Print (L"(64K page protection)"); >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; >> +=C2=A0=C2=A0=C2=A0 default: >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Print (L"(OEM Reserved)"); > > Maybe IncrementErrorCount() + Print() here. > >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; >> +=C2=A0 } >> + >> +=C2=A0 return; >> +} >> + >> +/** >> +=C2=A0 An ACPI_PARSER array describing the ACPI HPET flags. >> +**/ >> +STATIC CONST ACPI_PARSER=C2=A0 DumpHpetFlagParser[] =3D { >> +=C2=A0 { L"Page Protection Flag", 4, 0, NULL, DumpHpetPageProtectionFla= g,=20 >> NULL, NULL, NULL }, >> +=C2=A0 { L"OEM Attributes",=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 4, 4, L= "0x%x",=20 >> NULL,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 NULL, NU= LL, NULL } >> +}; >> + >> +/** >> +=C2=A0 This function prints HPET Flags fields. >> +=C2=A0 If no format string is specified the Format must be NULL. >> + >> +=C2=A0 @param [in] Format=C2=A0 Optional format string for tracing the = data. >> +=C2=A0 @param [in] Ptr=C2=A0=C2=A0=C2=A0=C2=A0 Pointer to the start of = the buffer. >> +**/ >> +VOID >> +EFIAPI >> +DumpHpetFlag ( >> +=C2=A0 IN CONST CHAR16=C2=A0 *Format OPTIONAL, >> +=C2=A0 IN UINT8=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *Ptr >> +=C2=A0 ) >> +{ >> +=C2=A0 if (Format !=3D NULL) { >> +=C2=A0=C2=A0=C2=A0 Print (Format, *(UINT8 *)Ptr); >> +=C2=A0=C2=A0=C2=A0 return; >> +=C2=A0 } >> + >> +=C2=A0 Print (L"0x%X\n", *(UINT8 *)Ptr); >> +=C2=A0 ParseAcpiBitFields ( >> +=C2=A0=C2=A0=C2=A0 TRUE, >> +=C2=A0=C2=A0=C2=A0 2, >> +=C2=A0=C2=A0=C2=A0 NULL, >> +=C2=A0=C2=A0=C2=A0 Ptr, >> +=C2=A0=C2=A0=C2=A0 4, >> +=C2=A0=C2=A0=C2=A0 PARSER_PARAMS (DumpHpetFlagParser) >> +=C2=A0=C2=A0=C2=A0 ); >> +} >> + >> +/** >> +=C2=A0 This function prints HPET Counter size fields. >> +=C2=A0 If no format string is specified the Format must be NULL. >> + >> +=C2=A0 @param [in] Format=C2=A0 Optional format string for tracing the = data. >> +=C2=A0 @param [in] Ptr=C2=A0=C2=A0=C2=A0=C2=A0 Pointer to the start of = the buffer. >> +**/ >> +VOID >> +EFIAPI >> +DumpCounterSize ( >> +=C2=A0 IN CONST CHAR16=C2=A0 *Format OPTIONAL, >> +=C2=A0 IN UINT8=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *Ptr >> +=C2=A0 ) >> +{ >> +=C2=A0 if (Format !=3D NULL) { >> +=C2=A0=C2=A0=C2=A0 Print (Format, *(UINT32 *)Ptr); >> +=C2=A0=C2=A0=C2=A0 return; >> +=C2=A0 } >> + >> +=C2=A0 Print (L"0x%X ", *(UINT32 *)Ptr); >> +=C2=A0 if (*Ptr =3D=3D 0) { >> +=C2=A0=C2=A0=C2=A0 Print (L"(Max 32-bit counter size)"); >> +=C2=A0 } else { >> +=C2=A0=C2=A0=C2=A0 Print (L"(Max 64-bit counter size)"); >> +=C2=A0 } >> +} >> + >> +/** >> +=C2=A0 This function validates the flags. >> + >> +=C2=A0 @param [in] Ptr=C2=A0=C2=A0=C2=A0=C2=A0 Pointer to the start of = the field data. >> +=C2=A0 @param [in] Context Pointer to context specific information e.g.= this >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 could be a pointe= r to the ACPI table header. >> +**/ >> +STATIC >> +VOID >> +EFIAPI >> +ValidateHpetRevId ( >> +=C2=A0 IN UINT8=C2=A0 *Ptr, >> +=C2=A0 IN VOID=C2=A0=C2=A0 *Context >> +=C2=A0 ) >> +{ >> +=C2=A0 if ((*(UINT8 *)Ptr) =3D=3D 0) { >> +=C2=A0=C2=A0=C2=A0 IncrementErrorCount (); >> +=C2=A0=C2=A0=C2=A0 Print ( >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 L"\nERROR: HPET Hardware Rev ID must be = set." >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ); >> +=C2=A0 } >> +} >> + >> +/** >> +=C2=A0 An ACPI_PARSER array describing the ACPI HPET Event Timer Block = ID. >> +**/ >> +STATIC CONST ACPI_PARSER=C2=A0 HpetEventTimerBlockIdFlagParser[] =3D { >> +=C2=A0 { L"Hardware Rev ID",=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 8,=C2=A0 0,=C2= =A0 L"0x%x",=20 >> NULL,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = NULL, ValidateHpetRevId, NULL }, >> +=C2=A0 { L"Timer count (minus one)",=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 5,=C2=A0 8,=C2=A0 L"0x%x",=20 >> NULL,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = NULL, NULL,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 NULL }, > > The description in the spec is: > 'Number of Comparators in 1st Timer Bloc' > (maybe the name should be shorted) > >> +=C2=A0 { L"Counter max size", 1,=C2=A0 13, NULL,=C2=A0=C2=A0=C2=A0 Dump= CounterSize, NULL,=20 >> NULL,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 NULL }, >> +=C2=A0 { L"Reserved",=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 1,=C2=A0 14, L"%d",=20 >> NULL,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = NULL, NULL,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 NULL }, >> +=C2=A0 { L"LegacyReplacement IRQ Routing",=C2=A0=C2=A0=C2=A0 1,=C2=A0 1= 5, L"%d",=20 >> NULL,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = NULL, NULL,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 NULL }, >> +=C2=A0 { L"PCI Vendor ID of 1st Timer Block", 16, 16, L"0x%x",=20 >> NULL,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = NULL, NULL,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 NULL } >> +}; >> + >> +/** >> +=C2=A0 This function prints Hardware ID of HPET Event timer block. >> +=C2=A0 If no format string is specified the Format must be NULL. >> + >> +=C2=A0 @param [in] Format=C2=A0 Optional format string for tracing the = data. >> +=C2=A0 @param [in] Ptr=C2=A0=C2=A0=C2=A0=C2=A0 Pointer to the start of = the buffer. >> +**/ >> +VOID >> +EFIAPI >> +DumpHpetEventTimerBlockId ( >> +=C2=A0 IN CONST CHAR16=C2=A0 *Format OPTIONAL, >> +=C2=A0 IN UINT8=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *Ptr >> +=C2=A0 ) >> +{ >> +=C2=A0 if (Format !=3D NULL) { >> +=C2=A0=C2=A0=C2=A0 Print (Format, *(UINT32 *)Ptr); >> +=C2=A0=C2=A0=C2=A0 return; >> +=C2=A0 } >> + >> +=C2=A0 Print (L"0x%X\n", *(UINT32 *)Ptr); >> +=C2=A0 ParseAcpiBitFields ( >> +=C2=A0=C2=A0=C2=A0 TRUE, >> +=C2=A0=C2=A0=C2=A0 2, >> +=C2=A0=C2=A0=C2=A0 NULL, >> +=C2=A0=C2=A0=C2=A0 Ptr, >> +=C2=A0=C2=A0=C2=A0 4, >> +=C2=A0=C2=A0=C2=A0 PARSER_PARAMS (HpetEventTimerBlockIdFlagParser) >> +=C2=A0=C2=A0=C2=A0 ); >> +} >> + >> +/** >> +=C2=A0 An ACPI_PARSER array describing the ACPI HPET Table. >> +**/ >> +STATIC CONST ACPI_PARSER=C2=A0 HpetParser[] =3D { >> +=C2=A0 PARSE_ACPI_HEADER (&AcpiHdrInfo), >> +=C2=A0 { L"Event Timer Block ID",=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 4= ,=C2=A0=C2=A0 36, NULL,=20 >> DumpHpetEventTimerBlockId, NULL, NULL, NULL }, >> +=C2=A0 { L"Event Timer Block Register", 12,=C2=A0 40, NULL,=20 >> DumpGas,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 NULL, NULL, NULL }, > > Even though this is close, maybe the spec definition should be used=20 > instead: > 'Base address' > >> +=C2=A0 { L"Sequence number",=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 1, 52, L"0x%x",=20 >> NULL,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 NULL, NULL, NU= LL }, > > 'HPET number' > >> +=C2=A0 { L"Minimum Clock Ticks",=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 2, 53, L"0x%x",=20 >> NULL,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 NULL, NULL, NU= LL }, >> +=C2=A0 { L"Flag",=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 1,=C2=A0=C2=A0 55, NULL,=20 >> DumpHpetFlag,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 NULL, NULL, NULL } >> +}; >> + >> +/** >> +=C2=A0 This function parses the ACPI HPET table. >> + >> +=C2=A0 @param [in] Trace=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 If TRUE, trace the ACPI fields. >> +=C2=A0 @param [in] Ptr=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Pointer to the start of the buff= er. >> +=C2=A0 @param [in] AcpiTableLength=C2=A0=C2=A0=C2=A0 Length of the ACPI= table. >> +=C2=A0 @param [in] AcpiTableRevision=C2=A0 Revision of the ACPI table. >> +**/ >> +VOID >> +EFIAPI >> +ParseAcpiHpet ( >> +=C2=A0 IN BOOLEAN=C2=A0 Trace, >> +=C2=A0 IN UINT8=C2=A0=C2=A0=C2=A0 *Ptr, >> +=C2=A0 IN UINT32=C2=A0=C2=A0 AcpiTableLength, >> +=C2=A0 IN UINT8=C2=A0=C2=A0=C2=A0 AcpiTableRevision >> +=C2=A0 ) >> +{ >> +=C2=A0 ParseAcpi ( >> +=C2=A0=C2=A0=C2=A0 Trace, >> +=C2=A0=C2=A0=C2=A0 0, >> +=C2=A0=C2=A0=C2=A0 "HPET", >> +=C2=A0=C2=A0=C2=A0 Ptr, >> +=C2=A0=C2=A0=C2=A0 AcpiTableLength, >> +=C2=A0=C2=A0=C2=A0 PARSER_PARAMS (HpetParser) >> +=C2=A0=C2=A0=C2=A0 ); >> +} >> diff --git=20 >> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandL= ib.c=20 >> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandL= ib.c=20 >> >> index bbac125bb9..9e15979ea2 100644 >> ---=20 >> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandL= ib.c >> +++=20 >> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandL= ib.c >> @@ -59,6 +59,7 @@ ACPI_TABLE_PARSER=C2=A0 ParserList[] =3D { >> =C2=A0=C2=A0=C2=A0 { EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE= ,=20 >> ParseAcpiFadt }, >> =C2=A0=C2=A0=C2=A0 { EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNAT= URE,=20 >> ParseAcpiGtdt }, >> =C2=A0=C2=A0=C2=A0 { EFI_ACPI_6_4_HETEROGENEOUS_MEMORY_ATTRIBUTE_TABLE_S= IGNATURE,=20 >> ParseAcpiHmat }, >> +=C2=A0 { EFI_ACPI_6_5_HIGH_PRECISION_EVENT_TIMER_TABLE_SIGNATURE,=20 >> ParseAcpiHpet }, >> =C2=A0=C2=A0=C2=A0 { EFI_ACPI_6_2_IO_REMAPPING_TABLE_SIGNATURE, ParseAcp= iIort }, >> =C2=A0=C2=A0=C2=A0 { EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNAT= URE,=20 >> ParseAcpiMadt }, >> =C2=A0=C2=A0=C2=A0 {=20 >> EFI_ACPI_6_2_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_BASE_ADDRESS_= DESCRIPTION_TABLE_SIGNATURE, >> diff --git=20 >> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandL= ib.inf=20 >> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandL= ib.inf=20 >> >> index a38965a4bf..3338e04379 100644 >> ---=20 >> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandL= ib.inf >> +++=20 >> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandL= ib.inf >> @@ -38,6 +38,7 @@ >> =C2=A0=C2=A0=C2=A0 Parsers/Fadt/FadtParser.c >> =C2=A0=C2=A0=C2=A0 Parsers/Gtdt/GtdtParser.c >> =C2=A0=C2=A0=C2=A0 Parsers/Hmat/HmatParser.c >> +=C2=A0 Parsers/Hpet/HpetParser.c >> =C2=A0=C2=A0=C2=A0 Parsers/Iort/IortParser.c >> =C2=A0=C2=A0=C2=A0 Parsers/Madt/MadtParser.c >> =C2=A0=C2=A0=C2=A0 Parsers/Madt/MadtParser.h -=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 (#116487): https://edk2.groups.io/g/devel/message/116487 Mute This Topic: https://groups.io/mt/104742259/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-