From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web12.9366.1592875436274946727 for ; Mon, 22 Jun 2020 18:23:56 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=aJAShDrB; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: zhichao.gao@intel.com) IronPort-SDR: zUUJTGKNWu9Ks9bBEhHeGzCyiLAQPGdBwNThFgfvhPuRqk65oeKsuTebq4ityqtHHFS/ZG9ERY HixCUD+CIlKw== X-IronPort-AV: E=McAfee;i="6000,8403,9660"; a="205420772" X-IronPort-AV: E=Sophos;i="5.75,268,1589266800"; d="scan'208";a="205420772" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2020 18:23:54 -0700 IronPort-SDR: KlVgungrfd/fBckNFd6cdRBuj5CqG+uBcE27wCeDN3jMEzVmU4tudtPr8n9/iN/OxM7t32P6fA x5f/qwzkQfvg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,268,1589266800"; d="scan'208";a="422838342" Received: from orsmsx109.amr.corp.intel.com ([10.22.240.7]) by orsmga004.jf.intel.com with ESMTP; 22 Jun 2020 18:23:53 -0700 Received: from orsmsx153.amr.corp.intel.com (10.22.226.247) by ORSMSX109.amr.corp.intel.com (10.22.240.7) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 22 Jun 2020 18:23:53 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by ORSMSX153.amr.corp.intel.com (10.22.226.247) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 22 Jun 2020 18:23:53 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.174) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 22 Jun 2020 18:23:53 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZV8+QS9CRMny7d0CNkX61nI5DfL32dFwbApb8q3Lz+WZSgt1MARibx8Y2BQb7NUle51BEuCoNUazt3u2/N5ONBGRGYEiyOsuRC451PpPY51/YDeLpMuj4C0ZqwB/qRVbd+e5p/lWg4itsyqyyGUOmozglbRKXiE9FoP1Lzmg8Bet5yBnMiA4o5OI8fgBUDnpF1rmmDLcN2z6GYD3gtChNfc8ZWRZVq03Ee778QqKApicuzDmNEViZWBexOgmK5z7Um5cBlPMlg06+qDhF3zSg9n+Y42vVZyRjTwdBm4SHACNx8G010BUI3eACoCsZClGEbJFtrAPpvGF2J5cCpPlow== 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=Bah3mFisRPMeSsIERNZn35VlotJeJ5XU5WOVReyDg7o=; b=Pv9EsEb5/UN96htIh2YjoLc41xk3yUqdscx09LYsJ6mIdmb3Zy0G0cnR6cGE+l3HLvRBJQ+D3GdVLwWnO+42y+LRXyOHJBnVgWY8SBee7fOeulhD5t+YLBBBNE55xA7FBz1g0Tv496E3dJe07cAcZcIEoHZacTMPaLj+WCIl3UEePKzwgO8iv5yDO3AzFynajqgWgKvUXBvKDAWY3cK3U5KvNE+P2eDLVEpD5OLiTr/Sd47dIYv1JTgAT+SBjGClks0vhCBd26op2Tbfl9nClwQ39wAWeWomEEMn0Ii2QBFSAIirGD4SnSwUnTP1DMRuJyRFPEX5ha4JjiGfskQ0sA== 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=Bah3mFisRPMeSsIERNZn35VlotJeJ5XU5WOVReyDg7o=; b=aJAShDrB1q8+C71iTaNYNlR7uUO5kcIODzpkKAmRmE2AwyvgINefNfn/U6eY/2qDVwssQUhnLf9ad73WJm8Ip+Z4g7yIK4P7QWuBpm4zoJj8ojXLoonuEV7vYbMlFxMcfBs2qcZBPKk0bHSCMxC4318j6TnBS0csNWhXhB4SFzE= Received: from DM6PR11MB4425.namprd11.prod.outlook.com (2603:10b6:5:1d9::31) by DM5PR11MB1594.namprd11.prod.outlook.com (2603:10b6:4:5::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Tue, 23 Jun 2020 01:23:51 +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:23:51 +0000 From: "Gao, Zhichao" To: Tomas Pilar , "devel@edk2.groups.io" CC: "nd@arm.com" , "Ni, Ray" Subject: Re: [PATCH v3 2/7] ShellPkg/AcpiView: Refactor configuration Thread-Topic: [PATCH v3 2/7] ShellPkg/AcpiView: Refactor configuration Thread-Index: AQHWQx33ugAp173cxk+qVLdDUU8HFKjlcVJQ Date: Tue, 23 Jun 2020 01:23:51 +0000 Message-ID: References: <20200615140351.1725-1-Tomas.Pilar@arm.com> <20200615140351.1725-3-Tomas.Pilar@arm.com> In-Reply-To: <20200615140351.1725-3-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: 653d83cb-fa5b-45ed-cee8-08d81714164b x-ms-traffictypediagnostic: DM5PR11MB1594: 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:7691; x-forefront-prvs: 04433051BF x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1oMtI1yv2OajdxTTgjZ/1vI4amIBBdaJcs1jOhqFcciONsOWfjS6OWGFSrNENevJkDifNmcfClNU4fCxMART9brOSnRGrbtC2RivoBkT5k3SsWsHdd/pel4fUdA8Uw+9gdx0cXP5SkL1r6mc8UDIutaTJ5NuXJwlpTbH0sM6U2DqZHWJo39lZ74V3iqBRMqVs0QShgl5JPDix+PPz0DZQWxUu9LfIufPD68xYrnSRzXBSEZD285jk8wTAS+wF052HPx6ZJAtYroi1jQZY4KY0fWhPy5CroNGUF5Ljo/SwmJnFfwVYmYW8wojK3ko52CxAuejGSq5aJLAl8TWDkDwig== 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)(396003)(136003)(376002)(39860400002)(346002)(366004)(52536014)(53546011)(6506007)(186003)(83380400001)(86362001)(5660300002)(26005)(76116006)(66946007)(110136005)(478600001)(2906002)(66476007)(66556008)(64756008)(66446008)(33656002)(7696005)(55016002)(4326008)(71200400001)(316002)(8936002)(9686003)(8676002)(54906003)(107886003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: EstsqsdrY09t+RYGR01f7CFEO0lMcVXwOAgo46+sCfNieT8A4kwJ93JbJwjdURt22MzeKzd0hRVLuGQSb/83juLeGHbMl1kFiEY0dV3OkHiRsuGBP2qLk37B/ohy4sY5UbUqSKUwDR65AVPKKlJ0E9nCd7RaEXCgABsJb/uRv9qoWlBCSsUcIDU4NkHy+aqozH24XeAwhtcvHsiSNFqKysdJkfIWQRBiJX86iqJtG2ObbGUNX6bgKGq6ouYPOqlne18FoaReQKxlkyJeabP8fv0d+NnPl47DR2aLQO958e9NYG1pJoUsX0udhQ90z/cFdnqIXPd67sAVfps9/6Tpz9VYW2o8ghLbWL5hIR7+kM//0QcMn86bLikfZ1HXRc4USA7cxzusi8j7icqE1ay5Cil4hUiy0s6wrO31v2zN+R+BdkpVRSBgXAZNqYgc+CI0eTrIGRRLrTLXH38xp86WvSGWCDhwIghZ5Zlop4chekWPZTfrfOVqtvZdI2VbkfqV MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 653d83cb-fa5b-45ed-cee8-08d81714164b X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jun 2020 01:23:51.1068 (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: KKkfEKBgoQFjdmnWGB1D9EdeM7Z4ZwcEur/DGnwn8IqwUU3WvTvShPOVGZYnQINgDgq+YdqvIpbd+DgiwXAjJQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB1594 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 See below. > -----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 2/7] ShellPkg/AcpiView: Refactor configuration >=20 > A new file and header (AcpiViewConfig.[ch]) is created that houses the us= er > configuration. This declutters the core code and improves modularity of t= he > design. >=20 > The module level symbols for verbosity, table selection, and highlighting= are > refactored into the new file. >=20 > Cc: Ray Ni > Cc: Zhichao Gao > Signed-off-by: Tomas Pilar > --- > .../UefiShellAcpiViewCommandLib/AcpiParser.c | 1 + > .../AcpiTableParser.c | 1 + > .../UefiShellAcpiViewCommandLib/AcpiView.c | 237 +++-------------- > .../UefiShellAcpiViewCommandLib/AcpiView.h | 95 ------- > .../AcpiViewConfig.c | 246 ++++++++++++++++++ > .../AcpiViewConfig.h | 177 +++++++++++++ > .../Parsers/Gtdt/GtdtParser.c | 1 + > .../Parsers/Iort/IortParser.c | 1 + > .../Parsers/Madt/MadtParser.c | 1 + > .../Parsers/Pptt/PpttParser.c | 1 + > .../Parsers/Srat/SratParser.c | 1 + > .../UefiShellAcpiViewCommandLib.inf | 32 +-- > 12 files changed, 479 insertions(+), 315 deletions(-) create mode 10064= 4 > ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiViewConfig.c > create mode 100644 > ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiViewConfig.h >=20 > diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c > b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c > index 3f12a33050a4..02f6d771c7e1 100644 > --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c > +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c > @@ -10,6 +10,7 @@ > #include > #include "AcpiParser.h" > #include "AcpiView.h" > +#include "AcpiViewConfig.h" >=20 > STATIC UINT32 gIndent; > STATIC UINT32 mTableErrorCount; > diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser= .c > b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c > index d5b9eee52323..4b618f131eac 100644 > --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c > +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c > @@ -17,6 +17,7 @@ > #include "AcpiParser.h" > #include "AcpiTableParser.h" > #include "AcpiView.h" > +#include "AcpiViewConfig.h" >=20 > #if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) #include > "Arm/SbbrValidator.h" > diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c > b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c > index f1a95b7b8f03..390e378e9a6c 100644 > --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c > +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c > @@ -20,6 +20,7 @@ > #include "AcpiParser.h" > #include "AcpiTableParser.h" > #include "AcpiView.h" > +#include "AcpiViewConfig.h" > #include "UefiShellAcpiViewCommandLib.h" >=20 > #if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) @@ -28,17 +29,8 > @@ >=20 > EFI_HII_HANDLE gShellAcpiViewHiiHandle =3D NULL; >=20 > -// Report variables > -STATIC UINT32 mSelectedAcpiTable; > -STATIC CONST CHAR16* mSelectedAcpiTableName; > -STATIC BOOLEAN mSelectedAcpiTableFound; > -STATIC EREPORT_OPTION mReportType; > STATIC UINT32 mTableCount; > STATIC UINT32 mBinTableCount; > -STATIC BOOLEAN mConsistencyCheck; > -STATIC BOOLEAN mColourHighlighting; > -STATIC BOOLEAN mMandatoryTableValidate; > -STATIC UINTN mMandatoryTableSpec; >=20 > /** > An array of acpiview command line parameters. > @@ -53,142 +45,6 @@ STATIC CONST SHELL_PARAM_ITEM ParamList[] =3D { > {NULL, TypeMax} > }; >=20 > -/** > - This function returns the colour highlighting status. > - > - @retval TRUE if colour highlighting is enabled. > -**/ > -BOOLEAN > -GetColourHighlighting ( > - VOID > - ) > -{ > - return mColourHighlighting; > -} > - > -/** > - This function sets the colour highlighting status. > - > - @param Highlight The Highlight status. > - > -**/ > -VOID > -SetColourHighlighting ( > - BOOLEAN Highlight > - ) > -{ > - mColourHighlighting =3D Highlight; > -} > - > -/** > - This function returns the consistency checking status. > - > - @retval TRUE if consistency checking is enabled. > -**/ > -BOOLEAN > -GetConsistencyChecking ( > - VOID > - ) > -{ > - return mConsistencyCheck; > -} > - > -/** > - This function sets the consistency checking status. > - > - @param ConsistencyChecking The consistency checking status. > - > -**/ > -VOID > -SetConsistencyChecking ( > - BOOLEAN ConsistencyChecking > - ) > -{ > - mConsistencyCheck =3D ConsistencyChecking; -} > - > -/** > - This function returns the ACPI table requirements validation flag. > - > - @retval TRUE if check for mandatory table presence should be performed= . > -**/ > -BOOLEAN > -GetMandatoryTableValidate ( > - VOID > - ) > -{ > - return mMandatoryTableValidate; > -} > - > -/** > - This function sets the ACPI table requirements validation flag. > - > - @param Validate Enable/Disable ACPI table requirements validation. > -**/ > -VOID > -SetMandatoryTableValidate ( > - BOOLEAN Validate > - ) > -{ > - mMandatoryTableValidate =3D Validate; > -} > - > -/** > - This function returns the identifier of specification to validate ACPI= table > - requirements against. > - > - @return ID of specification listing mandatory tables. > -**/ > -UINTN > -GetMandatoryTableSpec ( > - VOID > - ) > -{ > - return mMandatoryTableSpec; > -} > - > -/** > - This function sets the identifier of specification to validate ACPI ta= ble > - requirements against. > - > - @param Spec ID of specification listing mandatory tables. > -**/ > -VOID > -SetMandatoryTableSpec ( > - UINTN Spec > - ) > -{ > - mMandatoryTableSpec =3D Spec; > -} > - > -/** > - This function returns the report options. > - > - @retval Returns the report option. > -**/ > -STATIC > -EREPORT_OPTION > -GetReportOption ( > - VOID > - ) > -{ > - return mReportType; > -} > - > -/** > - This function returns the selected ACPI table. > - > - @retval Returns signature of the selected ACPI table. > -**/ > -STATIC > -UINT32 > -GetSelectedAcpiTable ( > - VOID > - ) > -{ > - return mSelectedAcpiTable; > -} > - > /** > This function dumps the ACPI table to a file. >=20 > @@ -205,19 +61,21 @@ DumpAcpiTableToFile ( > IN CONST UINTN Length > ) > { > - EFI_STATUS Status; > - CHAR16 FileNameBuffer[MAX_FILE_NAME_LEN]; > - SHELL_FILE_HANDLE DumpFileHandle; > - UINTN TransferBytes; > + EFI_STATUS Status; > + CHAR16 FileNameBuffer[MAX_FILE_NAME_LEN]; > + SHELL_FILE_HANDLE DumpFileHandle; > + UINTN TransferBytes; > + SELECTED_ACPI_TABLE *SelectedTable; >=20 > DumpFileHandle =3D NULL; > TransferBytes =3D Length; > + GetSelectedAcpiTable (&SelectedTable); >=20 > UnicodeSPrint ( > FileNameBuffer, > sizeof (FileNameBuffer), > L".\\%s%04d.bin", > - mSelectedAcpiTableName, > + SelectedTable->Name, > mBinTableCount++ > ); >=20 > @@ -273,10 +131,11 @@ ProcessTableReportOptions ( > IN CONST UINT32 Length > ) > { > - UINTN OriginalAttribute; > - UINT8* SignaturePtr; > - BOOLEAN Log; > - BOOLEAN HighLight; > + UINTN OriginalAttribute; > + UINT8 *SignaturePtr; > + BOOLEAN Log; > + BOOLEAN HighLight; > + SELECTED_ACPI_TABLE *SelectedTable; Make the *SignaturePtr & *SelectedTable align with other variable. Except t= his, Reviewed-by: Zhichao Gao Thanks, Zhichao