From nobody Wed Apr 24 05:33:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+61601+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 1592919817689465.013171398602; Tue, 23 Jun 2020 06:43:37 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id IrUqYY1788612xZePXRUVRgJ; Tue, 23 Jun 2020 06:43:36 -0700 X-Received: from EUR05-DB8-obe.outbound.protection.outlook.com (EUR05-DB8-obe.outbound.protection.outlook.com [40.107.20.52]) by mx.groups.io with SMTP id smtpd.web11.7230.1592919814221157035 for ; Tue, 23 Jun 2020 06:43:34 -0700 X-Received: from AM6P195CA0062.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:87::39) by VI1PR08MB5440.eurprd08.prod.outlook.com (2603:10a6:803:134::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.20; Tue, 23 Jun 2020 13:43:32 +0000 X-Received: from VE1EUR03FT038.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:87:cafe::90) by AM6P195CA0062.outlook.office365.com (2603:10a6:209:87::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Tue, 23 Jun 2020 13:43:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+61601+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT038.mail.protection.outlook.com (10.152.19.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Tue, 23 Jun 2020 13:43:31 +0000 X-Received: ("Tessian outbound da41658aa5d4:v59"); Tue, 23 Jun 2020 13:43:31 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 83bf69e6415a8da2 X-CR-MTA-TID: 64aa7808 X-Received: from 4f579bcd896b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id F1B4B4B9-A4ED-483D-ADC2-272CF033ECD7.1; Tue, 23 Jun 2020 13:43:25 +0000 X-Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 4f579bcd896b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 23 Jun 2020 13:43:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f8otSSknHm5nSVD80BbEadIJ4+5oTdoPVBOswVPjbkZYzBeF76VwlJ/hODg618SuR2F6C57YfJsMp9DKM78Z098eS5PFbsoU/fui6RGkMIOOvX7juVv7SzOCU5z3a+HjcKFFBYv08x8PO9/2Pic/dJIfelCs4/HCLQ8+yfTwtV/3C3lpRck4BobbBxBNB3/zhbC5tpifN/KybOEbLTSlE+PzeQ4NzSwu89sF8GA3wpzglS7bVhdBYqc5Ncj9H/5oCPZiNQkKeuG2qo30XQhOfCWFTiw9F+QJehqiJqa6mA4Ps82YsoBsIIRkaO8TbEZhX7m0pHiAwQ7yNoWKGbeOJQ== 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=yLimyfg67ksFHw+Iha9g0rDeDe83NlUb1d+MgXR53Q0=; b=I6N5cYCScWUYKivhm6WPuIp8seh8yCqdnTFc64ggDyedpvn37YI/5m/0yBrmVB7p21GFkutQdV9bO10ukU2lJvpQpsu9ymN/vlvn+NrPWGeI6Mn8bFrrRNlKsI63Qa/Nj7VMYgZZctZxemVpZ2qi8iUuP+VuGzMKveAV66/c4C0r6oi6loIFcZbv25t1N3EiBMlS2Iyj8pVy1qG4pHQFjsltMu965lM6QF1c2c1Ql7jZgQtMqT0UQMis8zQB6SOQ8GE2MP+a0SsjGlJwOzbbwTo9x86yJZenCpqWvP+tpWQ/q7VbLMCsaJkCkQtH8f/55qpVy+MDP+sUGlIEIKQyKQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=bestguesspass action=none header.from=arm.com; dkim=none (message not signed); arc=none X-Received: from DB6PR0201CA0042.eurprd02.prod.outlook.com (2603:10a6:4:3f::52) by AM6PR08MB4199.eurprd08.prod.outlook.com (2603:10a6:20b:b0::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.23; Tue, 23 Jun 2020 13:43:23 +0000 X-Received: from DB5EUR03FT003.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:3f:cafe::d5) by DB6PR0201CA0042.outlook.office365.com (2603:10a6:4:3f::52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Tue, 23 Jun 2020 13:43:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (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=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; X-Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT003.mail.protection.outlook.com (10.152.20.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3109.22 via Frontend Transport; Tue, 23 Jun 2020 13:43:23 +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; Tue, 23 Jun 2020 13:43:22 +0000 X-Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.1779.2; Tue, 23 Jun 2020 13:43:22 +0000 X-Received: from localhost.localdomain (10.57.20.205) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Tue, 23 Jun 2020 13:43:22 +0000 From: "Tomas Pilar (tpilar)" To: CC: , , Ray Ni , "Zhichao Gao" Subject: [edk2-devel] [PATCH v4 1/7] ShellPkg/AcpiView: Move log reset to main method Date: Tue, 23 Jun 2020 14:42:58 +0100 Message-ID: <20200623134304.2619-2-Tomas.Pilar@arm.com> In-Reply-To: <20200623134304.2619-1-Tomas.Pilar@arm.com> References: <20200623134304.2619-1-Tomas.Pilar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFTY:;SFS:(4636009)(136003)(346002)(376002)(396003)(39860400002)(46966005)(70586007)(70206006)(1076003)(186003)(2906002)(336012)(83380400001)(6666004)(5660300002)(86362001)(26005)(4326008)(82310400002)(426003)(36756003)(81166007)(54906003)(356005)(316002)(8936002)(478600001)(8676002)(6916009)(47076004)(2616005)(82740400003);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 19cdc5b2-18ff-43fc-07c6-08d8177b6b02 X-MS-TrafficTypeDiagnostic: AM6PR08MB4199:|VI1PR08MB5440: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:127;OLM:127; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: S7u7qfw9PbQcFGRLwu3bEmEITOKTzY6chnszAR4JLMBzdxO2Z/GY3rcD5aTjj34Uqps7PCppad8QVginnUtpcGXCDuQqks56TuY1PVsj2wuAFzOuIPHyK819Q2jLzvWevWwNIVIheVbp9IdUVNOj1gTBqjSGurCqgZGHRFnf7XOUfzkuguc2Fi8xQAHOsrFoEzssCanYnx/xmX69TnveyLUX/Dpg62cuESLo2BQpn+I30kTI4LuAWPt/rKc5Pho5YhA/3hhO9vYIF0isASOp1ERfVFnCiTlaMkP12vQnS2X9GyNz/8TFrrsmoAdVbAWjpQY6depHNQBitio9ut06OMzgyjwqcvYCovX/okK6o89CABho1iyTJvmSL2xC+D2InfN5xZKaui2pgAkWj0l99g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4199 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT038.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 31ad2af7-a775-45d1-caf3-08d8177b6614 X-Microsoft-Antispam-Message-Info: xaNenWKcAtJq7fnYZ9FH1HcaqJV/mdZuk8uvAJfCpAyKpmcAZN0JqrIy0Fx1ZDzptSh+sTj4y5xaUjw0oqiw/GngUzG43KCUFaG9iIZOo2IQqNdVhfuSz2ryF09eU3shhDVW0tp0En6WfmLKKqkul8wF2PHVOjf03/IqHYJpA6Yyl9eDigYznozsBjgkYRUs4E05V2Xaf1SdaAQR0DgNbn0RRFjI5fK/ZeZBekITBYoEldtuOLjoRhyd+qNmyRoiEUITbShUzkAiHQMxJeqR32u3ycgGOjdLpY9Mw/+Q8iC7a/fgog/uYweq901dn6EAvfj0Duc6AkakvSGcRY1ySuEy/3tfbzGSo2DS2xcs/8PsJUaTC8bpsUonokzTHgmFqi3rBgnPlHYySsQdNwFmKg== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jun 2020 13:43:31.5117 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 19cdc5b2-18ff-43fc-07c6-08d8177b6b02 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT038.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB5440 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,Tomas.Pilar@arm.com X-Gm-Message-State: OGHmG6XbzLF7xNjFaJRlDyRgx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1592919816; bh=QAD+LdlQMJiiqzlPXbsJ3sbFldyGuOxtpEVCHJfSZHg=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=JaggBn9GCo1hTUYxyTRYdCkJWxJH4zz+LFZUGh21NaAbV0u1CJAsDIKvnOgIliSgWVE 1zucEo9xrLAAhbJLaRMLjmIZev/5zVKQjh0wfkj2S7Zg5eXGKYokyFU2woCwmFwQGR1tC qCwqh22kt4EIWNxBlvwinvfcopANiU9Gykc= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The error and warning counters are reset in the AcpiView main method. This improves reusability of the main method. Cc: Ray Ni Cc: Zhichao Gao Reviewed-by: Zhichao Gao Signed-off-by: Tomas Pilar --- ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c b/Shel= lPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c index 84ffb3595750..f1a95b7b8f03 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c @@ -424,6 +424,10 @@ AcpiView ( EfiConfigurationTable =3D NULL; OriginalAttribute =3D 0; =20 + // Reset The error/warning counters + ResetErrorCount (); + ResetWarningCount (); + // Search the table for an entry that matches the ACPI Table Guid FoundAcpiTable =3D FALSE; for (Index =3D 0; Index < SystemTable->NumberOfTableEntries; Index++) { @@ -566,10 +570,6 @@ ShellCommandRunAcpiView ( Package =3D NULL; TmpDumpFileHandle =3D NULL; =20 - // Reset The error/warning counters - ResetErrorCount (); - ResetWarningCount (); - Status =3D ShellCommandLineParse (ParamList, &Package, &ProblemParam, TR= UE); if (EFI_ERROR (Status)) { if (Status =3D=3D EFI_VOLUME_CORRUPTED && ProblemParam !=3D NULL) { --=20 2.24.1.windows.2 -=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 (#61601): https://edk2.groups.io/g/devel/message/61601 Mute This Topic: https://groups.io/mt/75059839/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 Wed Apr 24 05:33:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+61603+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 1592919820971751.5128712614417; Tue, 23 Jun 2020 06:43:40 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id GFOhYY1788612x1bHng6IOia; Tue, 23 Jun 2020 06:43:40 -0700 X-Received: from EUR01-DB5-obe.outbound.protection.outlook.com (EUR01-DB5-obe.outbound.protection.outlook.com [40.107.15.74]) by mx.groups.io with SMTP id smtpd.web11.7231.1592919814946042762 for ; Tue, 23 Jun 2020 06:43:35 -0700 X-Received: from AM6P195CA0008.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:81::21) by AM6PR08MB5287.eurprd08.prod.outlook.com (2603:10a6:20b:b0::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.21; Tue, 23 Jun 2020 13:43:31 +0000 X-Received: from AM5EUR03FT042.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:81:cafe::98) by AM6P195CA0008.outlook.office365.com (2603:10a6:209:81::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.25 via Frontend Transport; Tue, 23 Jun 2020 13:43:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+61603+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT042.mail.protection.outlook.com (10.152.17.168) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Tue, 23 Jun 2020 13:43:31 +0000 X-Received: ("Tessian outbound 022d32fb9a40:v59"); Tue, 23 Jun 2020 13:43:31 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: ecc6cd927fd46a66 X-CR-MTA-TID: 64aa7808 X-Received: from d2fba8881e24.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 4934819E-6E47-419C-BF14-CB6C75887171.1; Tue, 23 Jun 2020 13:43:26 +0000 X-Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d2fba8881e24.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 23 Jun 2020 13:43:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PRIUGeyAG9S4TPsxB2qpYbkxvB3u4pKOYHJkxIENALIwHOjxlDhTZyyEbJIr117rghHcfMYQio706xb1u8Q9yR/+oU6XrGhUTqKg43vSw9V0YCUpLn3vp3mPx878ndR7BGuNRyf17ZT0PPT8Tzdzbv+Rj8A2+5hfAu01TEkqYjxxbrhFiZ2myZVNQ/7l4tqLyclACv9mSw05JCPOsVs0hklPY5CV28wWowDDuK8r9LycCKRZjMO9lgUhBto0pGt4UZ1EvwQmgcisZV5VmLCZiNL1UNIDanWm8UDfaJgacPXVGAfhsAminwUFU3wtFmXJ+CTGztm3cP2oMjMP9HhQVw== 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=dvbj/omvUH6Dh3V+AMMYUXQC3NSoCGUez6AcOBt3LWA=; b=bfk9f4xC3phMQthVeHptq+v9yxfIi4X/zkkEtYS8cy6EKj7HhnGXbm+UFzIPUGpoX0KctY/HkeKPba6SuULjN+eNgwdkJULBaWcDPFGvcx7lfVm+2szv1AEmlXC274hj6Ink4vtJD77+55P3yINwfETXhCd6g9t5kNSWeiXXGlltF8oQqzYRWHoy1j/FedsZD3R8mymjKNrj/2ZLsJIkESk8o+PNUEW3D2xsQHk3J/cZzFx4c47ytI/0GkJcKdWk4M06RXuA5C8Iact8p6KkrHJY3vGq4m7MowunTSMf8nAAoNzOasfwSxKHqhi2kDuw1sHlAWvjhu6xQO408qhIwQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=bestguesspass action=none header.from=arm.com; dkim=none (message not signed); arc=none X-Received: from DB6PR0201CA0023.eurprd02.prod.outlook.com (2603:10a6:4:3f::33) by AM0PR08MB3892.eurprd08.prod.outlook.com (2603:10a6:208:106::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Tue, 23 Jun 2020 13:43:24 +0000 X-Received: from DB5EUR03FT003.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:3f:cafe::f4) by DB6PR0201CA0023.outlook.office365.com (2603:10a6:4:3f::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Tue, 23 Jun 2020 13:43:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (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=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; X-Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT003.mail.protection.outlook.com (10.152.20.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3109.22 via Frontend Transport; Tue, 23 Jun 2020 13:43:24 +0000 X-Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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; Tue, 23 Jun 2020 13:43:22 +0000 X-Received: from localhost.localdomain (10.57.20.205) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Tue, 23 Jun 2020 13:43:22 +0000 From: "Tomas Pilar (tpilar)" To: CC: , , Ray Ni , "Zhichao Gao" Subject: [edk2-devel] [PATCH v4 2/7] ShellPkg/AcpiView: Refactor configuration Date: Tue, 23 Jun 2020 14:42:59 +0100 Message-ID: <20200623134304.2619-3-Tomas.Pilar@arm.com> In-Reply-To: <20200623134304.2619-1-Tomas.Pilar@arm.com> References: <20200623134304.2619-1-Tomas.Pilar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFTY:;SFS:(4636009)(376002)(396003)(39860400002)(136003)(346002)(46966005)(82740400003)(186003)(26005)(478600001)(47076004)(316002)(30864003)(81166007)(8936002)(356005)(2616005)(82310400002)(19627235002)(1076003)(5660300002)(70206006)(6916009)(336012)(70586007)(2906002)(54906003)(8676002)(6666004)(426003)(36756003)(4326008)(86362001)(83380400001);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7250b54a-770b-4491-67df-08d8177b6b0a X-MS-TrafficTypeDiagnostic: AM0PR08MB3892:|AM6PR08MB5287: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:5236;OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: GInxzXN+vBlW30OK6XhJV3lFMdtzkDQmui71dbV/rpsTOCV7RQHnJrtPw8+OiY6wgO/Elm5cw6mTqTQfxXfYUuTDUDoEP7uhNBApqXYa80l/ACYxip1pxdcfTPjUx0BfkUGx90rHWH166mxBRP6ZCfGJByitrAZAepjeoy0qfZ4xZCIgQfG+NP/GCNm7/bZbLHF/rFg5ucdqMkl+C6oLNBy9IItue+ifKqWVbanU1sqWPH2C5Uebu450SM8kBefiTFSG3n3YkqVcb35XLE21ViCyP6F5R++kxmQI1UdgtOWKx7Hd7qV3CunNxaefjYYOhKEJDnnfaLpARa54uTNFT0r52N2gH8M7sECNUt6vr/SfUbZZv2pmYOd8m6Ipv08mS4Nfu6FqrKLTi0YZibDcyw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3892 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT042.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: aa42b787-8505-49fd-a94c-08d8177b669e X-Microsoft-Antispam-Message-Info: uynjrWzzuxGLw5Cbw8PTz6zC2wRcY5uUYmw89QoPrBXeTqtginzm6X9mKYOldhUZe8ibvxvTjUeMOm7vLqe5HHtUgpVnm+O3vZA2fUwYZs4tGaUhGGWxXeEy+lwwXbdeUo7uHGiUO69imSwalf6czlO46H7EzRROLKKHhycX+HFLTkrHKkARX2QWbkcSe9nGGBhOIriSqb39PhyTxsMCiaGDeSATMymocqfeQRbug5Kpqf7bzLOQ7gYjwuVbFrcRn5MCJnJF83ewnroM9FxsTbyUStdLP+bCDcG+ef9VDAvl6NoZt+VDY3kRDEJem2QHsiSEaf393G0DqBTizAM46uwZVu8DZo67WZWvMeyuDd9ePKM2OSQaO9swWGLBXHYBpOm/Gr+o2eOTW9RL4OZyEw== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jun 2020 13:43:31.6395 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7250b54a-770b-4491-67df-08d8177b6b0a X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB5287 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,Tomas.Pilar@arm.com X-Gm-Message-State: hTrmgf0C68v67ld9xoAa2Wyux1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1592919820; bh=NgbkFGfruzkuCj8GLnuTcgTVBCT8H4N+FCy8xOIiGTw=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=Ybyw62rtQ29TruqMnlSQx2B27gKm+gqzeli3NqeY2+Jaj4vW1ktLXf16wjFhpWKMHHM Ms6zBdXeQ/543QIHnHIDEgoqkI33Gcthf30nRYRnZ3KxLiI3Hi/FRe7BOq7aDPa9+vUuy Tjlrfs0h9Wddyj5k38w8JGFkVMXBhpmRFLo= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" A new file and header (AcpiViewConfig.[ch]) is created that houses the user configuration. This declutters the core code and improves modularity of the design. The module level symbols for verbosity, table selection, and highlighting are refactored into the new file. Cc: Ray Ni Cc: Zhichao Gao Reviewed-by: Zhichao Gao Signed-off-by: Tomas Pilar --- .../UefiShellAcpiViewCommandLib/AcpiParser.c | 1 + .../AcpiTableParser.c | 1 + .../UefiShellAcpiViewCommandLib/AcpiView.c | 237 +++-------------- .../UefiShellAcpiViewCommandLib/AcpiView.h | 95 ------- .../AcpiViewConfig.c | 246 ++++++++++++++++++ .../AcpiViewConfig.h | 177 +++++++++++++ .../Parsers/Gtdt/GtdtParser.c | 1 + .../Parsers/Iort/IortParser.c | 1 + .../Parsers/Madt/MadtParser.c | 1 + .../Parsers/Pptt/PpttParser.c | 1 + .../Parsers/Srat/SratParser.c | 1 + .../UefiShellAcpiViewCommandLib.inf | 32 +-- 12 files changed, 479 insertions(+), 315 deletions(-) create mode 100644 ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiViewCo= nfig.c create mode 100644 ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiViewCo= nfig.h diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c b/Sh= ellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c index 3f12a33050a4..02f6d771c7e1 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c @@ -10,6 +10,7 @@ #include #include "AcpiParser.h" #include "AcpiView.h" +#include "AcpiViewConfig.h" =20 STATIC UINT32 gIndent; STATIC UINT32 mTableErrorCount; diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c= b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c index d5b9eee52323..4b618f131eac 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c @@ -17,6 +17,7 @@ #include "AcpiParser.h" #include "AcpiTableParser.h" #include "AcpiView.h" +#include "AcpiViewConfig.h" =20 #if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) #include "Arm/SbbrValidator.h" diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c b/Shel= lPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c index f1a95b7b8f03..b068dd4d2722 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c @@ -20,6 +20,7 @@ #include "AcpiParser.h" #include "AcpiTableParser.h" #include "AcpiView.h" +#include "AcpiViewConfig.h" #include "UefiShellAcpiViewCommandLib.h" =20 #if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) @@ -28,17 +29,8 @@ =20 EFI_HII_HANDLE gShellAcpiViewHiiHandle =3D NULL; =20 -// Report variables -STATIC UINT32 mSelectedAcpiTable; -STATIC CONST CHAR16* mSelectedAcpiTableName; -STATIC BOOLEAN mSelectedAcpiTableFound; -STATIC EREPORT_OPTION mReportType; STATIC UINT32 mTableCount; STATIC UINT32 mBinTableCount; -STATIC BOOLEAN mConsistencyCheck; -STATIC BOOLEAN mColourHighlighting; -STATIC BOOLEAN mMandatoryTableValidate; -STATIC UINTN mMandatoryTableSpec; =20 /** An array of acpiview command line parameters. @@ -53,142 +45,6 @@ STATIC CONST SHELL_PARAM_ITEM ParamList[] =3D { {NULL, TypeMax} }; =20 -/** - This function returns the colour highlighting status. - - @retval TRUE if colour highlighting is enabled. -**/ -BOOLEAN -GetColourHighlighting ( - VOID - ) -{ - return mColourHighlighting; -} - -/** - This function sets the colour highlighting status. - - @param Highlight The Highlight status. - -**/ -VOID -SetColourHighlighting ( - BOOLEAN Highlight - ) -{ - mColourHighlighting =3D Highlight; -} - -/** - This function returns the consistency checking status. - - @retval TRUE if consistency checking is enabled. -**/ -BOOLEAN -GetConsistencyChecking ( - VOID - ) -{ - return mConsistencyCheck; -} - -/** - This function sets the consistency checking status. - - @param ConsistencyChecking The consistency checking status. - -**/ -VOID -SetConsistencyChecking ( - BOOLEAN ConsistencyChecking - ) -{ - mConsistencyCheck =3D ConsistencyChecking; -} - -/** - This function returns the ACPI table requirements validation flag. - - @retval TRUE if check for mandatory table presence should be performed. -**/ -BOOLEAN -GetMandatoryTableValidate ( - VOID - ) -{ - return mMandatoryTableValidate; -} - -/** - This function sets the ACPI table requirements validation flag. - - @param Validate Enable/Disable ACPI table requirements validation. -**/ -VOID -SetMandatoryTableValidate ( - BOOLEAN Validate - ) -{ - mMandatoryTableValidate =3D Validate; -} - -/** - This function returns the identifier of specification to validate ACPI t= able - requirements against. - - @return ID of specification listing mandatory tables. -**/ -UINTN -GetMandatoryTableSpec ( - VOID - ) -{ - return mMandatoryTableSpec; -} - -/** - This function sets the identifier of specification to validate ACPI table - requirements against. - - @param Spec ID of specification listing mandatory tables. -**/ -VOID -SetMandatoryTableSpec ( - UINTN Spec - ) -{ - mMandatoryTableSpec =3D Spec; -} - -/** - This function returns the report options. - - @retval Returns the report option. -**/ -STATIC -EREPORT_OPTION -GetReportOption ( - VOID - ) -{ - return mReportType; -} - -/** - This function returns the selected ACPI table. - - @retval Returns signature of the selected ACPI table. -**/ -STATIC -UINT32 -GetSelectedAcpiTable ( - VOID - ) -{ - return mSelectedAcpiTable; -} - /** This function dumps the ACPI table to a file. =20 @@ -205,19 +61,21 @@ DumpAcpiTableToFile ( IN CONST UINTN Length ) { - EFI_STATUS Status; - CHAR16 FileNameBuffer[MAX_FILE_NAME_LEN]; - SHELL_FILE_HANDLE DumpFileHandle; - UINTN TransferBytes; + EFI_STATUS Status; + CHAR16 FileNameBuffer[MAX_FILE_NAME_LEN]; + SHELL_FILE_HANDLE DumpFileHandle; + UINTN TransferBytes; + SELECTED_ACPI_TABLE *SelectedTable; =20 DumpFileHandle =3D NULL; TransferBytes =3D Length; + GetSelectedAcpiTable (&SelectedTable); =20 UnicodeSPrint ( FileNameBuffer, sizeof (FileNameBuffer), L".\\%s%04d.bin", - mSelectedAcpiTableName, + SelectedTable->Name, mBinTableCount++ ); =20 @@ -273,10 +131,11 @@ ProcessTableReportOptions ( IN CONST UINT32 Length ) { - UINTN OriginalAttribute; - UINT8* SignaturePtr; - BOOLEAN Log; - BOOLEAN HighLight; + UINTN OriginalAttribute; + UINT8 *SignaturePtr; + BOOLEAN Log; + BOOLEAN HighLight; + SELECTED_ACPI_TABLE *SelectedTable; =20 // // set local variables to suppress incorrect compiler/analyzer warnings @@ -285,15 +144,16 @@ ProcessTableReportOptions ( SignaturePtr =3D (UINT8*)(UINTN)&Signature; Log =3D FALSE; HighLight =3D GetColourHighlighting (); + GetSelectedAcpiTable (&SelectedTable); =20 switch (GetReportOption ()) { case ReportAll: Log =3D TRUE; break; case ReportSelected: - if (Signature =3D=3D GetSelectedAcpiTable ()) { + if (Signature =3D=3D SelectedTable->Type) { Log =3D TRUE; - mSelectedAcpiTableFound =3D TRUE; + SelectedTable->Found =3D TRUE; } break; case ReportTableList: @@ -321,8 +181,8 @@ ProcessTableReportOptions ( ); break; case ReportDumpBinFile: - if (Signature =3D=3D GetSelectedAcpiTable ()) { - mSelectedAcpiTableFound =3D TRUE; + if (Signature =3D=3D SelectedTable->Type) { + SelectedTable->Found =3D TRUE; DumpAcpiTableToFile (TablePtr, Length); } break; @@ -356,37 +216,7 @@ ProcessTableReportOptions ( return Log; } =20 -/** - This function converts a string to ACPI table signature. - - @param [in] Str Pointer to the string to be converted to the - ACPI table signature. =20 - @retval The ACPI table signature. -**/ -STATIC -UINT32 -ConvertStrToAcpiSignature ( - IN CONST CHAR16* Str - ) -{ - UINT8 Index; - CHAR8 Ptr[4]; - - ZeroMem (Ptr, sizeof (Ptr)); - Index =3D 0; - - // Convert to Upper case and convert to ASCII - while ((Index < 4) && (Str[Index] !=3D 0)) { - if (Str[Index] >=3D L'a' && Str[Index] <=3D L'z') { - Ptr[Index] =3D (CHAR8)(Str[Index] - (L'a' - L'A')); - } else { - Ptr[Index] =3D (CHAR8)Str[Index]; - } - Index++; - } - return *(UINT32*)Ptr; -} =20 /** This function iterates the configuration table entries in the @@ -417,6 +247,7 @@ AcpiView ( UINT8 RsdpRevision; PARSE_ACPI_TABLE_PROC RsdpParserProc; BOOLEAN Trace; + SELECTED_ACPI_TABLE *SelectedTable; =20 // // set local variables to suppress incorrect compiler/analyzer warnings @@ -428,6 +259,9 @@ AcpiView ( ResetErrorCount (); ResetWarningCount (); =20 + // Retrieve the user selection of ACPI table to process + GetSelectedAcpiTable (&SelectedTable); + // Search the table for an entry that matches the ACPI Table Guid FoundAcpiTable =3D FALSE; for (Index =3D 0; Index < SystemTable->NumberOfTableEntries; Index++) { @@ -496,7 +330,7 @@ AcpiView ( if (ReportTableList !=3D ReportOption) { if (((ReportSelected =3D=3D ReportOption) || (ReportDumpBinFile =3D=3D ReportOption)) && - (!mSelectedAcpiTableFound)) { + (!SelectedTable->Found)) { Print (L"\nRequested ACPI Table not found.\n"); } else if (GetConsistencyChecking () && (ReportDumpBinFile !=3D ReportOption)) { @@ -554,17 +388,12 @@ ShellCommandRunAcpiView ( CHAR16* ProblemParam; SHELL_FILE_HANDLE TmpDumpFileHandle; CONST CHAR16* MandatoryTableSpecStr; + CONST CHAR16 *SelectedTableName; =20 // Set Defaults - mReportType =3D ReportAll; mTableCount =3D 0; mBinTableCount =3D 0; - mSelectedAcpiTable =3D 0; - mSelectedAcpiTableName =3D NULL; - mSelectedAcpiTableFound =3D FALSE; - mConsistencyCheck =3D TRUE; - mMandatoryTableValidate =3D FALSE; - mMandatoryTableSpec =3D 0; + AcpiConfigSetDefaults (); =20 ShellStatus =3D SHELL_SUCCESS; Package =3D NULL; @@ -671,25 +500,23 @@ ShellCommandRunAcpiView ( } =20 if (ShellCommandLineGetFlag (Package, L"-l")) { - mReportType =3D ReportTableList; + SetReportOption (ReportTableList); } else { - mSelectedAcpiTableName =3D ShellCommandLineGetValue (Package, L"-s= "); - if (mSelectedAcpiTableName !=3D NULL) { - mSelectedAcpiTable =3D (UINT32)ConvertStrToAcpiSignature ( - mSelectedAcpiTableName - ); - mReportType =3D ReportSelected; + SelectedTableName =3D ShellCommandLineGetValue (Package, L"-s"); + if (SelectedTableName !=3D NULL) { + SelectAcpiTable (SelectedTableName); + SetReportOption (ReportSelected); =20 if (ShellCommandLineGetFlag (Package, L"-d")) { // Create a temporary file to check if the media is writable. CHAR16 FileNameBuffer[MAX_FILE_NAME_LEN]; - mReportType =3D ReportDumpBinFile; + SetReportOption (ReportDumpBinFile); =20 UnicodeSPrint ( FileNameBuffer, sizeof (FileNameBuffer), L".\\%s%04d.tmp", - mSelectedAcpiTableName, + SelectedTableName, mBinTableCount ); =20 diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h b/Shel= lPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h index be65564c86a6..92d64a88814d 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h @@ -23,17 +23,6 @@ **/ #define RSDP_LENGTH_OFFSET 20 =20 -/** - The EREPORT_OPTION enum describes ACPI table Reporting options. -**/ -typedef enum ReportOption { - ReportAll, ///< Report All tables. - ReportSelected, ///< Report Selected table. - ReportTableList, ///< Report List of tables. - ReportDumpBinFile, ///< Dump selected table to a file. - ReportMax, -} EREPORT_OPTION; - /** This function resets the ACPI table error counter to Zero. **/ @@ -70,90 +59,6 @@ GetWarningCount ( VOID ); =20 -/** - This function returns the colour highlighting status. - - @retval TRUE if colour highlighting is enabled. -**/ -BOOLEAN -GetColourHighlighting ( - VOID - ); - -/** - This function sets the colour highlighting status. - - @param Highlight The Highlight status. - -**/ -VOID -SetColourHighlighting ( - BOOLEAN Highlight - ); - -/** - This function returns the consistency checking status. - - @retval TRUE if consistency checking is enabled. -**/ -BOOLEAN -GetConsistencyChecking ( - VOID - ); - -/** - This function sets the consistency checking status. - - @param ConsistencyChecking The consistency checking status. - -**/ -VOID -SetConsistencyChecking ( - BOOLEAN ConsistencyChecking - ); - -/** - This function returns the ACPI table requirements validation flag. - - @retval TRUE if check for mandatory table presence should be performed. -**/ -BOOLEAN -GetMandatoryTableValidate ( - VOID - ); - -/** - This function sets the ACPI table requirements validation flag. - - @param Validate Enable/Disable ACPI table requirements validation. -**/ -VOID -SetMandatoryTableValidate ( - BOOLEAN Validate - ); - -/** - This function returns the identifier of specification to validate ACPI t= able - requirements against. - - @return ID of specification listing mandatory tables. -**/ -UINTN -GetMandatoryTableSpec ( - VOID - ); - -/** - This function sets the identifier of specification to validate ACPI table - requirements against. - - @param Spec ID of specification listing mandatory tables. -**/ -VOID -SetMandatoryTableSpec ( - UINTN Spec - ); - /** This function processes the table reporting options for the ACPI table. =20 diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiViewConfig.c = b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiViewConfig.c new file mode 100644 index 000000000000..759a915928c7 --- /dev/null +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiViewConfig.c @@ -0,0 +1,246 @@ +/** @file + State and accessors for 'acpiview' configuration. + + Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include + +#include "AcpiViewConfig.h" + +// Report variables +STATIC BOOLEAN mConsistencyCheck; +STATIC BOOLEAN mColourHighlighting; +STATIC EREPORT_OPTION mReportType; +STATIC BOOLEAN mMandatoryTableValidate; +STATIC UINTN mMandatoryTableSpec; + +// User selection of which ACPI table should be checked +SELECTED_ACPI_TABLE mSelectedAcpiTable; + +/** + Reset the AcpiView user configuration to defaults +**/ +VOID +EFIAPI +AcpiConfigSetDefaults ( + VOID + ) +{ + mReportType =3D ReportAll; + mSelectedAcpiTable.Type =3D 0; + mSelectedAcpiTable.Name =3D NULL; + mSelectedAcpiTable.Found =3D FALSE; + mConsistencyCheck =3D TRUE; + mMandatoryTableValidate =3D FALSE; + mMandatoryTableSpec =3D 0; +} + +/** + This function converts a string to ACPI table signature. + + @param [in] Str Pointer to the string to be converted to the + ACPI table signature. + + @retval The ACPI table signature. +**/ +STATIC +UINT32 +ConvertStrToAcpiSignature ( + IN CONST CHAR16 *Str + ) +{ + UINT8 Index; + CHAR8 Ptr[4]; + + ZeroMem (Ptr, sizeof (Ptr)); + Index =3D 0; + + // Convert to Upper case and convert to ASCII + while ((Index < 4) && (Str[Index] !=3D 0)) { + if (Str[Index] >=3D L'a' && Str[Index] <=3D L'z') { + Ptr[Index] =3D (CHAR8)(Str[Index] - (L'a' - L'A')); + } else { + Ptr[Index] =3D (CHAR8)Str[Index]; + } + Index++; + } + return *(UINT32 *) Ptr; +} + +/** + This function selects an ACPI table in current context. + The string name of the table is converted into UINT32 + table signature. + + @param [in] TableName The name of the ACPI table to select. +**/ +VOID +EFIAPI +SelectAcpiTable ( + IN CONST CHAR16 *TableName + ) +{ + ASSERT (TableName !=3D NULL); + + mSelectedAcpiTable.Name =3D TableName; + mSelectedAcpiTable.Type =3D ConvertStrToAcpiSignature (mSelectedAcpiTabl= e.Name); +} + +/** + This function returns the selected ACPI table. + + @param [out] SelectedAcpiTable Pointer that will contain the returned st= ruct. +**/ +VOID +EFIAPI +GetSelectedAcpiTable ( + OUT SELECTED_ACPI_TABLE **SelectedAcpiTable + ) +{ + *SelectedAcpiTable =3D &mSelectedAcpiTable; +} + +/** + This function returns the colour highlighting status. + + @retval TRUE Colour highlighting is enabled. +**/ +BOOLEAN +EFIAPI +GetColourHighlighting ( + VOID + ) +{ + return mColourHighlighting; +} + +/** + This function sets the colour highlighting status. + + @param [in] Highlight The highlight status. +**/ +VOID +EFIAPI +SetColourHighlighting ( + BOOLEAN Highlight + ) +{ + mColourHighlighting =3D Highlight; +} + +/** + This function returns the consistency checking status. + + @retval TRUE Consistency checking is enabled. +**/ +BOOLEAN +EFIAPI +GetConsistencyChecking ( + VOID + ) +{ + return mConsistencyCheck; +} + +/** + This function sets the consistency checking status. + + @param [in] ConsistencyChecking The consistency checking status. +**/ +VOID +EFIAPI +SetConsistencyChecking ( + BOOLEAN ConsistencyChecking + ) +{ + mConsistencyCheck =3D ConsistencyChecking; +} + +/** + This function returns the report options. + + @return The current report option. +**/ +EREPORT_OPTION +EFIAPI +GetReportOption ( + VOID + ) +{ + return mReportType; +} + +/** + This function sets the report options. + + @param [in] ReportType The report option to set. +**/ +VOID +EFIAPI +SetReportOption ( + EREPORT_OPTION ReportType + ) +{ + mReportType =3D ReportType; +} + +/** + This function returns the ACPI table requirements validation flag. + + @retval TRUE Check for mandatory table presence should be performed. +**/ +BOOLEAN +EFIAPI +GetMandatoryTableValidate ( + VOID + ) +{ + return mMandatoryTableValidate; +} + +/** + This function sets the ACPI table requirements validation flag. + + @param [in] Validate Enable/Disable ACPI table requirements validation. +**/ +VOID +EFIAPI +SetMandatoryTableValidate ( + BOOLEAN Validate + ) +{ + mMandatoryTableValidate =3D Validate; +} + +/** + This function returns the identifier of specification to validate ACPI t= able + requirements against. + + @return ID of specification listing mandatory tables. +**/ +UINTN +EFIAPI +GetMandatoryTableSpec ( + VOID + ) +{ + return mMandatoryTableSpec; +} + +/** + This function sets the identifier of specification to validate ACPI table + requirements against. + + @param [in] Spec ID of specification listing mandatory tables. +**/ +VOID +EFIAPI +SetMandatoryTableSpec ( + UINTN Spec + ) +{ + mMandatoryTableSpec =3D Spec; +} diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiViewConfig.h = b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiViewConfig.h new file mode 100644 index 000000000000..2db4a65415d8 --- /dev/null +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiViewConfig.h @@ -0,0 +1,177 @@ +/** @file + Header file for 'acpiview' configuration. + + Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef ACPI_VIEW_CONFIG_H_ +#define ACPI_VIEW_CONFIG_H_ + +/** + This function returns the colour highlighting status. + + @retval TRUE Colour highlighting is enabled. +**/ +BOOLEAN +EFIAPI +GetColourHighlighting ( + VOID + ); + +/** + This function sets the colour highlighting status. + + @param [in] Highlight The highlight status. +**/ +VOID +EFIAPI +SetColourHighlighting ( + BOOLEAN Highlight + ); + +/** + This function returns the consistency checking status. + + @retval TRUE Consistency checking is enabled. +**/ +BOOLEAN +EFIAPI +GetConsistencyChecking ( + VOID + ); + +/** + This function sets the consistency checking status. + + @param [in] ConsistencyChecking The consistency checking status. +**/ +VOID +EFIAPI +SetConsistencyChecking ( + BOOLEAN ConsistencyChecking + ); + +/** + This function returns the ACPI table requirements validation flag. + + @retval TRUE Check for mandatory table presence should be performed. +**/ +BOOLEAN +EFIAPI +GetMandatoryTableValidate ( + VOID + ); + +/** + This function sets the ACPI table requirements validation flag. + + @param [in] Validate Enable/Disable ACPI table requirements validation. +**/ +VOID +EFIAPI +SetMandatoryTableValidate ( + BOOLEAN Validate + ); + +/** + This function returns the identifier of specification to validate ACPI t= able + requirements against. + + @return ID of specification listing mandatory tables. +**/ +UINTN +EFIAPI +GetMandatoryTableSpec ( + VOID + ); + +/** + This function sets the identifier of specification to validate ACPI table + requirements against. + + @param [in] Spec ID of specification listing mandatory tables. +**/ +VOID +EFIAPI +SetMandatoryTableSpec ( + UINTN Spec + ); + +/** + The EREPORT_OPTION enum describes ACPI table Reporting options. +**/ +typedef enum { + ReportAll, ///< Report All tables. + ReportSelected, ///< Report Selected table. + ReportTableList, ///< Report List of tables. + ReportDumpBinFile, ///< Dump selected table to a file. + ReportMax, +} EREPORT_OPTION; + +/** + This function returns the report options. + + @return The current report option. +**/ +EREPORT_OPTION +EFIAPI +GetReportOption ( + VOID + ); + +/** + This function sets the report options. + + @param [in] ReportType The report option to set. +**/ +VOID +EFIAPI +SetReportOption ( + EREPORT_OPTION ReportType + ); + +/** + A structure holding the user selection detailing which + ACPI table is to be examined by the AcpiView code. +**/ +typedef struct { + UINT32 Type; ///< 32bit signature of the selected ACPI t= able. + CONST CHAR16* Name; ///< User friendly name of the selected ACP= I table. + BOOLEAN Found; ///< The selected table has been found in t= he system. +} SELECTED_ACPI_TABLE; + +/** + This function returns the selected ACPI table. + + @param [out] SelectedAcpiTable Pointer that will contain the returned st= ruct. +**/ +VOID +EFIAPI +GetSelectedAcpiTable ( + OUT SELECTED_ACPI_TABLE** SelectedAcpiTable + ); + +/** + This function selects an ACPI table in current context. + The string name of the table is converted into UINT32 + table signature. + + @param [in] TableName The name of the ACPI table to select. +**/ +VOID +EFIAPI +SelectAcpiTable ( + CONST CHAR16* TableName + ); + +/** + Reset the AcpiView user configuration to defaults. +**/ +VOID +EFIAPI +AcpiConfigSetDefaults ( + VOID + ); + +#endif // ACPI_VIEW_CONFIG_H_ diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/Gtdt= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtPa= rser.c index bdd30ff45c61..d02fc4929d6f 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c @@ -12,6 +12,7 @@ #include #include "AcpiParser.h" #include "AcpiTableParser.h" +#include "AcpiViewConfig.h" =20 // "The number of GT Block Timers must be less than or equal to 8" #define GT_BLOCK_TIMER_COUNT_MAX 8 diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/Iort= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortPa= rser.c index 9a006a01448b..f7447947b230 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c @@ -13,6 +13,7 @@ #include #include "AcpiParser.h" #include "AcpiTableParser.h" +#include "AcpiViewConfig.h" =20 // Local variables STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/Madt= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtPa= rser.c index f85d2b36532c..15aa2392b60c 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c @@ -15,6 +15,7 @@ #include #include "AcpiParser.h" #include "AcpiTableParser.h" +#include "AcpiViewConfig.h" #include "MadtParser.h" =20 // Local Variables diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/Pptt= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttPa= rser.c index 0db272c16af0..acd2b81bb325 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.c @@ -13,6 +13,7 @@ #include #include "AcpiParser.h" #include "AcpiView.h" +#include "AcpiViewConfig.h" #include "PpttParser.h" =20 // Local variables diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/Srat= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratPa= rser.c index 6f66be68cc0b..b9b67820b89f 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c @@ -13,6 +13,7 @@ #include #include "AcpiParser.h" #include "AcpiTableParser.h" +#include "AcpiViewConfig.h" =20 // Local Variables STATIC CONST UINT8* SratRAType; diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiView= CommandLib.inf b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpi= ViewCommandLib.inf index d21ecd40a8cf..92de2391b09f 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.inf +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.inf @@ -19,15 +19,14 @@ [Defines] DESTRUCTOR =3D UefiShellAcpiViewCommandLibDestructor =20 [Sources.common] - UefiShellAcpiViewCommandLib.uni - UefiShellAcpiViewCommandLib.c - UefiShellAcpiViewCommandLib.h - AcpiParser.h - AcpiTableParser.h - AcpiView.h AcpiParser.c + AcpiParser.h AcpiTableParser.c + AcpiTableParser.h AcpiView.c + AcpiView.h + AcpiViewConfig.c + AcpiViewConfig.h Parsers/Bgrt/BgrtParser.c Parsers/Dbg2/Dbg2Parser.c Parsers/Dsdt/DsdtParser.c @@ -36,40 +35,43 @@ [Sources.common] Parsers/Gtdt/GtdtParser.c Parsers/Iort/IortParser.c Parsers/Madt/MadtParser.c + Parsers/Madt/MadtParser.h Parsers/Mcfg/McfgParser.c Parsers/Pptt/PpttParser.c + Parsers/Pptt/PpttParser.h Parsers/Rsdp/RsdpParser.c Parsers/Slit/SlitParser.c Parsers/Spcr/SpcrParser.c Parsers/Srat/SratParser.c Parsers/Ssdt/SsdtParser.c Parsers/Xsdt/XsdtParser.c - Parsers/Madt/MadtParser.h - Parsers/Pptt/PpttParser.h + UefiShellAcpiViewCommandLib.c + UefiShellAcpiViewCommandLib.h + UefiShellAcpiViewCommandLib.uni =20 [Sources.ARM, Sources.AARCH64] Arm/SbbrValidator.h Arm/SbbrValidator.c =20 [Packages] + MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec ShellPkg/ShellPkg.dec - MdeModulePkg/MdeModulePkg.dec =20 [LibraryClasses] - MemoryAllocationLib BaseLib BaseMemoryLib DebugLib + FileHandleLib + HiiLib + MemoryAllocationLib + PcdLib + PrintLib ShellCommandLib ShellLib + UefiBootServicesTableLib UefiLib UefiRuntimeServicesTableLib - UefiBootServicesTableLib - PcdLib - HiiLib - PrintLib - FileHandleLib =20 =20 [FixedPcd] --=20 2.24.1.windows.2 -=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 (#61603): https://edk2.groups.io/g/devel/message/61603 Mute This Topic: https://groups.io/mt/75059841/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 Wed Apr 24 05:33:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+61602+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 1592919819706428.83363929339816; Tue, 23 Jun 2020 06:43:39 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id MNogYY1788612xDEIGl8k7Tv; Tue, 23 Jun 2020 06:43:38 -0700 X-Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.54]) by mx.groups.io with SMTP id smtpd.web11.7233.1592919815405239471 for ; Tue, 23 Jun 2020 06:43:35 -0700 X-Received: from AM5PR0701CA0054.eurprd07.prod.outlook.com (2603:10a6:203:2::16) by DBBPR08MB4743.eurprd08.prod.outlook.com (2603:10a6:10:d9::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.21; Tue, 23 Jun 2020 13:43:32 +0000 X-Received: from VE1EUR03FT029.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:2:cafe::ab) by AM5PR0701CA0054.outlook.office365.com (2603:10a6:203:2::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.10 via Frontend Transport; Tue, 23 Jun 2020 13:43:32 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+61602+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT029.mail.protection.outlook.com (10.152.18.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Tue, 23 Jun 2020 13:43:32 +0000 X-Received: ("Tessian outbound 8fb20e43acb7:v59"); Tue, 23 Jun 2020 13:43:31 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: b77def79eea51476 X-CR-MTA-TID: 64aa7808 X-Received: from acf98bc250bc.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 6D314AB7-FE90-4728-B381-2B07B176051E.1; Tue, 23 Jun 2020 13:43:26 +0000 X-Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id acf98bc250bc.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 23 Jun 2020 13:43:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YqQtXvADH1zVX0j6rSauVl0TsGwFYFdxIK6j+sA5JfNdUE+IfQDmTY9jQOQGhoG96UAZmxf1ZbFnGT6cv9GrsmvQLiW5iUH9O1ljHQIqNGySCBb53p5Ux18LcJzTJMwdT9OhXxxhYDFB9vZNKjczPI3/KP4jvWN0iuRovHRM1xh+zoOADkzkcfQmBfiPsIfu0nSRvczGSZksTuE1HuhTKWjO3Y/tZ5+sDjfxXayZqM9ttvktOQOuWk2jyGKqi5y56oVsnxbPUtQ62k8tpdhIhgY+XabmTX1huD937y+Yia+BJS0kQCwtKoz9HaHP3JvovBhMTSmC1dfGou/OT3SrUg== 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=/vdgKEk7BqfHeFk6DrqAFrZubyNg4BGiu4LKNEHFuVw=; b=QUIQnIOG6K8ls9RCyInR+Fj4gs2sXMMPpfb0sFoUW2sX8zB3bQ6MjEoNVzI5W0ocKlIA7281hweI/X1Psz4axSdsoWETcGbefg6zWdenSLjvbqBytYVAzfxZrY/jMnU3MBYbCDdAPJ7D3e5eZTpWBs2CDOKWOIiGgG+mbm6dwMUKzGmIraBJ52eTDoWf+ErrrExsV99gOt6+ld4F21CYD+TImf+3KfRH7j3btCIyMeYZj9ugr/FpRzJMsMC3KPzbw3YC0bhg6zSnu1x56CQko77h3DwmURAF/bNgO2L6KcuuaodUqnddpKU5sealcaUmrYN1kiyUPYYcfbp+HIv8/Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=bestguesspass action=none header.from=arm.com; dkim=none (message not signed); arc=none X-Received: from DB6PR0201CA0023.eurprd02.prod.outlook.com (2603:10a6:4:3f::33) by VE1PR08MB4783.eurprd08.prod.outlook.com (2603:10a6:802:a9::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Tue, 23 Jun 2020 13:43:25 +0000 X-Received: from DB5EUR03FT003.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:3f:cafe::f4) by DB6PR0201CA0023.outlook.office365.com (2603:10a6:4:3f::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Tue, 23 Jun 2020 13:43:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (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=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; X-Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT003.mail.protection.outlook.com (10.152.20.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3109.22 via Frontend Transport; Tue, 23 Jun 2020 13:43:25 +0000 X-Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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; Tue, 23 Jun 2020 13:43:23 +0000 X-Received: from localhost.localdomain (10.57.20.205) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Tue, 23 Jun 2020 13:43:23 +0000 From: "Tomas Pilar (tpilar)" To: CC: , , Ray Ni , "Zhichao Gao" Subject: [edk2-devel] [PATCH v4 3/7] ShellPkg/AcpiView: Move table count reset Date: Tue, 23 Jun 2020 14:43:00 +0100 Message-ID: <20200623134304.2619-4-Tomas.Pilar@arm.com> In-Reply-To: <20200623134304.2619-1-Tomas.Pilar@arm.com> References: <20200623134304.2619-1-Tomas.Pilar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFTY:;SFS:(4636009)(396003)(39860400002)(376002)(346002)(136003)(46966005)(82740400003)(186003)(356005)(36756003)(316002)(54906003)(82310400002)(83380400001)(6916009)(47076004)(81166007)(26005)(86362001)(70586007)(5660300002)(336012)(70206006)(478600001)(2906002)(1076003)(8936002)(426003)(2616005)(6666004)(8676002)(4326008);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a14099a5-1523-4e8a-14c2-08d8177b6b52 X-MS-TrafficTypeDiagnostic: VE1PR08MB4783:|DBBPR08MB4743: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:1107;OLM:1107; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 6O9Ftc+zpi6oi89bZbMc5ybKitaOfoGsJCil1ZN6XH0MGp/tMPPlf7ZuRhUtGdyqG7zS3tYpxzNkciz7WV7XM9pbDqEGj6PaNtJ7OkcUeKS+XJXCj5BMEtU7DNR/ipfGGTVI3Ad9uMT9Mjf9h1qiY/beBNwZkQR9xY6yco1W4MV2xwBQAxzBiW+uvHD1B3LNt/zy9Vs9Dp1M3xzUqGsqxrLLGmElamqFwGVm7nGLAvDXXpZBoB48FJc7ZLZGlzfYzK5WCimK3RRfuAgsuA61qnfgjwsAYqPyeJM6du/7D/Z3+Gj35VOWQb2a5ejy3VevnKE3equ5xJpAkhuIcJEyjiDbZ99jzVFPuuezQf0JNt0q7IhhbRKRgzuzgp8/IeB455GbdbH8VZN9SAmwND8qNA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4783 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT029.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: b5355e35-ea3b-420a-2947-08d8177b6715 X-Microsoft-Antispam-Message-Info: 08ApwRaw/IUWNqKPrShNe2kIn8gF8IiReS806hnpELPEV5UV4E/wFCq56n6/iUWsSxo3C2EO4MrCFe/BAcSnYVzOhofxGN6kCiqt8WEjSHggfHCQ0mSdQR6eJ1FeeMBt40yud/voNPRA0uo5RHGhsts1DYhPzzb+knH8snfGRq6ARugBrTv6j00eTUqB2KioZFfOzBP/HrEIQORAHebw2V1phCUJfv+ajLzkjOybaEmKuLzPhP53+GMI1MEffIXSJ8aOD1fUryTgqRFpZmuOgQz703QcUwiyDQ7zTnwkd0t2WTmdWYjA5P+eC3iFv5wy0kjv+zsv6JIdF1ZbvKp2BERbvIQDK+2zD3biBRSd7xNWzVA8T3s+LcpWWlf89I/2AX5v6X982YEH0BAxy9CJjw== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jun 2020 13:43:32.0403 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a14099a5-1523-4e8a-14c2-08d8177b6b52 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB4743 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,Tomas.Pilar@arm.com X-Gm-Message-State: 9A1WoOPbO5u7H5tQ29OAUdVZx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1592919818; bh=uRIZNubEqjWeIFPTIo+XkT8JJlSJm2kNNOmiByU18to=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=KuBV9KFYfe8P2WzVmS2wG9tO6ULekn5JHKI9Co5vnHsQBZ2In4Gsc2h5mqlv4SL5OPi RsM4gDTgc8Fkr0VfKWCXWpAEVbtjdEjDvTZ7gBZdgdF/TY762g5BJwvgSDTAt/o5lETBQ GxNRaFTtEvREI0xUVGwdgwDXStSP+K9m95c= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The table count module level symbols are now reset when executing the core method, rather than the shell command wrapper. Cc: Ray Ni Cc: Zhichao Gao Reviewed-by: Zhichao Gao Signed-off-by: Tomas Pilar --- ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c b/Shel= lPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c index b068dd4d2722..40778374af45 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c @@ -255,6 +255,10 @@ AcpiView ( EfiConfigurationTable =3D NULL; OriginalAttribute =3D 0; =20 + // Reset Table counts + mTableCount =3D 0; + mBinTableCount =3D 0; + // Reset The error/warning counters ResetErrorCount (); ResetWarningCount (); @@ -390,9 +394,7 @@ ShellCommandRunAcpiView ( CONST CHAR16* MandatoryTableSpecStr; CONST CHAR16 *SelectedTableName; =20 - // Set Defaults - mTableCount =3D 0; - mBinTableCount =3D 0; + // Set configuration defaults AcpiConfigSetDefaults (); =20 ShellStatus =3D SHELL_SUCCESS; --=20 2.24.1.windows.2 -=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 (#61602): https://edk2.groups.io/g/devel/message/61602 Mute This Topic: https://groups.io/mt/75059840/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 Wed Apr 24 05:33:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+61605+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 1592919822713834.656192296379; Tue, 23 Jun 2020 06:43:42 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id NWK6YY1788612xxg0qqCoGi2; Tue, 23 Jun 2020 06:43:42 -0700 X-Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.45]) by mx.groups.io with SMTP id smtpd.web12.7197.1592919817711753510 for ; Tue, 23 Jun 2020 06:43:38 -0700 X-Received: from AM6P194CA0064.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:84::41) by AM0PR08MB3553.eurprd08.prod.outlook.com (2603:10a6:208:de::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Tue, 23 Jun 2020 13:43:34 +0000 X-Received: from VE1EUR03FT037.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:84:cafe::5d) by AM6P194CA0064.outlook.office365.com (2603:10a6:209:84::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Tue, 23 Jun 2020 13:43:34 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+61605+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT037.mail.protection.outlook.com (10.152.19.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Tue, 23 Jun 2020 13:43:33 +0000 X-Received: ("Tessian outbound f44be76249db:v59"); Tue, 23 Jun 2020 13:43:33 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: f04fe14048f53718 X-CR-MTA-TID: 64aa7808 X-Received: from a02c9f8f2f95.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E35E2058-9853-4D06-A6F1-9338DB59AD72.1; Tue, 23 Jun 2020 13:43:27 +0000 X-Received: from EUR02-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a02c9f8f2f95.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 23 Jun 2020 13:43:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dkthsU1BOwpsYzLXNPnWlQtxAZ0LlEwRrNM5jsqb2m63cOq1CW7XVR6DGS8O0SAZ/UzpnjDXIdXjUT7iO9MFoXCUr2WhEhD7fZK0woS31L+rW8dHsnMpKhF99WgIFgKX7Ot+1DeSy1RlbJp0yiYZkY1mcabvXzfQo1H8FE2Se1KsZngLvs1VHbTjDGG6P+4nv94I+CtdJ2zHtts1Cr1g6Spk1t43JqFTB9jRAnCq3Oa0CMVdl8mxtrvraRKReZn4akgruE2vurvo23CWUcknmMjXQj9XretK8BGifpo/R80FxzSrHzr+dh/gTCZcHA/Rzxp+bMKUNnvCg2FImKBfDA== 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=myMYj4TNYgLfwXzec+gZX/2vUHojrDz6qpGBSuEHd+I=; b=PpNQ0mD2rlO19nmpCVmQ2/Kpz2RuI+lWfXVi8Rp40c7yfTLVwB4J8+nXBHd0Nbz1pEGL+eA8EkmvYm6ca+2a2c5SWeo5OqnfAQ+FO4Ee+ZdU+OKEMxvM6YiDyLaFvLUaxtupBFz5uOBPjrKV0qBQusmxpRwmpOj98p0hGfWHRgBKh5WMisKXofDzJZ7tMPfRUWe6jWdENZGStG4Wnyvhsvx1cBdbdGlrw2dLGu3xg3fwbnjajGns0IXtp+7vCZjyYJ18glm/XOL23BTAAvxSSUZMvCm5Zte+rrk2QNc9ia21FRGD64pbvWh1gd9PmO2ipp4QTUcEOEBSVoiGwIb1OA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=bestguesspass action=none header.from=arm.com; dkim=none (message not signed); arc=none X-Received: from DB6PR0201CA0026.eurprd02.prod.outlook.com (2603:10a6:4:3f::36) by DB8PR08MB5050.eurprd08.prod.outlook.com (2603:10a6:10:e2::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.23; Tue, 23 Jun 2020 13:43:25 +0000 X-Received: from DB5EUR03FT003.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:3f:cafe::c8) by DB6PR0201CA0026.outlook.office365.com (2603:10a6:4:3f::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Tue, 23 Jun 2020 13:43:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (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=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; X-Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT003.mail.protection.outlook.com (10.152.20.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3109.22 via Frontend Transport; Tue, 23 Jun 2020 13:43:25 +0000 X-Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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; Tue, 23 Jun 2020 13:43:23 +0000 X-Received: from localhost.localdomain (10.57.20.205) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Tue, 23 Jun 2020 13:43:23 +0000 From: "Tomas Pilar (tpilar)" To: CC: , , Ray Ni , "Zhichao Gao" Subject: [edk2-devel] [PATCH v4 4/7] ShellPkg/AcpiView: Move parameter parsing Date: Tue, 23 Jun 2020 14:43:01 +0100 Message-ID: <20200623134304.2619-5-Tomas.Pilar@arm.com> In-Reply-To: <20200623134304.2619-1-Tomas.Pilar@arm.com> References: <20200623134304.2619-1-Tomas.Pilar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFTY:;SFS:(4636009)(376002)(346002)(136003)(39860400002)(396003)(46966005)(356005)(2616005)(82310400002)(8676002)(81166007)(5660300002)(30864003)(86362001)(6916009)(8936002)(1076003)(47076004)(82740400003)(336012)(426003)(70586007)(70206006)(6666004)(83380400001)(4326008)(186003)(2906002)(26005)(478600001)(36756003)(316002)(54906003);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5419a46e-9604-46b9-3d3c-08d8177b6c7d X-MS-TrafficTypeDiagnostic: DB8PR08MB5050:|AM0PR08MB3553: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:3044;OLM:3044; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: n9KQYuvgWDmDHNfYVSXkEgK1gkZGkx/bRjoeXqU/3A/UKz/seWbny6+CBb9cIda3zGfpLUf6VmhSZdVs/dFASO69InGgTY1IKYUBZGJ1GszL2QaRdfG5fcDl6rCPwwNBk588bOxR1Cw7txbCHFTGsrAYTX/ck7GmSQBwGb0nx9NjvUjLL2u4v6u45qnuIcCQiguMVR9Nf/k7a4IZJGyx4yfrXWY/oIs1Bwh/lmXxvFflfQifiXBGKSd4q8CopNj/jOEN9nhGzjbc7ikmQGSsm+rIQEOTrbhzDyFAwJFJY1t4GPw6Vc8OKGNR9JOJfylIxYlh9GErMf1bBPDAe68Dsy2R+1MI9inx3f0OPrEUp1O6Tks8gyXusqHNuOx/KqkKYLut9eEwOrHhfRNYf192nw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5050 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT037.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: b6dd7d2b-6d4f-437a-41f9-08d8177b677c X-Microsoft-Antispam-Message-Info: DZ6ToEKc5yIIqs5B9Pw8LlTe/LHlx41Ji7pQt55NgefBkAb5sPVrFNQw19d2rPTxvaPpLoZcUuQ6vaNPvISUFMKNmurEGd7mbRPUdl9CPP6AVpj3juq/Ajs5Xej28j4exvEth3JNDE+c3ELO1djyNfd1C6DaOL4DfY9Ievx50/uvs190XzZyJeaWGStpoQxweClRnEeL/BZ2XjBMBScjYQFPN988VN4wbqFRU7F6kQJ13OATv0gD21j0aJ2rmLxh2Qmzv3Yy/TJJ3Nzl7uSmWS3GurxA9lQRKHbO6G8556VIqPXbBznr8XMTPU6uXHZv4VvayxZQXX2XYvvV8A0y2uGllj6xNzHFMmaeUlYKYLOCoOHIg0lo+LJ/GyV+XWZu/zF2TasxAG3uVRUe+QSY8g== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jun 2020 13:43:33.9979 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5419a46e-9604-46b9-3d3c-08d8177b6c7d X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3553 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,Tomas.Pilar@arm.com X-Gm-Message-State: KiZIbX5d7ADTliFRfGdEFvNzx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1592919822; bh=kXt0V4CXmNxLWdISx2YJr+MzHbgx4E08Wz9i9V25bY8=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=MI5aqkXQrmoWPUagLUTIFOZmz9CZPIjHazUZXZ0qQWG4WD0rU73eJ06NKGmd4HP6uGg cKCuyASiIGJCZOa6ftUOdNytLVKmHNKM14A4UTohbeF4zNbKVo4xdtkXzK5mStpP23mAu oYks6hLWd7vAypTHUc6Z8x/4vKnYC00JwX0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Parsing command line parameters is done in the shell command wrapper. This declutters the core code and improves modular design. Cc: Ray Ni Cc: Zhichao Gao Reviewed-by: Zhichao Gao Signed-off-by: Tomas Pilar --- .../UefiShellAcpiViewCommandLib/AcpiView.c | 205 ---------------- .../UefiShellAcpiViewCommandLib/AcpiView.h | 18 +- .../UefiShellAcpiViewCommandLib.c | 218 +++++++++++++++++- .../UefiShellAcpiViewCommandLib.h | 10 +- 4 files changed, 240 insertions(+), 211 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c b/Shel= lPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c index 40778374af45..e524fcb0b27a 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c @@ -32,19 +32,6 @@ EFI_HII_HANDLE gShellAcpiViewHiiHandle =3D NULL; STATIC UINT32 mTableCount; STATIC UINT32 mBinTableCount; =20 -/** - An array of acpiview command line parameters. -**/ -STATIC CONST SHELL_PARAM_ITEM ParamList[] =3D { - {L"-q", TypeFlag}, - {L"-d", TypeFlag}, - {L"-h", TypeFlag}, - {L"-l", TypeFlag}, - {L"-s", TypeValue}, - {L"-r", TypeValue}, - {NULL, TypeMax} -}; - /** This function dumps the ACPI table to a file. =20 @@ -228,7 +215,6 @@ ProcessTableReportOptions ( Returns EFI_UNSUPPORTED if the RSDP version is less than 2. Returns EFI_SUCCESS if successful. **/ -STATIC EFI_STATUS EFIAPI AcpiView ( @@ -372,194 +358,3 @@ AcpiView ( } return EFI_SUCCESS; } - -/** - Function for 'acpiview' command. - - @param[in] ImageHandle Handle to the Image (NULL if Internal). - @param[in] SystemTable Pointer to the System Table (NULL if Internal). -**/ -SHELL_STATUS -EFIAPI -ShellCommandRunAcpiView ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE* SystemTable - ) -{ - EFI_STATUS Status; - SHELL_STATUS ShellStatus; - LIST_ENTRY* Package; - CHAR16* ProblemParam; - SHELL_FILE_HANDLE TmpDumpFileHandle; - CONST CHAR16* MandatoryTableSpecStr; - CONST CHAR16 *SelectedTableName; - - // Set configuration defaults - AcpiConfigSetDefaults (); - - ShellStatus =3D SHELL_SUCCESS; - Package =3D NULL; - TmpDumpFileHandle =3D NULL; - - Status =3D ShellCommandLineParse (ParamList, &Package, &ProblemParam, TR= UE); - if (EFI_ERROR (Status)) { - if (Status =3D=3D EFI_VOLUME_CORRUPTED && ProblemParam !=3D NULL) { - ShellPrintHiiEx ( - -1, - -1, - NULL, - STRING_TOKEN (STR_GEN_PROBLEM), - gShellAcpiViewHiiHandle, - L"acpiview", - ProblemParam - ); - FreePool (ProblemParam); - } else { - Print (L"acpiview: Error processing input parameter(s)\n"); - } - ShellStatus =3D SHELL_INVALID_PARAMETER; - } else { - if (ShellCommandLineGetCount (Package) > 1) { - ShellPrintHiiEx ( - -1, - -1, - NULL, - STRING_TOKEN (STR_GEN_TOO_MANY), - gShellAcpiViewHiiHandle, - L"acpiview" - ); - ShellStatus =3D SHELL_INVALID_PARAMETER; - } else if (ShellCommandLineGetFlag (Package, L"-?")) { - ShellPrintHiiEx ( - -1, - -1, - NULL, - STRING_TOKEN (STR_GET_HELP_ACPIVIEW), - gShellAcpiViewHiiHandle, - L"acpiview" - ); - } else if (ShellCommandLineGetFlag (Package, L"-s") && - ShellCommandLineGetValue (Package, L"-s") =3D=3D NULL) { - ShellPrintHiiEx ( - -1, - -1, - NULL, - STRING_TOKEN (STR_GEN_NO_VALUE), - gShellAcpiViewHiiHandle, - L"acpiview", - L"-s" - ); - ShellStatus =3D SHELL_INVALID_PARAMETER; - } else if (ShellCommandLineGetFlag (Package, L"-r") && - ShellCommandLineGetValue (Package, L"-r") =3D=3D NULL) { - ShellPrintHiiEx ( - -1, - -1, - NULL, - STRING_TOKEN (STR_GEN_NO_VALUE), - gShellAcpiViewHiiHandle, - L"acpiview", - L"-r" - ); - ShellStatus =3D SHELL_INVALID_PARAMETER; - } else if ((ShellCommandLineGetFlag (Package, L"-s") && - ShellCommandLineGetFlag (Package, L"-l"))) { - ShellPrintHiiEx ( - -1, - -1, - NULL, - STRING_TOKEN (STR_GEN_TOO_MANY), - gShellAcpiViewHiiHandle, - L"acpiview" - ); - ShellStatus =3D SHELL_INVALID_PARAMETER; - } else if (ShellCommandLineGetFlag (Package, L"-d") && - !ShellCommandLineGetFlag (Package, L"-s")) { - ShellPrintHiiEx ( - -1, - -1, - NULL, - STRING_TOKEN (STR_GEN_MISSING_OPTION), - gShellAcpiViewHiiHandle, - L"acpiview", - L"-s", - L"-d" - ); - ShellStatus =3D SHELL_INVALID_PARAMETER; - } else { - // Turn on colour highlighting if requested - SetColourHighlighting (ShellCommandLineGetFlag (Package, L"-h")); - - // Surpress consistency checking if requested - SetConsistencyChecking (!ShellCommandLineGetFlag (Package, L"-q")); - - // Evaluate the parameters for mandatory ACPI table presence checks - SetMandatoryTableValidate (ShellCommandLineGetFlag (Package, L"-r")); - MandatoryTableSpecStr =3D ShellCommandLineGetValue (Package, L"-r"); - - if (MandatoryTableSpecStr !=3D NULL) { - SetMandatoryTableSpec (ShellHexStrToUintn (MandatoryTableSpecStr)); - } - - if (ShellCommandLineGetFlag (Package, L"-l")) { - SetReportOption (ReportTableList); - } else { - SelectedTableName =3D ShellCommandLineGetValue (Package, L"-s"); - if (SelectedTableName !=3D NULL) { - SelectAcpiTable (SelectedTableName); - SetReportOption (ReportSelected); - - if (ShellCommandLineGetFlag (Package, L"-d")) { - // Create a temporary file to check if the media is writable. - CHAR16 FileNameBuffer[MAX_FILE_NAME_LEN]; - SetReportOption (ReportDumpBinFile); - - UnicodeSPrint ( - FileNameBuffer, - sizeof (FileNameBuffer), - L".\\%s%04d.tmp", - SelectedTableName, - mBinTableCount - ); - - Status =3D ShellOpenFileByName ( - FileNameBuffer, - &TmpDumpFileHandle, - EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE | - EFI_FILE_MODE_CREATE, - 0 - ); - - if (EFI_ERROR (Status)) { - ShellStatus =3D SHELL_INVALID_PARAMETER; - TmpDumpFileHandle =3D NULL; - ShellPrintHiiEx ( - -1, - -1, - NULL, - STRING_TOKEN (STR_GEN_READONLY_MEDIA), - gShellAcpiViewHiiHandle, - L"acpiview" - ); - goto Done; - } - // Delete Temporary file. - ShellDeleteFile (&TmpDumpFileHandle); - } // -d - } // -s - } - - // Parse ACPI Table information - Status =3D AcpiView (SystemTable); - if (EFI_ERROR (Status)) { - ShellStatus =3D SHELL_NOT_FOUND; - } - } - } - -Done: - if (Package !=3D NULL) { - ShellCommandLineFreeVarList (Package); - } - return ShellStatus; -} diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h b/Shel= lPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h index 92d64a88814d..d5b95f5ee707 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h @@ -64,7 +64,7 @@ GetWarningCount ( =20 @param [in] Signature The ACPI table Signature. @param [in] TablePtr Pointer to the ACPI table data. - @param [in] Length The length fo the ACPI table. + @param [in] Length The length of the ACPI table. =20 @retval Returns TRUE if the ACPI table should be traced. **/ @@ -75,4 +75,20 @@ ProcessTableReportOptions ( IN CONST UINT32 Length ); =20 +/** + This function iterates the configuration table entries in the + system table, retrieves the RSDP pointer and starts parsing the ACPI tab= les. + + @param [in] SystemTable Pointer to the EFI system table. + + @retval EFI_NOT_FOUND The RSDP pointer was not found. + @retval EFI_UNSUPPORTED The RSDP version was less than 2. + @retval EFI_SUCCESS The command was successful. +**/ +EFI_STATUS +EFIAPI +AcpiView ( + IN EFI_SYSTEM_TABLE* SystemTable + ); + #endif // ACPIVIEW_H_ diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiView= CommandLib.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiVi= ewCommandLib.c index e0d5a8108552..c3942ad24e5b 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.c @@ -1,24 +1,44 @@ /** @file Main file for 'acpiview' Shell command function. =20 - Copyright (c) 2016 - 2019, ARM Limited. All rights reserved.
+ Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 #include #include + +#include #include +#include +#include #include -#include +#include #include +#include #include + #include "AcpiParser.h" #include "AcpiTableParser.h" #include "AcpiView.h" +#include "AcpiViewConfig.h" #include "UefiShellAcpiViewCommandLib.h" =20 CONST CHAR16 gShellAcpiViewFileName[] =3D L"ShellCommand"; =20 +/** + An array of acpiview command line parameters. +**/ +STATIC CONST SHELL_PARAM_ITEM ParamList[] =3D { + {L"-q", TypeFlag}, + {L"-d", TypeFlag}, + {L"-h", TypeFlag}, + {L"-l", TypeFlag}, + {L"-s", TypeValue}, + {L"-r", TypeValue}, + {NULL, TypeMax} +}; + /** A list of available table parsers. */ @@ -92,6 +112,200 @@ ShellCommandGetManFileNameAcpiView ( return gShellAcpiViewFileName; } =20 +/** + Function for 'acpiview' command. + + @param[in] ImageHandle Handle to the Image (NULL if internal). + @param[in] SystemTable Pointer to the System Table (NULL if internal). + + @retval SHELL_INVALID_PARAMETER The command line invocation could not be= parsed + @retval SHELL_NOT_FOUND The command failed + @retval SHELL_SUCCESS The command was successful +**/ +SHELL_STATUS +EFIAPI +ShellCommandRunAcpiView ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE* SystemTable + ) +{ + EFI_STATUS Status; + SHELL_STATUS ShellStatus; + LIST_ENTRY* Package; + CHAR16* ProblemParam; + SHELL_FILE_HANDLE TmpDumpFileHandle; + CONST CHAR16* MandatoryTableSpecStr; + CONST CHAR16* SelectedTableName; + + // Set configuration defaults + AcpiConfigSetDefaults (); + + ShellStatus =3D SHELL_SUCCESS; + Package =3D NULL; + TmpDumpFileHandle =3D NULL; + + Status =3D ShellCommandLineParse (ParamList, &Package, &ProblemParam, TR= UE); + if (EFI_ERROR (Status)) { + if (Status =3D=3D EFI_VOLUME_CORRUPTED && ProblemParam !=3D NULL) { + ShellPrintHiiEx ( + -1, + -1, + NULL, + STRING_TOKEN (STR_GEN_PROBLEM), + gShellAcpiViewHiiHandle, + L"acpiview", + ProblemParam + ); + FreePool (ProblemParam); + } else { + Print (L"acpiview: Error processing input parameter(s)\n"); + } + ShellStatus =3D SHELL_INVALID_PARAMETER; + } else { + if (ShellCommandLineGetCount (Package) > 1) { + ShellPrintHiiEx ( + -1, + -1, + NULL, + STRING_TOKEN (STR_GEN_TOO_MANY), + gShellAcpiViewHiiHandle, + L"acpiview" + ); + ShellStatus =3D SHELL_INVALID_PARAMETER; + } else if (ShellCommandLineGetFlag (Package, L"-?")) { + ShellPrintHiiEx ( + -1, + -1, + NULL, + STRING_TOKEN (STR_GET_HELP_ACPIVIEW), + gShellAcpiViewHiiHandle, + L"acpiview" + ); + } else if (ShellCommandLineGetFlag (Package, L"-s") && + ShellCommandLineGetValue (Package, L"-s") =3D=3D NULL) { + ShellPrintHiiEx ( + -1, + -1, + NULL, + STRING_TOKEN (STR_GEN_NO_VALUE), + gShellAcpiViewHiiHandle, + L"acpiview", + L"-s" + ); + ShellStatus =3D SHELL_INVALID_PARAMETER; + } else if (ShellCommandLineGetFlag (Package, L"-r") && + ShellCommandLineGetValue (Package, L"-r") =3D=3D NULL) { + ShellPrintHiiEx ( + -1, + -1, + NULL, + STRING_TOKEN (STR_GEN_NO_VALUE), + gShellAcpiViewHiiHandle, + L"acpiview", + L"-r" + ); + ShellStatus =3D SHELL_INVALID_PARAMETER; + } else if ((ShellCommandLineGetFlag (Package, L"-s") && + ShellCommandLineGetFlag (Package, L"-l"))) { + ShellPrintHiiEx ( + -1, + -1, + NULL, + STRING_TOKEN (STR_GEN_TOO_MANY), + gShellAcpiViewHiiHandle, + L"acpiview" + ); + ShellStatus =3D SHELL_INVALID_PARAMETER; + } else if (ShellCommandLineGetFlag (Package, L"-d") && + !ShellCommandLineGetFlag (Package, L"-s")) { + ShellPrintHiiEx ( + -1, + -1, + NULL, + STRING_TOKEN (STR_GEN_MISSING_OPTION), + gShellAcpiViewHiiHandle, + L"acpiview", + L"-s", + L"-d" + ); + ShellStatus =3D SHELL_INVALID_PARAMETER; + } else { + // Turn on colour highlighting if requested + SetColourHighlighting (ShellCommandLineGetFlag (Package, L"-h")); + + // Surpress consistency checking if requested + SetConsistencyChecking (!ShellCommandLineGetFlag (Package, L"-q")); + + // Evaluate the parameters for mandatory ACPI table presence checks + SetMandatoryTableValidate (ShellCommandLineGetFlag (Package, L"-r")); + MandatoryTableSpecStr =3D ShellCommandLineGetValue (Package, L"-r"); + + if (MandatoryTableSpecStr !=3D NULL) { + SetMandatoryTableSpec (ShellHexStrToUintn (MandatoryTableSpecStr)); + } + + if (ShellCommandLineGetFlag (Package, L"-l")) { + SetReportOption (ReportTableList); + } else { + SelectedTableName =3D ShellCommandLineGetValue (Package, L"-s"); + if (SelectedTableName !=3D NULL) { + SelectAcpiTable (SelectedTableName); + SetReportOption (ReportSelected); + + if (ShellCommandLineGetFlag (Package, L"-d")) { + // Create a temporary file to check if the media is writable. + CHAR16 FileNameBuffer[MAX_FILE_NAME_LEN]; + SetReportOption (ReportDumpBinFile); + + UnicodeSPrint ( + FileNameBuffer, + sizeof (FileNameBuffer), + L".\\%s0000.tmp", + SelectedTableName + ); + + Status =3D ShellOpenFileByName ( + FileNameBuffer, + &TmpDumpFileHandle, + EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE | + EFI_FILE_MODE_CREATE, + 0 + ); + + if (EFI_ERROR (Status)) { + ShellStatus =3D SHELL_INVALID_PARAMETER; + TmpDumpFileHandle =3D NULL; + ShellPrintHiiEx ( + -1, + -1, + NULL, + STRING_TOKEN (STR_GEN_READONLY_MEDIA), + gShellAcpiViewHiiHandle, + L"acpiview" + ); + goto Done; + } + // Delete Temporary file. + ShellDeleteFile (&TmpDumpFileHandle); + } // -d + } // -s + } + + // Parse ACPI Table information + Status =3D AcpiView (SystemTable); + if (EFI_ERROR (Status)) { + ShellStatus =3D SHELL_NOT_FOUND; + } + } + } + +Done: + if (Package !=3D NULL) { + ShellCommandLineFreeVarList (Package); + } + return ShellStatus; +} + /** Constructor for the Shell AcpiView Command library. =20 diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiView= CommandLib.h b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiVi= ewCommandLib.h index c1cf7a57af7a..a3a29164004d 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.h +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.h @@ -1,7 +1,7 @@ /** @file Header file for 'acpiview' Shell command functions. =20 - Copyright (c) 2016 - 2017, ARM Limited. All rights reserved.
+ Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 @@ -13,8 +13,12 @@ extern EFI_HII_HANDLE gShellAcpiViewHiiHandle; /** Function for 'acpiview' command. =20 - @param[in] ImageHandle Handle to the Image (NULL if Internal). - @param[in] SystemTable Pointer to the System Table (NULL if Internal). + @param[in] ImageHandle Handle to the Image (NULL if internal). + @param[in] SystemTable Pointer to the System Table (NULL if internal). + + @retval SHELL_INVALID_PARAMETER The command line invocation could not be= parsed + @retval SHELL_NOT_FOUND The command failed + @retval SHELL_SUCCESS The command was successful **/ SHELL_STATUS EFIAPI --=20 2.24.1.windows.2 -=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 (#61605): https://edk2.groups.io/g/devel/message/61605 Mute This Topic: https://groups.io/mt/75059844/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 Wed Apr 24 05:33:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+61606+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 1592919822839133.3414792158609; Tue, 23 Jun 2020 06:43:42 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id ZJ1mYY1788612x5fKQUFwdga; Tue, 23 Jun 2020 06:43:42 -0700 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.60]) by mx.groups.io with SMTP id smtpd.web12.7198.1592919820120164383 for ; Tue, 23 Jun 2020 06:43:40 -0700 X-Received: from AM6PR10CA0103.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:8c::44) by AM0PR08MB4307.eurprd08.prod.outlook.com (2603:10a6:208:13d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Tue, 23 Jun 2020 13:43:37 +0000 X-Received: from AM5EUR03FT058.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8c:cafe::fb) by AM6PR10CA0103.outlook.office365.com (2603:10a6:209:8c::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.24 via Frontend Transport; Tue, 23 Jun 2020 13:43:37 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+61606+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT058.mail.protection.outlook.com (10.152.17.48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Tue, 23 Jun 2020 13:43:37 +0000 X-Received: ("Tessian outbound 217a52b9caed:v59"); Tue, 23 Jun 2020 13:43:37 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 254210a84c8a626e X-CR-MTA-TID: 64aa7808 X-Received: from eb8b7ed66e5b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 2FCA9798-BFBA-4DFF-895B-C5A28C97F4D7.1; Tue, 23 Jun 2020 13:43:31 +0000 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id eb8b7ed66e5b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 23 Jun 2020 13:43:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YynomxVwgP8hkhS83xoWyYtthzvv4PyAqB1+FeqadPF6UPMd9QChKyZOdUkig19I9svIfThQU8Za3N1fsfxgwWYz+Oex6SroHaiKWFNWm5fbJc6XFf5Hjg17uaDhDVwJ9L1seJkO8rzPmhaTelHDU/nHuawjIrVuby39J7KlLFs/N/iFGYKWC0Kx9iJTvMPXjiDYeIl+waieCMmTNxTuxAoyzBZK/M9a7gobiy9BMmhHKb/fHaN1/L0p0+4ZbpGZ8i3Mr8LAzo39/LoFFS649W8AO1Alk8s1JOxgWV47HpXzWYcirsfk7tb/p7bAK9Aoy5jJ2J1EnEM47OB6rF1O8w== 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=km04FZL++i0I1dy/rVy4hxMVHs/7YsTjVEWvaILGQTs=; b=kIXHVnRiMj5zVTuVGGp0Xm2lJjGV20TD3+XuZfAwOjoTapor642Q4HMhEYR+1EKaP+gb1Z7JFEg16KuaZZddohMKwUCpcy+KnCHfzwzNFkiCFa4Ry/r2v1O886ireKOU75A46GkV8H59vS+QI2gev6ZIoDTNx+Xxot0SMxckljZDPB/ny2HYfn6N8tL5RYeSsT0yOlH5Wy/u0lZk9TVa1fBIRcKSJNPdcyW3+7idFACWyHDCyTo8wEKODr+C4DK2ns/lmANXUO8Dvu+ZZkjWQZcYPC3p1RiCUDu0IHSBycvKvQME4fPFwQUyikek15MDVb14akdz8o74d3C7WlUaqw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=bestguesspass action=none header.from=arm.com; dkim=none (message not signed); arc=none X-Received: from DB6PR0201CA0027.eurprd02.prod.outlook.com (2603:10a6:4:3f::37) by VI1PR08MB3197.eurprd08.prod.outlook.com (2603:10a6:803:3e::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Tue, 23 Jun 2020 13:43:30 +0000 X-Received: from DB5EUR03FT003.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:3f:cafe::97) by DB6PR0201CA0027.outlook.office365.com (2603:10a6:4:3f::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Tue, 23 Jun 2020 13:43:30 +0000 X-MS-Exchange-Authentication-Results: spf=pass (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=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; X-Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT003.mail.protection.outlook.com (10.152.20.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3109.22 via Frontend Transport; Tue, 23 Jun 2020 13:43:30 +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; Tue, 23 Jun 2020 13:43:24 +0000 X-Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.1779.2; Tue, 23 Jun 2020 13:43:24 +0000 X-Received: from localhost.localdomain (10.57.20.205) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Tue, 23 Jun 2020 13:43:24 +0000 From: "Tomas Pilar (tpilar)" To: CC: , , Ray Ni , "Zhichao Gao" Subject: [edk2-devel] [PATCH v4 5/7] ShellPkg/AcpiView: Refactor DumpAcpiTableToFile Date: Tue, 23 Jun 2020 14:43:02 +0100 Message-ID: <20200623134304.2619-6-Tomas.Pilar@arm.com> In-Reply-To: <20200623134304.2619-1-Tomas.Pilar@arm.com> References: <20200623134304.2619-1-Tomas.Pilar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFTY:;SFS:(6029001)(4636009)(39860400002)(136003)(396003)(346002)(376002)(46966005)(8936002)(356005)(336012)(82310400002)(81166007)(2906002)(316002)(478600001)(426003)(2616005)(1076003)(6666004)(47076004)(186003)(26005)(82740400003)(4326008)(8676002)(83380400001)(5660300002)(70206006)(70586007)(6916009)(86362001)(36756003)(54906003);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9acdb35b-fb85-424e-5b06-08d8177b6e74 X-MS-TrafficTypeDiagnostic: VI1PR08MB3197:|AM0PR08MB4307: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:9508;OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: yO47sphk8at98zJ1HHIdFUWh2ynNuHWIETjZ/cfMAIdti0tv9SqQuXQC9Iq2nsQKG/PxfwuqfLFxLY6emji4Cc+aFKc+vCz1ZG39aUzCuuzpl+Qp8ErzZgpwsd3VEhXWV4AcFfSksLeb/R1Cb3ZrHzTmnZOnR2qvvq4lrPp22uC/Fdl3/0L+AeISraU9HZVXt7twD4h3LhkLQD8JBQ8dNP98DIOB6kuIeSe1BMO+6yzr1j0vaDUqivJGqRsf1i54vO2qavOA/q2xN0zcJu7QjEsVRE5QZ9+PFk0hReimJsMrI/UNwyqD4r2Tdy45GN53v1XGm9LoBPfDUZDtQZJ/7sHl9F7twiD0sPxS40jJeD40sTY+3FARx0zcTXoS2EmClrBYmXVdcs+RVIC1xmxkqQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3197 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT058.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 304e9d9f-4c6b-4d26-b8f4-08d8177b6a1f X-Microsoft-Antispam-Message-Info: edS/TQNxS5CVfP724c4qE/Uh/mXKFPnqvM2UY9nVE1k9Uk0h7xmwFltW+RYbPmjjg7r2Ci1yRMw+m6xRmRgTBaQtXba46Nme93djx2x5Dzs+CBXd8QnVpMv3olmIvyUduKhdO/fUvlunZCCacUIbbQ9XUdKvsfYRpqgi15givoig1UIgdQZQR1zEfR5y6FOnIxIxc0sk0LAUse1cKvD9apDArfA5CQ4nBlBELMhysEBHZskX+B4iGbF2TwvPzYzRZuU6ASVGKpNpW+Aqr0rfKvMmZCjk8oOfVqxfy61SBQ8eTyp+101tW3+1shA5QTj5IWjRQsOgL4/XqfBrU5hc+Vc1InYrV+Bztx8UFnFntONCt7NbP19vyj+ggyHFnEiU56z6ZMMzATIvkWXfwrIrMA== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jun 2020 13:43:37.3850 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9acdb35b-fb85-424e-5b06-08d8177b6e74 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB4307 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,Tomas.Pilar@arm.com X-Gm-Message-State: iezbMMXSiIOGNsSOhbjwf11qx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1592919822; bh=7Cpe8nHlg0fDXm2KB84nMUp0+JTVDFCAOxCQYBHhJsE=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=YcIU3r9NQhM6CUzW0G/Xc6K+bVK0kVr920x8tBuQACh/kP34zJ2V3nAdypBIwoTS0ir lbQ0O9YrCnCESpH6A5yvNyRBCWF3AQofDDZ2axlOeIqNYSQHP2ACQpVzrJYnBG1jfshDf eO7q3JmB1uQeLrMUrczKL5JhuMtgFYQE4qw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Method is refactored into two parts. A new method is created that dumps arbitrary buffers into a newly created file. This method is called from core code after the core code determined the appropriate filename to be used. This improves the modular design. Cc: Ray Ni Cc: Zhichao Gao Reviewed-by: Zhichao Gao Signed-off-by: Tomas Pilar --- .../UefiShellAcpiViewCommandLib/AcpiView.c | 38 +----------- .../UefiShellAcpiViewCommandLib.c | 59 +++++++++++++++++++ .../UefiShellAcpiViewCommandLib.h | 17 +++++- 3 files changed, 76 insertions(+), 38 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c b/Shel= lPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c index e524fcb0b27a..d2240b2e89d5 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c @@ -27,8 +27,6 @@ #include "Arm/SbbrValidator.h" #endif =20 -EFI_HII_HANDLE gShellAcpiViewHiiHandle =3D NULL; - STATIC UINT32 mTableCount; STATIC UINT32 mBinTableCount; =20 @@ -48,14 +46,10 @@ DumpAcpiTableToFile ( IN CONST UINTN Length ) { - EFI_STATUS Status; CHAR16 FileNameBuffer[MAX_FILE_NAME_LEN]; - SHELL_FILE_HANDLE DumpFileHandle; UINTN TransferBytes; SELECTED_ACPI_TABLE *SelectedTable; =20 - DumpFileHandle =3D NULL; - TransferBytes =3D Length; GetSelectedAcpiTable (&SelectedTable); =20 UnicodeSPrint ( @@ -66,39 +60,9 @@ DumpAcpiTableToFile ( mBinTableCount++ ); =20 - Status =3D ShellOpenFileByName ( - FileNameBuffer, - &DumpFileHandle, - EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_CREA= TE, - 0 - ); - if (EFI_ERROR (Status)) { - ShellPrintHiiEx ( - -1, - -1, - NULL, - STRING_TOKEN (STR_GEN_READONLY_MEDIA), - gShellAcpiViewHiiHandle, - L"acpiview" - ); - return FALSE; - } - Print (L"Dumping ACPI table to : %s ... ", FileNameBuffer); =20 - Status =3D ShellWriteFile ( - DumpFileHandle, - &TransferBytes, - (VOID*)Ptr - ); - if (EFI_ERROR (Status)) { - Print (L"ERROR: Failed to dump table to binary file.\n"); - TransferBytes =3D 0; - } else { - Print (L"DONE.\n"); - } - - ShellCloseFile (&DumpFileHandle); + TransferBytes =3D ShellDumpBufferToFile (FileNameBuffer, Ptr, Length); return (Length =3D=3D TransferBytes); } =20 diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiView= CommandLib.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiVi= ewCommandLib.c index c3942ad24e5b..e6a65d5bc5f7 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.c @@ -25,6 +25,7 @@ #include "UefiShellAcpiViewCommandLib.h" =20 CONST CHAR16 gShellAcpiViewFileName[] =3D L"ShellCommand"; +EFI_HII_HANDLE gShellAcpiViewHiiHandle =3D NULL; =20 /** An array of acpiview command line parameters. @@ -98,6 +99,64 @@ RegisterAllParsers ( return Status; } =20 +/** + Dump a buffer to a file. Print error message if a file cannot be created. + + @param[in] FileName The filename that shall be created to contain the = buffer. + @param[in] Buffer Pointer to buffer that shall be dumped. + @param[in] BufferSize The size of buffer to be dumped in bytes. + + @return The number of bytes that were written +**/ +UINTN +EFIAPI +ShellDumpBufferToFile ( + IN CONST CHAR16* FileNameBuffer, + IN CONST VOID* Buffer, + IN CONST UINTN BufferSize + ) +{ + EFI_STATUS Status; + SHELL_FILE_HANDLE DumpFileHandle; + UINTN TransferBytes; + + Status =3D ShellOpenFileByName ( + FileNameBuffer, + &DumpFileHandle, + EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_CREA= TE, + 0 + ); + + if (EFI_ERROR (Status)) { + ShellPrintHiiEx ( + -1, + -1, + NULL, + STRING_TOKEN (STR_GEN_READONLY_MEDIA), + gShellAcpiViewHiiHandle, + L"acpiview" + ); + return 0; + } + + TransferBytes =3D BufferSize; + Status =3D ShellWriteFile ( + DumpFileHandle, + &TransferBytes, + (VOID *) Buffer + ); + + if (EFI_ERROR (Status)) { + Print (L"ERROR: Failed to write binary file.\n"); + TransferBytes =3D 0; + } else { + Print (L"DONE.\n"); + } + + ShellCloseFile (&DumpFileHandle); + return TransferBytes; +} + /** Return the file name of the help text file if not using HII. =20 diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiView= CommandLib.h b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiVi= ewCommandLib.h index a3a29164004d..b1b1ffe63e28 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.h +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.h @@ -8,7 +8,22 @@ #ifndef UEFI_SHELL_ACPIVIEW_COMMAND_LIB_H_ #define UEFI_SHELL_ACPIVIEW_COMMAND_LIB_H_ =20 -extern EFI_HII_HANDLE gShellAcpiViewHiiHandle; +/** + Dump a buffer to a file. Print error message if a file cannot be created. + + @param[in] FileName The filename that shall be created to contain the = buffer. + @param[in] Buffer Pointer to buffer that shall be dumped. + @param[in] BufferSize The size of buffer to be dumped in bytes. + + @return The number of bytes that were written +**/ +UINTN +EFIAPI +ShellDumpBufferToFile ( + IN CONST CHAR16* FileNameBuffer, + IN CONST VOID* Buffer, + IN CONST UINTN BufferSize + ); =20 /** Function for 'acpiview' command. --=20 2.24.1.windows.2 -=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 (#61606): https://edk2.groups.io/g/devel/message/61606 Mute This Topic: https://groups.io/mt/75059846/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 Wed Apr 24 05:33:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+61604+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 1592919821337174.53710112849205; Tue, 23 Jun 2020 06:43:41 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id BBhPYY1788612x32DHmmyl3o; Tue, 23 Jun 2020 06:43:41 -0700 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.85]) by mx.groups.io with SMTP id smtpd.web10.7132.1592919816787416437 for ; Tue, 23 Jun 2020 06:43:37 -0700 X-Received: from AM7PR04CA0014.eurprd04.prod.outlook.com (2603:10a6:20b:110::24) by HE1PR0802MB2330.eurprd08.prod.outlook.com (2603:10a6:3:c8::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.23; Tue, 23 Jun 2020 13:43:33 +0000 X-Received: from AM5EUR03FT007.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:110:cafe::8a) by AM7PR04CA0014.outlook.office365.com (2603:10a6:20b:110::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Tue, 23 Jun 2020 13:43:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+61604+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT007.mail.protection.outlook.com (10.152.16.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Tue, 23 Jun 2020 13:43:33 +0000 X-Received: ("Tessian outbound f44be76249db:v59"); Tue, 23 Jun 2020 13:43:33 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 45f1059b2c20f3fc X-CR-MTA-TID: 64aa7808 X-Received: from b1d2ee627343.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 17A44993-0C83-48FC-87DF-D772B37DD06C.1; Tue, 23 Jun 2020 13:43:27 +0000 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b1d2ee627343.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 23 Jun 2020 13:43:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c66wzFAKDrkIgEyJizWR26JOH574euRZfRrWZUa+AmjFIoJoIAp86VDYAUFC+sKfEcK48gvo9/2kMoZf5e/vj3NTEFHhJTYWcdp3Pn72Gnr9jGYKt05HvgEuhfw/IniF/iE3279VbIrCl2GziV3EqK+eKjO8l7Uf9zNIrc8pw+Ia4b2dI+u3sh05MMzjSg34G0hqsr2rDQDa5cBW2HtcoaP/yqphujgrcsS0r/f/U3b+u2qJzAyxW28x0DE01QbNK7bE8mcEz0fTbHdS0fseMrqPR8QqRAToMGWcfUPzs7C0Xi3zxuprIgW2zxE0NQsZOz/P5mSKfkpTadUXdylrdg== 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=zhAuSgA9qxy+CAa6wKlD9Sn+gxZTGXrPNGZhJq1ABzU=; b=eU+kd4oL03rem4DNizLdC0pfNNBkZLaFHcM16BPobdjsIighugHu9ZJsrFOFOpC/94KtBrWGxJMr418wvtEfM1ykj1gol91Xz/5EXkMJs2igtWSdmZTtMRkTUH55ORI4Z+A5V59whQdZYOfWCvVLAOBshHNNKnJDwN7omdwn7yfVMXT0rW9IamnuSCII7nxBrFPxSskvMMNvcmE3SIkwYFRwEcrJYXQKEpzspnNRyvvaeSE9r47+/2y/Z8m1rdNc5R7ScmvokGJo5Q2pHwMDXQ0U8CQS91R7lO9Ql9AcbumdnHYs7o6K+bBAjb4ODv3UChplmqn2mShaF5nhI2AQAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=bestguesspass action=none header.from=arm.com; dkim=none (message not signed); arc=none X-Received: from AM5PR0402CA0005.eurprd04.prod.outlook.com (2603:10a6:203:90::15) by DB8PR08MB5354.eurprd08.prod.outlook.com (2603:10a6:10:114::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Tue, 23 Jun 2020 13:43:26 +0000 X-Received: from AM5EUR03FT029.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:90:cafe::15) by AM5PR0402CA0005.outlook.office365.com (2603:10a6:203:90::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Tue, 23 Jun 2020 13:43:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (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=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; X-Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT029.mail.protection.outlook.com (10.152.16.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3109.22 via Frontend Transport; Tue, 23 Jun 2020 13:43:26 +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; Tue, 23 Jun 2020 13:43:25 +0000 X-Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.1779.2; Tue, 23 Jun 2020 13:43:24 +0000 X-Received: from localhost.localdomain (10.57.20.205) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Tue, 23 Jun 2020 13:43:24 +0000 From: "Tomas Pilar (tpilar)" To: CC: , , Ray Ni , "Zhichao Gao" Subject: [edk2-devel] [PATCH v4 6/7] ShellPkg: Add AcpiViewCommandLib Date: Tue, 23 Jun 2020 14:43:03 +0100 Message-ID: <20200623134304.2619-7-Tomas.Pilar@arm.com> In-Reply-To: <20200623134304.2619-1-Tomas.Pilar@arm.com> References: <20200623134304.2619-1-Tomas.Pilar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFTY:;SFS:(4636009)(136003)(346002)(39860400002)(396003)(376002)(46966005)(336012)(478600001)(8676002)(8936002)(6666004)(81166007)(2906002)(82310400002)(82740400003)(426003)(26005)(47076004)(186003)(356005)(83380400001)(2616005)(4326008)(70206006)(70586007)(36756003)(5660300002)(19627235002)(316002)(6916009)(54906003)(86362001)(1076003);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6c4998ba-a52d-4737-40c7-08d8177b6c16 X-MS-TrafficTypeDiagnostic: DB8PR08MB5354:|HE1PR0802MB2330: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8882;OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: c3ZpW7cIXyKKdf+Ga5ndNAFkxVD13HgAYnbPzbB3f1qK/YnZGiMkwNwrI6oR/7Kw6S0ysLIF+z+RnGCCV6kl15FH4Lx8BA8n64vv2NCw1NEXgUcKxNX49SLCzuc3LoztE6pEN0c+XzgflELGPgk1m+uqwFEIRRLli/9JwXK94pN1lH0j/5kWQB2C2A0Zcc9MkmaG4eddBF1x+6E3F+7Alg+TiYoQOiJdHRPUSCBP/a0MoqN60N1xmya/CbFRzSfy2FBXeE0geeJH0o8CtG9Ua0mlCBhOvPgYgRnXCfWMBHfoqj5kV64iill3o39JM/XyEqOCzhbt1CjpePDSQYWwpaHEcubc0R8p19WJYS6HzFcvwR12GmwqBDsJV4yb0ecazaP5ZP0gGKeeqtKKKy3Vig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5354 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT007.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 82141ed4-04ec-477e-f8e7-08d8177b67de X-Microsoft-Antispam-Message-Info: T89IRBHkFMneUziT93x1cR4282F671frN1zEgaAJPmXrhhpS8GOIrykrmGX2a2TTUk7+LkXo3Y6IVjiT/28wpqWwR4mQwAUgjmsmN9B8x3ysaCYWiI1o75NCajp/CBxHOfSwIA1lBjhuv2Hd946BAiDM4PrQvEz+WOXsCXoj6MWSww9uJQfoFbut6uiEWL4ux14UwC7UVZc+mRTmMCuMlk3ck3paEsGM+qyK58tIVZUrFeJ1mzIaTgKdR7h898Wk3QPRtJOZDi3Wz2q1hc0MhmJCbMvpPGwTw0ymUlEe47/G8Lu/wpGwJBZhhjbw557wqn2/NRB6PDs6f+/bgfH73PDHigpDx5TtH4hXTqw3JLoFpIdoyeQiGLgQQTxSyRiA3mTrjtje9QIJR53dzZKojw== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jun 2020 13:43:33.4129 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6c4998ba-a52d-4737-40c7-08d8177b6c16 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0802MB2330 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,Tomas.Pilar@arm.com X-Gm-Message-State: M6NHlUe39Y4pVL6RLr9H9IqTx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1592919821; bh=qux8SmzJ5q5hK1ghX6xKDRLBtACyFPXxoQwASV07/nc=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=ukxndgv98zhaDKYyWZ0XpnFHbeo0wtnDINZWmi83WIrBlgki8OccNN0Xc53cUYn5Wm2 hF0MV0VWa5DsxrO8b8ngq6fAqNox+CNZUCHT/1Bpk2GS5nOIzrz+bNOmrZSYHaWFfa9qL mdEtBXI1Ov3QVBIomJFnWiT3uJuoUGnULF8= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The UefiShellAcpiViewCommandLib is converted from NULL library to a named library so that it may be used in modules other than shell. The library interface exposes the main method for to AcpiView functionality as well as a helper method to dump a buffer to a file. The Shell module is still built by pulling UefiShellAcpiViewCommandLib as a NULL library to preserve the modularity of shell builds. Cc: Ray Ni Cc: Zhichao Gao Reviewed-by: Zhichao Gao Signed-off-by: Tomas Pilar --- .../Library/AcpiViewCommandLib.h} | 15 ++++++++------- .../UefiShellAcpiViewCommandLib/AcpiView.c | 2 +- .../UefiShellAcpiViewCommandLib.c | 2 +- .../UefiShellAcpiViewCommandLib.inf | 3 +-- ShellPkg/ShellPkg.dec | 3 +++ ShellPkg/ShellPkg.dsc | 3 ++- 6 files changed, 16 insertions(+), 12 deletions(-) rename ShellPkg/{Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComm= andLib.h =3D> Include/Library/AcpiViewCommandLib.h} (72%) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiView= CommandLib.h b/ShellPkg/Include/Library/AcpiViewCommandLib.h similarity index 72% rename from ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewC= ommandLib.h rename to ShellPkg/Include/Library/AcpiViewCommandLib.h index b1b1ffe63e28..11cf96c6e0d7 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.h +++ b/ShellPkg/Include/Library/AcpiViewCommandLib.h @@ -1,12 +1,13 @@ /** @file - Header file for 'acpiview' Shell command functions. + Library providing 'acpiview' functionality to display and + validate installed ACPI tables. =20 Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 -#ifndef UEFI_SHELL_ACPIVIEW_COMMAND_LIB_H_ -#define UEFI_SHELL_ACPIVIEW_COMMAND_LIB_H_ +#ifndef ACPI_VIEW_COMMAND_LIB_H_ +#define ACPI_VIEW_COMMAND_LIB_H_ =20 /** Dump a buffer to a file. Print error message if a file cannot be created. @@ -26,14 +27,14 @@ ShellDumpBufferToFile ( ); =20 /** - Function for 'acpiview' command. + Display and validate ACPI tables. =20 @param[in] ImageHandle Handle to the Image (NULL if internal). @param[in] SystemTable Pointer to the System Table (NULL if internal). =20 - @retval SHELL_INVALID_PARAMETER The command line invocation could not be= parsed - @retval SHELL_NOT_FOUND The command failed - @retval SHELL_SUCCESS The command was successful + @retval SHELL_INVALID_PARAMETER The command line invocation could not be= parsed. + @retval SHELL_NOT_FOUND The command failed. + @retval SHELL_SUCCESS The command was successful. **/ SHELL_STATUS EFIAPI diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c b/Shel= lPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c index d2240b2e89d5..9a5b013fb234 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c @@ -17,11 +17,11 @@ #include #include #include +#include #include "AcpiParser.h" #include "AcpiTableParser.h" #include "AcpiView.h" #include "AcpiViewConfig.h" -#include "UefiShellAcpiViewCommandLib.h" =20 #if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) #include "Arm/SbbrValidator.h" diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiView= CommandLib.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiVi= ewCommandLib.c index e6a65d5bc5f7..d2f26ff89f12 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.c @@ -16,13 +16,13 @@ #include #include #include +#include #include =20 #include "AcpiParser.h" #include "AcpiTableParser.h" #include "AcpiView.h" #include "AcpiViewConfig.h" -#include "UefiShellAcpiViewCommandLib.h" =20 CONST CHAR16 gShellAcpiViewFileName[] =3D L"ShellCommand"; EFI_HII_HANDLE gShellAcpiViewHiiHandle =3D NULL; diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiView= CommandLib.inf b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpi= ViewCommandLib.inf index 92de2391b09f..91459f9ec632 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.inf +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.inf @@ -14,7 +14,7 @@ [Defines] FILE_GUID =3D FB5B305E-84F5-461F-940D-82D345757AFA MODULE_TYPE =3D UEFI_APPLICATION VERSION_STRING =3D 1.0 - LIBRARY_CLASS =3D NULL|UEFI_APPLICATION UEFI_DRIVER + LIBRARY_CLASS =3D AcpiViewCommandLib|UEFI_APPLICATION U= EFI_DRIVER CONSTRUCTOR =3D UefiShellAcpiViewCommandLibConstructor DESTRUCTOR =3D UefiShellAcpiViewCommandLibDestructor =20 @@ -46,7 +46,6 @@ [Sources.common] Parsers/Ssdt/SsdtParser.c Parsers/Xsdt/XsdtParser.c UefiShellAcpiViewCommandLib.c - UefiShellAcpiViewCommandLib.h UefiShellAcpiViewCommandLib.uni =20 [Sources.ARM, Sources.AARCH64] diff --git a/ShellPkg/ShellPkg.dec b/ShellPkg/ShellPkg.dec index c17e358d15ed..d0843d338126 100644 --- a/ShellPkg/ShellPkg.dec +++ b/ShellPkg/ShellPkg.dec @@ -34,6 +34,9 @@ [LibraryClasses] ## @libraryclass provides BCFG command BcfgCommandLib|Include/Library/BcfgCommandLib.h =20 + ## @libraryclass provides the AcpiView command + AcpiViewCommandLib|Include/Library/AcpiViewCommandLib.h + [Guids] gEfiShellEnvironment2ExtGuid =3D {0xd2c18636, 0x40e5, 0x4eb5, {0xa3, = 0x1b, 0x36, 0x69, 0x5f, 0xd4, 0x2c, 0x87}} gEfiShellPkgTokenSpaceGuid =3D {0x171e9188, 0x31d3, 0x40f5, {0xb1, = 0x0c, 0x53, 0x9b, 0x2d, 0xb9, 0x40, 0xcd}} diff --git a/ShellPkg/ShellPkg.dsc b/ShellPkg/ShellPkg.dsc index b7ee856b3a16..5d2d96ab071c 100644 --- a/ShellPkg/ShellPkg.dsc +++ b/ShellPkg/ShellPkg.dsc @@ -2,7 +2,7 @@ # Shell Package # # Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.
-# Copyright (c) 2018, Arm Limited. All rights reserved.
+# Copyright (c) 2018 - 2020, Arm Limited. All rights reserved.
# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All right= s reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent @@ -50,6 +50,7 @@ [LibraryClasses.common] =20 PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeC= offGetEntryPointLib.inf BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCom= mandLib.inf + AcpiViewCommandLib|ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShel= lAcpiViewCommandLib.inf IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf =20 UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManag= erLib.inf --=20 2.24.1.windows.2 -=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 (#61604): https://edk2.groups.io/g/devel/message/61604 Mute This Topic: https://groups.io/mt/75059843/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 Wed Apr 24 05:33:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+61607+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 1592919823952934.7527506427854; Tue, 23 Jun 2020 06:43:43 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Z9bNYY1788612xkNpoq9JcsE; Tue, 23 Jun 2020 06:43:43 -0700 X-Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.77]) by mx.groups.io with SMTP id smtpd.web10.7135.1592919820808270649 for ; Tue, 23 Jun 2020 06:43:41 -0700 X-Received: from DB6PR07CA0204.eurprd07.prod.outlook.com (2603:10a6:6:42::34) by DB7PR08MB3866.eurprd08.prod.outlook.com (2603:10a6:10:7b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Tue, 23 Jun 2020 13:43:38 +0000 X-Received: from DB5EUR03FT016.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:42:cafe::59) by DB6PR07CA0204.outlook.office365.com (2603:10a6:6:42::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.10 via Frontend Transport; Tue, 23 Jun 2020 13:43:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+61607+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT016.mail.protection.outlook.com (10.152.20.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Tue, 23 Jun 2020 13:43:38 +0000 X-Received: ("Tessian outbound da41658aa5d4:v59"); Tue, 23 Jun 2020 13:43:38 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 961e57048b8c6ece X-CR-MTA-TID: 64aa7808 X-Received: from dd937278ec99.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 61A948F2-6823-4D96-8C3C-F2A38FB6F126.1; Tue, 23 Jun 2020 13:43:33 +0000 X-Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id dd937278ec99.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 23 Jun 2020 13:43:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FgXeGNudEPIDpbtH1C31MfGuV+UgcXCWo4F+VG0mDS7AfScSM0LHWD4C8J/kV1x1dDU0HW/qkU18yAMtPQ6QT0J8s1jwZKHnU8sD08D6oc4vQMtL9TGRqBFnEoJykdQsxqOj7R8FGT7wHh9odszscpxboCP3FyXFyd1hybQGvk98R9pCdqyjZRYiu5dWWRd0aM2Vh4UL0lZXj9XuKmqAZfushGpV5N3yyjumuAYEuikfXmX1EoRH3omNbFbUC3NaJOcdVGty8rWQPgaxFgXfr/LSusW2hLwomQrmGwmb9OBOKMoTL1Nx1hz1XAyv4jnGkpGgKP8iGuQvYS0egZP+VA== 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=BA6pbNQlTewIZoiH9oEaZWLc5X978LPtVR1JA8Jn3VI=; b=bKpcYl7NjWMoGOs2tyXisEN+h+ZPGZGwjnol+YwZb0YTO6J/uHPELo8vYdm88yK3m39N4uFyfJiNbUrrvXNhFO2MYgKmu9Oys7TdJqn+Jny5wFbmGb/Gh/kJ9q5Zi1YV/V1XddY6027mtjUem8STLSI4bm2KctWoWieVOWDcDEF6xCoRnA/NL6RsM0xN4hL5tyNEXZvm77iZnSjzjEe8Fd9aeTvwpJ6zMeYFD5+ZJAxePDW0Sb2Q+d1BSX8khhF8LThykV53Favr0Jo4YitdCJQQc5CCfZNBgmve9jpbtsuijKGIqRHfXoak4aod5JRCBjreIocuazr/JrhkUL45hQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=bestguesspass action=none header.from=arm.com; dkim=none (message not signed); arc=none X-Received: from DB6PR0201CA0029.eurprd02.prod.outlook.com (2603:10a6:4:3f::39) by DBBPR08MB4919.eurprd08.prod.outlook.com (2603:10a6:10:f0::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Tue, 23 Jun 2020 13:43:30 +0000 X-Received: from DB5EUR03FT003.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:3f:cafe::84) by DB6PR0201CA0029.outlook.office365.com (2603:10a6:4:3f::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.20 via Frontend Transport; Tue, 23 Jun 2020 13:43:30 +0000 X-MS-Exchange-Authentication-Results: spf=pass (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=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; X-Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT003.mail.protection.outlook.com (10.152.20.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3109.22 via Frontend Transport; Tue, 23 Jun 2020 13:43:30 +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; Tue, 23 Jun 2020 13:43:25 +0000 X-Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.1779.2; Tue, 23 Jun 2020 13:43:25 +0000 X-Received: from localhost.localdomain (10.57.20.205) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Tue, 23 Jun 2020 13:43:25 +0000 From: "Tomas Pilar (tpilar)" To: CC: , , Ray Ni , "Zhichao Gao" Subject: [edk2-devel] [PATCH v4 7/7] ShellPkg/AcpiView: Add application wrapper Date: Tue, 23 Jun 2020 14:43:04 +0100 Message-ID: <20200623134304.2619-8-Tomas.Pilar@arm.com> In-Reply-To: <20200623134304.2619-1-Tomas.Pilar@arm.com> References: <20200623134304.2619-1-Tomas.Pilar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFTY:;SFS:(4636009)(396003)(376002)(39860400002)(136003)(346002)(46966005)(82740400003)(186003)(26005)(478600001)(316002)(47076004)(8936002)(81166007)(356005)(2616005)(82310400002)(1076003)(5660300002)(70206006)(6916009)(336012)(70586007)(2906002)(54906003)(8676002)(426003)(6666004)(36756003)(4326008)(86362001)(83380400001);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 812220b7-ffae-4a3b-d5f5-08d8177b6f03 X-MS-TrafficTypeDiagnostic: DBBPR08MB4919:|DB7PR08MB3866: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:2958;OLM:2958; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 7bimYgXI3QrD6eWBIS59SS+Vu2S/VdQYaGnPjM73i+MyiScmi3zLYDd9yG61b5c29JPP9PKnEl8USJPmFuF2cmD29zMOGj66UZ6UB4Gbf1vdfRwhzzB4VcAN1SOTWbxpOyA6eMydH7EqO1OCVsBJCarFHNBuwL5y1BvuGwVO0gtTil6T9rUEe6RlNeylkVfehRCg3MzUS9BOWw6od4+Lz/+VbrEQAUL/iVbVtqcyAiYSUUtDHXWkt83MSk6QmoL6SbOlma6ybSsrW5Gb0cBNAp5CNtI4M7aU9qQq5Ka6A5Kk4bv6j3zdPwr7e9tFxBk/+W1jX9UMD7UdDx5wXxoOqwyP4ScfA8iHx4u93Luhby6+mzJpZ56jl2u22kqjUP2ncvcloMVNiVY2JArqwba7SgjEXwtKyz1cgIyzO/l7zYw8YyJTq59VgQ/1TEBcWHq7ne1ylxOoCw7LcoSqprtWXI8Ass12ENUQMUcYZ6K02Nw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB4919 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT016.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 2ba823ce-d5f9-4885-53a1-08d8177b6a8a X-Microsoft-Antispam-Message-Info: qVLaLADZMVG/Eem49ZB5PqhFM0cm00mugfeVyBDwsEyeO2Cz6P7t+NL83xZ3aKKRWUiKk41XF1DafYQikdU3jsMZVGV4beL6ZZVDgWBFRoy0qYfpuhXAJ0fslB58wPzpp5BssY/KBcND0BtUb/BKgBzlQBOVWbmWbCOgUisRMH0dJnZ88beS8EiKWxaJI2zoWQnhOre1csKNuVSPS0oxWLzSwt/RI2cMM1lBIpXCXAjUFnEuRxUzdssOvCBUV+4U7Gu4tBOIOKB2/DddsudIPj7Ty1WF9NYHCgFDj1JYBIB2WsjNMkAC0XRwQ1eG4GoxL919+fZ4xJB/cpdbOrSx3m4b9FxB+fJ85pvV/m5UDI4MCYUQolV6k0Smj+6XfHeMUxjoI6hkPpgkeThY0yE9qlxACaTQiYkpOW0XBC2PoEAKK9qEbj6gHU/TAYBuD6pZ8I4OVXxyrkBZGHu/Hz49vJecHd+qkHTjzyEpVfiw2j4= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jun 2020 13:43:38.3783 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 812220b7-ffae-4a3b-d5f5-08d8177b6f03 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3866 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,Tomas.Pilar@arm.com X-Gm-Message-State: VLBWwkppIA6dD24QGkgKeIc3x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1592919823; bh=OsRnZyOT0TtZap8L5J5SwY/eSN+w2uAJJRxg5ETY2l0=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=R08loGZX/oF8CpJV1JWU0IqS7Rnej1ORQJtn7uimq4W9znTnORXE2FFBgx5FdxB9Yvt uXMgjhQn6Rhxq08u8AjaeJ0qTocXP9cv6HMdVO4rNt3NX1Ol+/BxSNrUQHEAeBvxilHMt gN+d6D9XzF5s3fRfadu7CnELGWJS+4QXiWQ= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Simple application wrapper that invokes the shell command wrapper for 'acpiview'. This allows the AcpiView functionality to be used on platforms with older specifications of the UEFI shell or where the 'acpiview' command is not built in due to platform build configuration. Furthermore, this app can be integrated into more comprehensive testing frameworks as a single component of a more thorough specification compliance validation strategy. Cc: Ray Ni Cc: Zhichao Gao Reviewed-by: Zhichao Gao Signed-off-by: Tomas Pilar --- .../Application/AcpiViewApp/AcpiViewApp.c | 40 ++++++ .../Application/AcpiViewApp/AcpiViewApp.inf | 34 +++++ .../Application/AcpiViewApp/AcpiViewApp.uni | 122 ++++++++++++++++++ ShellPkg/ShellPkg.dsc | 1 + 4 files changed, 197 insertions(+) create mode 100644 ShellPkg/Application/AcpiViewApp/AcpiViewApp.c create mode 100644 ShellPkg/Application/AcpiViewApp/AcpiViewApp.inf create mode 100644 ShellPkg/Application/AcpiViewApp/AcpiViewApp.uni diff --git a/ShellPkg/Application/AcpiViewApp/AcpiViewApp.c b/ShellPkg/Appl= ication/AcpiViewApp/AcpiViewApp.c new file mode 100644 index 000000000000..2f650c9d92d2 --- /dev/null +++ b/ShellPkg/Application/AcpiViewApp/AcpiViewApp.c @@ -0,0 +1,40 @@ +/** @file + Main file for AcpiViewApp application + + Copyright (c) 2020, ARM Limited. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include +#include +#include +#include + +#include + +// +// String token ID of help message text. +// Shell supports to find help message in the resource section of an appli= cation image if +// .MAN file is not found. This global variable is added to make build too= l recognizes +// that the help string is consumed by user and then build tool will add t= he string into +// the resource section. Thus the application can use '-?' option to show = help message in +// Shell. +// +GLOBAL_REMOVE_IF_UNREFERENCED EFI_STRING_ID mStringHelpTokenId =3D STRING_= TOKEN (STR_GET_HELP_ACPIVIEW); + +/** + Application Entry Point wrapper around the shell command + + @param[in] ImageHandle Handle to the Image (NULL if internal). + @param[in] SystemTable Pointer to the System Table (NULL if internal). +**/ +EFI_STATUS +EFIAPI +AcpiViewAppMain ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + return ShellCommandRunAcpiView (gImageHandle, SystemTable); +} diff --git a/ShellPkg/Application/AcpiViewApp/AcpiViewApp.inf b/ShellPkg/Ap= plication/AcpiViewApp/AcpiViewApp.inf new file mode 100644 index 000000000000..2ed1d185339d --- /dev/null +++ b/ShellPkg/Application/AcpiViewApp/AcpiViewApp.inf @@ -0,0 +1,34 @@ +## @file +# EFI application that displays and verifies ACPI tables +# +# Copyright (c) 2020, ARM Limited. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# +## + +[Defines] + INF_VERSION =3D 0x0001001B + BASE_NAME =3D AcpiViewApp + FILE_GUID =3D 46361B5B-AF17-41FF-95F9-E1BCE08435B9 + MODULE_TYPE =3D UEFI_APPLICATION + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D AcpiViewAppMain + UEFI_HII_RESOURCE_SECTION =3D TRUE + +[Sources.common] + AcpiViewApp.c + AcpiViewApp.uni + +[Packages] + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + +[LibraryClasses] + UefiBootServicesTableLib + UefiLib + BaseLib + UefiApplicationEntryPoint + AcpiViewCommandLib diff --git a/ShellPkg/Application/AcpiViewApp/AcpiViewApp.uni b/ShellPkg/Ap= plication/AcpiViewApp/AcpiViewApp.uni new file mode 100644 index 000000000000..c56f21084356 --- /dev/null +++ b/ShellPkg/Application/AcpiViewApp/AcpiViewApp.uni @@ -0,0 +1,122 @@ +// @file +// +// Standalone EFI application that displays and verifies ACPI tables +// +// Copyright (c) 2020, ARM Limited. All rights reserved.
+// SPDX-License-Identifier: BSD-2-Clause-Patent +// + +/=3D# + +#langdef en-US "english" + +#string STR_GET_HELP_ACPIVIEW #language en-US "" +".TH acpiview 0 "Display ACPI information."\r\n" +".SH NAME\r\n" +"Display ACPI Table information.\r\n" +".SH SYNOPSIS\r\n" +" \r\n" +"ACPIVIEWAPP.EFI [[-?] | [[[[-l] | [-s AcpiTable [-d]]] [-q] [-h]] [-r Spe= c]]]\r\n" +" \r\n" +".SH OPTIONS\r\n" +" \r\n" +" -l - Display list of installed ACPI Tables.\r\n" +" -s - Display only the specified AcpiTable type and only support single\= r\n" +" invocation option.\r\n" +" AcpiTable : The required ACPI Table type.\r\n" +" -d - Generate a binary file dump of the specified AcpiTable.\r\n" +" -q - Quiet. Suppress errors and warnings. Disables consistency checks.\= r\n" +" -h - Enable colour highlighting.\r\n" +" -r - Validate that all required ACPI tables are installed\r\n" +" Spec : Specification to validate against.\r\n" +" For Arm, the possible values are:\r\n" +" 0 - Server Base Boot Requirements v1.0\r\n" +" 1 - Server Base Boot Requirements v1.1\r\n" +" 2 - Server Base Boot Requirements v1.2\r\n" +" -? - Show help.\r\n" +" \r\n" +".SH DESCRIPTION\r\n" +" \r\n" +" This program is provided to allow examination of ACPI table values from= the\r\n" +" UEFI Shell. This can help with investigations, especially at that stag= e\r\n" +" where the tables are not enabling an OS to boot.\r\n" +" The program is not exhaustive, and only encapsulates detailed knowledge= of a\r\n" +" limited number of table types.\r\n" +" \r\n" +" Default behaviour is to display the content of all tables installed.\r\= n" +" 'Known' table types (listed in NOTES below) will be parsed and displaye= d\r\n" +" with descriptions and field values. Where appropriate a degree of\r\n" +" consistency checking is done and errors may be reported in the output.\= r\n" +" Other table types will be displayed as an array of Hexadecimal bytes.\r= \n" +" \r\n" +" To facilitate debugging, the -s and -d options can be used to generate = a\r\n" +" binary file image of a table that can be copied elsewhere for investiga= tion\r\n" +" using tools such as those provided by acpica.org. This is especially\r= \n" +" relevant for AML type tables like DSDT and SSDT.\r\n" +" \r\n" +"NOTES:\r\n" +" 1. The AcpiTable parameter can match any installed table type.\r\n" +" Tables without specific handling will be displayed as a raw hex dump= (or\r\n" +" dumped to a file if -d is used).\r\n" +" 2. -s option supports to display the specified AcpiTable type that is p= resent\r\n" +" in the system. For normal type AcpiTable, it would display the data = of the\r\n" +" AcpiTable and AcpiTable header. The following type may contain heade= r type\r\n" +" other than AcpiTable header. The actual header can refer to the ACPI= spec\r\n" +" 6.3\r\n" +" Extra A. Particular types:\r\n" +" APIC - Multiple APIC Description Table (MADT)\r\n" +" BGRT - Boot Graphics Resource Table\r\n" +" DBG2 - Debug Port Table 2\r\n" +" DSDT - Differentiated System Description Table\r\n" +" FACP - Fixed ACPI Description Table (FADT)\r\n" +" GTDT - Generic Timer Description Table\r\n" +" IORT - IO Remapping Table\r\n" +" MCFG - Memory Mapped Config Space Base Address Description Table\= r\n" +" PPTT - Processor Properties Topology Table\r\n" +" RSDP - Root System Description Pointer\r\n" +" SLIT - System Locality Information Table\r\n" +" SPCR - Serial Port Console Redirection Table\r\n" +" SRAT - System Resource Affinity Table\r\n" +" SSDT - Secondary SystemDescription Table\r\n" +" XSDT - Extended System Description Table\r\n" +" \r\n" +".SH STANDARDS\r\n" +" \r\n" +" Table details correspond to those in 'Advanced Configuration and Power\= r\n" +" Interface Specification' Version 6.3 [January 2019]\r\n" +" (https://uefi.org/specifications)\r\n" +" \r\n" +" NOTE: The nature of the ACPI standard means that almost all tables in 6= .3\r\n" +" will be 'backwards compatible' with prior version of the specific= ation\r\n" +" in terms of structure, so formatted output should be correct. Th= e main\r\n" +" exception will be that previously 'reserved' fields will be repor= ted\r\n" +" with new names, where they have been added in later versions of t= he\r\n" +" specification.\r\n" +" \r\n" +".SH EXAMPLES\r\n" +" \r\n" +" \r\n" +"EXAMPLES:\r\n" +" * To display a list of the installed table types:\r\n" +" fs0:\> acpiviewapp.efi -l\r\n" +" \r\n" +" * To parse and display a specific table type:\r\n" +" fs0:\> acpiviewapp.efi -s GTDT\r\n" +" \r\n" +" * To save a binary dump of the contents of a table to a file\r\n" +" in the current working directory:\r\n" +" fs0:\> acpiviewapp.efi -s DSDT -d\r\n" +" \r\n" +" * To display contents of all ACPI tables:\r\n" +" fs0:\> acpiviewapp.efi\r\n" +" \r\n" +" * To check if all Server Base Boot Requirements (SBBR) v1.2 mandatory\r= \n" +" ACPI tables are installed (Arm only):\r\n" +" fs0:\> acpiviewapp.efi -r 2\r\n" +" \r\n" +".SH RETURNVALUES\r\n" +" \r\n" +"RETURN VALUES:\r\n" +" SHELL_SUCCESS Data was displayed as requested.\r\n" +" SHELL_INVALID_PARAMETER ACPI Table parsing failed.\r\n" +" \r\n" diff --git a/ShellPkg/ShellPkg.dsc b/ShellPkg/ShellPkg.dsc index 5d2d96ab071c..86e9f1e0040d 100644 --- a/ShellPkg/ShellPkg.dsc +++ b/ShellPkg/ShellPkg.dsc @@ -144,6 +144,7 @@ [Components] gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE } ShellPkg/DynamicCommand/DpDynamicCommand/DpApp.inf + ShellPkg/Application/AcpiViewApp/AcpiViewApp.inf =20 [BuildOptions] *_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECATED_INTERFACES --=20 2.24.1.windows.2 -=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 (#61607): https://edk2.groups.io/g/devel/message/61607 Mute This Topic: https://groups.io/mt/75059847/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-