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=WZM0qZ/8; spf=pass (domain: arm.com, ip: 40.107.1.80, mailfrom: krzysztof.koch@arm.com) 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 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=6DhMPWx6dymt2TyuOFFM0M7qq+zafpvrKmer88ibKmM=; b=WZM0qZ/8Wdrc1ZF7ksoryXyt153sO+Mjgg/yNhg1Bn8yDFQV1TOBsE1t+x77m+CHCPHWir2g1D3o0KQSInWsuoWEvmE7x9vxdJiQbPZ/KDlVJCk3umy16z2K5aHPGfh3Lot/vCjVcUcMoPeZYcPVHsOg7x3msvILPFPfrnY1SvU= 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 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 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 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 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 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: [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> 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)(396003)(346002)(376002)(2980300002)(199004)(189003)(26005)(356004)(6666004)(54906003)(2616005)(8676002)(70206006)(86362001)(446003)(81166006)(44832011)(486006)(11346002)(8936002)(81156014)(50226002)(478600001)(7696005)(2351001)(51416003)(47776003)(68736007)(336012)(2906002)(48376002)(16586007)(5660300002)(4326008)(6916009)(305945005)(36756003)(186003)(1076003)(126002)(426003)(476003)(53416004)(63370400001)(50466002)(316002)(63350400001)(53936002)(70586007)(76176011);DIR:OUT;SFP:1101;SCL:1;SRVR:AM5PR0802MB2596;H:nebula.arm.com;FPR:;SPF:TempError;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6134dbfa-b52a-4e92-95e6-08d70b6779bd X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328);SRVR:AM5PR0802MB2596; X-MS-TrafficTypeDiagnostic: AM5PR0802MB2596: X-Microsoft-Antispam-PRVS: NoDisclaimer: True X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-Forefront-PRVS: 01026E1310 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 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/Madt/MadtParser.c | 118 ++++++++------------ 1 file changed, 44 insertions(+), 74 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c index 59c3df0cc8a080497b517baf36fc63f1e4ab866f..338295d30e35c366a60505225cf57145a8e73d93 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 != 0) { + IncrementErrorCount (); + Print ( + L"\nERROR: System Vector Base must be zero." + ); + } +} /** 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 = *(UINT16*)Ptr; + + // SPE not supported by this processor + if (SpeOverflowInterrupt == 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 != ARM_PPI_ID_PMBIRQ) { + IncrementWarningCount(); + Print ( + L"\nWARNING: SPE Overflow Interrupt ID of %d is not compliant with SBSA " + L"Level 3 PPI ID assignment: %d.", + SpeOverflowInterrupt, + ARM_PPI_ID_PMBIRQ + ); + } +} /** An ACPI_PARSER array describing the GICC Interrupt Controller Structure. @@ -158,78 +200,6 @@ STATIC CONST ACPI_PARSER MadtInterruptControllerHeaderParser[] = { {L"Reserved", 2, 2, NULL, NULL, NULL, NULL, NULL} }; -/** - 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 != 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 = *(UINT16*)Ptr; - - // SPE not supported by this processor - if (SpeOverflowInterrupt == 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 != ARM_PPI_ID_PMBIRQ) { - IncrementWarningCount(); - Print ( - L"\nWARNING: SPE Overflow Interrupt ID of %d is not compliant with SBSA " - 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)'