From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=zM5dID+b; spf=pass (domain: arm.com, ip: 40.107.1.87, mailfrom: krzysztof.koch@arm.com) 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8hshQxlY34JTBiPz2TBd4qnjE8g3SrSeSQHLryZWqU0=; b=zM5dID+byzVT3d9tDi/4xltujVxNU7NPjtdotuNri0EgWsr5/1bifx2mLeK55kontGPqvCnu4X3SCHdvSuaSyVw5lvlWIEmyG/P/rfYDV85jqJdDp4ClCcVw5P0JLDZ7Sipq29QRZv0EilwBRdsOjGCmUmj8onYlvqMlEIm5OqM= 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 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 Authentication-Results: spf=temperror (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=temperror action=none header.from=arm.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) 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 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 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: [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> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: <20190718100502.24688-1-krzysztof.koch@arm.com> References: <20190718100502.24688-1-krzysztof.koch@arm.com> Return-Path: Krzysztof.Koch@arm.com MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:40.67.248.234;IPV:NLI;CTRY:IE;EFV:NLI;SFV:NSPM;SFS:(10009020)(4636009)(136003)(39860400002)(376002)(346002)(396003)(2980300002)(189003)(199004)(50466002)(8936002)(26005)(50226002)(7696005)(68736007)(51416003)(8676002)(86362001)(186003)(76176011)(47776003)(53416004)(478600001)(426003)(6666004)(63350400001)(356004)(63370400001)(336012)(81156014)(476003)(81166006)(2616005)(48376002)(1076003)(126002)(305945005)(2351001)(44832011)(11346002)(5660300002)(4326008)(2906002)(6916009)(16586007)(316002)(36756003)(53936002)(54906003)(70206006)(70586007)(486006)(446003);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR0802MB2601;H:nebula.arm.com;FPR:;SPF:TempError;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 488a28c9-6961-4ed0-f4d3-08d70b677a1a X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328);SRVR:HE1PR0802MB2601; X-MS-TrafficTypeDiagnostic: HE1PR0802MB2601: X-Microsoft-Antispam-PRVS: NoDisclaimer: True X-MS-Oob-TLC-OOBClassifiers: OLM:2331; X-Forefront-PRVS: 01026E1310 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 Content-Type: text/plain 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 --- Notes: v1: - remove redundant forward function declarations [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c | 116 ++++++++------------ 1 file changed, 43 insertions(+), 73 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c index 586de7cbfb12f856c0c735b6e295c1cc32eb2ceb..4bf928139a507d0b8f203ed0cbf0863cc2ec5de5 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 - 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 @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 Platforms + // 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 = *(UINT32*)Ptr; + + if (RsdtAddr != 0) { + IncrementErrorCount (); + Print ( + L"\nERROR: Rsdt Address = 0x%p. This must be NULL on ARM Platforms.", + RsdtAddr + ); + } +#endif +} /** 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 Platforms + // 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 = *(UINT64*)Ptr; + + if (XsdtAddr == 0) { + IncrementErrorCount (); + Print ( + L"\nERROR: Xsdt Address = 0x%p. This must not be NULL on ARM Platforms.", + XsdtAddr + ); + } +#endif +} /** An array describing the ACPI RSDP Table. @@ -61,76 +101,6 @@ STATIC CONST ACPI_PARSER RsdpParser[] = { {L"Reserved", 3, 33, L"%x %x %x", Dump3Chars, NULL, NULL, NULL} }; -/** - 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 Platforms - // 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 = *(UINT32*)Ptr; - - if (RsdtAddr != 0) { - IncrementErrorCount (); - Print ( - L"\nERROR: Rsdt Address = 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 Platforms - // 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 = *(UINT64*)Ptr; - - if (XsdtAddr == 0) { - IncrementErrorCount (); - Print ( - L"\nERROR: Xsdt Address = 0x%p. This must not be NULL on ARM Platforms.", - XsdtAddr - ); - } -#endif -} - /** This function parses the ACPI RSDP table. -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'