From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web10.9399.1592875703933997775 for ; Mon, 22 Jun 2020 18:28:24 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=YjAwuic4; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: zhichao.gao@intel.com) IronPort-SDR: wwewPPCfsrUuW9YvC2WrtGq/WubPi+p7mlIt4ubrBy9ljiFWpiGLn44pKYNQv2Jcut1oT6dYa+ N628hdFa1xJg== X-IronPort-AV: E=McAfee;i="6000,8403,9660"; a="142192261" X-IronPort-AV: E=Sophos;i="5.75,268,1589266800"; d="scan'208";a="142192261" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2020 18:28:23 -0700 IronPort-SDR: SijAFlr8MIp6vgJadwj5SPGEcSqDcVDynIn2XnC4bYrZlMLyTA5XprozOZUYfKv6s4poSDzQia Bx5LaDwAwxhA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,268,1589266800"; d="scan'208";a="310282221" Received: from orsmsx102.amr.corp.intel.com ([10.22.225.129]) by orsmga008.jf.intel.com with ESMTP; 22 Jun 2020 18:28:23 -0700 Received: from orsmsx156.amr.corp.intel.com (10.22.240.22) by ORSMSX102.amr.corp.intel.com (10.22.225.129) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 22 Jun 2020 18:28:22 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by ORSMSX156.amr.corp.intel.com (10.22.240.22) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 22 Jun 2020 18:28:22 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.171) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 22 Jun 2020 18:28:22 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LjbT+6zWKndb/PBYniPexMCb9fHEKiGifk6i5tgFSMxcA/XbzXCkt4jPevGrQYlE8RAz7w/hCdPt4jKep7yhCK7Kem0WTuoUFR2K6Ken96w3Ke2dRQNy+4SVhkwZmctkMUhJVekDRC7jD4fFi43hnkP5yQ/mtnVfqo8nHMXTZ3znJbDDcDd2bKGOVyYhKokY/m8Tq66pQ+Iy1Tf8BJubTrmkHgGHtrgCW4McehCGB/Nv5DfyoEL3ukzqn8T7hE+P6T5zXwBpWz8zuMJ1ROY+wL5lAe0xeYk9FOuk8YmaIJ6GMO98LgmMlh4yRm5NWhOBaeeC5j2l1xkIXb+KD9tmEg== 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=KezlSLMX118WBN/ZlvMRQA7N5eUcF0m7xJ1Pa3LJOpw=; b=OPZTB3NDNf05td08694D1SoqjPV09QH1kiqZGqzos+7YAVKiQRYsvjfbuohrAVhQslvwlvkzceyycHqVn9jBx1Fe1a/KGKaiiXcwKhyRtCBlqpwurXbK2Z8MJd9zBFeqCCz9PS7/9HPl3effJQYZMgiGN2DRDFZMAQ/d8NWCxhNY2BLOfa8GC1VZGeRSth+CsQfAhAB6MlbiMFxhkVeNP+/3glAGI7/zo30lmVz3seEbETsX3wseUQVbZp1wJs0POoLyYIGsn/g41omS8GaQEjEdYWcF2zOpDu5yY/fucfHUs8xMTRzN96hsiZxQw+blQZWd9yiEPDEHI1nCEOzyPw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KezlSLMX118WBN/ZlvMRQA7N5eUcF0m7xJ1Pa3LJOpw=; b=YjAwuic4y2NxQz92MAA5Uta8wm1rHGTujITZnP15nQmETPEDaLWvchywhG3XCrXQ+D59zMi8R2+yJMNyuq3vap/blcMO5qnnlPT+o2EHpCYerwj9y3ZGYa22+Z6BsZL9dH/iBWm6ALW4kabCyZiib8Ajk8gX+3v/49t94cPD0s8= Received: from DM6PR11MB4425.namprd11.prod.outlook.com (2603:10b6:5:1d9::31) by DM6PR11MB3212.namprd11.prod.outlook.com (2603:10b6:5:5b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.23; Tue, 23 Jun 2020 01:28:21 +0000 Received: from DM6PR11MB4425.namprd11.prod.outlook.com ([fe80::ad34:e1fc:2e7b:d124]) by DM6PR11MB4425.namprd11.prod.outlook.com ([fe80::ad34:e1fc:2e7b:d124%3]) with mapi id 15.20.3109.027; Tue, 23 Jun 2020 01:28:21 +0000 From: "Gao, Zhichao" To: Tomas Pilar , "devel@edk2.groups.io" CC: "nd@arm.com" , "Ni, Ray" Subject: Re: [PATCH v3 7/7] ShellPkg/AcpiView: Add application wrapper Thread-Topic: [PATCH v3 7/7] ShellPkg/AcpiView: Add application wrapper Thread-Index: AQHWQx30JlpcdaaLV0edjiUq9SkY+KjldM7A Date: Tue, 23 Jun 2020 01:28:21 +0000 Message-ID: References: <20200615140351.1725-1-Tomas.Pilar@arm.com> <20200615140351.1725-8-Tomas.Pilar@arm.com> In-Reply-To: <20200615140351.1725-8-Tomas.Pilar@arm.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.2.0.6 authentication-results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.45] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4f872b20-7c0e-4541-150a-08d81714b738 x-ms-traffictypediagnostic: DM6PR11MB3212: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4125; x-forefront-prvs: 04433051BF x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: KnYSnhCbLCWmUCMoG8WgYTceuQtaVeVqZzknEwhkWgoRuSls6/MyzcrvHL+1S2uyJRrpN9DRGqMijATpcbYu8iIlJHJ9GTQLjFwiYjSiGKhGjSeyqcaK0Ph9D6WXAAe93Ikk2jHAl5I5JQiFN8BqbCUtHX6OjiH1wGBMuNuWfhMQiCr3QZz83kBAyGf3V6StaPhcsu/FTPXDhADX32IsurUmWK+gcXaav6l4xtMA+PHwznMOELnxzbW/m65bdmAW3+0Z6VyGzgS1WA3tiTGdHk4+VnDhguqdMoptNQxj9pCNaWV7pnsPsseQA6GHUqkfexTWhmoTtyOieT8XKrmYp9gzQbSkVVI1OT6Cu1STLclTarvM5iby9QNyB4lLGVcheJtFsJIpmgJZ39xDphAO7A== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4425.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(376002)(396003)(39860400002)(136003)(366004)(346002)(7696005)(5660300002)(478600001)(4326008)(76116006)(316002)(55016002)(9686003)(110136005)(66946007)(54906003)(186003)(66476007)(66556008)(64756008)(2906002)(66446008)(33656002)(83380400001)(86362001)(26005)(53546011)(6506007)(8936002)(8676002)(107886003)(52536014)(71200400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: p7FbF6706M7+0zWF0DN4SeYVsWwUNcDhgid1+n6zxQISaJWkbl4ShwX4EiKZmVRzid8ZhKn0wSptwaZj//l4DxGf7NDSWzyJQjgsPtUkmC5P5bpwwhqiqMhLBkUoW4pD8ZTb5exT7/kbh+N2ZKNTzRQireC6kX5rKzR6mn9juUPxTelRUSvDbC7DfFgK2DCE6BRQG0Hnj7lZEelGwdV93s12s9bs7qT77c9Mev3gTFSIaJZMXSBA3RMCw0Z08/dWJvR0E17X0YPkHXCilTiQnEcNHvl+6n9dmmWYCGMaaJF5zw4em+XvUL6s/uruVpDv//k6sNzf39WLDJhQ5niCrK3cdOWEFBKB9f51oifnf1G05QC+XS8bZG/iCqaaKCjzbevBYkw+1q+zu5tzvDmZffUQWgoMITiT7qUotkOopl2dDssSxjRdyKnT1gUIVUkPPHCvNEt0IK/xjGuSOCjOLszYlqfzrEoqXzUmSwJE4LL09qFhAfApqGtf7gYLZWlM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 4f872b20-7c0e-4541-150a-08d81714b738 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jun 2020 01:28:21.1876 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: DkSHx6br/ObUXxQJGTmByEccUHBY/ON9cGNEIuYbCQGbG5D7FWCFeoBGFCh1Y4UO791bc8EFQ1euV+wnQ3b2OQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3212 Return-Path: zhichao.gao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Zhichao Gao Thanks, Zhichao > -----Original Message----- > From: Tomas Pilar > Sent: Monday, June 15, 2020 10:04 PM > To: devel@edk2.groups.io > Cc: nd@arm.com; Ni, Ray ; Gao, Zhichao > > Subject: [PATCH v3 7/7] ShellPkg/AcpiView: Add application wrapper >=20 > Simple application wrapper that invokes the shell command wrapper for > 'acpiview'. >=20 > This allows the AcpiView functionality to be used on platforms with older > specifications of the UEFI shell or where the 'acpiview' command is not b= uilt in > due to platform build configuration. >=20 > Furthermore, this app can be integrated into more comprehensive testing > frameworks as a single component of a more thorough specification complia= nce > validation strategy. >=20 > Cc: Ray Ni > Cc: Zhichao Gao > Signed-off-by: Tomas Pilar > --- > .../Application/AcpiViewApp/AcpiViewApp.c | 40 ++++++ > .../Application/AcpiViewApp/AcpiViewApp.inf | 34 +++++ > .../Application/AcpiViewApp/AcpiViewApp.uni | 122 ++++++++++++++++++ > ShellPkg/ShellPkg.dsc | 1 + > 4 files changed, 197 insertions(+) > create mode 100644 ShellPkg/Application/AcpiViewApp/AcpiViewApp.c > create mode 100644 ShellPkg/Application/AcpiViewApp/AcpiViewApp.inf > create mode 100644 ShellPkg/Application/AcpiViewApp/AcpiViewApp.uni >=20 > diff --git a/ShellPkg/Application/AcpiViewApp/AcpiViewApp.c > b/ShellPkg/Application/AcpiViewApp/AcpiViewApp.c > new file mode 100644 > index 000000000000..2f650c9d92d2 > --- /dev/null > +++ b/ShellPkg/Application/AcpiViewApp/AcpiViewApp.c > @@ -0,0 +1,40 @@ > +/** @file > + Main file for AcpiViewApp application > + > + Copyright (c) 2020, ARM Limited. All rights reserved.
> + SPDX-License-Identifier: BSD-2-Clause-Patent **/ > + > +#include > +#include > +#include > +#include > +#include > + > +#include > + > +// > +// String token ID of help message text. > +// Shell supports to find help message in the resource section of an > +application 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 i= n // Shell. > +// > +GLOBAL_REMOVE_IF_UNREFERENCED EFI_STRING_ID mStringHelpTokenId =3D > +STRING_TOKEN (STR_GET_HELP_ACPIVIEW); > + > +/** > + Application Entry Point wrapper around the shell command > + > + @param[in] ImageHandle Handle to the Image (NULL if internal). > + @param[in] SystemTable Pointer to the System Table (NULL if internal)= . > +**/ > +EFI_STATUS > +EFIAPI > +AcpiViewAppMain ( > + IN EFI_HANDLE ImageHandle, > + IN EFI_SYSTEM_TABLE *SystemTable > + ) > +{ > + return ShellCommandRunAcpiView (gImageHandle, SystemTable); } > diff --git a/ShellPkg/Application/AcpiViewApp/AcpiViewApp.inf > b/ShellPkg/Application/AcpiViewApp/AcpiViewApp.inf > new file mode 100644 > index 000000000000..2ed1d185339d > --- /dev/null > +++ b/ShellPkg/Application/AcpiViewApp/AcpiViewApp.inf > @@ -0,0 +1,34 @@ > +## @file > +# EFI application that displays and verifies ACPI tables # # > +Copyright (c) 2020, ARM Limited. All rights reserved.
# # > +SPDX-License-Identifier: BSD-2-Clause-Patent # # ## > + > +[Defines] > + INF_VERSION =3D 0x0001001B > + BASE_NAME =3D AcpiViewApp > + FILE_GUID =3D 46361B5B-AF17-41FF-95F9-E1BCE08435B= 9 > + MODULE_TYPE =3D UEFI_APPLICATION > + VERSION_STRING =3D 1.0 > + ENTRY_POINT =3D AcpiViewAppMain > + UEFI_HII_RESOURCE_SECTION =3D TRUE > + > +[Sources.common] > + AcpiViewApp.c > + AcpiViewApp.uni > + > +[Packages] > + MdeModulePkg/MdeModulePkg.dec > + MdePkg/MdePkg.dec > + ShellPkg/ShellPkg.dec > + > +[LibraryClasses] > + UefiBootServicesTableLib > + UefiLib > + BaseLib > + UefiApplicationEntryPoint > + AcpiViewCommandLib > diff --git a/ShellPkg/Application/AcpiViewApp/AcpiViewApp.uni > b/ShellPkg/Application/AcpiViewApp/AcpiViewApp.uni > new file mode 100644 > index 000000000000..c56f21084356 > --- /dev/null > +++ b/ShellPkg/Application/AcpiViewApp/AcpiViewApp.uni > @@ -0,0 +1,122 @@ > +// @file > +// > +// Standalone EFI application that displays and verifies ACPI tables // > +// Copyright (c) 2020, ARM Limited. All rights reserved.
// > +SPDX-License-Identifier: BSD-2-Clause-Patent // > + > +/=3D# > + > +#langdef en-US "english" > + > +#string STR_GET_HELP_ACPIVIEW #language en-US "" > +".TH acpiview 0 "Display ACPI information."\r\n" > +".SH NAME\r\n" > +"Display ACPI Table information.\r\n" > +".SH SYNOPSIS\r\n" > +" \r\n" > +"ACPIVIEWAPP.EFI [[-?] | [[[[-l] | [-s AcpiTable [-d]]] [-q] [-h]] [-r S= pec]]]\r\n" > +" \r\n" > +".SH OPTIONS\r\n" > +" \r\n" > +" -l - Display list of installed ACPI Tables.\r\n" > +" -s - Display only the specified AcpiTable type and only support 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" > +" -r - Validate that all required ACPI tables are installed\r\n" > +" Spec : Specification to validate against.\r\n" > +" For Arm, the possible values are:\r\n" > +" 0 - Server Base Boot Requirements v1.0\r\n" > +" 1 - Server Base Boot Requirements v1.1\r\n" > +" 2 - Server Base Boot Requirements v1.2\r\n" > +" -? - Show help.\r\n" > +" \r\n" > +".SH DESCRIPTION\r\n" > +" \r\n" > +" This program is provided to allow examination of ACPI table values fr= om > the\r\n" > +" UEFI Shell. This can help with investigations, especially at that st= age\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 displa= yed\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 investi= gation\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 > Table\r\n" > +" PPTT - Processor Properties Topology Table\r\n" > +" RSDP - Root System Description Pointer\r\n" > +" SLIT - System Locality Information Table\r\n" > +" SPCR - Serial Port Console Redirection Table\r\n" > +" SRAT - System Resource Affinity Table\r\n" > +" SSDT - Secondary SystemDescription Table\r\n" > +" XSDT - Extended System Description Table\r\n" > +" \r\n" > +".SH STANDARDS\r\n" > +" \r\n" > +" Table details correspond to those in 'Advanced Configuration and 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.3\r\n" > +" will be 'backwards compatible' with prior version of the specif= ication\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 rep= orted\r\n" > +" with new names, where they have been added in later versions of= the\r\n" > +" specification.\r\n" > +" \r\n" > +".SH EXAMPLES\r\n" > +" \r\n" > +" \r\n" > +"EXAMPLES:\r\n" > +" * To display a list of the installed table types:\r\n" > +" fs0:\> acpiviewapp.efi -l\r\n" > +" \r\n" > +" * To parse and display a specific table type:\r\n" > +" fs0:\> acpiviewapp.efi -s GTDT\r\n" > +" \r\n" > +" * To save a binary dump of the contents of a table to a file\r\n" > +" in the current working directory:\r\n" > +" fs0:\> acpiviewapp.efi -s DSDT -d\r\n" > +" \r\n" > +" * To display contents of all ACPI tables:\r\n" > +" fs0:\> acpiviewapp.efi\r\n" > +" \r\n" > +" * To check if all Server Base Boot Requirements (SBBR) v1.2 mandatory= \r\n" > +" ACPI tables are installed (Arm only):\r\n" > +" fs0:\> acpiviewapp.efi -r 2\r\n" > +" \r\n" > +".SH RETURNVALUES\r\n" > +" \r\n" > +"RETURN VALUES:\r\n" > +" SHELL_SUCCESS Data was displayed as requested.\r\n" > +" SHELL_INVALID_PARAMETER ACPI Table parsing failed.\r\n" > +" \r\n" > diff --git a/ShellPkg/ShellPkg.dsc b/ShellPkg/ShellPkg.dsc index > 5d2d96ab071c..86e9f1e0040d 100644 > --- a/ShellPkg/ShellPkg.dsc > +++ b/ShellPkg/ShellPkg.dsc > @@ -144,6 +144,7 @@ [Components] > gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE > } > ShellPkg/DynamicCommand/DpDynamicCommand/DpApp.inf > + ShellPkg/Application/AcpiViewApp/AcpiViewApp.inf >=20 > [BuildOptions] > *_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECATED_INTERFACES > -- > 2.24.1.windows.2 >=20