From nobody Fri May 3 17:27:02 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43926+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 156344434205664.62003996631267; Thu, 18 Jul 2019 03:05:42 -0700 (PDT) Return-Path: X-Received: from EUR02-HE1-obe.outbound.protection.outlook.com (EUR02-HE1-obe.outbound.protection.outlook.com [40.107.1.87]) by groups.io with SMTP; Thu, 18 Jul 2019 03:05:41 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZzJp0KlnKQUJbvB1j6TTWSDnMBe4bNGSNxeL+BJ5Y6YOw4Vdq4xhtc2fhVrB5LjWLtaMkpt8BZGutrUayhRAc9jXxDTFKmaJ6zKkvMedUmD9ihbe2ieCfylmYAeWqI4Zy7pkm+6n7fY3aWwa/T9ddCcz87827cGB9pkBon7rsGOaeD9Y20vFoVK1STSUdTivmBhYldd/mf2nyeT+QtYqYPiKWOkFiJ/cyLmrMQBiKKmtxXyky8kirno+qZZZbiPAJnAk/MgWa5vUJ+P09EPtsDnyU3n0+NSBblr+sn4oa6eBg/edfAcNHEiq+x28c3URL4n2QHZUsT20RpnhHbHS+A== 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-SenderADCheck; bh=8hshQxlY34JTBiPz2TBd4qnjE8g3SrSeSQHLryZWqU0=; b=aypUY/o5f0A1P52TRIsmu6+7NgZIvQ6LmmmsGBdj93XHjeIUhNkYMf6QMjBjhebG8OtNN6IWdRC89ve/fitbHuezmfKWTJmhl0EPiSxjc2zuphzEq6qbK0Aa02zTJLXrCP1nNEmR164IKsP8nRTnsKZeWlPvQi3pwFYon5vQ3F7Zn0yZ/1TBB+eZIPabkuiLTTCMUOTeI3zKWkcLpLpKRpOfyHj1JvAskALVWgMhkNdI2C8ur88VWBlYX4O8LMVlI4ppo0yZjlJrgnWyLkqPZwoN5gOO3Ctd1gw7XQPgxER7vRdXyf8TalC2YhMcl5G0peYMLLqXKsyrp+4RH9uemA== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=temperror (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com;dmarc=temperror action=none header.from=arm.com;dkim=none (message not signed);arc=none X-Received: from VI1PR0802CA0003.eurprd08.prod.outlook.com (2603:10a6:800:aa::13) by HE1PR0802MB2601.eurprd08.prod.outlook.com (2603:10a6:3:d8::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.12; Thu, 18 Jul 2019 10:05:37 +0000 X-Received: from DB5EUR03FT042.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::206) by VI1PR0802CA0003.outlook.office365.com (2603:10a6:800:aa::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2073.14 via Frontend Transport; Thu, 18 Jul 2019 10:05:36 +0000 Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+43926+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) X-Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT042.mail.protection.outlook.com (10.152.21.123) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2052.18 via Frontend Transport; Thu, 18 Jul 2019 10:05:35 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1415.2; Thu, 18 Jul 2019 10:05:12 +0000 X-Received: from E119924.Arm.com (10.1.199.124) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Thu, 18 Jul 2019 10:05:12 +0000 From: "Krzysztof Koch" To: CC: , , , , , Subject: [edk2-devel] [PATCH v1 1/8] ShellPkg: acpiview: RSDP: Remove redundant forward declarations Date: Thu, 18 Jul 2019 11:04:55 +0100 Message-ID: <20190718100502.24688-2-krzysztof.koch@arm.com> In-Reply-To: <20190718100502.24688-1-krzysztof.koch@arm.com> References: <20190718100502.24688-1-krzysztof.koch@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 488a28c9-6961-4ed0-f4d3-08d70b677a1a X-MS-TrafficTypeDiagnostic: HE1PR0802MB2601: X-Microsoft-Antispam-PRVS: NoDisclaimer: True X-MS-Oob-TLC-OOBClassifiers: OLM:2331; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: 9fsFRBuw4957HJ3Rxh0iXquSg/1HXTl4ovloasSbKBf1hwMmyVCjkJxQotKtZra/xvl6JlOqpGi6W5MSDzLeFTBbQ97rhZ3nT6mQwRkhLg0x2i4kSff3JsM5vtb/j/OLQ+UN89n4ciMZffD30PMzvlDCA2yyPn+mW0nOQBjkSe6a5VsLG9U0VLh0C9gx+OrujlNA25SKH6adQU57SoHYP8ROKcDTbPaeQ01VMSHay+m0P4/dHtcaJs/z0rVCIv8PSWkVtLFJBEqCApbYbcJt+zsKvhgfumEDhvrooUzfQV/JoMl26bmt0bf9W4lvKZo+SD24EMPOh3ApeTu7w9fznhHBfa9WfLzfC0CZ8KDojMC1QeiCacmtb2vWCuFwNXT1W5hBv76BtuwCMqnZad9foMRFrtvK9iGdKlBZSfitNR4= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2019 10:05:35.4198 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 488a28c9-6961-4ed0-f4d3-08d70b677a1a X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[40.67.248.234];Helo=[nebula.arm.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0802MB2601 Precedence: Bulk List-Unsubscribe: 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,krzysztof.koch@arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1563444341; bh=o3XVCNQShHNlZ9QAG3WO4Jb2UKQvjII96QH6xhR7VYQ=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=dvs0TL9HrWKJbw+k++ClbofSrTh9XVuL3tir3yP0utJMbjrSqS/7FgTq6vCmfWnYBcN kWq9To4yBcpvBsc7juazAJgUz9Cpb6D+icdVaZ9QO5V9pjISWsIBOsG6U0GhPL4pj2DLf N/g6duH9EhKM0Ic56sK9IASdmEyqHyXUo0E= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Remove redundant forward function declarations by repositioning blocks of code. This way the code structure is consistent across ACPI table parsers and the code becomes more concise. Signed-off-by: Krzysztof Koch Reviewed-by: Alexei Fedorov Reviewed-by: Jaben Carsey Reviewed-by: Sami Mujawar Reviewed-by: Zhichao Gao --- Notes: v1: - remove redundant forward function declarations [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c | 1= 16 ++++++++------------ 1 file changed, 43 insertions(+), 73 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/Rsdp= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpPa= rser.c index 586de7cbfb12f856c0c735b6e295c1cc32eb2ceb..4bf928139a507d0b8f203ed0cbf= 0863cc2ec5de5 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c @@ -1,7 +1,7 @@ /** @file RSDP table parser =20 - Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. + Copyright (c) 2016 - 2019, ARM Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent =20 @par Reference(s): @@ -28,7 +28,27 @@ EFIAPI ValidateRsdtAddress ( IN UINT8* Ptr, IN VOID* Context - ); + ) +{ +#if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) + // Reference: Server Base Boot Requirements System Software on ARM Platf= orms + // Section: 4.2.1.1 RSDP + // Root System Description Pointer (RSDP), ACPI ? 5.2.5. + // - Within the RSDP, the RsdtAddress field must be null (zero) and the + // XsdtAddresss MUST be a valid, non-null, 64-bit value. + UINT32 RsdtAddr; + + RsdtAddr =3D *(UINT32*)Ptr; + + if (RsdtAddr !=3D 0) { + IncrementErrorCount (); + Print ( + L"\nERROR: Rsdt Address =3D 0x%p. This must be NULL on ARM Platforms= .", + RsdtAddr + ); + } +#endif +} =20 /** This function validates the XSDT Address. @@ -43,7 +63,27 @@ EFIAPI ValidateXsdtAddress ( IN UINT8* Ptr, IN VOID* Context - ); + ) +{ +#if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) + // Reference: Server Base Boot Requirements System Software on ARM Platf= orms + // Section: 4.2.1.1 RSDP + // Root System Description Pointer (RSDP), ACPI ? 5.2.5. + // - Within the RSDP, the RsdtAddress field must be null (zero) and the + // XsdtAddresss MUST be a valid, non-null, 64-bit value. + UINT64 XsdtAddr; + + XsdtAddr =3D *(UINT64*)Ptr; + + if (XsdtAddr =3D=3D 0) { + IncrementErrorCount (); + Print ( + L"\nERROR: Xsdt Address =3D 0x%p. This must not be NULL on ARM Platf= orms.", + XsdtAddr + ); + } +#endif +} =20 /** An array describing the ACPI RSDP Table. @@ -61,76 +101,6 @@ STATIC CONST ACPI_PARSER RsdpParser[] =3D { {L"Reserved", 3, 33, L"%x %x %x", Dump3Chars, NULL, NULL, NULL} }; =20 -/** - This function validates the RSDT Address. - - @param [in] Ptr Pointer to the start of the field data. - @param [in] Context Pointer to context specific information e.g. this - could be a pointer to the ACPI table header. -**/ -STATIC -VOID -EFIAPI -ValidateRsdtAddress ( - IN UINT8* Ptr, - IN VOID* Context - ) -{ -#if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) - // Reference: Server Base Boot Requirements System Software on ARM Platf= orms - // Section: 4.2.1.1 RSDP - // Root System Description Pointer (RSDP), ACPI ? 5.2.5. - // - Within the RSDP, the RsdtAddress field must be null (zero) and the - // XsdtAddresss MUST be a valid, non-null, 64-bit value. - UINT32 RsdtAddr; - - RsdtAddr =3D *(UINT32*)Ptr; - - if (RsdtAddr !=3D 0) { - IncrementErrorCount (); - Print ( - L"\nERROR: Rsdt Address =3D 0x%p. This must be NULL on ARM Platforms= .", - RsdtAddr - ); - } -#endif -} - -/** - This function validates the XSDT Address. - - @param [in] Ptr Pointer to the start of the field data. - @param [in] Context Pointer to context specific information e.g. this - could be a pointer to the ACPI table header. -**/ -STATIC -VOID -EFIAPI -ValidateXsdtAddress ( - IN UINT8* Ptr, - IN VOID* Context - ) -{ -#if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) - // Reference: Server Base Boot Requirements System Software on ARM Platf= orms - // Section: 4.2.1.1 RSDP - // Root System Description Pointer (RSDP), ACPI ? 5.2.5. - // - Within the RSDP, the RsdtAddress field must be null (zero) and the - // XsdtAddresss MUST be a valid, non-null, 64-bit value. - UINT64 XsdtAddr; - - XsdtAddr =3D *(UINT64*)Ptr; - - if (XsdtAddr =3D=3D 0) { - IncrementErrorCount (); - Print ( - L"\nERROR: Xsdt Address =3D 0x%p. This must not be NULL on ARM Platf= orms.", - XsdtAddr - ); - } -#endif -} - /** This function parses the ACPI RSDP table. =20 -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=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 (#43926): https://edk2.groups.io/g/devel/message/43926 Mute This Topic: https://groups.io/mt/32513485/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- From nobody Fri May 3 17:27:02 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43931+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 156344439721673.55315426481411; Thu, 18 Jul 2019 03:06:37 -0700 (PDT) Return-Path: X-Received: from EUR01-DB5-obe.outbound.protection.outlook.com (EUR01-DB5-obe.outbound.protection.outlook.com [40.107.15.79]) by groups.io with SMTP; Thu, 18 Jul 2019 03:06:36 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q6PFAtxXczFfuquteAn6eF1XHvfRpbPcr4tVAmHq83Cy2T1dCaEppV5vGxUy7tL/9yq4eYUNSRDHHapR9pNYF7y01b2GSwZ3/ibP923Xe6Ff7xusN8gz74QKPGQu054q8K8jBsSFm0p6cr1gdaonJR1uTfSyshDMwK+XuhHWKLC8UX0/nNgnrTpancWrBBe5xtHbvI40WTVoFL4JG6fxwt/UK4gL3VFbGOvdOG/cjmYcdmmUJuiTFaTJ1NkaL+WsnES/lIbOkLeVDpnpjzeRX6cDuOAeOW1tdPFy5GHdlTEmUz6lldhPmR3F1G+c50H4PaWcG3AelDW3C78VUcG0HQ== 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-SenderADCheck; bh=VM1GTyhqSZsYnoz8OWO6PxyEH2elrEBVOLQ9PsZTdzA=; b=iahaRwBgSniLMqOWKN66cek8JlmomMCsx24XTY3ieoVlVfJ57MeqB0ZacMNOfFaQM5SxxpI7oqqrkDLKXq9Ru60WDhOuunz4Jcruz86gBNF5adxYPZe85VrxSzTJbXbfP1kZvDlogHdAdMDim+hNAeyCz8F/Kh3DH0+8f/pqeGLHSoZc504jHETnOJ55Kr5BP3ufZsj5EY0EANxQwgNa6k78EgddJDvB+2jSKtIk2UuFzHMQJa0SQ7ezMTY9q+CctCopUTb9CvFmpnIB96BNr6YM865S0zZf9kEARgIs2DSPFfAMegofifVUBnmRlmFOC/CkbR2K4kQ4wnm1bDg3nQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=temperror (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com;dmarc=temperror action=none header.from=arm.com;dkim=none (message not signed);arc=none X-Received: from VI1PR0802CA0022.eurprd08.prod.outlook.com (2603:10a6:800:aa::32) by AM5PR0802MB2594.eurprd08.prod.outlook.com (2603:10a6:203:99::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2073.14; Thu, 18 Jul 2019 10:06:32 +0000 X-Received: from DB5EUR03FT042.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::201) by VI1PR0802CA0022.outlook.office365.com (2603:10a6:800:aa::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2094.12 via Frontend Transport; Thu, 18 Jul 2019 10:06:32 +0000 Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+43931+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) X-Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT042.mail.protection.outlook.com (10.152.21.123) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2052.18 via Frontend Transport; Thu, 18 Jul 2019 10:06:30 +0000 X-Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1415.2; Thu, 18 Jul 2019 10:05:13 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1415.2; Thu, 18 Jul 2019 10:05:12 +0000 X-Received: from E119924.Arm.com (10.1.199.124) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Thu, 18 Jul 2019 10:05:12 +0000 From: "Krzysztof Koch" To: CC: , , , , , Subject: [edk2-devel] [PATCH v1 2/8] ShellPkg: acpiview: FADT: Remove redundant forward declarations Date: Thu, 18 Jul 2019 11:04:56 +0100 Message-ID: <20190718100502.24688-3-krzysztof.koch@arm.com> In-Reply-To: <20190718100502.24688-1-krzysztof.koch@arm.com> References: <20190718100502.24688-1-krzysztof.koch@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d342c29c-5ba7-45cc-425d-08d70b679b24 X-MS-TrafficTypeDiagnostic: AM5PR0802MB2594: X-Microsoft-Antispam-PRVS: NoDisclaimer: True X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: COiXxbOcXkR9P16E2GERPKZxnFNItk0YLs/mb5DOXyrCtHP6De/mcfmakyZMAXUsB3WyE3DHfMevn/pMGp8pFyM3UfvGv8JnXV0uG61kay6W8lbL44pVAgrSNak1sVemNaS5ig+aOaQO+z9zPrTEQUha1GPMlWDw6s+agvlb4F0hgapDJgGcw4SO3vtCzw+lZAokbxvv5Km1mdwzTY1drHWvtRT2Gubs22o6Qj1Y9ymIuTwe7eA1xuzv/6SS8/t6Z+SxkkLmFo0npniCnbXgOcVIqFmgbvAzTR1FfcSKZ/NjPeZxwHJPIVTufRDf4DyfWOh9NVBaqH8oRu2LOCTU20aipSifCMLf8G0CYAF3Tv66Gr7b5sa39faJJsNZ/y5G3o7Jg/TX4Uuo6WYLyqdw0XAyujZwXzAUDF2GktzEs/U= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2019 10:06:30.8466 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d342c29c-5ba7-45cc-425d-08d70b679b24 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[40.67.248.234];Helo=[nebula.arm.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2594 Precedence: Bulk List-Unsubscribe: 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,krzysztof.koch@arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1563444396; bh=l7l6T/5fgBEi4T/Y+Xk6RnyjDAjyru3hT+Jt+AlC2II=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=wy3o4fsRR69vmtgGWqGczzuhv6gc/do3jE4TXxhOMyuEcVF6VJu4CvhtdRE170Z+HRo zJ2Pi55+Hdu7ujknJskkWeNecERAWvj/cbcPP+2AeapcOvHQUJ3/TDQV4TYnUzzDe5MFA +Uxa9U3Io0MMjlSj8BFEl6B/Xs/3m8exNmM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Remove redundant forward function declarations by repositioning blocks of code. This way the code structure is consistent across ACPI table parsers and the code becomes more concise. Signed-off-by: Krzysztof Koch Reviewed-by: Alexei Fedorov Reviewed-by: Jaben Carsey Reviewed-by: Sami Mujawar Reviewed-by: Zhichao Gao --- Notes: v1: - remove redundant forward function declarations [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c | 1= 13 ++++++-------------- 1 file changed, 34 insertions(+), 79 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/Fadt= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtPa= rser.c index cee7ee0770433da96d6042d2f5d687903f4b5495..e40c9ef8ee4b3285faf8c6edf3c= b6236ee367397 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c @@ -1,7 +1,7 @@ /** @file FADT table parser =20 - Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. + Copyright (c) 2016 - 2019, ARM Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent =20 @par Reference(s): @@ -46,7 +46,17 @@ EFIAPI ValidateFirmwareCtrl ( IN UINT8* Ptr, IN VOID* Context - ); +) +{ +#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) + if (*(UINT32*)Ptr !=3D 0) { + IncrementErrorCount (); + Print ( + L"\nERROR: Firmware Control must be zero for ARM platforms." + ); + } +#endif +} =20 /** This function validates the X_Firmware Control Field. @@ -61,7 +71,17 @@ EFIAPI ValidateXFirmwareCtrl ( IN UINT8* Ptr, IN VOID* Context - ); +) +{ +#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) + if (*(UINT64*)Ptr !=3D 0) { + IncrementErrorCount (); + Print ( + L"\nERROR: X Firmware Control must be zero for ARM platforms." + ); + } +#endif +} =20 /** This function validates the flags. @@ -76,7 +96,17 @@ EFIAPI ValidateFlags ( IN UINT8* Ptr, IN VOID* Context - ); +) +{ +#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) + if (((*(UINT32*)Ptr) & HW_REDUCED_ACPI) =3D=3D 0) { + IncrementErrorCount (); + Print ( + L"\nERROR: HW_REDUCED_ACPI flag must be set for ARM platforms." + ); + } +#endif +} =20 /** An ACPI_PARSER array describing the ACPI FADT Table. @@ -142,81 +172,6 @@ STATIC CONST ACPI_PARSER FadtParser[] =3D { {L"Hypervisor VendorIdentity", 8, 268, L"%lx", NULL, NULL, NULL, NULL} }; =20 -/** - This function validates the Firmware Control Field. - - @param [in] Ptr Pointer to the start of the field data. - @param [in] Context Pointer to context specific information e.g. this - could be a pointer to the ACPI table header. -**/ -STATIC -VOID -EFIAPI -ValidateFirmwareCtrl ( - IN UINT8* Ptr, - IN VOID* Context -) -{ -#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) - if (*(UINT32*)Ptr !=3D 0) { - IncrementErrorCount (); - Print ( - L"\nERROR: Firmware Control must be zero for ARM platforms." - ); - } -#endif -} - -/** - This function validates the X_Firmware Control Field. - - @param [in] Ptr Pointer to the start of the field data. - @param [in] Context Pointer to context specific information e.g. this - could be a pointer to the ACPI table header. -**/ -STATIC -VOID -EFIAPI -ValidateXFirmwareCtrl ( - IN UINT8* Ptr, - IN VOID* Context -) -{ -#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) - if (*(UINT64*)Ptr !=3D 0) { - IncrementErrorCount (); - Print ( - L"\nERROR: X Firmware Control must be zero for ARM platforms." - ); - } -#endif -} - -/** - This function validates the flags. - - @param [in] Ptr Pointer to the start of the field data. - @param [in] Context Pointer to context specific information e.g. this - could be a pointer to the ACPI table header. -**/ -STATIC -VOID -EFIAPI -ValidateFlags ( - IN UINT8* Ptr, - IN VOID* Context -) -{ -#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) - if (((*(UINT32*)Ptr) & HW_REDUCED_ACPI) =3D=3D 0) { - IncrementErrorCount (); - Print ( - L"\nERROR: HW_REDUCED_ACPI flag must be set for ARM platforms." - ); - } -#endif -} - /** This function parses the ACPI FADT table. This function parses the FADT table and optionally traces the ACPI table= fields. -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=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 (#43931): https://edk2.groups.io/g/devel/message/43931 Mute This Topic: https://groups.io/mt/32513493/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- From nobody Fri May 3 17:27:02 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43929+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 156344434787361.10615088263535; Thu, 18 Jul 2019 03:05:47 -0700 (PDT) Return-Path: X-Received: from EUR02-AM5-obe.outbound.protection.outlook.com (EUR02-AM5-obe.outbound.protection.outlook.com [40.107.0.40]) by groups.io with SMTP; Thu, 18 Jul 2019 03:05:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hnq6qqX44qW4FgjfeF7wxXTI9nNBM0SWrnTlTYW15/gIx+rXdm29hkS3IyqAM+qLodmDcyyccwZjfKl9XpiRq2k2ITNETpHulL2MTsXOIjyVOEkZpZx3JkxlX65NKiXIg9RRx5PeM1eBYRQPoqcBm4pN32Pbx6gJKuEr2F1iyn+MQajB9PE0V6d7JV/JJmklD/V73ljhU8BNmDcDUvLiyNT4Jj2Zg0BKwREdVsXEMQ+G7YP9r19Ar9eob6oXDamSY/hv5U2EjT2GQBt8DCRcv87hYWL4x1B3SanvMlrAPBobqqNB0LwG7KOjsXHIjQ+/hGrcUa4YPeWU/qxnEYPyRg== 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-SenderADCheck; bh=TKxnZqmi2pvSiwxcetNwONkRZuwrD8tfRxaAtJo3+XI=; b=MZOa+mQsfdOYxVY+0X/hyepcsbtwn8vfhaUzyf0G5aWkPZnED9jNs5OFUhXSH4pxmPutcy59TqlX/SHTfQ836h4PaBO4UWUYMMt85AP7BVhd6q08Mc31r3r7shtBIXvZxoYffd0PI1C+XJQXYFxcMYpJXGodKet2anJtnzJLx6iJsfQig3hvICMuVi9tiF2CjNWUoTVhC1ZzKV2FZthF3t60gXzDRMj9mP+pL2cgeLNDyk1OGAXJrTPHS6bJvfGGQwMrW06NWKD/tJSl+ZbCWICppWB8YIdUy5PTXmY+iSWT7TyBCIj5LLtADGSRlVKLF41QnIaBiL/eGKkDxbk+UQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=temperror (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com;dmarc=temperror action=none header.from=arm.com;dkim=none (message not signed);arc=none X-Received: from HE1PR0802CA0016.eurprd08.prod.outlook.com (2603:10a6:3:bd::26) by AM0PR08MB4947.eurprd08.prod.outlook.com (2603:10a6:208:158::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2073.14; Thu, 18 Jul 2019 10:05:42 +0000 X-Received: from DB5EUR03FT050.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::200) by HE1PR0802CA0016.outlook.office365.com (2603:10a6:3:bd::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2073.14 via Frontend Transport; Thu, 18 Jul 2019 10:05:42 +0000 Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+43929+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) X-Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT050.mail.protection.outlook.com (10.152.21.128) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2052.18 via Frontend Transport; Thu, 18 Jul 2019 10:05:38 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1415.2; Thu, 18 Jul 2019 10:05:12 +0000 X-Received: from E119924.Arm.com (10.1.199.124) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Thu, 18 Jul 2019 10:05:12 +0000 From: "Krzysztof Koch" To: CC: , , , , , Subject: [edk2-devel] [PATCH v1 3/8] ShellPkg: acpiview: SPCR: Remove redundant forward declaration Date: Thu, 18 Jul 2019 11:04:57 +0100 Message-ID: <20190718100502.24688-4-krzysztof.koch@arm.com> In-Reply-To: <20190718100502.24688-1-krzysztof.koch@arm.com> References: <20190718100502.24688-1-krzysztof.koch@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 590a7556-1758-4258-1556-08d70b677bcd X-MS-TrafficTypeDiagnostic: AM0PR08MB4947: X-Microsoft-Antispam-PRVS: NoDisclaimer: True X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: e+Ej7nKTqzhZtLtIU3BNVzHzRiUvBJuIpoUAJRTQ5gN6CiYzwUu3u6001cJ5Fvyb6cN74ePTU2mTLTNV08JaTNOBp2u75PyvvPqDIht08CCVhm4ciEDqyCXWB0iKk2KT/80gKlw0nH06U3bsypCwoixuSL0PkxiW4X0EddzRaFYRNYWwYWvBQYAUBDD9AF9G4929kAItjqirDoW9ADj+7RWEiTnLErFoAfxyS13zxiRtVV9Cqo893n46GmxigoZCJz3X+Os1kTu7QwNUlOHRGssje0BW1g1tlXiZc/81N/3a3Pa2gvfVxYHB4uSAGMqruo6wsB7uoOBcB5z8UCoSv0zAD0zOAjw3KI+WMuRpn3TVQhS+T5DSomOqwM3sN1k7/22x9zlCyjVXzhHUzITNQmdQKuWvvI7Rd3Oh4wfFwe0= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2019 10:05:38.2659 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 590a7556-1758-4258-1556-08d70b677bcd X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[40.67.248.234];Helo=[nebula.arm.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB4947 Precedence: Bulk List-Unsubscribe: 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,krzysztof.koch@arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1563444347; bh=C98wsVbAeRukY+l4jWq9Yq7kpM7KlyUDiYsS+z3m1OQ=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=OKfbpVk68mbbbqP8s3Pkwo1851Jo4QJ24TUSf3DePkbXcMR98moQCU6FsyyjHknSyoS ooYzwMlkkdfvTRADqu7yHTuB2yobtBWVoYJ1slFt59g/2QVv6LEVGD+s80Ome6nMYSLNT CqqdwjhD4Af2rIovBQvlE63eAXdBgz5bDyE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Reposition blocks of code to remove redundant forward function declarations in order to reduce the code size. Signed-off-by: Krzysztof Koch Reviewed-by: Alexei Fedorov Reviewed-by: Jaben Carsey Reviewed-by: Sami Mujawar Reviewed-by: Zhichao Gao --- Notes: v1: - remove redundant forward function declarations [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Spcr/SpcrParser.c | 9= 8 +++++++------------- 1 file changed, 34 insertions(+), 64 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Spcr/Spcr= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Spcr/SpcrPa= rser.c index 1974a9c046e4a3bccccc55cf758184af097b2420..3b06b05dee8c056c6e009b9e485= ccd35d4194e95 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Spcr/SpcrParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Spcr/SpcrParser.c @@ -1,7 +1,7 @@ /** @file SPCR table parser =20 - Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. + Copyright (c) 2016 - 2019, ARM Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent =20 @par Reference(s): @@ -31,7 +31,23 @@ EFIAPI ValidateInterruptType ( IN UINT8* Ptr, IN VOID* Context - ); + ) +{ +#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) + UINT8 InterruptType; + + InterruptType =3D *Ptr; + + if (InterruptType !=3D + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_GIC)= { + IncrementErrorCount (); + Print ( + L"\nERROR: InterruptType =3D %d. This must be 8 on ARM Platforms", + InterruptType + ); + } +#endif +} =20 /** This function validates the Irq. @@ -46,7 +62,22 @@ EFIAPI ValidateIrq ( IN UINT8* Ptr, IN VOID* Context - ); + ) +{ +#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) + UINT8 Irq; + + Irq =3D *Ptr; + + if (Irq !=3D 0) { + IncrementErrorCount (); + Print ( + L"\nERROR: Irq =3D %d. This must be zero on ARM Platforms\n", + Irq + ); + } +#endif +} =20 /** An ACPI_PARSER array describing the ACPI SPCR Table. @@ -76,67 +107,6 @@ STATIC CONST ACPI_PARSER SpcrParser[] =3D { {L"Reserved", 4, 76, L"%x", NULL, NULL, NULL, NULL} }; =20 -/** - This function validates the Interrupt Type. - - @param [in] Ptr Pointer to the start of the field data. - @param [in] Context Pointer to context specific information e.g. this - could be a pointer to the ACPI table header. -**/ -STATIC -VOID -EFIAPI -ValidateInterruptType ( - IN UINT8* Ptr, - IN VOID* Context - ) -{ -#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) - UINT8 InterruptType; - - InterruptType =3D *Ptr; - - if (InterruptType !=3D - EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_GIC)= { - IncrementErrorCount (); - Print ( - L"\nERROR: InterruptType =3D %d. This must be 8 on ARM Platforms", - InterruptType - ); - } -#endif -} - -/** - This function validates the Irq. - - @param [in] Ptr Pointer to the start of the field data. - @param [in] Context Pointer to context specific information e.g. this - could be a pointer to the ACPI table header. -**/ -STATIC -VOID -EFIAPI -ValidateIrq ( - IN UINT8* Ptr, - IN VOID* Context - ) -{ -#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) - UINT8 Irq; - - Irq =3D *Ptr; - - if (Irq !=3D 0) { - IncrementErrorCount (); - Print ( - L"\nERROR: Irq =3D %d. This must be zero on ARM Platforms\n", - Irq - ); - } -#endif -} - /** This function parses the ACPI SPCR table. When trace is enabled this function parses the SPCR table and -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=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 (#43929): https://edk2.groups.io/g/devel/message/43929 Mute This Topic: https://groups.io/mt/32513489/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- From nobody Fri May 3 17:27:02 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43925+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1563444342117506.25965712069217; Thu, 18 Jul 2019 03:05:42 -0700 (PDT) Return-Path: X-Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.46]) by groups.io with SMTP; Thu, 18 Jul 2019 03:05:40 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g8Lk2hynOxuS2gutifkq471NXD+Fk508uZYpRrPlobJA01dY97QJz0i9aRBXFHG79d0xVRNUjENlyeIzFn60VNbJ00tgIiwchPhNw5GDWyYL6mdIC86BQCI9ffliN7FLu3kl+YA1GP0i1yGEVtMhkDqyGfZ4CY2KeihkVOu2ddnTWBVNYTwoMUibohRINAWF5qAE96wIKH3cw4UvJpGpKGrWqJyFp399kW41TLrwoAewtsfwkU8QxcYStGZrWqNx7K9PU2/rvZ/hLP9jxBTyRUN7j4yLiOsjwe3/8mc7PtlamusnSmjw5VIyIUnnnTkmCV1VzCrklp0Ymz0fm0Pcwg== 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-SenderADCheck; bh=XalO7w01F4EPs/I/IVSzRAAgBz0y8y9FU3/YJC+cTMI=; b=dfypPTat8NuAgJHar9DRDgfE8kLkt2Fq0IjjmnBYrtiJLWfxPsvT1WbzivBe8J4Rgkkhk+2n/xgOsQ4yvQvnjAQH7IAEV4Mb1TdI5AN98tUjV5D1IEqsVQ4XttE80ApHw3+cWKvVW8ntk/7EKne5IwRMaFFDwsQndQA7GlBNGD2/MKIj9m7aMB8u3UYLdqqfrSlWRxaQP+aD0DSRWfY+7jq9P80qYZy+JUxH2uWs0G8PW/rYpTXlyeWSajSXsgylxoQV87ocnnUKkTHvDRjHh9JG5s1cfh74YxRhwc7P99HGap6+xwoYeI0H9QgWEQODoB4FhrxMjZdSKVZBkF6+DA== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=temperror (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com;dmarc=temperror action=none header.from=arm.com;dkim=none (message not signed);arc=none X-Received: from VI1PR08CA0157.eurprd08.prod.outlook.com (2603:10a6:800:d1::11) by AM0PR08MB4945.eurprd08.prod.outlook.com (2603:10a6:208:157::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2073.10; Thu, 18 Jul 2019 10:05:36 +0000 X-Received: from DB5EUR03FT021.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::204) by VI1PR08CA0157.outlook.office365.com (2603:10a6:800:d1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2094.11 via Frontend Transport; Thu, 18 Jul 2019 10:05:36 +0000 Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+43925+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) X-Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT021.mail.protection.outlook.com (10.152.20.238) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2052.18 via Frontend Transport; Thu, 18 Jul 2019 10:05:34 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1415.2; Thu, 18 Jul 2019 10:05:13 +0000 X-Received: from E119924.Arm.com (10.1.199.124) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Thu, 18 Jul 2019 10:05:13 +0000 From: "Krzysztof Koch" To: CC: , , , , , Subject: [edk2-devel] [PATCH v1 4/8] ShellPkg: acpiview: SRAT: Remove redundant forward declarations Date: Thu, 18 Jul 2019 11:04:58 +0100 Message-ID: <20190718100502.24688-5-krzysztof.koch@arm.com> In-Reply-To: <20190718100502.24688-1-krzysztof.koch@arm.com> References: <20190718100502.24688-1-krzysztof.koch@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 41e81945-80b5-403d-46c0-08d70b677999 X-MS-TrafficTypeDiagnostic: AM0PR08MB4945: X-Microsoft-Antispam-PRVS: NoDisclaimer: True X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: ol47iPM8wv6EqAUAOYoF+5ci4zfC3aw+CcV8P06jpuymuR7bnoDZT3Sa1sKKX7uuhjZTpZwybqQuuK1ht5FVBO4g4M3Z929zfzhO06HN256LH2SyuNTdlJd7QAFbmnrlUVTWhlsg4NrtmmomMgBOb+N2P/bXN9lXC0OHApN4DAqffN+j+5YOCePkiRS26VeNYCrWampA22M1bIjBJmNqboedUK1xRR0zoMOH2vs/k25U2AGzEbYbQOrunTnRlkU09oc9mzIo3G5arPLe0xn5kxknDLGxgzdY1uhHw+lLE5W+p6CPpmiCgFlpjcfnaFgTe0qtWzU06Vj6YLKkkBp2f9FHu8phP/sTsXPEfr83Oauxo8oRvD6gPAeCM6r2ZHkq2myuoORmtVJfIWSucdzjYBzNKGrveiEcSvUh39EXGmE= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2019 10:05:34.5719 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 41e81945-80b5-403d-46c0-08d70b677999 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[40.67.248.234];Helo=[nebula.arm.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB4945 Precedence: Bulk List-Unsubscribe: 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,krzysztof.koch@arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1563444341; bh=++qJftfMS+EmIXSYE1LHMZb4DhMIsQrmQBm4OOJGTBY=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=DRRGmEQX9QqbYJUWLEGkx+88xrL8Noo6xEUAFs975HfZngJi8xhMXt7LSGChcgBZ+XM TSkjF1iVnQTQnqQwjxvoB3uDIR++ZfldLd0IkZ5bMggAp4Hv+Ok+AFkbkMqCJiSBiCi1a nvbpXmzr+gC06lhKa3xETx+ZkFJE7Gj5vzQ= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Remove redundant forward function declarations by repositioning blocks of code. This way the code structure is consistent across ACPI table parsers and the code becomes more concise. Signed-off-by: Krzysztof Koch Reviewed-by: Alexei Fedorov Reviewed-by: Jaben Carsey Reviewed-by: Sami Mujawar Reviewed-by: Zhichao Gao --- Notes: v1: - remove redundant forward function declarations [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c | 6= 4 ++++++-------------- 1 file changed, 18 insertions(+), 46 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/Srat= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratPa= rser.c index 075ff2a141a82b522e8aaedb7ad79249aaf5eaac..03d28d52842040e4872e204fc10= ae3dba7861936 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c @@ -1,7 +1,7 @@ /** @file SRAT table parser =20 - Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. + Copyright (c) 2016 - 2019, ARM Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent =20 @par Reference(s): @@ -32,7 +32,13 @@ EFIAPI ValidateSratReserved ( IN UINT8* Ptr, IN VOID* Context - ); + ) +{ + if (*(UINT32*)Ptr !=3D 1) { + IncrementErrorCount (); + Print (L"\nERROR: Reserved should be 1 for backward compatibility.\n"); + } +} =20 /** This function traces the APIC Proximity Domain field. @@ -44,9 +50,16 @@ STATIC VOID EFIAPI DumpSratApicProximity ( - IN CONST CHAR16* Format, - IN UINT8* Ptr - ); + IN CONST CHAR16* Format, + IN UINT8* Ptr + ) +{ + UINT32 ProximityDomain; + + ProximityDomain =3D Ptr[0] | (Ptr[1] << 8) | (Ptr[2] << 16); + + Print (Format, ProximityDomain); +} =20 /** An ACPI_PARSER array describing the SRAT Table. @@ -139,47 +152,6 @@ STATIC CONST ACPI_PARSER SratX2ApciAffinityParser[] = =3D { {L"Reserved", 4, 20, L"0x%x", NULL, NULL, NULL, NULL} }; =20 -/** This function validates the Reserved field in the SRAT table header. - - @param [in] Ptr Pointer to the start of the field data. - @param [in] Context Pointer to context specific information e.g. this - could be a pointer to the ACPI table header. -**/ -STATIC -VOID -EFIAPI -ValidateSratReserved ( - IN UINT8* Ptr, - IN VOID* Context - ) -{ - if (*(UINT32*)Ptr !=3D 1) { - IncrementErrorCount (); - Print (L"\nERROR: Reserved should be 1 for backward compatibility.\n"); - } -} - -/** - This function traces the APIC Proximity Domain field. - - @param [in] Format Format string for tracing the data. - @param [in] Ptr Pointer to the start of the buffer. -**/ -STATIC -VOID -EFIAPI -DumpSratApicProximity ( - IN CONST CHAR16* Format, - IN UINT8* Ptr - ) -{ - UINT32 ProximityDomain; - - ProximityDomain =3D Ptr[0] | (Ptr[1] << 8) | (Ptr[2] << 16); - - Print (Format, ProximityDomain); -} - /** This function parses the ACPI SRAT table. When trace is enabled this function parses the SRAT table and -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=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 (#43925): https://edk2.groups.io/g/devel/message/43925 Mute This Topic: https://groups.io/mt/32513484/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- From nobody Fri May 3 17:27:02 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43924+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1563444342203938.6198311270158; Thu, 18 Jul 2019 03:05:42 -0700 (PDT) Return-Path: X-Received: from EUR02-HE1-obe.outbound.protection.outlook.com (EUR02-HE1-obe.outbound.protection.outlook.com [40.107.1.80]) by groups.io with SMTP; Thu, 18 Jul 2019 03:05:40 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cmM106TxrcVFCxpt4C3ZHxJnXZFaISpoKYx27x1RYwZdmVhOy1KY/hhO+j5de2nnGg/fngZleR1pGiZAtkgXUveBcOWkC2jjDEG4hKDvFPWivy83sc2mGP5cMrk3UwuQyrgZ8ovge8yTcHUghua/qDfTXRbhWZwgpTTx/++sePWYmFEG4eZxRN4WZgJXtaHVprBCU/EbSURlYEYAXlmCdNNtvu3+rwyYbN05MNtaoon3UYyMv2gTFCkDQ9hkcRPjxJEQ/M6rW2Zxvo9HBIQ8XjOq3w/2w5XXDZd987rP8+zlYoubPLoEIprqU/gqMwS+7ZYqeCZUB0amIjMxFHea/w== 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-SenderADCheck; bh=6DhMPWx6dymt2TyuOFFM0M7qq+zafpvrKmer88ibKmM=; b=DPjAZGPYEZHc9fs4MRfWbWcFM6Tk3AvKff83IKOUdvdGtfSGKmMeFdGOzEnxjaUEuFCz9RpmRnso1GG4mCzyTLKooEz2YUkgEUqmaE3oghAwdpuHwQjlcuxE1YcrhyBbILAz4/3nQQXIHuQkZjpkhscRJWKh4i6xu0S83jtYsv9xQruqHFshwUIXMan6g5vulozsQKX1Ii7aJjbpgGlZHhw6Dv2QzAuxlinrZ22pYTifGOWhDM6bx/3cbSLuO6na8MiE8nOywcsDovqGlQ2yIAn+YGLuZWZoDCbRTP3jXjlv1R9pcz8FzHwhje/I6h8wuGl59w+DgOwRBmhErOUtHg== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=temperror (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com;dmarc=temperror action=none header.from=arm.com;dkim=none (message not signed);arc=none X-Received: from VI1PR0802CA0044.eurprd08.prod.outlook.com (2603:10a6:800:a9::30) by AM5PR0802MB2596.eurprd08.prod.outlook.com (2603:10a6:203:98::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2073.14; Thu, 18 Jul 2019 10:05:36 +0000 X-Received: from DB5EUR03FT026.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::206) by VI1PR0802CA0044.outlook.office365.com (2603:10a6:800:a9::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2073.11 via Frontend Transport; Thu, 18 Jul 2019 10:05:36 +0000 Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+43924+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) X-Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT026.mail.protection.outlook.com (10.152.20.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2052.18 via Frontend Transport; Thu, 18 Jul 2019 10:05:34 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1415.2; Thu, 18 Jul 2019 10:05:13 +0000 X-Received: from E119924.Arm.com (10.1.199.124) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Thu, 18 Jul 2019 10:05:13 +0000 From: "Krzysztof Koch" To: CC: , , , , , Subject: [edk2-devel] [PATCH v1 5/8] ShellPkg: acpiview: MADT: Remove redundant forward declarations Date: Thu, 18 Jul 2019 11:04:59 +0100 Message-ID: <20190718100502.24688-6-krzysztof.koch@arm.com> In-Reply-To: <20190718100502.24688-1-krzysztof.koch@arm.com> References: <20190718100502.24688-1-krzysztof.koch@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6134dbfa-b52a-4e92-95e6-08d70b6779bd X-MS-TrafficTypeDiagnostic: AM5PR0802MB2596: X-Microsoft-Antispam-PRVS: NoDisclaimer: True X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: eLtPLIxywj4qlrFJSAy0UKq77J7NK/X/i+wPdEndxEXXujpmL2m0NgFb53j7X9tMUVxXwMK/Qd8m+NyCBTtAf8ZGvYFlq7G4+Qs/svqLjra2gFslHlp25aoXPwgZ2Veiuy+57/SH0C05zBn+Z86HvVYzrdVGMi1fHQey83Vlbv6jtDip8jhNu4Xw9nvQbkfzuobSezODYr0yAyo6lptkqam2jE6RY0JEdYe+Ot21E8QSmW7OTNo03uW8h0DqqRghxN4uhAPItNmLx0ZTji5aTPGu+L6vpxJzqlX/CtAJxrvRaJJy4H8glsatrbANCs3oz9QNexOxs0QZs78ylKqqb8X75RUu9NtI5N0ampkmuCbH9pwZDLeekmfnu5XuAyNwSrHhaLYuUqDZN4faks5LpPvWQBtYA6l8vcGtH22IniA= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2019 10:05:34.8089 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6134dbfa-b52a-4e92-95e6-08d70b6779bd X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[40.67.248.234];Helo=[nebula.arm.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2596 Precedence: Bulk List-Unsubscribe: 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,krzysztof.koch@arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1563444341; bh=OoEFz7gcb7UHhDdmhtg5vIuNHhI1JVk0N9nvmRbOCEM=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=aoriRksFPVkGg3SKqqe43qiHZh0chsUeMyVhrVNrME0vNmId2abCAFzH4fH0lriVnAp Kdmu/Tz64WQGjLr0IoR1Q43eqhDf6xQ2o9hACJSOmQCWMhxyBoth2LCe7SnFmpkRgLCIU y1JGzt9lDr0RALmohsWLzKojnbvOpL0a0Mw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Remove redundant forward function declarations by repositioning blocks of code. This way the code structure is consistent across ACPI table parsers and the code becomes more concise. Signed-off-by: Krzysztof Koch Reviewed-by: Alexei Fedorov Reviewed-by: Jaben Carsey Reviewed-by: Sami Mujawar Reviewed-by: Zhichao Gao --- Notes: v1: - remove redundant forward function declarations [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c | 1= 18 ++++++++------------ 1 file changed, 44 insertions(+), 74 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/Madt= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtPa= rser.c index 59c3df0cc8a080497b517baf36fc63f1e4ab866f..338295d30e35c366a60505225cf= 57145a8e73d93 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c @@ -35,7 +35,15 @@ EFIAPI ValidateGICDSystemVectorBase ( IN UINT8* Ptr, IN VOID* Context - ); +) +{ + if (*(UINT32*)Ptr !=3D 0) { + IncrementErrorCount (); + Print ( + L"\nERROR: System Vector Base must be zero." + ); + } +} =20 /** This function validates the SPE Overflow Interrupt in the GICC. @@ -50,7 +58,41 @@ EFIAPI ValidateSpeOverflowInterrupt ( IN UINT8* Ptr, IN VOID* Context - ); + ) +{ + UINT16 SpeOverflowInterrupt; + + SpeOverflowInterrupt =3D *(UINT16*)Ptr; + + // SPE not supported by this processor + if (SpeOverflowInterrupt =3D=3D 0) { + return; + } + + if ((SpeOverflowInterrupt < ARM_PPI_ID_MIN) || + ((SpeOverflowInterrupt > ARM_PPI_ID_MAX) && + (SpeOverflowInterrupt < ARM_PPI_ID_EXTENDED_MIN)) || + (SpeOverflowInterrupt > ARM_PPI_ID_EXTENDED_MAX)) { + IncrementErrorCount (); + Print ( + L"\nERROR: SPE Overflow Interrupt ID of %d is not in the allowed PPI= ID " + L"ranges of %d-%d or %d-%d (for GICv3.1 or later).", + SpeOverflowInterrupt, + ARM_PPI_ID_MIN, + ARM_PPI_ID_MAX, + ARM_PPI_ID_EXTENDED_MIN, + ARM_PPI_ID_EXTENDED_MAX + ); + } else if (SpeOverflowInterrupt !=3D ARM_PPI_ID_PMBIRQ) { + IncrementWarningCount(); + Print ( + L"\nWARNING: SPE Overflow Interrupt ID of %d is not compliant with S= BSA " + L"Level 3 PPI ID assignment: %d.", + SpeOverflowInterrupt, + ARM_PPI_ID_PMBIRQ + ); + } +} =20 /** An ACPI_PARSER array describing the GICC Interrupt Controller Structure. @@ -158,78 +200,6 @@ STATIC CONST ACPI_PARSER MadtInterruptControllerHeader= Parser[] =3D { {L"Reserved", 2, 2, NULL, NULL, NULL, NULL, NULL} }; =20 -/** - This function validates the System Vector Base in the GICD. - - @param [in] Ptr Pointer to the start of the field data. - @param [in] Context Pointer to context specific information e.g. this - could be a pointer to the ACPI table header. -**/ -STATIC -VOID -EFIAPI -ValidateGICDSystemVectorBase ( - IN UINT8* Ptr, - IN VOID* Context -) -{ - if (*(UINT32*)Ptr !=3D 0) { - IncrementErrorCount (); - Print ( - L"\nERROR: System Vector Base must be zero." - ); - } -} - -/** - This function validates the SPE Overflow Interrupt in the GICC. - - @param [in] Ptr Pointer to the start of the field data. - @param [in] Context Pointer to context specific information e.g. this - could be a pointer to the ACPI table header. -**/ -STATIC -VOID -EFIAPI -ValidateSpeOverflowInterrupt ( - IN UINT8* Ptr, - IN VOID* Context - ) -{ - UINT16 SpeOverflowInterrupt; - - SpeOverflowInterrupt =3D *(UINT16*)Ptr; - - // SPE not supported by this processor - if (SpeOverflowInterrupt =3D=3D 0) { - return; - } - - if ((SpeOverflowInterrupt < ARM_PPI_ID_MIN) || - ((SpeOverflowInterrupt > ARM_PPI_ID_MAX) && - (SpeOverflowInterrupt < ARM_PPI_ID_EXTENDED_MIN)) || - (SpeOverflowInterrupt > ARM_PPI_ID_EXTENDED_MAX)) { - IncrementErrorCount (); - Print ( - L"\nERROR: SPE Overflow Interrupt ID of %d is not in the allowed PPI= ID " - L"ranges of %d-%d or %d-%d (for GICv3.1 or later).", - SpeOverflowInterrupt, - ARM_PPI_ID_MIN, - ARM_PPI_ID_MAX, - ARM_PPI_ID_EXTENDED_MIN, - ARM_PPI_ID_EXTENDED_MAX - ); - } else if (SpeOverflowInterrupt !=3D ARM_PPI_ID_PMBIRQ) { - IncrementWarningCount(); - Print ( - L"\nWARNING: SPE Overflow Interrupt ID of %d is not compliant with S= BSA " - L"Level 3 PPI ID assignment: %d.", - SpeOverflowInterrupt, - ARM_PPI_ID_PMBIRQ - ); - } -} - /** This function parses the ACPI MADT table. When trace is enabled this function parses the MADT table and -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=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 (#43924): https://edk2.groups.io/g/devel/message/43924 Mute This Topic: https://groups.io/mt/32513483/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- From nobody Fri May 3 17:27:02 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43932+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1563444401602254.9028707694431; Thu, 18 Jul 2019 03:06:41 -0700 (PDT) Return-Path: X-Received: from EUR03-AM5-obe.outbound.protection.outlook.com (EUR03-AM5-obe.outbound.protection.outlook.com [40.107.3.83]) by groups.io with SMTP; Thu, 18 Jul 2019 03:06:40 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e1LNWEQ1Cv9mItdqHW/fw+bdhyBOkpC8OcD/Fb6hsYzqLJPuqYF+P7g+p5coy0wlrv5tDsFfPC+oW1rEOd65xP1dK266yPKVD0w4z6h/BO1TDfRoT4ha13ecqNauPmK3nm60KpiB6ln2tt13iDCQyG3RmyISAs/ee8LRc+gINAfaexsjcNVj1CYXVBvRTO3ovlXZFUbsNj/BFnLholSy9SAWK8q44cj9lBCc0hE2QaMgUgL4IHafuN/h6SP7/vrqAUWEw6z0wnFFdn3dHjt1QF8mWBPnVE6OespoBqPTBA/JLHbHFwtbCRvNx1qu/1thbe5KNCCaS6rA+/mTts5RDg== 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-SenderADCheck; bh=XsgML4vFHJ5VbN+aUHbLX+ZSf06+82jHp/fBPCn1/PE=; b=dHmFGLZ2w0CgczDXJvXMZTSI9SWB5d5/O/dUF2cBLBjPgfY6W0Oy88G17sxL7FPv16JeOvSCNf2zlq77Wz0BmAO+5jPWYwjqi6TJoawYWm3qWc0yaXgj1dYZWpnvYbDOzGW5WriP0FFXiQ2inbsKHGMoONkrLybTqTRF9cIOkZl87+2RwQRzQiwB825+/EleWy0x6ZjZHA9KCVPx/cBmMrmNWXn2+C/eBbuFbInD/yn/VnNYEM5HJ54IJzmvS9anaRxK0+MmeipvdZfTAiUV/xeAwwkHpkPOb9G8oDU/VOYKS6eqXGes7quCNdAqUyuBvZauLSVNC9shHcHLiyHA6g== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=temperror (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com;dmarc=temperror action=none header.from=arm.com;dkim=none (message not signed);arc=none X-Received: from VI1PR08CA0263.eurprd08.prod.outlook.com (2603:10a6:803:dc::36) by AM5PR0801MB1842.eurprd08.prod.outlook.com (2603:10a6:203:3c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.12; Thu, 18 Jul 2019 10:06:36 +0000 X-Received: from DB5EUR03FT004.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::206) by VI1PR08CA0263.outlook.office365.com (2603:10a6:803:dc::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2094.11 via Frontend Transport; Thu, 18 Jul 2019 10:06:36 +0000 Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+43932+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) X-Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT004.mail.protection.outlook.com (10.152.20.128) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2052.18 via Frontend Transport; Thu, 18 Jul 2019 10:06:34 +0000 X-Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1415.2; Thu, 18 Jul 2019 10:05:14 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1415.2; Thu, 18 Jul 2019 10:05:13 +0000 X-Received: from E119924.Arm.com (10.1.199.124) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Thu, 18 Jul 2019 10:05:13 +0000 From: "Krzysztof Koch" To: CC: , , , , , Subject: [edk2-devel] [PATCH v1 6/8] ShellPkg: acpiview: IORT: Remove redundant forward declarations Date: Thu, 18 Jul 2019 11:05:00 +0100 Message-ID: <20190718100502.24688-7-krzysztof.koch@arm.com> In-Reply-To: <20190718100502.24688-1-krzysztof.koch@arm.com> References: <20190718100502.24688-1-krzysztof.koch@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7aeb3842-b835-4f15-94ec-08d70b679d49 X-MS-TrafficTypeDiagnostic: AM5PR0801MB1842: X-Microsoft-Antispam-PRVS: NoDisclaimer: True X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: zdwAK57VbImy5BT1SWOimfOW98pfILZcvMq//rEJrto4c7f2opkMwJfvcHz0LZJxbH65lm2iReTw9K6TlJp01bQylzdRhykxFLeMgpXAGsv6/79AvvrAXTVBBnK8EmKw3p2Oz8HTg3x2FBXd48Pam85I924jT+Qaro7vb4UcP/xdrQ40wN7rGgvNulB0GXVnpaxUVeht4indx1z2FPsfUBoKaV48UaE6btJWZaNmyRMtZR2ukzXsZqKXJ2E3x9wGq51o5l0dx3Nq+wF9sgn2fI8kigTpSzmlmuQotLkKxasVRUbKUyb80VpQhLQXQG5zDANXKuYx7pyKLrVq5Oqv6TPLjAX6EfnZuFPFqaV6vXbIFp7hpBGeJFMWr+bni+vZVfzORfe0Wv/v1LGFkehMipI7vs17Fc8AD05O5ECi7xs= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2019 10:06:34.4466 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7aeb3842-b835-4f15-94ec-08d70b679d49 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[40.67.248.234];Helo=[nebula.arm.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1842 Precedence: Bulk List-Unsubscribe: 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,krzysztof.koch@arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1563444401; bh=/g/cxwC4wnWhcg4B5VkBhOSg7X9yKqnb2eArK0jQpXE=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=Z5iSIOh01IprP6GmgWA1x1l1P6BrBfluvW7EsrRfeuithjb9drYrPnAbCE74hxZq9QW jznsAvdidCo2G0/+CWrIhOdJsVcgX66qp5DQVk0ySG9nEGe6tjTDtBTSsi86sz+IqHPC0 VQdxTDR5u59OoOl1kHtlIAStX7KMe8Q44Is= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Remove redundant forward function declarations by repositioning blocks of code. This way the code structure is consistent across ACPI table parsers and the code becomes more concise. Signed-off-by: Krzysztof Koch Reviewed-by: Alexei Fedorov Reviewed-by: Jaben Carsey Reviewed-by: Sami Mujawar Reviewed-by: Zhichao Gao --- Notes: v1: - remove redundant forward function declarations [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c | 5= 8 +++++--------------- 1 file changed, 14 insertions(+), 44 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/Iort= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortPa= rser.c index 93f78e1a9786ed53f6b5529f478b72a220b4f8df..0461205b4f8bc02aa11ab1db1d0= deb73bce053b7 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c @@ -45,7 +45,13 @@ EFIAPI ValidateItsIdMappingCount ( IN UINT8* Ptr, IN VOID* Context - ); + ) +{ + if (*(UINT32*)Ptr !=3D 0) { + IncrementErrorCount (); + Print (L"\nERROR: IORT ID Mapping count must be zero."); + } +} =20 /** This function validates the ID Mapping array offset for the ITS node. @@ -60,7 +66,13 @@ EFIAPI ValidateItsIdArrayReference ( IN UINT8* Ptr, IN VOID* Context - ); + ) +{ + if (*(UINT32*)Ptr !=3D 0) { + IncrementErrorCount (); + Print (L"\nERROR: IORT ID Mapping offset must be zero."); + } +} =20 /** Helper Macro for populating the IORT Node header in the ACPI_PARSER arra= y. @@ -210,48 +222,6 @@ STATIC CONST ACPI_PARSER IortNodePmcgParser[] =3D { {L"Node reference", 4, 28, L"0x%x", NULL, NULL, NULL, NULL}, }; =20 -/** - This function validates the ID Mapping array count for the ITS node. - - @param [in] Ptr Pointer to the start of the field data. - @param [in] Context Pointer to context specific information e.g. this - could be a pointer to the ACPI table header. -**/ -STATIC -VOID -EFIAPI -ValidateItsIdMappingCount ( - IN UINT8* Ptr, - IN VOID* Context - ) -{ - if (*(UINT32*)Ptr !=3D 0) { - IncrementErrorCount (); - Print (L"\nERROR: IORT ID Mapping count must be zero."); - } -} - -/** - This function validates the ID Mapping array offset for the ITS node. - - @param [in] Ptr Pointer to the start of the field data. - @param [in] Context Pointer to context specific information e.g. this - could be a pointer to the ACPI table header. -**/ -STATIC -VOID -EFIAPI -ValidateItsIdArrayReference ( - IN UINT8* Ptr, - IN VOID* Context - ) -{ - if (*(UINT32*)Ptr !=3D 0) { - IncrementErrorCount (); - Print (L"\nERROR: IORT ID Mapping offset must be zero."); - } -} - /** This function parses the IORT Node Id Mapping array. =20 -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=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 (#43932): https://edk2.groups.io/g/devel/message/43932 Mute This Topic: https://groups.io/mt/32513494/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- From nobody Fri May 3 17:27:02 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43927+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1563444343465939.743869666564; Thu, 18 Jul 2019 03:05:43 -0700 (PDT) Return-Path: X-Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.82]) by groups.io with SMTP; Thu, 18 Jul 2019 03:05:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y/tkr8eMCWfuSH5riAkFZCgnZ+yemEOd40w8soyVuykOPxPKmsCsEDniVKmTyV1As8ORdMNO3Nn2Irx1lkRRcziv7F8qtXvRORyeEuTGs0NVGklA0o976b5YsefqjAUMng1pNmhiRbo4FvdlMToVaT1rKURkxQEtiSEbhx226jWes0a2zR1vq+fP2Fb/ph9D+hGa57+8bnFblyQLfrwWEC0rjJL/Va+JdZ/N+AgTQuqF2VzFrI38jpImqr3RI+w9KNNQmUSejPwD3THfktviD0/EtZ+pzLPV0gqRVR43nnYDqIgUhbndnWQbkNzOPcL0sy7bblHdQ9m1CStf++Pz5w== 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-SenderADCheck; bh=0EfnCZwCaBwZC3b9d7LgQCGdrSfa5rWM024vFXyvGOU=; b=N22+xoo/vGS/V5m3Zcsd6n30xe26QvUYFcawFLAoToJWKaxPfnEWagWHZNzoiHt3IBg8x4dLLbLC3OWVYfFkRSOYLBt+vsS6ZFNiZsukJtIbBYJBGAQVUa0SKZBYqTZz2JqPF6xLXkljWVkSktWVF3WJwLjSRNcFQcbmopWz64SC1F5O9d8kUS0OgYAiMr2XmHRuLLuzlxNz05mu3R5JW6UhhaGH/F0wAR0PKDOGqOihy4hlI0q1n8QBxz43Hn/6Uzp/r+JzyPoCcRq/hN7vgiI2DPKuE257wr789oPApoKEPYeBsr9V3wZLZGiNs0I/sOqksUYSmy0NEY5e8pVHpg== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=temperror (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com;dmarc=temperror action=none header.from=arm.com;dkim=none (message not signed);arc=none X-Received: from VI1PR0802CA0043.eurprd08.prod.outlook.com (2603:10a6:800:a9::29) by AM6PR08MB4949.eurprd08.prod.outlook.com (2603:10a6:20b:e1::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.12; Thu, 18 Jul 2019 10:05:38 +0000 X-Received: from DB5EUR03FT026.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::202) by VI1PR0802CA0043.outlook.office365.com (2603:10a6:800:a9::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2073.11 via Frontend Transport; Thu, 18 Jul 2019 10:05:38 +0000 Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+43927+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) X-Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT026.mail.protection.outlook.com (10.152.20.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2052.18 via Frontend Transport; Thu, 18 Jul 2019 10:05:36 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1415.2; Thu, 18 Jul 2019 10:05:14 +0000 X-Received: from E119924.Arm.com (10.1.199.124) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Thu, 18 Jul 2019 10:05:13 +0000 From: "Krzysztof Koch" To: CC: , , , , , Subject: [edk2-devel] [PATCH v1 7/8] ShellPkg: acpiview: GTDT: Remove redundant forward declarations Date: Thu, 18 Jul 2019 11:05:01 +0100 Message-ID: <20190718100502.24688-8-krzysztof.koch@arm.com> In-Reply-To: <20190718100502.24688-1-krzysztof.koch@arm.com> References: <20190718100502.24688-1-krzysztof.koch@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4c6a6a2c-670d-487f-b815-08d70b677aec X-MS-TrafficTypeDiagnostic: AM6PR08MB4949: X-Microsoft-Antispam-PRVS: NoDisclaimer: True X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: CpYlP0CThM3d8T6i/FRFs+GyaH8ovB4sa2Sxp7s+eaxCyNtu22JYt4wRdPt4NuPjZi5vsvsfFcIP/BQjmE1+iNm4SqKcEjz6ZSEziBUaXJDPKKcMqQpKoGCumXRnvIy3jaaDF8RUoxDkvQ66CbjnY36hgu9SOTh4xjS/GAVi0kVRR345qh/boVgHuzAOzp0aaHA0HWNKriqbrvKFs0IGPHN2K4yvwFkhBSR7Cabg1RNHdGkZZZ7wIdR2ylhg93YOX+53dfpd5BNzkUYdWyHwGfaGtmX3qnlIOXL/s/rDDME4PYWOiikjl1kRvEMBipBRXO7lH1LYsrmq6zScQDGQBBSDlTYnIeZFz2X9qwiL+LVY7D9b4VWsOmyu19T5DmSt71oABx9g9/zGCl8WKyH5mQLKaFGqXaZhYcBK7HmLUhs= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2019 10:05:36.7955 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4c6a6a2c-670d-487f-b815-08d70b677aec X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[40.67.248.234];Helo=[nebula.arm.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4949 Precedence: Bulk List-Unsubscribe: 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,krzysztof.koch@arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1563444343; bh=uPBRGfCARvetpZf9Ny9sy0D5WA/4QZo/BiYJ2ci23KA=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=CUJttwLdI9HftQ3S5ran6za1WnjWcyOtfSrPB2ApzLdAi23xc6FKAWFf1XWFWdfX4FZ Dtfg5RSvT6Qpg9mDEjTZswDUfpIxe3n2Iuy2WboP4emljrrGWYjWApTunQrSGfeW11hnr 08u4JXA/DSMHroUEehZwKcWePMucYj2lyUw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Remove redundant forward function declarations by repositioning blocks of code. This way the code structure is consistent across ACPI table parsers and the code becomes more concise. Replace multple use of literal values for GT Block Timer Frame count/number validation with a macro definition. Signed-off-by: Krzysztof Koch Reviewed-by: Alexei Fedorov Reviewed-by: Jaben Carsey Reviewed-by: Sami Mujawar Reviewed-by: Zhichao Gao --- Notes: v1: - remove redundant forward function declarations [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c | 9= 1 +++++++------------- 1 file changed, 33 insertions(+), 58 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/Gtdt= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtPa= rser.c index 3b05ff3015d4a3af62dd9fab057c32369a456267..1e5b5764f50a2d29aa904c889bc= 89af5bdc3af5c 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c @@ -13,6 +13,9 @@ #include "AcpiParser.h" #include "AcpiTableParser.h" =20 +// "The number of GT Block Timers must be less than or equal to 8" +#define GT_BLOCK_TIMER_COUNT_MAX 8 + // Local variables STATIC CONST UINT32* GtdtPlatformTimerCount; STATIC CONST UINT32* GtdtPlatformTimerOffset; @@ -36,7 +39,21 @@ EFIAPI ValidateGtBlockTimerCount ( IN UINT8* Ptr, IN VOID* Context - ); + ) +{ + UINT32 BlockTimerCount; + + BlockTimerCount =3D *(UINT32*)Ptr; + + if (BlockTimerCount > GT_BLOCK_TIMER_COUNT_MAX) { + IncrementErrorCount (); + Print ( + L"\nERROR: Timer Count =3D %d. Max Timer Count is %d.", + BlockTimerCount, + GT_BLOCK_TIMER_COUNT_MAX + ); + } +} =20 /** This function validates the GT Frame Number. @@ -51,7 +68,21 @@ EFIAPI ValidateGtFrameNumber ( IN UINT8* Ptr, IN VOID* Context - ); + ) +{ + UINT8 FrameNumber; + + FrameNumber =3D *(UINT8*)Ptr; + + if (FrameNumber >=3D GT_BLOCK_TIMER_COUNT_MAX) { + IncrementErrorCount (); + Print ( + L"\nERROR: GT Frame Number =3D %d. GT Frame Number must be in range = 0-%d.", + FrameNumber, + GT_BLOCK_TIMER_COUNT_MAX - 1 + ); + } +} =20 /** An ACPI_PARSER array describing the ACPI GTDT Table. @@ -134,62 +165,6 @@ STATIC CONST ACPI_PARSER SBSAGenericWatchdogParser[] = =3D { {L"Watchdog Timer Flags", 4, 24, L"0x%x", NULL, NULL, NULL, NULL} }; =20 -/** - This function validates the GT Block timer count. - - @param [in] Ptr Pointer to the start of the field data. - @param [in] Context Pointer to context specific information e.g. this - could be a pointer to the ACPI table header. -**/ -STATIC -VOID -EFIAPI -ValidateGtBlockTimerCount ( - IN UINT8* Ptr, - IN VOID* Context - ) -{ - UINT32 BlockTimerCount; - - BlockTimerCount =3D *(UINT32*)Ptr; - - if (BlockTimerCount > 8) { - IncrementErrorCount (); - Print ( - L"\nERROR: Timer Count =3D %d. Max Timer Count is 8.", - BlockTimerCount - ); - } -} - -/** - This function validates the GT Frame Number. - - @param [in] Ptr Pointer to the start of the field data. - @param [in] Context Pointer to context specific information e.g. this - could be a pointer to the ACPI table header. -**/ -STATIC -VOID -EFIAPI -ValidateGtFrameNumber ( - IN UINT8* Ptr, - IN VOID* Context - ) -{ - UINT8 FrameNumber; - - FrameNumber =3D *(UINT8*)Ptr; - - if (FrameNumber > 7) { - IncrementErrorCount (); - Print ( - L"\nERROR: GT Frame Number =3D %d. GT Frame Number must be in range = 0-7.", - FrameNumber - ); - } -} - /** This function parses the Platform GT Block. =20 -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=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 (#43927): https://edk2.groups.io/g/devel/message/43927 Mute This Topic: https://groups.io/mt/32513486/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- From nobody Fri May 3 17:27:02 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43930+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1563444386345642.241414107225; Thu, 18 Jul 2019 03:06:26 -0700 (PDT) Return-Path: X-Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.46]) by groups.io with SMTP; Thu, 18 Jul 2019 03:06:25 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XYIs2spB2L8KvCTApmcwJaccKEQo4PupJ60O21jkFCgGuBuxLTcjFO2D3QvtYybDa5Jj986ucyUAgYrEgsgGP6y5hkZK6CAph1ZHBTLh9wB4xKuyc9XgSMQ8itG4iTB8dUkNMNnUW0xe3GiYIV6qwBFsOZWJUbUw95ahkBUBuSBS7NKtj/CKJaBA44xloeQnmVCGU3bv15U/zZ/+TjwqSxnoZlQmmVl5R3QmUJMqqIY8N6X3kIIo7cT++3BC7XjzQ47+ci2VDgcHZVBQeslNpAPddQ9VQuEIt8cHuFKlMwMSjDhFYZtwzZ8obza4M9QGz+FxY1wc10DlCY944KS8nw== 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-SenderADCheck; bh=kEavClE2mhVFG2lg7ChxJmoEd58ZJRQDL63NDyqx7Qw=; b=W6dUjcVYuzkqlydAR/zULqo2xUGDgvLD5g6jXktqLdeGndJXPhxwjKLLk/mofg0s7AfEXFh6n7qabF5+6s/jHBdINeD6NjehPj7+mLLfbT2HKXhjkwM+wLvsvX2OGdf9h+ImbBeuAFqYXQN4SWkBymChqEChea4r1e0S4+zbvws86Y70gQ8qfdajCgMGhphV5lZqtV9NsRwRQaJpLxCBs3WNgsgqwyt4k46LWRsld3+sFXAj23F5T5IMrjN7+za/rqT7BWkRrrHHZ1Q2n6v6GwT8VXvQDeN4y2BUpycA3rtQcNrfT10w16GS0Wd7BayvUoBG/aBxXaW/uv6YWMFL3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=temperror (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com;dmarc=temperror action=none header.from=arm.com;dkim=none (message not signed);arc=none X-Received: from VI1PR08CA0116.eurprd08.prod.outlook.com (2603:10a6:800:d4::18) by DB8PR08MB4955.eurprd08.prod.outlook.com (2603:10a6:10:38::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2073.14; Thu, 18 Jul 2019 10:06:22 +0000 X-Received: from DB5EUR03FT061.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::208) by VI1PR08CA0116.outlook.office365.com (2603:10a6:800:d4::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2094.12 via Frontend Transport; Thu, 18 Jul 2019 10:06:21 +0000 Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+43930+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) X-Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT061.mail.protection.outlook.com (10.152.21.234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2052.18 via Frontend Transport; Thu, 18 Jul 2019 10:06:20 +0000 X-Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1415.2; Thu, 18 Jul 2019 10:05:14 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1415.2; Thu, 18 Jul 2019 10:05:14 +0000 X-Received: from E119924.Arm.com (10.1.199.124) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Thu, 18 Jul 2019 10:05:14 +0000 From: "Krzysztof Koch" To: CC: , , , , , Subject: [edk2-devel] [PATCH v1 8/8] ShellPkg: acpiview: DBG2: Remove redundant forward declarations Date: Thu, 18 Jul 2019 11:05:02 +0100 Message-ID: <20190718100502.24688-9-krzysztof.koch@arm.com> In-Reply-To: <20190718100502.24688-1-krzysztof.koch@arm.com> References: <20190718100502.24688-1-krzysztof.koch@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6c89aa68-0dd7-4d7f-d24c-08d70b679536 X-MS-TrafficTypeDiagnostic: DB8PR08MB4955: X-Microsoft-Antispam-PRVS: NoDisclaimer: True X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: C1dpWDLIjd62vfiRfALvddOQpmGKAfb8yiCaCOYANGU4//v3Lyc71vVnkYraS6Gow8XTmnGDus1HRaR8f3TcqTaUlAj/I2u02sbU85mNTH7/6815Hhll9NEh426qhH+m3bSuxl0/9cIbxl0pbVbhoUyHE9cuiJNr7nC1kBUu7ftP1va0Fdd8DzpQYWk7CsNt/aOJas34Q0Eo9jU6rvAYPY9dJzbMMtxnr4t2Dy+iuRA0dBPqslhQ0MJi94OLkxFFJ7rFgkrauiNWgmfI6KiV7b1mI8m0tELAKbXqrX79nh/nXSS1NE8FPK055adkb8w35iSCeKg8m8S3R1BjOtSAwPMYWS6pQ/zQhuLKm3LTXsQhNAsoXbetNfJLEQBTvSg9nha7LeqiW12HHF0VTdq5yd910CqAXSbieEXDhm5pjSc= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2019 10:06:20.9029 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6c89aa68-0dd7-4d7f-d24c-08d70b679536 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[40.67.248.234];Helo=[nebula.arm.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB4955 Precedence: Bulk List-Unsubscribe: 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,krzysztof.koch@arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1563444385; bh=N2WdjvjFXocF4C0y0rEgbLvdjlRa9sYPCHxvcACOe2g=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=s8/WOe3EZOClUZ40VsPlyAWA1nGmPqQMcthGiK3Lfnb2LXBIQTLrg7yONdOxHr0BvpZ l8qDmvT/BRv+t9wcPzztkPYac1VV676axbZWEHcE2JrPT+hH9xKGu+LzA/F3abiLxyXMw +bTaEZoThWDI83D+VZG3kh7jzySK2QD0wtE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Remove redundant forward function declarations by repositioning blocks of code. This way the code structure is consistent across ACPI table parsers and the code becomes more concise. Signed-off-by: Krzysztof Koch Reviewed-by: Alexei Fedorov Reviewed-by: Jaben Carsey Reviewed-by: Sami Mujawar Reviewed-by: Zhichao Gao --- Notes: v1: - remove redundant forward function declarations [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Dbg2Parser.c | 6= 2 +++++--------------- 1 file changed, 16 insertions(+), 46 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Dbg2= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Dbg2Pa= rser.c index 8de5ebf74775bab8e765849cba6ef4eb6f659a5a..1efcbd40f86efdabed2152540a4= 15db8a950fb71 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Dbg2Parser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Dbg2Parser.c @@ -27,7 +27,7 @@ STATIC CONST UINT16* AddrSizeOffset; STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; =20 /** - This function Validates the NameSpace string length. + This function validates the NameSpace string length. =20 @param [in] Ptr Pointer to the start of the buffer. @param [in] Context Pointer to context specific information e.g. this @@ -37,24 +37,23 @@ STATIC VOID EFIAPI ValidateNameSpaceStrLen ( - IN UINT8* Ptr, - IN VOID* Context - ); + IN UINT8* Ptr, + IN VOID* Context + ) +{ + UINT16 NameSpaceStrLen; =20 -/** - This function parses the debug device information structure. + NameSpaceStrLen =3D *(UINT16*)Ptr; =20 - @param [in] Ptr Pointer to the start of the buffer. - @param [out] Length Pointer in which the length of the debug - device information is returned. -**/ -STATIC -VOID -EFIAPI -DumpDbgDeviceInfo ( - IN UINT8* Ptr, - OUT UINT32* Length - ); + if (NameSpaceStrLen < 2) { + IncrementErrorCount (); + Print ( + L"\nERROR: NamespaceString Length =3D %d. If no Namespace device exi= sts, " \ + L"NamespaceString[] must contain a period '.'", + NameSpaceStrLen + ); + } +} =20 /// An ACPI_PARSER array describing the ACPI DBG2 table. STATIC CONST ACPI_PARSER Dbg2Parser[] =3D { @@ -91,35 +90,6 @@ STATIC CONST ACPI_PARSER DbgDevInfoParser[] =3D { (VOID**)&AddrSizeOffset, NULL, NULL} }; =20 -/** - This function validates the NameSpace string length. - - @param [in] Ptr Pointer to the start of the buffer. - @param [in] Context Pointer to context specific information e.g. this - could be a pointer to the ACPI table header. -**/ -STATIC -VOID -EFIAPI -ValidateNameSpaceStrLen ( - IN UINT8* Ptr, - IN VOID* Context - ) -{ - UINT16 NameSpaceStrLen; - - NameSpaceStrLen =3D *(UINT16*)Ptr; - - if (NameSpaceStrLen < 2) { - IncrementErrorCount (); - Print ( - L"\nERROR: NamespaceString Length =3D %d. If no Namespace device exi= sts,\n" - L" then NamespaceString[] must contain a period '.'", - NameSpaceStrLen - ); - } -} - /** This function parses the debug device information structure. =20 -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=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 (#43930): https://edk2.groups.io/g/devel/message/43930 Mute This Topic: https://groups.io/mt/32513492/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-