From nobody Sat Apr 27 02:12:18 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+60052+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 1590085019767456.2275722680723; Thu, 21 May 2020 11:16:59 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id HUZsYY1788612xrM22FxYPD8; Thu, 21 May 2020 11:16:59 -0700 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.54]) by mx.groups.io with SMTP id smtpd.web12.1401.1590085016356876463 for ; Thu, 21 May 2020 11:16:57 -0700 X-Received: from DB6PR07CA0067.eurprd07.prod.outlook.com (2603:10a6:6:2a::29) by AM0PR08MB5411.eurprd08.prod.outlook.com (2603:10a6:208:181::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23; Thu, 21 May 2020 18:16:53 +0000 X-Received: from DB5EUR03FT024.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:2a:cafe::a5) by DB6PR07CA0067.outlook.office365.com (2603:10a6:6:2a::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.8 via Frontend Transport; Thu, 21 May 2020 18:16:53 +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+60052+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 DB5EUR03FT024.mail.protection.outlook.com (10.152.20.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 18:16:53 +0000 X-Received: ("Tessian outbound 9eabd37e4fee:v57"); Thu, 21 May 2020 18:16:53 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 88e581fb7ec22a39 X-CR-MTA-TID: 64aa7808 X-Received: from c1be71a4bb7f.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 6012F777-27FB-47B3-A364-17B39F754B7F.1; Thu, 21 May 2020 18:16:48 +0000 X-Received: from EUR03-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id c1be71a4bb7f.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 21 May 2020 18:16:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k/3hrM0u9Q0KcdzgOpnTkKYxlMdHSVZp1/eciakv7+JpHRQrhtAXtoeExdHaU94MX5LoY2g719H9RurXEjXlbT08ZXfkW+NQd6fFg3f4Am6q58J4pz0YeLnm8bHe/fJEPdoJj4BvjMOGo+G2Rloggh+jIFagUMHCUynZ8PbeBgXtNAEAt+Wsm/pbF6VC10klF1WOeWapgX+zJujNUgH5UyOYW2oXikJvQG808xrClWWytp2mE92O9xR81dF2TPZ98Th/LvAZMXZBV+kzU1eSOp8OQ9XzZ2WQAi3Nc4YTs/q2kWyCRztvXouPb2IVnB8r4RktB4DGEvHVyuMnFvFIrA== 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=Jh9/fp1rShy4fGZ6CLAFYPFm7f4MJt4A7lqyLvAvQA8=; b=faQCkM8LaN/Wlv2WBTNBQn1DoaKoWFoyykxON1mxPbap0C9Fnjvw5/lEneCdvgFdXZrbnRJYtzA16h9Nmhgw/Z9U1q6T4RJanolouiKgV/PAAka6rIKTzY5BxeJc/winA4O3w/e2D9lqf60xaGWlJW0y15sAffWUARBzJBqiOmSaKhlUgzhLxAuzdOVBX2s8KisaQrI96LILUKxFq9oKiMeVV+rcoAblYQwNXHuxHw78yd75KeJEoXvPqCLqlk79Hf1tu9NXfYprgElxoUVAydTb5nRZ4ClVy6eLf8t5JInM+o8YOqabiq0zgQH5ujy3bCVzwhPefVkZWbhWeb5WlA== 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 AM6P193CA0085.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:88::26) by DB8PR08MB4090.eurprd08.prod.outlook.com (2603:10a6:10:ab::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23; Thu, 21 May 2020 18:16:47 +0000 X-Received: from AM5EUR03FT025.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:88:cafe::4) by AM6P193CA0085.outlook.office365.com (2603:10a6:209:88::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.24 via Frontend Transport; Thu, 21 May 2020 18:16:47 +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 AM5EUR03FT025.mail.protection.outlook.com (10.152.16.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 18:16:47 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1415.2; Thu, 21 May 2020 18:16:46 +0000 X-Received: from localhost.localdomain (10.57.25.130) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Thu, 21 May 2020 18:16:46 +0000 From: "Tomas Pilar (tpilar)" To: CC: Ray Ni , Zhichao Gao Subject: [edk2-devel] [PATCH v1 1/6] ShellPkg/AcpiView: Move log reset to main method Date: Thu, 21 May 2020 19:16:24 +0100 Message-ID: <20200521181629.79-2-Tomas.Pilar@arm.com> In-Reply-To: <20200521181629.79-1-Tomas.Pilar@arm.com> References: <20200521181629.79-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)(396003)(39860400002)(346002)(376002)(46966005)(478600001)(5660300002)(81166007)(82740400003)(36756003)(47076004)(6666004)(336012)(426003)(356005)(6916009)(82310400002)(1076003)(86362001)(2906002)(8936002)(4326008)(8676002)(316002)(54906003)(70586007)(2616005)(186003)(26005)(70206006);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6a54d3ca-b300-450f-af8a-08d7fdb323b2 X-MS-TrafficTypeDiagnostic: DB8PR08MB4090:|AM0PR08MB5411: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:127;OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: qO/EB6gQMI629FHd5w5jnVy+QnaJZLJjeOMrJe2ss19UlsaseB8SjmUsOftfuzFCNOIfJkeKcMCGwGLSOWaFMv1nIBhAw9JRPZaJxSzEOmVtCYCgKkl5VB8Ndsue4lYhU/9Ae0foh4nZPClo1c4UEZYQWLTqJe6TH6XwCStqw8YPpAIfRHuPZXSpnPS3gpcFw1dyWhs/7bCsM9Vhxnlxk+1X0h4xhIMjq605Eqr+F62IRehXebafGidJQ9dLC7KMUBwiA6+pK4nPISn4CKs5OqNFSW2MvQb7v8MwWShsQSy3hBV+gm6DCZqx50J3CAAJRZU2LkxcG9/pB5vvK3co1sfcx2TqsRMnjr0p7Z1phefVNm7DjmUS0fzG0Huafmf6oyQjTy79J7Ay7cefBJFj9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB4090 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT024.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: f4f03137-31cc-4dc1-00cb-08d7fdb31fe1 X-Microsoft-Antispam-Message-Info: xSDs9TJUI00fXrSDpDngFonxiMuNKAW6SYx+x9XXfVDIEpUvvDE1BCSchuCPFj/BfG8LG0I/w1mGLZ6EKUJeHvlZw2S6CkiIWOEaatbVvbwYBz/x13Afy99hxpPjC2HZdmbREJHS0+5oJzHDwbBgmaLPnlEIDP51bz4eh533pc6ArMmD1xbxPcDmCyZFXqq2faI3VweCrZ+ouNrFG9P/FTGRx1Rg6fkjlCNXAIFFymfxbExAbovXtEKHSMDdWbXoG3MQowGAoB4VVGeC74SOrFl2hbJn+gDp4zHrezdiEDq3qj3MZwIVXcgMMYc4sWmRe48Lv+/fQFLxGl9NItiTIU7lQn5Knu0fUn/swc8qd9CydbaXAA23qvYgVcXrHFQp4U3VK2RdZUMJ70SMADgb8g== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2020 18:16:53.6040 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6a54d3ca-b300-450f-af8a-08d7fdb323b2 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: AM0PR08MB5411 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: tMnPJKbVVTMOPPjTDElDJzsOx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590085019; bh=QmdDluv79K0cm5eJtWGtVRuGS1Xjgnx6DqDb4VnquF4=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=mahMzO7nip6d3yeMX3DLpIJoz4sni66/5pFLK7cclQpi7TvicfTVI9oWtu/Ec0Xh+/0 rdimfj2gopXVPn5Uy2Q0YgqlqeGvA8AlLTXg5HUGJuOtc7xvwp8nwVYf0sE05lvqPxLHN rSCAIrvSDmNtgYNeHQGyuSYz6L+x1FxgEYs= 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 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; + // 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; - // 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) { -- 2.24.1.windows.2 IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you. -=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 (#60052): https://edk2.groups.io/g/devel/message/60052 Mute This Topic: https://groups.io/mt/74381816/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 Sat Apr 27 02:12:18 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+60056+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 1590085021139733.4040212290575; Thu, 21 May 2020 11:17:01 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id dhGxYY1788612x4lOKzLLKfB; Thu, 21 May 2020 11:17:00 -0700 X-Received: from EUR03-VE1-obe.outbound.protection.outlook.com (EUR03-VE1-obe.outbound.protection.outlook.com [40.107.5.50]) by mx.groups.io with SMTP id smtpd.web10.1335.1590085018721511413 for ; Thu, 21 May 2020 11:16:59 -0700 X-Received: from AM6P192CA0072.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:82::49) by VI1PR08MB4413.eurprd08.prod.outlook.com (2603:10a6:803:f1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.26; Thu, 21 May 2020 18:16:55 +0000 X-Received: from AM5EUR03FT041.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:82:cafe::5b) by AM6P192CA0072.outlook.office365.com (2603:10a6:209:82::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 18:16:55 +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+60056+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 AM5EUR03FT041.mail.protection.outlook.com (10.152.17.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 18:16:54 +0000 X-Received: ("Tessian outbound b157666c5529:v57"); Thu, 21 May 2020 18:16:54 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 8f3b3c6625473b19 X-CR-MTA-TID: 64aa7808 X-Received: from 4d08eb28409c.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 8B222048-12A6-4C46-BAE3-DB1095C5F729.1; Thu, 21 May 2020 18:16:49 +0000 X-Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 4d08eb28409c.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 21 May 2020 18:16:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A86jnKg3tuV3FfXehK94NQbMLTg0JeC8/yiud21Eig9q4f/ECkct9As8U0iPexNkAA2ev9jK1nJDFcpq5VXa01ag8cPRz6JPS5x6E/GlLW8O/ONFlT0xktgziTh844kObqQMv6J+lYSWibwdSabMccHwJY9+pPEmET+wFPexhYwri1ZLa3Lpc6FGtIl8PPCzfsv8uXRX3hGi4utMxYmkA0mjmqByZsZKOy+Q9JB3e3BNsGHnbAlCY97qS52LfjgoRzp0X0MIKFs3LP7sr6LVlDTlhoU5XfM5tex7pAP54JH+Q9Z39d5uUcC07qKq2iuvNlYxCVXjI45c3YJs3JgTEQ== 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=3yETKNbDX0tyFN4sAT42sc4lUbeS9nar2q7oko9k0so=; b=h/VfKqIzfcwiCEge2xvzLMTIivaWKIlKqQa07Nm6Cd5uRiJcJgQglLeQvdoyoG+TASZ2K3StbsVBQfkm5DMWCazwHEEjksNVzCVJAmn6LtvX1pVmlgXdUTWkLBOlYozT8OGoDaCOkeK/z/0eBSw7gkyrZnUa5u/0Ty7m9oXzqMzCph+r09nWfPrxVuxu2drWai0YWwPk8nEhuZBIyA3+P4l55Lg78cnlIA8zj6hpbKysUXQnxb8IMwZYu4y8oexSIGFes1FX0HeCm7/SuUXMQurEcGmvSzoVM9i+JFYlBdpK3LuNKtmRnKZs9ecY/8CmUmqH+sBuJM+BJl6xy4AD7A== 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 AM5PR0602CA0020.eurprd06.prod.outlook.com (2603:10a6:203:a3::30) by DB7PR08MB3321.eurprd08.prod.outlook.com (2603:10a6:5:20::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.24; Thu, 21 May 2020 18:16:47 +0000 X-Received: from VE1EUR03FT060.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:a3:cafe::8a) by AM5PR0602CA0020.outlook.office365.com (2603:10a6:203:a3::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.24 via Frontend Transport; Thu, 21 May 2020 18:16:47 +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 VE1EUR03FT060.mail.protection.outlook.com (10.152.19.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 18:16:47 +0000 X-Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1415.2; Thu, 21 May 2020 18:16:47 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1779.2; Thu, 21 May 2020 18:16:46 +0000 X-Received: from localhost.localdomain (10.57.25.130) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Thu, 21 May 2020 18:16:46 +0000 From: "Tomas Pilar (tpilar)" To: CC: Ray Ni , Zhichao Gao Subject: [edk2-devel] [PATCH v1 2/6] ShellPkg/AcpiView: Refactor configuration Date: Thu, 21 May 2020 19:16:25 +0100 Message-ID: <20200521181629.79-3-Tomas.Pilar@arm.com> In-Reply-To: <20200521181629.79-1-Tomas.Pilar@arm.com> References: <20200521181629.79-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)(426003)(2906002)(478600001)(19627235002)(54906003)(6916009)(2616005)(336012)(316002)(82310400002)(82740400003)(356005)(81166007)(4326008)(47076004)(8676002)(26005)(8936002)(36756003)(1076003)(30864003)(86362001)(70586007)(186003)(70206006)(5660300002)(6666004);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a832a9dc-364f-4b9e-c35e-08d7fdb3247f X-MS-TrafficTypeDiagnostic: DB7PR08MB3321:|VI1PR08MB4413: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:5236;OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 3BV2JtIJ08LfnhXudA95+WluyJheZEaNASIuU0yJPCLJduqTQtaFfOTBggjeKcqevqNQ9j8ohZh08BxfFG8XebMdlSmp6GF+EBUi4N7hTM7DjueqSElfr6olP6ZXqAOHdP8CizXx4KnfuAmHmwMqlVvDJIXNxUQwBBEG6/BpzQi+EzBxIzEgImeN9KtrpOvDrWN27PXP4I3d9stJ1Loui4ewmQXG1GhOKYVyAc2PMIl2OZg0WzGP4+yViyx9PrJ0dTCm68dN/Em4Xbvx4kG5ZFFW1zMhg/v08XHwlKst0Gl5U+4bmVPCBnfsr+R+3aKz8UI4B1fLQlsrbnGpPlzG6GP9m6CWoaeHcAWgKGVlml0GuwHSgBH/AvYc3BOn99fxXI0yGVcmmLccOQYX9Y+neg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3321 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT041.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 629e31a5-7d51-4e15-5931-08d7fdb3201a X-Microsoft-Antispam-Message-Info: 3r2/RUBxwqW5eVwqd8MeB/zmHa0JfcFSLXzDjyf4qvNVL5CSA1cwXLY1vfLZVmVoEj4V6rW6COWJYMR1ig0Ulb66uMDp75TjvfHRRky705p8vd3iZh4idiHmFqInrWqmGc2mgsqcUawOddMKDCvFfxeXIIjoqRzAXyTK5zLzaWIh2b38KSf2cScZ8FGspJqMSHe59RWX8iUqj4uDMhawqdXnN8UVOhHTDL6xutemkXbBY/r+8xaTdHPmEbjvjw0+F63ju7gH+HXKeBbWyuW3vAdEk6kTTeW5qeXu+6aETin6k4x+YA4nhjHEujK9Q3qRJ4wVF+EjBb1bEC9fBBbEP/3posIc4DGdAVDjVnOc/4LzrN3LdEaeHEuDPursntXWp0JLXioBVJE8U6+/YxJYUA== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2020 18:16:54.8701 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a832a9dc-364f-4b9e-c35e-08d7fdb3247f 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: VI1PR08MB4413 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: D5Vy1I6JzlFKumdVQq3JN2EAx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590085020; bh=UxrB1OijSv4KWpgBT3QiJBstlddFCu4WiP70mHteO10=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=DSp/G4v6QO64PXrf718HOAqydOk/PR3uj9c3ag9zbzpdZfNBdXBYDR1145THoFGRhFs xDI5aDKuHgIn/B+gj2sVR/ZzOMgaWzauuwYRgvE9zS3T15WcCndEAKaSI+uPw52DZ4F0J Pa+rxhC+t4XCOioyfCAHsnEMj0+2ZXjClDE= 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 Signed-off-by: Tomas Pilar --- ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c = | 1 + ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c = | 1 + ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c = | 237 +++++++++---------------------------------------------------------- ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h = | 95 --------------------------- ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiViewConfig.c = | 246 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++ ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiViewConfig.h = | 177 ++++++++++++++++++++++++++++++++++++++++++++++++++ ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c = | 1 + ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c = | 1 + ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c = | 1 + ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.c = | 1 + ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c = | 1 + ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.i= nf | 32 ++++----- 12 files changed, 479 insertions(+), 315 deletions(-) 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" 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" #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..2f7395c23bce 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" #if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) @@ -28,17 +29,8 @@ EFI_HII_HANDLE gShellAcpiViewHiiHandle =3D NULL; -// 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; /** An array of acpiview command line parameters. @@ -53,142 +45,6 @@ STATIC CONST SHELL_PARAM_ITEM ParamList[] =3D { {NULL, TypeMax} }; -/** - 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. @@ -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; DumpFileHandle =3D NULL; TransferBytes =3D Length; + GetSelectedAcpiTable (&SelectedTable); UnicodeSPrint ( FileNameBuffer, sizeof (FileNameBuffer), L".\\%s%04d.bin", - mSelectedAcpiTableName, + SelectedTable.Name, mBinTableCount++ ); @@ -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; // // 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); 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; } -/** - 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 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; // // set local variables to suppress incorrect compiler/analyzer warnings @@ -428,6 +259,9 @@ AcpiView ( ResetErrorCount (); ResetWarningCount (); + // 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; // 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 (); ShellStatus =3D SHELL_SUCCESS; Package =3D NULL; @@ -671,25 +500,23 @@ ShellCommandRunAcpiView ( } 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); 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); UnicodeSPrint ( FileNameBuffer, sizeof (FileNameBuffer), L".\\%s%04d.tmp", - mSelectedAcpiTableName, + SelectedTableName, mBinTableCount ); 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 -/** - 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 ); -/** - 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. diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiViewConfig.c = b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiViewConfig.c new file mode 100644 index 000000000000..6f6d1a9d52c1 --- /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..fc99624e41dc --- /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" // "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" // 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" // 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" // 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" // 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 [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 [Sources.ARM, Sources.AARCH64] Arm/SbbrValidator.h Arm/SbbrValidator.c [Packages] + MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec ShellPkg/ShellPkg.dec - MdeModulePkg/MdeModulePkg.dec [LibraryClasses] - MemoryAllocationLib BaseLib BaseMemoryLib DebugLib + FileHandleLib + HiiLib + MemoryAllocationLib + PcdLib + PrintLib ShellCommandLib ShellLib + UefiBootServicesTableLib UefiLib UefiRuntimeServicesTableLib - UefiBootServicesTableLib - PcdLib - HiiLib - PrintLib - FileHandleLib [FixedPcd] -- 2.24.1.windows.2 IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you. -=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 (#60056): https://edk2.groups.io/g/devel/message/60056 Mute This Topic: https://groups.io/mt/74381822/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 Sat Apr 27 02:12:18 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+60053+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 1590085019219653.1993367650396; Thu, 21 May 2020 11:16:59 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 5KasYY1788612xMFrUG3HZA3; Thu, 21 May 2020 11:16:58 -0700 X-Received: from EUR02-VE1-obe.outbound.protection.outlook.com (EUR02-VE1-obe.outbound.protection.outlook.com [40.107.2.85]) by mx.groups.io with SMTP id smtpd.web10.1333.1590085017026548321 for ; Thu, 21 May 2020 11:16:57 -0700 X-Received: from DB6PR0501CA0048.eurprd05.prod.outlook.com (2603:10a6:4:67::34) by DB6PR0801MB1719.eurprd08.prod.outlook.com (2603:10a6:4:3a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.27; Thu, 21 May 2020 18:16:54 +0000 X-Received: from DB5EUR03FT064.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:67:cafe::6) by DB6PR0501CA0048.outlook.office365.com (2603:10a6:4:67::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 18:16:54 +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+60053+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 DB5EUR03FT064.mail.protection.outlook.com (10.152.21.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 18:16:54 +0000 X-Received: ("Tessian outbound facc38080784:v57"); Thu, 21 May 2020 18:16:54 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 112444581ddab345 X-CR-MTA-TID: 64aa7808 X-Received: from 5d995988851b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 39354344-11ED-4ECC-A174-F3327EB6859B.1; Thu, 21 May 2020 18:16:48 +0000 X-Received: from EUR01-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 5d995988851b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 21 May 2020 18:16:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hcem63nhJ3WqghChIENxGSPOkrDSGATQoXeX8heGSdb0sAFJZCggldPwhRzZD4j93fFc+Cxt3mM6pniVhbjep11a2wglPxtLz94Ef4jH+1sWoIew94+yAtewwFHP+0vLoCfEuHGF921tNNNmw2MnDysMbTO1kkpi3GNNME9PmvGhnr3GazzY+b8mLZqgR/xpyde9C/ZJnz3Uu3tfWqSouJi57PpV9DHTUvJIoq0nJlYbC/VKjftkFdWinE1dHFbmL+lzKLFcii+M14+CCsdJP7l2nyLO74oqElqIoMPOWys7Bar1sPdpaOnwuaZws+NsUrAp5iBvQ5iwrWdWQleb/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gSBPCu9Yf8as3Ly6daP99iIM+v4m08IzAgjukic69Pc=; b=EsJDdt+cCYLdL38df6mUXJ7aXZ51gbwKvebok2/D1rMFS1fXD6eoJwd1LUY9fYlqTrXEWEwBpwTi3oxMxOKlZWweYlTPY1SI7UKz+4LvUNInLtd0APDn4HQL4yM7RD/QWft78ERoge8fAxvCDVyATjl6A0HYSvM/+Q5aLA0Oz51YXS5gqWfb3edSw3Lz9BsqjEJxrxVvGnvU3R1bYhYc+6u/VJTwkUyxeeULsNhcSJ9DERzreaqltcAIaUa1VyUEkqDbYrb7fKztLM5L2vvOx4K0cjEyyl77w+UMMkdIsQ3YCTNGEdO3pg/YR/SgsdRzhgzoY4mhVvcApGq5+o1XsA== 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 AM6P193CA0079.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:88::20) by AM0PR08MB3988.eurprd08.prod.outlook.com (2603:10a6:208:131::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20; Thu, 21 May 2020 18:16:47 +0000 X-Received: from AM5EUR03FT025.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:88:cafe::92) by AM6P193CA0079.outlook.office365.com (2603:10a6:209:88::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 18:16:47 +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 AM5EUR03FT025.mail.protection.outlook.com (10.152.16.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 18:16:47 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1415.2; Thu, 21 May 2020 18:16:47 +0000 X-Received: from localhost.localdomain (10.57.25.130) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Thu, 21 May 2020 18:16:46 +0000 From: "Tomas Pilar (tpilar)" To: CC: Ray Ni , Zhichao Gao Subject: [edk2-devel] [PATCH v1 3/6] ShellPkg/AcpiView: Move table count reset Date: Thu, 21 May 2020 19:16:26 +0100 Message-ID: <20200521181629.79-4-Tomas.Pilar@arm.com> In-Reply-To: <20200521181629.79-1-Tomas.Pilar@arm.com> References: <20200521181629.79-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)(396003)(39860400002)(346002)(376002)(46966005)(1076003)(2616005)(186003)(478600001)(6666004)(426003)(2906002)(82740400003)(8676002)(4326008)(336012)(54906003)(36756003)(316002)(86362001)(8936002)(47076004)(26005)(82310400002)(356005)(81166007)(70206006)(70586007)(6916009)(5660300002);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 16976db3-550d-4ad9-8aec-08d7fdb323f2 X-MS-TrafficTypeDiagnostic: AM0PR08MB3988:|DB6PR0801MB1719: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:1107;OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: NmRg5W76bLfulNAv/24DZsbWQQ2tVbO6fqX6gq52En9+RGMCVap/7wtaFNCJCENJatmIItrD2Av1yG2KMr/CuZvRXiyvfOjg6Gmu3Q9xwkAXGNYSkMw7GFvkKqCw38X8UN9elf6S53Bhj2ldi4YHST1ic7VO7QXzTDcAQaebZ47msEUk1TBM/GNduPgRwfUWZbsG7c5B9cgr+QDU+a6mUya5k2L+RATUp7JUJVrcmnjDSRuh6TirwyE3wwPjTTPKLicdTF6f47ZCwM0WOtEnrydgXl4QEQ1fjbCuaIyoLmB82BT6S4ZvruLCKxEoPh4V/NW+51a3sTQdpomFKGkS3hDzYn/zHjsR99jrzE9NzaXISK1+zB0Tog8rESf7ehtZp8lbqQ6AFggXMMCpDcp0sK+j2uNUmcjaaQ0DZWhadnubHb4bqgiQjp3P9uNvKb819zy32vyFlU+M567IfDeD6YyHtfA8oMYn35quqRl4LuiC6IoxcfaoESsV8T/rW3/lOG8iCUGnG1VAr+ftbJwnnA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3988 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT064.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 956c46af-5bd8-44c8-8152-08d7fdb32008 X-Microsoft-Antispam-Message-Info: S2nEdVe6+Kl2qGsoimPJDMB0glQiKvXqCZFAAf24iJ3wOBT/ISu9SPHzqbdTdWmWtzmmTDLBP7j2xu/aDi1VZ3KGYTvlZnMbos3IGWwc3PKMZ1r5re2dfOs1dwcq58QgzW2chZpApp8hYnQI0BW5taP21i6bPaRRy15PWKQvJWxq+l28vpPe4PrxLFemcGytyK5MweZhdG/YBwxkdWwEdeNd/2nyL3I1Vt2w8+qfl8QFYPB9kIXdi5riNOAf43rFAhKhHIlANOy4xqosJVSha0TrqIUl0y2FQSEf/RNs4xwNyCwfcdci9BiYslWRtCA1IqPwdAqe9+ec9MrDRvVC3GrOVts9sjANi72JxVmLLV5D6ta36/2veNNNvM4rairYcMWbI2VuVfAcl66ShcbX/cqtFmH7YvbFKZ8AL2rHK9b+dbfPXTAC8riZEfUSVBxW1oyIXJP2wZsAQAIdb6vYcc7YKLgdA6OUJPw4KXmg5bu8Ch+rtJRK6qHj9ELKW7BgUb2mo7WJiGILlfgfB1DIAw== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2020 18:16:54.0225 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 16976db3-550d-4ad9-8aec-08d7fdb323f2 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: DB6PR0801MB1719 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: hcm9p0zWcK7f2ODzwHomPk0ix1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590085018; bh=pLXrrKRn/79/MZFKTVOY81JJFJ+IjYw+6xWFxFZpCag=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=J4yiT5o2cN0v7k4Jr8VNNb4NfoyPrR8ONmKaEOdE11S8HQQeGHYiV7G/mSHKjiwlAr5 JoVrOneiHm4ZX6S1I69V2TZQZRCE/b69InR2j64KMvfxyajzPoYagSzQNx0fusWESAG0w T2eaPlvIGxYAdIR610E17GCXXOTpwi4Ls38= 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 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 2f7395c23bce..c9654e52c434 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c @@ -255,6 +255,10 @@ AcpiView ( EfiConfigurationTable =3D NULL; OriginalAttribute =3D 0; + // 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; - // Set Defaults - mTableCount =3D 0; - mBinTableCount =3D 0; + // Set configuration defaults AcpiConfigSetDefaults (); ShellStatus =3D SHELL_SUCCESS; -- 2.24.1.windows.2 IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you. -=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 (#60053): https://edk2.groups.io/g/devel/message/60053 Mute This Topic: https://groups.io/mt/74381817/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 Sat Apr 27 02:12:18 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+60054+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 1590085020065426.9958745589962; Thu, 21 May 2020 11:17:00 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id mmXeYY1788612xzwa2EFhFiR; Thu, 21 May 2020 11:16:59 -0700 X-Received: from EUR02-AM5-obe.outbound.protection.outlook.com (EUR02-AM5-obe.outbound.protection.outlook.com [40.107.0.46]) by mx.groups.io with SMTP id smtpd.web10.1334.1590085018332032645 for ; Thu, 21 May 2020 11:16:58 -0700 X-Received: from AM5PR0101CA0033.eurprd01.prod.exchangelabs.com (2603:10a6:206:16::46) by AM0PR08MB4483.eurprd08.prod.outlook.com (2603:10a6:208:145::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.27; Thu, 21 May 2020 18:16:55 +0000 X-Received: from AM5EUR03FT012.eop-EUR03.prod.protection.outlook.com (2603:10a6:206:16:cafe::ec) by AM5PR0101CA0033.outlook.office365.com (2603:10a6:206:16::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.24 via Frontend Transport; Thu, 21 May 2020 18:16:55 +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+60054+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 AM5EUR03FT012.mail.protection.outlook.com (10.152.16.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 18:16:55 +0000 X-Received: ("Tessian outbound d078647f4174:v57"); Thu, 21 May 2020 18:16:55 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 602a35a3836cb428 X-CR-MTA-TID: 64aa7808 X-Received: from 9e8b23371560.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id BE877888-9121-4448-8F1C-36839B0A1CFB.1; Thu, 21 May 2020 18:16:50 +0000 X-Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 9e8b23371560.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 21 May 2020 18:16:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=evEgijuyeGjYL1kMqwU0kmsPhwufCxFdOGb68vCTNfOEzX7E/dHHffhmC4S5im7DPYc180rCBVJgD7Rx4a4ljMwgiLgA9xh2yyd4f3JookoY3WFHIfmeCsU6/bsq+5XryjhyMIrdQ8r2Wd9qxqzs5H12/UjltDeRTxmCapvgX8Ei03f2QWFjTM1OrFboyjlXgo1bbRfZ8lhCywguPimIensQz0st6eexQaLuLGXK2bmnDKG6MVS0LQro/ZMw9j01Hl41m/GHrMaHvw0180w7yy7mcOdFcMYv2wWGIunzdN8koSF0HjlLPYy9P0/eVFzJN9ThPKo8CLfIEsv89paOqA== 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=Eg9J9nu4oXhIkmNUZrApLYpfcyRuFp3I8JuMHgw954A=; b=Pkqn8N0TJNE2WMw0pxyYgaUASde42TiQJIyY6iNhQtuLiEFqOYYJKC4SGeppWojdhpzZ54BVIYDA4FL7hsP/6SbrWOR9w8slUJ14hOADopWyS8bV1cXGZQCf3is0SAsdJs29y//5WtT48jIAxRs/I+8s0QRB55GWmloX+37u8yZPehIgjdN33bxQ3rGhII8j22l/Yqz/P5DdtbG9hUWluHl428wcWQmJP6DdJT0JjptR5tmVFJV3LQeB1tbUMezdXKa0DMucKll/wLqUrz94iNrLUZ1m9Ard5jDTVIIYUs0J5LVpiet7g0K6Ehu9KvhWX+behjEZFQQij6ozQIauwA== 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 AM5PR0602CA0003.eurprd06.prod.outlook.com (2603:10a6:203:a3::13) by AM0PR08MB5492.eurprd08.prod.outlook.com (2603:10a6:208:185::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.26; Thu, 21 May 2020 18:16:48 +0000 X-Received: from VE1EUR03FT060.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:a3:cafe::e) by AM5PR0602CA0003.outlook.office365.com (2603:10a6:203:a3::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.24 via Frontend Transport; Thu, 21 May 2020 18:16:48 +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 VE1EUR03FT060.mail.protection.outlook.com (10.152.19.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 18:16:48 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1415.2; Thu, 21 May 2020 18:16:47 +0000 X-Received: from localhost.localdomain (10.57.25.130) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Thu, 21 May 2020 18:16:47 +0000 From: "Tomas Pilar (tpilar)" To: CC: Ray Ni , Zhichao Gao Subject: [edk2-devel] [PATCH v1 4/6] ShellPkg/AcpiView: Move parameter parsing Date: Thu, 21 May 2020 19:16:27 +0100 Message-ID: <20200521181629.79-5-Tomas.Pilar@arm.com> In-Reply-To: <20200521181629.79-1-Tomas.Pilar@arm.com> References: <20200521181629.79-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)(39860400002)(346002)(376002)(396003)(136003)(46966005)(36756003)(5660300002)(186003)(26005)(8936002)(6916009)(6666004)(70206006)(336012)(426003)(1076003)(2616005)(478600001)(8676002)(30864003)(70586007)(81166007)(2906002)(82310400002)(86362001)(356005)(82740400003)(4326008)(47076004)(316002)(54906003);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: eec49768-9bf9-4641-3bcb-08d7fdb324ea X-MS-TrafficTypeDiagnostic: AM0PR08MB5492:|AM0PR08MB4483: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:3044;OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: RP7xSqB66JgpD60FFVAma58rvZjcP5goJYJ0wFIiI2l+BSKquNJLJa2lYwvPanEZrNSONgbJDwI7lH7tXLLxlEutWKt5+0Kw+rbB12vrwxHJolSjWtT9X2bzTaLyWSYspUX//rFvCsZW2cgPoIXn9KXjMBYtbpdIahU/L/gsYU08UMcIcVBj9xjhFtM++p8iTr34z7MHSLC2g3PHbHhhZtiEr6/lk9ndWrmpOjFjR0x52IvnOhO0icUzQwQAmUEUt+vo4v/E1bnc7Nt++d8iYhrnv93SXf4k1GcWFUAOnF/Rqph2yCUy3BI1VQ7x5iogEYbxhTWREECvGia6g5W0p05t/pYxtOz6DIkZifekPUsXbQKbHZYwcnxwePr/oPkk3UPWKMj2A/8CnzpRHhHJBA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5492 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT012.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 4a606e81-4924-4398-a662-08d7fdb3208d X-Microsoft-Antispam-Message-Info: ReH+od3zjOkvBRPM20+xXMWTNmh82p8ap/1NAWhGqIHjymFRF1t2OyKOhjGB5FBBe2yvRl9O7c89t3u68HyQEnMv5Pw9UoK5Py55XkwQ8SLXbd9F0fFzc4+W8asTLhn4uL7d1AH2jyfknRUR097z8B21yN8/R3E8GILYZoREMhmIV/kTHN0DQPrJoownAhp+DCDpsj1X6wV5MpLmGJ5XbJ3axuB/UP4CfTFMuq3OKVFT43UKDjtQCeOsmU1QUKVux1qp4oIISeWeVvebTFByF7SyM51ltBptZAQ15nydwsdiGPeq69HCytghq9oHvkC2F/zWEMYyhEnO31k6DyPTD5KGHId+QdV9RiD/Vf0uikZvs7mBJRfg9W8rJJZY/ldVtEGURIezEfNvZlq5eMWvm0+dHBMr7ZMauO1tHvtk4zosl0l0lPWeXm6HkDk+XDnFkEduysUTHrZw7D5m/5Ff/0EKpy0tJEeJNQouZlBAPUtY2688hCcgh9Mc3zwJ4j1I4kR+DRVLXW6OG6ZpHs3mwA== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2020 18:16:55.5788 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eec49768-9bf9-4641-3bcb-08d7fdb324ea 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: AM0PR08MB4483 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: o0Fuir7shzmGTfShkunLr4ufx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590085019; bh=Mm+iCUVfapfjAlQMpV4tSc6OzyONtmTBtlT8K1iWKD8=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=KNrx8VLEN6CtcTWrRHdoIxo9My6ukMPoqGfwkX6EjUL/lAk5qNnN319LCcq6SrURsNS SGTG46G51VuxQpGukteFP3dxqnxpqDWnGssErPOVr7isELqm97wmoQ8tvvi3HNux5PuCC BzqgJSGs7caL7QuJulKdZrm3uoDcUoEy3T4= 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 Signed-off-by: Tomas Pilar --- ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c = | 205 ----------------------------------------------------------------- ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h = | 18 +++++- ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.c= | 218 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +- ShellPkg/Library/UefiShellAcpiViewCommandLib/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 c9654e52c434..a3160ed6f0a2 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; -/** - 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. @@ -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 ( @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. @retval Returns TRUE if the ACPI table should be traced. **/ @@ -75,4 +75,20 @@ ProcessTableReportOptions ( IN CONST UINT32 Length ); +/** + 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. - 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 **/ #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" CONST CHAR16 gShellAcpiViewFileName[] =3D L"ShellCommand"; +/** + 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; } +/** + 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. 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. - 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 **/ @@ -13,8 +13,12 @@ extern EFI_HII_HANDLE gShellAcpiViewHiiHandle; /** 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). + @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 -- 2.24.1.windows.2 IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you. -=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 (#60054): https://edk2.groups.io/g/devel/message/60054 Mute This Topic: https://groups.io/mt/74381819/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 Sat Apr 27 02:12:18 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+60055+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 1590085020781735.2434937613806; Thu, 21 May 2020 11:17:00 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id isxgYY1788612x9b5Po2aahY; Thu, 21 May 2020 11:17:00 -0700 X-Received: from FRA01-PR2-obe.outbound.protection.outlook.com (FRA01-PR2-obe.outbound.protection.outlook.com [40.107.12.88]) by mx.groups.io with SMTP id smtpd.web11.1376.1590085018601262627 for ; Thu, 21 May 2020 11:16:59 -0700 X-Received: from AM6P192CA0067.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:82::44) by PR2PR08MB4716.eurprd08.prod.outlook.com (2603:10a6:101:28::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23; Thu, 21 May 2020 18:16:56 +0000 X-Received: from AM5EUR03FT064.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:82:cafe::d0) by AM6P192CA0067.outlook.office365.com (2603:10a6:209:82::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 18:16:56 +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+60055+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 AM5EUR03FT064.mail.protection.outlook.com (10.152.17.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 18:16:55 +0000 X-Received: ("Tessian outbound cff7dd4de28a:v57"); Thu, 21 May 2020 18:16:55 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 18527d3499e99c60 X-CR-MTA-TID: 64aa7808 X-Received: from 01609b73db7e.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 8B7A2084-5001-42CE-A185-729AA4716B7F.1; Thu, 21 May 2020 18:16:50 +0000 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 01609b73db7e.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 21 May 2020 18:16:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZRHX78NQwlEV0vsj82ScBxGWoYunSm9OwsoWshaNu4I42nUDj5qOezKVuCqWF4zJUF1y6LGcAvoLfiTzy5qjce+0SMWXWoIs49kWr7tQ8OhEdr4k0SSyHOO45TfM2tlWDb9cg3vBjMQc1tXhuwNH/BgtG/nYhN5O+bKIXffmAt4L/Auu0zI7WzriDi+qNy0TUyJifKe7goVB2sORJaHora6cnmgiq4NFA6WQXonKIfqVSHu7FSeNfbpTOlEzw1BQFItB/DHYAD6iZpezvQHvZ5NBebVr1OY1lvt4umtk3G2wmNmI0k+5yiOyKO51O5L/DPEhV+bB1FPgEFZXoGR3YQ== 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=S5YjE/35bNZ0Fk6xY0Mxmb1Lt6aCrGlynzvBV9yWppM=; b=gZudrkV1Tel5PTG/t8xPt8AnazK2VkR+uviwkp8J2LW72TfaRdDEE0ORsToyYCJmKJXeudoQSYeuu3rJYq+WpMurD+GM6Ulh18+ReLNgYr0jNlQI4AbbFVZMmkd5tgFxB0n6RJ8dN6SIPiTNnckpb+08MdLTJNAIfahF/j8gcKX9BrUp9EyAhb7U9gaYylvGraPPCetej7a7K2IZnnSpU1tblI63ZxmUbIQ72SFp2xy/6SONAMLpgkuCrX/VW/2BJhjKk6/OQ1blLtjGUhjUXw+JmrFG/yXVrh+C6ZCF9JnYiMkrLLm/Mfpx2950POWHyY+CKJuPmywNLDl4OeAv/w== 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 AM5PR0602CA0019.eurprd06.prod.outlook.com (2603:10a6:203:a3::29) by AM0PR08MB3394.eurprd08.prod.outlook.com (2603:10a6:208:e0::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.24; Thu, 21 May 2020 18:16:48 +0000 X-Received: from VE1EUR03FT060.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:a3:cafe::a5) by AM5PR0602CA0019.outlook.office365.com (2603:10a6:203:a3::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 18:16:48 +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 VE1EUR03FT060.mail.protection.outlook.com (10.152.19.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 18:16:48 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1415.2; Thu, 21 May 2020 18:16:47 +0000 X-Received: from localhost.localdomain (10.57.25.130) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Thu, 21 May 2020 18:16:47 +0000 From: "Tomas Pilar (tpilar)" To: CC: Ray Ni , Zhichao Gao Subject: [edk2-devel] [PATCH v1 5/6] ShellPkg/AcpiView: Refactor DumpAcpiTableToFile Date: Thu, 21 May 2020 19:16:28 +0100 Message-ID: <20200521181629.79-6-Tomas.Pilar@arm.com> In-Reply-To: <20200521181629.79-1-Tomas.Pilar@arm.com> References: <20200521181629.79-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)(346002)(136003)(396003)(39860400002)(376002)(46966005)(8936002)(36756003)(1076003)(8676002)(6666004)(26005)(86362001)(5660300002)(70206006)(70586007)(186003)(6916009)(336012)(2616005)(2906002)(426003)(54906003)(82740400003)(81166007)(82310400002)(4326008)(356005)(478600001)(316002)(47076004);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b277250c-68e0-4cf0-90f1-08d7fdb32502 X-MS-TrafficTypeDiagnostic: AM0PR08MB3394:|PR2PR08MB4716: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:9508;OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: Epp3ESJHWdRtEAeSzMyEW4J2RLVzz8vJJWliqTHOT+IpuyIk7vzTGHkR50D3cI0xhfeDjbdIagR2NDxfjQeV3u03ZY7z2pVTtfcICzj9miJgjJHaqBd7Ku/JqydHt4tiuZDQkpEAyj7B3NHanQ8m8bRhiA4e4ePBQVzxvWQmXavYDIsftZPHpV+Ax6q+3Cg6tIzctAh4VVEAjRptA9nENyIScPfLyWXQdrn3P1bBxH/dWN8tQAMVg3G/yxmSdoA7qb7Sx1eCi3YWRbvLbpKUjaDLH39tUujr82UGby1xlKOoNUATjVeJ2PBvNtENZAOJkvQtX9+f343d9ZrSC4HLDFZp8qvwNpbHIHnM+MwD7HFEb28YnxJwdhpyka2+1tu5OUZTG0lI160RGFAE6Gv+SQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3394 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT064.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: f251dd1c-57a1-4e40-8950-08d7fdb320cf X-Microsoft-Antispam-Message-Info: WlFlmjWBCb16xlFQCbQS4xXGBeAq1BiKN3zTlxeIzN6r4wMfszVQZf7hb4Gd9DLFimRVnnCbtu1lG1WBPXTygVBhISw4mS+BD54qYSjoDx1TYvx0nWKz1JA/xVpL13A3cdyE9PCr5UBIsOCPaEmZ82GrHpAgB1ClKANbWDI2fHopLJM2GgC/uIneEqwKxQ4dmRartZXR+F4Z+SnVYUYcfmgNKEgFzkM7E/Sfx/LXNVPFc08G/7HArWGeOm2UI7D+gqeyeXawiTteJVWKIMYfgbebvBRlEnrJ4Vk5JKM5ugL6q+ilQq7MSADtGfYUXUZA6LRjqUFzUOsfRKf5d9hIVoOVEii2v6hpuBSBgF1FXnY9en6pkPqAYEQZNyspFTMcUbPayMdT6anRBij1rJoxIQ== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2020 18:16:55.7543 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b277250c-68e0-4cf0-90f1-08d7fdb32502 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: PR2PR08MB4716 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: uA5Jv7e6cDaHelBMKuHjB0sAx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590085020; bh=eGLXNEQaf5z8HPYnUsUUglAMwbLJl+inbPqE96gbPGg=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=ByeLs9omsAJ5aO8CQitYR4hO2textTozur5l1e+ApyB+gTDVDaMG+3HB/ZI8jQ0deH4 M6HO0u0pTD2l4auDZAghMLpg8skBDoyf87xbCPol/KF67v9XRBi5chtqvlbXCwtrOeUnX deyLBepH//ux09cOD30XvPkCHvHtOTwgCdI= 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 Signed-off-by: Tomas Pilar --- ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c = | 35 +---------------------------------- ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.c= | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.h= | 17 +++++++++++++++++ 3 files changed, 76 insertions(+), 34 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c b/Shel= lPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c index a3160ed6f0a2..e866b84c6844 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c @@ -48,13 +48,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; - DumpFileHandle =3D NULL; TransferBytes =3D Length; GetSelectedAcpiTable (&SelectedTable); @@ -66,39 +63,9 @@ DumpAcpiTableToFile ( mBinTableCount++ ); - 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); - 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 DumpFile (FileNameBuffer, Ptr, Length); return (Length =3D=3D TransferBytes); } diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiView= CommandLib.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiVi= ewCommandLib.c index c3942ad24e5b..adf3cce6cfe2 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.c @@ -98,6 +98,64 @@ RegisterAllParsers ( return Status; } +/** + Dump a buffer to a file + + @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 +DumpFile ( + 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. diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiView= CommandLib.h b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiVi= ewCommandLib.h index a3a29164004d..9dd39cf4b3f0 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.h +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.h @@ -10,6 +10,23 @@ extern EFI_HII_HANDLE gShellAcpiViewHiiHandle; +/** + Dump a buffer to a file + + @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 +DumpFile ( + IN CONST CHAR16* FileNameBuffer, + IN CONST VOID* Buffer, + IN CONST UINTN BufferSize + ); + /** Function for 'acpiview' command. -- 2.24.1.windows.2 IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you. -=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 (#60055): https://edk2.groups.io/g/devel/message/60055 Mute This Topic: https://groups.io/mt/74381820/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 Sat Apr 27 02:12:18 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+60057+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 1590085021782290.75277305120426; Thu, 21 May 2020 11:17:01 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id emz6YY1788612xAe1r4gUd94; Thu, 21 May 2020 11:17:01 -0700 X-Received: from EUR01-VE1-obe.outbound.protection.outlook.com (EUR01-VE1-obe.outbound.protection.outlook.com [40.107.14.59]) by mx.groups.io with SMTP id smtpd.web10.1338.1590085020213899390 for ; Thu, 21 May 2020 11:17:00 -0700 X-Received: from AM4PR0501CA0047.eurprd05.prod.outlook.com (2603:10a6:200:68::15) by VI1PR0801MB1679.eurprd08.prod.outlook.com (2603:10a6:800:59::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23; Thu, 21 May 2020 18:16:57 +0000 X-Received: from AM5EUR03FT054.eop-EUR03.prod.protection.outlook.com (2603:10a6:200:68:cafe::75) by AM4PR0501CA0047.outlook.office365.com (2603:10a6:200:68::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 18:16:57 +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+60057+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 AM5EUR03FT054.mail.protection.outlook.com (10.152.16.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 18:16:57 +0000 X-Received: ("Tessian outbound 444e8e881ac1:v57"); Thu, 21 May 2020 18:16:57 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 623df706f2d3a6cb X-CR-MTA-TID: 64aa7808 X-Received: from 77e671c53e2e.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 482BF446-1B04-4277-88D4-5F9FCB8B5E13.1; Thu, 21 May 2020 18:16:51 +0000 X-Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 77e671c53e2e.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 21 May 2020 18:16:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YvwY3XYWNjUnmhyZPYOfo83eui0OIbzLs8M2ThhH2lysnzQjrUDig9VcsC2zDudVOmeeMWsT0/dnEcrSfe9/v53Q4YgyObbqDGrP944I6gr+3vA/DgK4EvdfRMqQPolEzPHIhEatxwBx4c2jPovTYX9cONEGd2S7iZdCk21FB+FeQiQE50nF6B5YDOo0Jgb3DIZaS9fZ3zX/tTIE7f8f6z1f/1m3p6MF5XuW1EhUhAGY+vZdqZ/NTWxi22A5dlJlDTDi7a6lcRJY7OHuPkt2adLRzyzMu82jYg1Yj9vBBpWhVbFHcIw22B7hmRehhA4PZQXm8vZugeucY37HV5bDMQ== 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=FRvvrbiW0rzlA7q6LA4wtQshomA+Rh/HHkRL0fDcnfs=; b=dZ+HHR2224XuLNI+JwsI4LhLa7HOCxG97zF2ILOHmbf9Jq64LoUTjF8+ZPgCd2+htVCNPL//jugqbqbMwBm5UbcCR2V1bWaEuv7at3w+EsaD59hsRzVR2eUnfu5s/cwNBlg/qSqydoy0CnGlzlVi7Ff+L4tT96UGqYZPEgw3reZrZ8UNeIt8rE5ZimvwbPqvNZRqjl23bgeXPtsfGLORqoS/oCg/Vpr2LMfUI74mHsbC/C1aGBg1GTYL7KhtFlze7fFLtnNONrnqbIY7iydhBSVACo0giAmUsAXNKSK/vEG2mpoez0JyRqTC7QL7np5R1LjF5V7RkSIe6aIbywVcDA== 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 AM7PR02CA0030.eurprd02.prod.outlook.com (2603:10a6:20b:100::40) by DB7PR08MB3131.eurprd08.prod.outlook.com (2603:10a6:5:1e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23; Thu, 21 May 2020 18:16:49 +0000 X-Received: from AM5EUR03FT014.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:100:cafe::82) by AM7PR02CA0030.outlook.office365.com (2603:10a6:20b:100::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 18:16:49 +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 AM5EUR03FT014.mail.protection.outlook.com (10.152.16.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 18:16:48 +0000 X-Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1415.2; Thu, 21 May 2020 18:16:48 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1779.2; Thu, 21 May 2020 18:16:48 +0000 X-Received: from localhost.localdomain (10.57.25.130) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Thu, 21 May 2020 18:16:48 +0000 From: "Tomas Pilar (tpilar)" To: CC: Ray Ni , Zhichao Gao Subject: [edk2-devel] [PATCH v1 6/6] ShellPkg/AcpiView: Add application wrapper Date: Thu, 21 May 2020 19:16:29 +0100 Message-ID: <20200521181629.79-7-Tomas.Pilar@arm.com> In-Reply-To: <20200521181629.79-1-Tomas.Pilar@arm.com> References: <20200521181629.79-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)(396003)(346002)(39860400002)(376002)(46966005)(26005)(6666004)(8936002)(86362001)(478600001)(5660300002)(2616005)(54906003)(336012)(1076003)(81166007)(356005)(8676002)(426003)(82740400003)(70206006)(36756003)(70586007)(47076004)(316002)(6916009)(4326008)(82310400002)(2906002)(186003);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fa2a3d75-0a3b-42a9-fefe-08d7fdb325e7 X-MS-TrafficTypeDiagnostic: DB7PR08MB3131:|VI1PR0801MB1679: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:2887;OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: JMyFHvzJ59NSz8pzloE651f+E/3OktlDhxZ9/kaEWlnSc6sAvbYL4VpUTaGmbv7k+60+e7VQ4MUW834cn95jAE25k9VaVUL2O27uptZEyNWupkRbOsRHJiG+witxVQGwszGsqTgQcws4Ari5nFsJJFundX1fpD/SoaG1oBGkT854CASeKgk4ByPMOa5kVoG1/sVFjrC9ajoED09ZXTvJFb0zfrrRn7kEpJdcpGq3KBPP9M13yo+q4EYVCjdhHszAb/Z7xGnouRncyjgk9qdqdZoVSBWFQOCWx20zQADuxgKNQKtclRZFBb2T/M28ePQJ1rk8P2A681BficWnONhAIbUqZISQ8y6EMVZd0J+NKIPmZAsHi6Ajn2wqbbOdSLK7JxFclCMvr6gGxCKRas4YctUvoCzpUPkAyLh1CuiKjBefEqlL4c9LxX3+PgCjp86l1v8qdptA49M9SiOvb8TV19xoVSrXJg5DBavasJ3Bx9c= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3131 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT054.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 580a2314-5393-4105-1ba5-08d7fdb320ec X-Microsoft-Antispam-Message-Info: BC2m+0sIL0MWjiJrekhMwm2UtG9zCW3fK6J0ma2hGgBnAN+Fn/djtwJ664jFEM0ch+H/Za/Rbu3VgszreVkjs/2xF1xqWFPfPrORDYew/lB0GGd1QL88yXdnJw9SDzV1jxFomDnMLEIq/Q52pofeRYb9O+OE5Q+J1Go/OJJpU79xrr63elC+FifR5qRppHzRfekxwj+VhKSaO85UFdhHxTU0keAKn6rh+L1gxDqRvm7fCQUctujzhMGqwAzEhGqFvYuEx+5gQpaKN0Ur1nnovDOqqsJhjWZAikR2EI09J/WMLEgHI593+pxDH1oorVCFDrHwbfh0/WsFqC4OuKAQ9ki5ehrfuk2jJF+++eJWXpXUkVVRZsTVaf1KYMuOxTht56OJhqsZD/GZfBw4xbab7eWYhgWBmiEIHdDWONgIJwjmAortIsdKiujtuu2kIHpXjclTNd46RknfJ9ii9v+WZmBEMhqpgrwu0jHt+HdJXwA= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2020 18:16:57.2339 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fa2a3d75-0a3b-42a9-fefe-08d7fdb325e7 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: VI1PR0801MB1679 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: Y64rooYmw6nDK3j2Zi0wcMOix1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590085021; bh=YMq3IBgvE2spBdJlI1PgR45tveXDirGYF+Eumremx8c=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=MhjKolWqpLK0Lck/AQbl8MVPb1w+IcdMM0bi/Rs0nGR/zljYbbg4Gpk4iyoSd35dI3n 0l7VR/yDxNML4qLwpKQW020hDvxrSn6pJdVH5HqRKGtW8fkHWlsXVQxmgjUrcHcBASt24 eMvMhLueBXPu5MpsYiz/xX4/TY0xtz6IwQs= 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 Signed-off-by: Tomas Pilar --- ShellPkg/Application/AcpiViewApp/AcpiViewApp.c | 189 +++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++ ShellPkg/Application/AcpiViewApp/AcpiViewApp.inf | 31 ++++++++++++ ShellPkg/ShellPkg.dsc | 6 ++- 3 files changed, 225 insertions(+), 1 deletion(-) diff --git a/ShellPkg/Application/AcpiViewApp/AcpiViewApp.c b/ShellPkg/Appl= ication/AcpiViewApp/AcpiViewApp.c new file mode 100644 index 000000000000..f83111629c21 --- /dev/null +++ b/ShellPkg/Application/AcpiViewApp/AcpiViewApp.c @@ -0,0 +1,189 @@ +/** @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 + +/** + Execute the AcpiView command from UefiShellAcpiViewCommandLib. + This function is pulled in directly from the library source. +**/ +SHELL_STATUS +EFIAPI +ShellCommandRunAcpiView ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE* SystemTable + ); + +CHAR16 mAcpiViewAppHelp[] =3D + u"\r\n" + "Display ACPI Table information.\r\n" + "\r\n" + "AcpiViewApp.efi [[-?] | [[-l] | [-s AcpiTable [-d]]] [-q] [-h]]\r\n" + " \r\n" + " -l - Display list of installed ACPI Tables.\r\n" + " -s - Display only the specified AcpiTable type and only support singl= e\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" + " -? - Show help.\r\n" + " \r\n" + " This program is provided to allow examination of ACPI table values fr= om " + "the\r\n" + " UEFI Shell. This can help with investigations, especially at that " + "stage\r\n" + " where the tables are not enabling an OS to boot.\r\n" + " The program is not exhaustive, and only encapsulates detailed knowled= ge " + "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 " + "displayed\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 generat= e " + "a\r\n" + " binary file image of a table that can be copied elsewhere for " + "investigation\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 du= mp " + "(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= " + "present\r\n" + " in the system. For normal type AcpiTable, it would display the dat= a of " + "the\r\n" + " AcpiTable and AcpiTable header. The following type may contain hea= der " + "type\r\n" + " other than AcpiTable header. The actual header can refer to the AC= PI " + "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 Tabl= e\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" + " Table details correspond to those in 'Advanced Configuration and Powe= r\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.1\r\n" + " will be 'backwards compatible' with prior version of the " + "specification\r\n" + " in terms of structure, so formatted output should be correct. T= he " + "main\r\n" + " exception will be that previously 'reserved' fields will be " + "reported\r\n" + " with new names, where they have been added in later versions of= " + "the\r\n" + " specification.\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"; + +/** + Determine if the user wants to display by checking for presence + of '/?' or '--help' on command line. We cannot override '-?' shell + command line handling. + + @retval EFI_SUCCESS No help was printed + @retval EFI_INVALID_PARAMETER Help was printed +**/ +STATIC +EFI_STATUS +CheckForHelpRequest ( + EFI_HANDLE ImageHandle + ) +{ + EFI_STATUS Status; + EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters; + UINTN Index; + + Status =3D gBS->HandleProtocol ( + ImageHandle, + &gEfiShellParametersProtocolGuid, + (VOID **)&ShellParameters + ); + if (EFI_ERROR(Status)) { + return Status; + } + + for (Index =3D 1; Index < ShellParameters->Argc; Index++) { + if ((StrCmp (ShellParameters->Argv[Index], L"/?") =3D=3D 0) || + (StrCmp (ShellParameters->Argv[Index], L"--help") =3D=3D 0)) { + Print (mAcpiViewAppHelp); + return EFI_INVALID_PARAMETER; + } + } + + return EFI_SUCCESS; +} + + +/** + 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 + ) +{ + EFI_STATUS Status; + + Status =3D CheckForHelpRequest (ImageHandle); + + // Do not run code if help was printed + if (Status !=3D EFI_INVALID_PARAMETER) { + Status =3D ShellCommandRunAcpiView (gImageHandle, SystemTable); + } + + return Status; +} diff --git a/ShellPkg/Application/AcpiViewApp/AcpiViewApp.inf b/ShellPkg/Ap= plication/AcpiViewApp/AcpiViewApp.inf new file mode 100644 index 000000000000..28e724fa1909 --- /dev/null +++ b/ShellPkg/Application/AcpiViewApp/AcpiViewApp.inf @@ -0,0 +1,31 @@ +## @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 + +[Sources.common] + AcpiViewApp.c + +[Packages] + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + +[LibraryClasses] + UefiBootServicesTableLib + UefiLib + BaseLib + UefiApplicationEntryPoint diff --git a/ShellPkg/ShellPkg.dsc b/ShellPkg/ShellPkg.dsc index b7ee856b3a16..1ed82ee7aca3 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 @@ -143,6 +143,10 @@ [Components] gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE } ShellPkg/DynamicCommand/DpDynamicCommand/DpApp.inf + ShellPkg/Application/AcpiViewApp/AcpiViewApp.inf { + + NULL|ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewC= ommandLib.inf + } [BuildOptions] *_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECATED_INTERFACES -- 2.24.1.windows.2 IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you. -=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 (#60057): https://edk2.groups.io/g/devel/message/60057 Mute This Topic: https://groups.io/mt/74381823/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-