From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.74]) by mx.groups.io with SMTP id smtpd.web10.16079.1592222250532320473 for ; Mon, 15 Jun 2020 04:57:31 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=LmRlUbcf; spf=pass (domain: arm.com, ip: 40.107.8.74, mailfrom: tomas.pilar@arm.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N37N5J9yjGgAI2kaC05jM5rvXnWm8LrFqucrG/Yn7Ks=; b=LmRlUbcfpf2ubT+VgGYxOJ2Zm9YMYnnXvI4EVXaChe0XNqpN050f7Y/Xz9j+iKHqxgqXJ1BUtuX2VhcXSo07MdJ8+0bKBSmABTUgtasrRoho7iBY2RKqggjehZm2Ibx8xFXHGeb2tr0hVkfTXdDP6m7PEhjbqWuq3QcVrzApEfg= Received: from DB3PR06CA0034.eurprd06.prod.outlook.com (2603:10a6:8:1::47) by AM5PR0801MB2002.eurprd08.prod.outlook.com (2603:10a6:203:49::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3088.22; Mon, 15 Jun 2020 11:57:27 +0000 Received: from DB5EUR03FT035.eop-EUR03.prod.protection.outlook.com (2603:10a6:8:1:cafe::6e) by DB3PR06CA0034.outlook.office365.com (2603:10a6:8:1::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3088.19 via Frontend Transport; Mon, 15 Jun 2020 11:57:27 +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 (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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT035.mail.protection.outlook.com (10.152.20.65) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3088.18 via Frontend Transport; Mon, 15 Jun 2020 11:57:27 +0000 Received: ("Tessian outbound 56dbe829191e:v59"); Mon, 15 Jun 2020 11:57:27 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 09daef31f98c0a07 X-CR-MTA-TID: 64aa7808 Received: from e10abd0eaf73.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id C0F31E30-6826-4426-8A15-5B09C93A06AF.1; Mon, 15 Jun 2020 11:57:22 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e10abd0eaf73.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 15 Jun 2020 11:57:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F/EVmqN40KIB3/nhG9vw2PDR59NqJUcbNpL2IfvkJKakSJnZoLGcIE/la/nT2BQPFsBsm1Mcf9xniUW7ow68mmRTr9ucbkt+RlczHQhvtEQctaatT8bbTQhs1uB8PGhDdhOrUVMttqxCtP3MTqEYiOqVuysC/lHAj6W0ReG/VIKWvSYXyjJrNPRUlJpbYsWeIlgxjwRNUk65CXwUu7ejCKaopbSgU4K/ymHm+GTHx0xCNnF6USv2gZKNW5YG8esn39jROnLQU5yW2QbFNoNddtB7u9RFEDN24s5UFMF4a/gzVQEwUV6/DPNqqFdrB8LJuWJHd1clx1HylpPcZnwIMw== 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=N37N5J9yjGgAI2kaC05jM5rvXnWm8LrFqucrG/Yn7Ks=; b=DIXe6EHXH77cpSVHwEGi/KHkkM6fa1jxdORm8bNjmfWd4r6eXvVK8HKdy/c8rJOp5Vg1q+wxQxjUzA8xXjs2OyL0kL2KSSTvp/O/irwQ8TpF7DBzJ8jRj86NC/iGfWiG5B+IKPIt0BXWTBfmo4LjiCFdPRrj4eISvETghgHnv3q/jnak2UM/7HN7vANJMJCb19jzH5nUploQI3XZjg7TS/DEtAo+fcXKObEH9VMxKA/GIP4bFg3yODZuZpHbK9RZ1N7lY4PKdneUgg5kd+HxXQP/yMdArwKnkxglYowH4tbc5DLr5MPBc3CsIIPGxrLoJB6OgTA5Nrt53w+8Ru4JPA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N37N5J9yjGgAI2kaC05jM5rvXnWm8LrFqucrG/Yn7Ks=; b=LmRlUbcfpf2ubT+VgGYxOJ2Zm9YMYnnXvI4EVXaChe0XNqpN050f7Y/Xz9j+iKHqxgqXJ1BUtuX2VhcXSo07MdJ8+0bKBSmABTUgtasrRoho7iBY2RKqggjehZm2Ibx8xFXHGeb2tr0hVkfTXdDP6m7PEhjbqWuq3QcVrzApEfg= Received: from AM5PR0801MB1844.eurprd08.prod.outlook.com (2603:10a6:203:39::22) by AM5PR0801MB1908.eurprd08.prod.outlook.com (2603:10a6:203:4b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3088.24; Mon, 15 Jun 2020 11:57:20 +0000 Received: from AM5PR0801MB1844.eurprd08.prod.outlook.com ([fe80::95cf:8f23:9053:2f60]) by AM5PR0801MB1844.eurprd08.prod.outlook.com ([fe80::95cf:8f23:9053:2f60%10]) with mapi id 15.20.3088.029; Mon, 15 Jun 2020 11:57:20 +0000 From: "Tomas Pilar (tpilar)" To: "Gao, Zhichao" , "devel@edk2.groups.io" CC: nd , "Ni, Ray" Subject: Re: [edk2-devel] [PATCH v2 6/6] ShellPkg/AcpiView: Add application wrapper Thread-Topic: [edk2-devel] [PATCH v2 6/6] ShellPkg/AcpiView: Add application wrapper Thread-Index: AQHWL6BVFelgZ4RUW0aq1RwPBivQLKjUZs0AgAVRbCA= Date: Mon, 15 Jun 2020 11:57:20 +0000 Message-ID: References: <20200521184421.2222-1-Tomas.Pilar@arm.com> <20200521184421.2222-7-Tomas.Pilar@arm.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Authentication-Results-Original: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=arm.com; x-originating-ip: [217.140.99.251] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 9c831350-e5f3-49d0-9b47-08d81123465d x-ms-traffictypediagnostic: AM5PR0801MB1908:|AM5PR0801MB2002: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:2000;OLM:2000; x-forefront-prvs: 04359FAD81 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: KZWWpP4JdcvcUSTSbjrlWQaWy6gGOZBuBp5IW5LhclxKwrgIVlqnthZuHrqGV979azBJQZ3/D9TAE0HMUcZf6niCrFrqaH3PX5zd4AEeZzBBx8d+9UAuSZINiMk0Jh/4r40S2PuP6KAzKQdAP1kSXH9uiTZVe8MfLu8bithzNkwdTW7iL5kQLeLIKNB6Iutr6pTZdgVYbr7FPVUPXk+RUVvT3t+vIF9CkzqxCIFI0YXxukHxSWr0tIGr+yRkPyUNHu0+G0/8+XSbldngZe/8DIcl0xvF3qP5qPdwt5wUoXw07KSiP4/tAhB7dK71xkXkC/1294XYJC2qBXfelhBwsGGOMFadmz1XG44rEadKNOGwqJw8dfzVeKTOo716f+ynDulzKwyxeRZHazXVLTgczQ== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM5PR0801MB1844.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(376002)(136003)(39860400002)(366004)(396003)(346002)(55016002)(9686003)(4326008)(478600001)(66476007)(5660300002)(71200400001)(64756008)(66946007)(66446008)(110136005)(966005)(66556008)(54906003)(33656002)(86362001)(30864003)(76116006)(2906002)(316002)(186003)(26005)(7696005)(52536014)(53546011)(6506007)(83380400001)(8936002)(8676002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: +O9JvEqvv7aUUwf426ghCiWdNxrhxutAUaoYqVmVGWld6npEClDDryAb/hTXZoQV2GZfaK/KIBFxXbg2eEqJ7U7fvBKDnUrVZklqGMqWxWmi1VGxUa2YUEwOiYBJeyIiSrG7WRBBrW0qwSuAoHyyBt/3fJ5/aaYfYJn6KPbVyO+/VuxGGsf3MkUDl3jRwdsGIBlrBB9fKxLvDyUpEoyiKcKrvTbulAYGv03c9aAJT2Ob6a0VfHubH2wasA1pxq9f+3Qmju9s4MPGrBHlPRD2munC7v5YVcxIbY3lZH/So+g8FAin4PKiKieYoCK/IBt7Q31c22CiW0SHCid51KySEj/fLOOLHOiom/BYsjtrzOB/ME9WR82WknDr+gFq1xYyrfmDK18mbz3qPUqRexqD3I/9B5jNdbRZC6UNXCA4NDf3mOWlPoKAdlPyvgY23V4wTNGESyfEujz2YDmV5PLmqqCLfNnFgoIoUd2wsyuCE33EaIfKN1XiG9beI9MnVWCu x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1908 Original-Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=arm.com; Return-Path: Tomas.Pilar@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT035.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFTY:;SFS:(4636009)(396003)(346002)(136003)(376002)(39860400002)(46966005)(356005)(8936002)(52536014)(81166007)(53546011)(6506007)(2906002)(7696005)(82310400002)(316002)(86362001)(4326008)(8676002)(83380400001)(9686003)(30864003)(55016002)(26005)(478600001)(82740400003)(336012)(70206006)(54906003)(33656002)(47076004)(70586007)(5660300002)(110136005)(966005)(186003)(107886003);DIR:OUT;SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: fca0422b-7617-4077-4d4c-08d81123420b X-Forefront-PRVS: 04359FAD81 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LglEPlCU+btYduhNIKzLQZFA8aIb3TnHCjMUrliaH/ItAvNGdxmU6zdgqySs4Yf0e+j8NWXbVk7b38e1JVwUCsLuz902bX3o7+aePrYp4wxoJKxuR96aZuPyvSqGCyerR/ooHjlFKaZiKAO0WsUpW+oPVRk7EPjib3iC3J3pMUmyDvhvbyX66awAo1HMWbAdNMXMzZ18faeWFfNIwcpVoYVjbNyV9c/QmvZVNyXqlYMG/RRxnvB7GG5qYiE2sZreEzBYszMrB6EsdYJt5MnjGyl82aVIjt+ML2jIgqNuzpfMo9Tf/BcDUxbpTaryiC7ULvxzQH+A/nesPKnjcKVHq1WzulhRxbGnu6Hl3zqT1LpC3K5GIzzpJkDVZXw4CVxaBrFWTmi7nMrwyFZpvowtTD6eyWyVsk5Edv7m/uH5bw7sC+XUhAO0PPo39LLseDjTBSiWC3JMByO26EntwBEkAJ5ZDSVBB1JDGWozAyjrp7I= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2020 11:57:27.4852 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9c831350-e5f3-49d0-9b47-08d81123465d 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: AM5PR0801MB2002 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thank you Zhichao, this is really useful, I was wondering how to hook into = the shell help framework.=20 Regarding the lower case const and static, I am entirely happy to change t= hem, but I have a couple of patch series outstanding and don't want to add = unnecessary merge conflicts, so I'll do a single formatting patch at the en= d that changes all instances of const and static in the UefiShellAcpiViewCo= mmandLib and one for AcpiViewApp. I hope that is acceptable. I am respinning the patches now. Cheers, Tom -----Original Message----- From: Gao, Zhichao =20 Sent: 12 June 2020 03:42 To: devel@edk2.groups.io; Tomas Pilar Cc: nd ; Ni, Ray Subject: RE: [edk2-devel] [PATCH v2 6/6] ShellPkg/AcpiView: Add applicatio= n wrapper (1) There is one more easy with to add the help info. Put the help string in the uni file that has the same name with the module= file name. See below example from TftpApp.inf: // // String token ID of help message text. // Shell supports to find help message in the resource section of an appli= cation image if // .MAN file is not found. This global variable is added to= make build tool recognizes // that the help string is consumed by user and= then build tool will add the string into // the resource section. Thus the= application can use '-?' option to show help message in // Shell. // GLOBAL_REMOVE_IF_UNREFERENCED EFI_STRING_ID mStringHelpTokenId =3D STRING_= TOKEN (STR_GET_HELP_TFTP); (2) I suggest to add the UefiShellAcpiViewCommandLib header file to make it vi= sible for other module. The application support to build in other module. I= t is better to put the lib visible in the inf config file. Consumers can be= clearly aware of which libs are required. When introduce new lib: a. add header file for the published interface b. add lib & header file in the package dec file c. add lib in the package dsc file [Components] for build only d. add the lib in the [LibraryClasses] for the package that would consum= e the lib (3) One white space in the end of line. It would break the Patchchecker.py. Se= e below. > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Tomas=20 > Pilar > (tpilar) > Sent: Friday, May 22, 2020 2:44 AM > To: devel@edk2.groups.io > Cc: nd@arm.com; Ni, Ray ; Gao, Zhichao=20 > > Subject: [edk2-devel] [PATCH v2 6/6] ShellPkg/AcpiView: Add=20 > application wrapper >=20 > Simple application wrapper that invokes the shell command wrapper for ac= piview. >=20 > This allows the AcpiView functionality to be used on platforms with=20 > older specifications of the UEFI shell or where the 'acpiview' command= =20 > is not built in due to platform build configuration. >=20 > Furthermore, this app can be integrated into more comprehensive=20 > testing frameworks as a single component of a more thorough=20 > specification compliance validation strategy. >=20 > 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(-) >=20 > diff --git a/ShellPkg/Application/AcpiViewApp/AcpiViewApp.c > b/ShellPkg/Application/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 si= ngle\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 che= cks.\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= from " > + "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 know= ledge " > + "of a\r\n" > + " limited number of table types.\r\n" > + " \r\n" > + " Default behaviour is to display the content of all tables installe= d.\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 out= put.\r\n" > + " Other table types will be displayed as an array of Hexadecimal byt= es.\r\n" > + " \r\n" > + " To facilitate debugging, the -s and -d options can be used to gene= rate " > + "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 especial= ly\r\n" > + " relevant for AML type tables like DSDT and SSDT.\r\n" > + " \r\n" > + "NOTES:\r\n" > + " 1. The AcpiTable parameter can match any installed table type.\r\n= " > + " Tables without specific handling will be displayed as a raw hex= dump " > + "(or\r\n" > + " dumped to a file if -d is used).\r\n" > + " 2. -s option supports to display the specified AcpiTable type that= is " > + "present\r\n" > + " in the system. For normal type AcpiTable, it would display the = data of " > + "the\r\n" > + " AcpiTable and AcpiTable header. The following type may contain = header " > + "type\r\n" > + " other than AcpiTable header. The actual header can refer to the= ACPI " > + "spec\r\n" > + " 6.3\r\n" > + " Extra A. Particular types:\r\n" > + " APIC - Multiple APIC Description Table (MADT)\r\n" > + " BGRT - Boot Graphics Resource Table\r\n" > + " DBG2 - Debug Port Table 2\r\n" > + " DSDT - Differentiated System Description Table\r\n" > + " FACP - Fixed ACPI Description Table (FADT)\r\n" > + " GTDT - Generic Timer Description Table\r\n" > + " IORT - IO Remapping Table\r\n" > + " MCFG - Memory Mapped Config Space Base Address Description > Table\r\n" > + " PPTT - Processor Properties Topology Table\r\n" > + " RSDP - Root System Description Pointer\r\n" > + " SLIT - System Locality Information Table\r\n" > + " SPCR - Serial Port Console Redirection Table\r\n" > + " SRAT - System Resource Affinity Table\r\n" > + " SSDT - Secondary SystemDescription Table\r\n" > + " XSDT - Extended System Description Table\r\n" > + " \r\n" > + " Table details correspond to those in 'Advanced Configuration and P= ower\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= . The " > + "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, Please remove the white space in the end of above line. Thanks, Zhichao > + &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/Application/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 # #=20 > +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-E1BCE08435= B9 > + 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=20 > reserved.
-# Copyright (c) 2018, Arm Limited. All rights=20 > reserved.
> +# Copyright (c) 2018 - 2020, Arm Limited. All rights reserved.
> # Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All=20 > rights 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 > + NULL|om > + mandLib.inf > + } >=20 > [BuildOptions] > *_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECATED_INTERFACES > -- > 2.24.1.windows.2 >=20 >=20 >=20 >=20