From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 64408AC1623 for ; Tue, 12 Dec 2023 13:24:24 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=4fEqjCmqra41+gq1bnOoRjJ9wPsxkLSJAW9QTx+COsY=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1702387463; v=1; b=N1Y8idiiIk+XBPJl7Ht3DkjU/c75PrGilfex/iUX/JgvQShHYjPwx+rfGOJE3+dfph5xDlUi 6gEDoRnOqZVdVWGUUKzvqnuPXHGWDTkwWQ/miebP0LbZSpoH0/nvFJ7cMqnQSGsr8OFMwlJC5Vw otxhj1f8t3J6zIzbctdcYi5o= X-Received: by 127.0.0.2 with SMTP id ERgmYY7687511xvWPkFYrRjH; Tue, 12 Dec 2023 05:24:23 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web10.12721.1702372337736971855 for ; Tue, 12 Dec 2023 01:12:17 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="398621954" X-IronPort-AV: E=Sophos;i="6.04,269,1695711600"; d="scan'208";a="398621954" X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2023 01:12:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="749638052" X-IronPort-AV: E=Sophos;i="6.04,269,1695711600"; d="scan'208";a="749638052" X-Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga006.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 12 Dec 2023 01:12:16 -0800 X-Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 12 Dec 2023 01:12:16 -0800 X-Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 12 Dec 2023 01:12:16 -0800 X-Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Tue, 12 Dec 2023 01:12:16 -0800 X-Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.168) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 12 Dec 2023 01:12:12 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ul+iV9YB0B8EQil29vwBxfrnKEOZZA79G0OZCLf5hLpPEFGp3NBIZUKF2vbWHckCFvesLxxHJUoEj1KPUs+SFTkgCDrrsKangLBzq7H5vbC3MpSv5sNbI4glCehNWPauGsu96Zd6JHIhT47mo+jLdirpKEh/mhRIMlV0MZ/eMUq5nM1zXnqntRQYxVHkVP+40vZ1cIbIPyOs6tlNrmFPHgVIhonR/EDtFRiHNoE1XWwKfzvWnOj4MLUz2ms3Nqt8zJfflMVr7ieDapj8qMZfZhrCc/H94q2V+bBHclxXnGnGuJ8VTVJLsY79B20bB9Msv+jcR6BLI3YJTLCPPeXyCw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xMolDEhvZdnemgE0RZeqL7zF6xoXs2+m7aBy0sddSKU=; b=GbyE5g17twQo5s+xcFzUhcuq8lfSaEUF3xQWffSIVmiDcDpQyXFTSlH4fZweT0VRxtgilhwAbqDOdeujKmqfGibljKa9JADIwqRlhcbthwn4mUumoK2L0MlNDkLJzNem+BVaFriZrmiJNVYCO9y0ZNRNWazzHVuKpsmitqXCZc/Xxrm9ANlVxsPclLPRAvHRGQ+4FytnkNA4cpqi87t2YrEKhjBPINNqcPMHwpAqnqiA5e9veKPG+ELDLmcax0hxJfNDNfY5BxMrMrnETUktQCV5jCW4Ssgo6RNna3j4DHbEIsZYCnYkx56p5M9g390UK4GknlDntT7xoTLEXTou8g== 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 X-Received: from DS7PR11MB7885.namprd11.prod.outlook.com (2603:10b6:8:d8::12) by SJ0PR11MB5152.namprd11.prod.outlook.com (2603:10b6:a03:2ae::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32; Tue, 12 Dec 2023 09:12:05 +0000 X-Received: from DS7PR11MB7885.namprd11.prod.outlook.com ([fe80::4025:835e:24bc:2aa9]) by DS7PR11MB7885.namprd11.prod.outlook.com ([fe80::4025:835e:24bc:2aa9%6]) with mapi id 15.20.7068.033; Tue, 12 Dec 2023 09:12:05 +0000 From: "Yuting Yang" To: "Zhang, Zifeng" , "Chen, Arthur G" , "devel@edk2.groups.io" CC: Rebecca Cran , "Gao, Liming" , "Feng, Bob C" Subject: Re: [edk2-devel] [Patch V2] BaseTools: VfrCompiler Adds DefaultValueError Feature Thread-Topic: [Patch V2] BaseTools: VfrCompiler Adds DefaultValueError Feature Thread-Index: AQHaLNnMGjYrtcdNyUa0aNkUkL/J9rClWmeggAABsnA= Date: Tue, 12 Dec 2023 09:12:05 +0000 Message-ID: References: <20231212090119.1150-1-yuting2.yang@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DS7PR11MB7885:EE_|SJ0PR11MB5152:EE_ x-ms-office365-filtering-correlation-id: c901d4e2-ab72-496f-b914-08dbfaf2690a x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: dDR/dAeOOOyHddhPkWqnpfZmarAyptpQpvoUxcu7BweZfmI6Jkh9qRDxT0yLEQOG3gRb/rKndSjdqGrJUZpiKYz8WRlyNt/ICAmXJUkaXDLFzDZQ85wKfPgrnRQgwzDRgsV7bO9tm2g9Usf9Vel9wCTWvKCvX9O2Fr8An0otZtk19onBuEf26yMCRWF9Q2kst4kXyZGBbh2uuhkkN8Kvf1EJ0U2QA2fZ73Nwr/8Ved8rQqdS92JCFJf3wmsLdYNeDA97XEOjJG16QcxEA5LUlVRkoqVbsTbu7WJIVpFqyzbsvfTuQgzzfzJf04TJjI2cY0TtFuuLHEfhbyj4IuV8diec0/FM2LCFRusJp4yAR97MUwwbIPs50sh0gsgc/k9TONyumg9lK06k5xEEZWEtqf9zlHCBXn2aXoL11AuibGzb5iaHC+8okEO0Wpkpn7duduca86BMy/z79l70pAANVCVG6Js9H+sarG4T4eTf+BaE+VT8ivm+yhcvIVFcpLWv0RRoqLvvf9Lgp4O7l5w2Y5SqJQW1BFEmx+8E6ihvv+wD6BeUP2u9dwvPDLHIDLEJNN2zzQbz5tmSPCEBEKQfuPEn84mnXkmKtNDRnJqAGLS8+y6FOaNtGHSyEHT+XLhwYhvYJeG53xXrkO5qYkMojMCUkRMx0aQW4Via9Z5+3Uw= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?8mJAktaC/DnnYCtuArc3CFDGBi17tDn0Wg55aJfjApcUPb0Hoi/S56/JVyGk?= =?us-ascii?Q?N4KMLTei3jyf3Ht7cgkSC3HVlRIEC3yoU+pyq0LG2XjDWfGYDXOVA3h1pwWT?= =?us-ascii?Q?YMRjDJulWxDG7/RzzoRZ+wLA307SXtj1/oRD5z1BD93CQ+yHbUKPhNjeemHt?= =?us-ascii?Q?lQPfIh/zSqEds9AV83HmCjBsT9Y5vSIdE7DahwlQOKFo1e3fr9ehnmO3QWYq?= =?us-ascii?Q?+mnTxto14UlX43S5MAXsy2SNTacJ4sf6/3dXaBNdqGgrJ1+dxv6vxO2Bocst?= =?us-ascii?Q?UGLQqN3xsJupx+EuPAWmfv6DEFnOaEqrqd51TLSUDnVNt/uurMR9SP2YzN3F?= =?us-ascii?Q?NM1kz4uT9BfckYG7lJyXQiFF4u7wQJkkD3vGYN3Oys9V+JYfV4V++YYb+RD6?= =?us-ascii?Q?xGFa81NSHYvg/LXPXoyU3nAeYnsKakx/ecOtMn5u7R4GL26onzPJ+nPvpEeg?= =?us-ascii?Q?sTDTml65q+frFyMr1h6kY2uxUVoy8SiFneEaJb2y5odgNVD+jHw7F9rMgsMq?= =?us-ascii?Q?6eOtbAABqjbQhO1in/zq/2ww8AvG1QQsdAYhgLd7dqPXkUynndcU2Qr8Id6l?= =?us-ascii?Q?DjL+SOm3zY2VgRFjMkC1f0YzuOO/nWLneWE9mclC15kNrkaOqWCaYatArlSO?= =?us-ascii?Q?7g5lYEbdu9Ve5bokAwdhJGpInxXbup/Bhqijzlcw8qMf00LPqdBb/0ZUmiM+?= =?us-ascii?Q?iUdN7VleasxvFST9psQxtROM1mk7cBtY5q0y8cEcG1z53jeooGH6uBZAz+JZ?= =?us-ascii?Q?+73Rf56r8VrfOdstTv7/LBQDpKwR+8o7HSmJOM6K95XO4JdwsrvIslHyUKyo?= =?us-ascii?Q?6a+5s6haR5R9/RmpXj9BbGb3fVBTUdmSfw6s6fiDzycyoF2IdvUIX7mGq2Ym?= =?us-ascii?Q?d4DljrkoQaqo5up9y8+RF9xdRKH+DyvE33trTU7jcO2kt9bc1MwSg4hqWUFk?= =?us-ascii?Q?JMotirZWvQS11CsLwmgvz8nxrhMkF9CDbVeQxFStNYponOkuXKQOcAtuptWn?= =?us-ascii?Q?bD7wzWV/zOFvp3uAMMEi1lwvYQZKlhJBpNcB6WkaLzHg7lKviV5Nhxn4Efz1?= =?us-ascii?Q?Aj1SzAOPKDpg41CMr2lUKC2mis6sT9UOSufGdJ2KMEbwK5Pee/B07C5wByLX?= =?us-ascii?Q?ynn5m0j3CdgVOmyV/hEf/7X4rX5tAMxN5wQ0a7OeSbv5mzOkk2jIudx0Rl2W?= =?us-ascii?Q?Sevs1ylWsCzw9VU85+NjR3qQYD5ITMVOZN69AXgqDmHhqGILmGmlcCRKk9r1?= =?us-ascii?Q?xu8mx8t9vHKLBvhvMWYiDwiHCqhr5H3Yh/zes1DDF7KlCRp8LyZ9xJY0+TWW?= =?us-ascii?Q?TdgNnsS3ov0xFLA9F5FUmN4PPGRY1fP8wnAChp8vpv0J5t2Xkuym2mgpwjDB?= =?us-ascii?Q?W4De6djdmCi1RNNFmhThTDH7U4sp00U2rH4lFNSWH23sZ+3OdLchletQqev3?= =?us-ascii?Q?wzP/KlJsCmtv985dFl473OzgFouFkPFaUBPb7gbQ7PP4GoYv4uJOkhoba2/z?= =?us-ascii?Q?bnXe9U/pZuCRC2mavvIb/Cxju3TqXb3iZ9YTGIOuh286EJJAOjEztQj62Hw9?= =?us-ascii?Q?Mf0aFdaTj4VS78EHF+gBR2bc54KG+Cb2gOiv0ktg?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DS7PR11MB7885.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c901d4e2-ab72-496f-b914-08dbfaf2690a X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Dec 2023 09:12:05.4283 (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: gMbLvNCPs+xRZ1C//b6qzV7vxMIMnrT+nKTR+RNcZ4IFfYkrgY/BhJKYcggUOsINTUIxMCDqM9JbBWAGIpzQHw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB5152 X-OriginatorOrg: intel.com Precedence: Bulk List-Subscribe: List-Help: 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,yuting2.yang@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: NKvaTmHl3g4CtT8B4mTN0WWbx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=N1Y8idii; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io +Cc Zhang, Zifeng, Chen, Arthur G -----Original Message----- From: Chen, Christine =20 Sent: Tuesday, December 12, 2023 5:04 PM To: Yang, Yuting2 ; devel@edk2.groups.io Cc: Rebecca Cran ; Gao, Liming ; Feng, Bob C Subject: RE: [Patch V2] BaseTools: VfrCompiler Adds DefaultValueError Featu= re +Cc Yang, Yuting2 > -----Original Message----- > From: Yang, Yuting2 > Sent: Tuesday, December 12, 2023 5:01 PM > To: devel@edk2.groups.io > Cc: Rebecca Cran ; Gao, Liming=20 > ; Feng, Bob C ; Chen,=20 > Christine > Subject: [Patch V2] BaseTools: VfrCompiler Adds DefaultValueError=20 > Feature >=20 > Add --catch_default option > Raise a DefaultValueError when encountering VFR default definitions to=20 > help remove default variables. > Add --except_list option > Exclude packages that don't require enabling the catch_default function. >=20 > Cc: Rebecca Cran > Cc: Liming Gao > Cc: Bob Feng > Cc: Christine Chen > Cc: Yuting Yang >=20 > Signed-off-by: Yuting Yang > --- > BaseTools/Source/C/VfrCompile/VfrCompiler.cpp | 40 ++- > BaseTools/Source/C/VfrCompile/VfrCompiler.h | 3 + > BaseTools/Source/C/VfrCompile/VfrError.cpp | 3 +- > BaseTools/Source/C/VfrCompile/VfrError.h | 3 +- > BaseTools/Source/C/VfrCompile/VfrFormPkg.h | 1 + > BaseTools/Source/C/VfrCompile/VfrSyntax.g | 238 ++++++++++-------- > 6 files changed, 184 insertions(+), 104 deletions(-) >=20 > diff --git a/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp > b/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp > index 5f4d262d85..e97cebff65 100644 > --- a/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp > +++ b/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp > @@ -78,6 +78,9 @@ CVfrCompiler::OptionInitialization ( > mOptions.WarningAsError =3D FALSE; mOptions.AutoDefau= lt > =3D FALSE; mOptions.CheckDefault =3D FALSE;+ > mOptions.IsCatchDefaultEnable =3D FALSE;+ mOptions.ExceptionLis= t > =3D NULL;+ mOptions.ExceptionListSize =3D 0; memset > (&mOptions.OverrideClassGuid, 0, sizeof (EFI_GUID)); if (Argc =3D=3D 1= ) {@@ - > 95,6 +98,23 @@ CVfrCompiler::OptionInitialization ( > Version (); SET_RUN_STATUS (STATUS_DEAD); return;+ = } else if > (stricmp(Argv[Index], "--catch_default") =3D=3D 0){+ > mOptions.IsCatchDefaultEnable =3D TRUE;+ } else if (stricmp(Argv[Index= ], "-- > except_list") =3D=3D 0){+ INT32 Start =3D ++Index;+ if ((Start = >=3D Argc) || > (Argv[Start][0] =3D=3D '-')) {+ DebugError (NULL, 0, 1001, "Missin= g option", "- > exception_list missing except list");+ goto Fail;+ }+ wh= ile > ((Argv[Index][0] !=3D '-') && (Index < Argc - 1)) {+ Index++;+ = }+ INT32 > End =3D Index--;+ mOptions.ExceptionListSize =3D End - Start;+ = for (INT32 i =3D > Start; i < End; i++) {+ mOptions.ExceptionList =3D (CHAR8**) > realloc(mOptions.ExceptionList, (i - Start + 1) * sizeof(CHAR8*));+ > mOptions.ExceptionList[i-Start] =3D Argv[i];+ } } else if (stric= mp(Argv[Index], > "-l") =3D=3D 0) { mOptions.CreateRecordListFile =3D TRUE; > gCIfrRecordInfoDB.TurnOn ();@@ -179,7 +199,11 @@=20 > CVfrCompiler::OptionInitialization ( > goto Fail; } strcpy (mOptions.VfrFileName, Argv[Index]);-+= for (int i =3D > 0; i < mOptions.ExceptionListSize; i++) {+ if (strstr(mOptions.VfrFi= leName, > mOptions.ExceptionList[i]) !=3D NULL) {+ mOptions.IsCatchDefaultEn= able =3D > FALSE;+ }+ } if (mOptions.OutputDirectory =3D=3D NULL) > { mOptions.OutputDirectory =3D (CHAR8 *) malloc (1); if > (mOptions.OutputDirectory =3D=3D NULL) {@@ -217,6 +241,11 @@ Fail: > free (mOptions.VfrFileName); mOptions.VfrFileName = =3D > NULL; }+ if (mOptions.ExceptionList !=3D NULL) {+ > free(mOptions.ExceptionList);+ mOptions.ExceptionList = =3D NULL;++ } > if (mOptions.VfrBaseFileName !=3D NULL) { free (mOptions.VfrBaseFileN= ame); > mOptions.VfrBaseFileName =3D NULL;@@ -496,6 +525,11 @@ > CVfrCompiler::~CVfrCompiler ( > mOptions.VfrBaseFileName =3D NULL; } + if (mOptions.ExceptionList= !=3D > NULL) {+ free (mOptions.ExceptionList);+ mOptions.ExceptionList =3D > NULL;+ }+ if (mOptions.OutputDirectory !=3D NULL) { free > (mOptions.OutputDirectory); mOptions.OutputDirectory =3D NULL;@@ -679= ,7 > +713,7 @@ CVfrCompiler::Compile ( > DebugError (NULL, 0, 0001, "Error opening the input file", "%s", > InFileName); goto Fail; }-+ InputInfo.IsCatchDefaultEnable =3D > mOptions.IsCatchDefaultEnable; if (mOptions.HasOverrideClassGuid) > { InputInfo.OverrideClassGuid =3D &mOptions.OverrideClassGuid; } el= se > {@@ -937,5 +971,3 @@ main ( > return GetUtilityStatus (); }--diff --git=20 > a/BaseTools/Source/C/VfrCompile/VfrCompiler.h > b/BaseTools/Source/C/VfrCompile/VfrCompiler.h > index b6e207d2ce..39e0a89a29 100644 > --- a/BaseTools/Source/C/VfrCompile/VfrCompiler.h > +++ b/BaseTools/Source/C/VfrCompile/VfrCompiler.h > @@ -52,6 +52,9 @@ typedef struct { > BOOLEAN WarningAsError; BOOLEAN AutoDefault; BOOLEAN > CheckDefault;+ BOOLEAN IsCatchDefaultEnable;+ CHAR8** ExceptionList;+ > INT16 ExceptionListSize; } OPTIONS; typedef enum {diff --git > a/BaseTools/Source/C/VfrCompile/VfrError.cpp > b/BaseTools/Source/C/VfrCompile/VfrError.cpp > index 65bb8e34fd..8a706f929b 100644 > --- a/BaseTools/Source/C/VfrCompile/VfrError.cpp > +++ b/BaseTools/Source/C/VfrCompile/VfrError.cpp > @@ -49,7 +49,8 @@ static SVFR_WARNING_HANDLE VFR_WARNING_HANDLE_TABLE=20 > [] =3D { > { VFR_WARNING_DEFAULT_VALUE_REDEFINED, ": default value re-defined > with different value"}, { VFR_WARNING_ACTION_WITH_TEXT_TWO, ": Action > opcode should not have TextTwo part"}, {=20 > VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE, ": Not recommend to use=20 > obsoleted framework opcode"},- { VFR_WARNING_CODEUNDEFINED, ": > undefined Warning Code" }+ { VFR_WARNING_CODEUNDEFINED, ": > undefined Warning Code" },+ { VFR_WARNING_UNSUPPORTED, ": pls remove=20 > the default values if necessary" } }; =20 > CVfrErrorHandle::CVfrErrorHandle (diff -- git=20 > a/BaseTools/Source/C/VfrCompile/VfrError.h > b/BaseTools/Source/C/VfrCompile/VfrError.h > index 7d16bd5f74..1b4bc173d2 100644 > --- a/BaseTools/Source/C/VfrCompile/VfrError.h > +++ b/BaseTools/Source/C/VfrCompile/VfrError.h > @@ -47,7 +47,8 @@ typedef enum { > VFR_WARNING_DEFAULT_VALUE_REDEFINED =3D 0,=20 > VFR_WARNING_ACTION_WITH_TEXT_TWO, > VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,- > VFR_WARNING_CODEUNDEFINED+ VFR_WARNING_CODEUNDEFINED,+=20 > VFR_WARNING_UNSUPPORTED } EFI_VFR_WARNING_CODE; typedef struct=20 > _SVFR_ERROR_HANDLE {diff --git=20 > a/BaseTools/Source/C/VfrCompile/VfrFormPkg.h > b/BaseTools/Source/C/VfrCompile/VfrFormPkg.h > index 9ef6f07787..d8fada3bcb 100644 > --- a/BaseTools/Source/C/VfrCompile/VfrFormPkg.h > +++ b/BaseTools/Source/C/VfrCompile/VfrFormPkg.h > @@ -96,6 +96,7 @@ struct SBufferNode { > typedef struct { EFI_GUID *OverrideClassGuid;+ BOOLEAN > IsCatchDefaultEnable; } INPUT_INFO_TO_SYNTAX; class CFormPkg {diff=20 > --git a/BaseTools/Source/C/VfrCompile/VfrSyntax.g > b/BaseTools/Source/C/VfrCompile/VfrSyntax.g > index 55fd067f8a..5daf1c423c 100644 > --- a/BaseTools/Source/C/VfrCompile/VfrSyntax.g > +++ b/BaseTools/Source/C/VfrCompile/VfrSyntax.g > @@ -50,6 +50,7 @@ VfrParserStart ( > { ParserBlackBox VfrParser(Fil= e); > VfrParser.parser()->SetOverrideClassGuid=20 > (InputInfo->OverrideClassGuid);+ > VfrParser.parser()->SetIsCatchDefaultEnable(InputInfo- > >IsCatchDefaultEnable); return VfrParser.parser()->vfrProgram(); } >>@@= - > 386,8 +387,8 @@ dataStructField32 [BOOLEAN FieldInUnion]: > ; dataStructField16 [BOOLEAN FieldInUnion]:- << - UINT32 ArrayNu= m =3D 0; > + <<+ UINT32 ArrayNum =3D 0; >> ("UINT16" | "CHAR16") > N:StringIdentifier@@ -737,7 +738,7 @@ vfrFormSetList : > ; vfrStatementExtension:- << + << EFI_GUID Guid; CIfrGuid= *GuidObj > =3D NULL; CHAR8 *TypeName =3D NULL;@@ -751,7 +752,7 @@ > vfrStatementExtension: > >> L:GuidOp Uuid "=3D" guidDefinition[Guid]- {"," DataType "=3D" = + {"," > DataType "=3D" ( U64:"UINT64" {OpenBracket AN1:Number CloseBr= acket > <getText(), AN1->getLine());>>} << TypeName = =3D=20 > U64->getText(); LineNum =3D U64->getLine(); >>@@ -770,7 > +771,7 @@ vfrStatementExtension: > | T:"EFI_HII_TIME" {OpenBracket AN8:Number CloseBracket=20 > <getText(), AN8->getLine());>>} > << TypeName =3D T->getText(); LineNum =3D T->getLine(); IsStruct =3D TRUE= ;>> | > R:"EFI_HII_REF" {OpenBracket AN9:Number CloseBracket < _STOU32(AN9->getText(), AN9->getLine());>>}- << TypeName =3D=20 > R->getText(); LineNum =3D R->getLine(); IsStruct =3D TRUE;>> > + << TypeName =3D=20 > + R->getText(); LineNum =3D R- > >getLine(); IsStruct =3D TRUE;>> | TN:StringIdentifier {OpenBracket > AN10:Number CloseBracket <getText(), AN10- > >getLine());>>} << = TypeName =3D TN->getText(); > LineNum =3D TN->getLine(); IsStruct =3D TRUE;>> )@@ -875,19 +876,19 @= @ > vfrExtensionData[UINT8 *DataBuff, UINT32 Size, CHAR8 *TypeName, UINT32=20 > TypeSize, > memcpy (ByteOffset, &Data_U64, TypeSize); = }else if (strcmp > ("UINT32", TypeName) =3D=3D 0) { Data_U32 =3D _STOU32(RD-= >getText(), > RD->getLine());- memcpy (ByteOffset, &Data_U32, TypeSize); > + memcpy (ByteOffset, &Data_U32, TypeSize); = }else if (strcmp > ("UINT16", TypeName) =3D=3D 0) { Data_U16 =3D _STOU16(RD-= >getText(), > RD->getLine());- memcpy (ByteOffset, &Data_U16, TypeSize); > + memcpy (ByteOffset, &Data_U16, TypeSize); = }else if (strcmp > ("UINT8", TypeName) =3D=3D 0) { Data_U8 =3D _STOU8(RD->ge= tText(), RD- > >getLine());- memcpy (ByteOffset, &Data_U8, TypeSize); > + memcpy (ByteOffset, &Data_U8, TypeSize); }= else if (strcmp > ("BOOLEAN", TypeName)=3D=3D 0) { Data_BL =3D _STOU8(RD->g= etText(), > RD->getLine());- memcpy (ByteOffset, &Data_BL, TypeSize); > + memcpy (ByteOffset, &Data_BL, TypeSize); }= else if (strcmp > ("EFI_STRING_ID", TypeName) =3D=3D 0) { Data_SID =3D _STO= SID(RD- > >getText(), RD->getLine());- memcpy (ByteOffset, &Data_SID= , > TypeSize); + = memcpy (ByteOffset, > &Data_SID, TypeSize); } } else > { gCVfrVarDataTypeDB.GetDataFieldInfo(TFName, FieldOffset, > FieldType, FieldSize, BitField);@@ -975,7 +976,15 @@ > vfrExtensionData[UINT8 *DataBuff, UINT32 Size, CHAR8 *TypeName, UINT32=20 > TypeSize, > vfrStatementDefaultStore : << UINT16 DefaultId =3D > EFI_HII_DEFAULT_CLASS_STANDARD; >>- D:DefaultStore N:StringIdentifier > ","+ D:DefaultStore N:StringIdentifier "," <<+ > if (mIsCatchDefaultEnable) {+ > gCVfrErrorHandle.HandleWarning (+ > VFR_WARNING_UNSUPPORTED,+ = D- > >getLine(),+ D- > >getText()+ );+ = }+ > >> Prompt "=3D" "ST= RING_TOKEN" "\(" S:Number > "\)" { "," Attribute "=3D" A:Number << Default= Id =3D _STOU16(A- > >getText(), A->getLine()); >>@@ -1074,7 +1083,7 @@ > vfrStatementVarStoreEfi : > | U64:"UINT64" "," << TypeName =3D U64-= >getText(); > LineNum =3D U64->getLine(); >> | D:"EFI_HII_DATE" "," = << > TypeName =3D D->getText(); LineNum =3D D->getLine(); >> | T:"EFI_HII_= TIME" > "," << TypeName =3D T->getText(); LineNum =3D T-= >getLine(); >>- | > R:"EFI_HII_REF" "," << TypeName =3D R->getText(= ); LineNum =3D R- > >getLine(); >> + | R:"EFI_HII_REF" "," <<= TypeName =3D R- > >getText(); LineNum =3D R->getLine(); >> ) { VarId "=3D" ID:Numbe= r "," > <<@@ -1092,8 +1101,8 @@ vfrStatementVarStoreEfi : > ( Name "=3D" SN:StringIdentifier "," << StoreName = =3D SN- > >getText(); >> |- Name "=3D" "STRING_TOKEN" "\(" VN:Number "\)= " "," - > VarSize "=3D" N:Number "," << + Name "=3D" "= STRING_TOKEN" > "\(" VN:Number "\)" ","+ VarSize "=3D" N:Number "," = << > IsUEFI23EfiVarstore =3D FALSE; = StoreName =3D > gCVfrStringDB.GetVarStoreNameFormStringId(_STOSID(VN->getText(), VN- > >getLine())); if (= StoreName =3D=3D NULL) {@@ - > 1116,7 +1125,7 @@ vfrStatementVarStoreEfi : > break; = case 8: > TypeName =3D (CHAR8 *) "UINT64";- = break; + > break; default: > _PCATCH (VFR_RETURN_UNSUPPORTED, N); > break;@@ -1124,7 +1133,7 @@ vfrStatementVarStoreEfi : > >> ) - Uuid "=3D"= guidDefinition[Guid] > << + Uuid "=3D" guidDefinition[Guid] << > if (IsUEFI23EfiVarstore) > { _PCATCH(gCVfrDat= aStorage.DeclareBufferVarS > tore ( = StoreName,@@ -1150,7 > +1159,7 @@ vfrStatementVarStoreEfi : > } > VSEObj.SetGuid (&Guid); = VSEObj.SetVarStoreId > (VarStoreId);- + > VSEObj.SetSize ((UINT16) Size); > VSEObj.SetName (StoreName); = if > (IsUEFI23EfiVarstore =3D=3D FALSE && StoreName !=3D NULL) {@@ -1184,7=20 > +1193,7 @@ vfrStatementVarStoreNameValue : > >> } (- Name = "=3D" "STRING_TOKEN" "\(" > N:Number "\)" "," << + Name "=3D" "STRING_TOKEN" "\(" N:Number "\)" "= ," > << if (!Created) > { _PCATCH(gCVfrD= ataStorage.DeclareNameVar > StoreBegin (SN->getText(), VarStoreId), SN); Created =3D TRUE;@@=20 > -1245,12 +1254,12 @@ vfrStatementDisableIfFormSet : > vfrStatementSuppressIfFormSet : << CIfrSuppressIf SIObj;>> L:Suppres= sIf > <<- SIObj.SetLi= neNo(L->getLine()); + > SIObj.SetLineNo(L->getLine()); = >> { FLAGS "=3D" > flagsField ( "\|" flagsField )* "," } vfrStatementExpression[0] ";" > vfrFormSetList- E: EndIf + E: EndIf ";" = << > CRT_END_OP (E); >> ; @@ -1491,7 +1500,7 @@ vfrQuestionDataFieldName > [EFI_QUESTION_ID &QId, UINT32 &Mask, CHAR8 *&VarIdStr, > ( SN2:StringIdentifier << _STRCAT (&Var= IdStr, SN2- > >getText()); LineNo =3D SN2->getLine(); >> (- "." = << + > "." << = _STRCAT > (&VarIdStr, "."); = if > (mConstantOnlyInExpression) > { _PCATCH(VFR_RE= TURN_CONSTANT_ONLY, > LineNo);@@ -1518,7 +1527,7 @@ vfrQuestionDataFieldName=20 > [EFI_QUESTION_ID &QId, UINT32 &Mask, CHAR8 *&VarIdStr, > ; vfrConstantValueField[UINT8 Type, EFI_IFR_TYPE_VALUE &Value, > BOOLEAN &ListType] :- << + << EFI_GUID Guid; BOOLEAN Ne= gative =3D > FALSE; BOOLEAN IntDecStyle =3D FALSE;@@ -1634,11 +1643,11 @@ > vfrConstantValueField[UINT8 Type, EFI_IFR_TYPE_VALUE &Value, BOOLEAN=20 > &ListType] > | Z:Zero << $Value.u8 =3D= _STOU8(Z->getText(), Z- > >getLine()); >> | HOUR:Number ":" MINUTE:Number ":" SECOND:Number << > $Value.time =3D _STOT(HOUR->getText(), MINUTE->getText(),SECOND- > >getText(), HOUR->getLine()); >> | YEAR:Number "/" MONTH:Number "/" > DAY:Number << $Value.date =3D _STOD(YEAR->getText(), MONTH->getText= (), > DAY->getText(), YEAR->getLine()); >>- | QI:Number";" FI:Number";" > guidDefinition[Guid] ";" "STRING_TOKEN" "\(" DP:Number "\)" + |=20 > QI:Number";" FI:Number";" guidDefinition[Guid] ";" "STRING_TOKEN" "\(" > DP:Number "\)" << $Va= lue.ref =3D _STOR(QI- > >getText(), FI->getText(), &Guid, DP->getText(), QI->getLine()); >> | > "STRING_TOKEN" "\(" S1:Number "\)" << $Value.string =3D _STO= SID(S1- > >getText(), S1->getLine()); >> | "\{" = << ListType =3D > TRUE; >>- L1:Number << + L1= :Number > << switch (Type) > { case EFI_IFR_T= YPE_NUM_SIZE_8 : > Type8[Index] =3D _STOU8(L1->getText(), L1->getLine());@@ -1658,8=20 > +1667,8 @@ vfrConstantValueField[UINT8 Type, EFI_IFR_TYPE_VALUE=20 > &Value, BOOLEAN &ListType] > Index++; = >> (- > "," - L2:Number << + ","+= L2:Number > << switch (Type) > { case EFI_IFR_T= YPE_NUM_SIZE_8 : > Type8[Index] =3D _STOU8(L2->getText(), L2->getLine());@@ -1679,7=20 > +1688,7 @@ vfrConstantValueField[UINT8 Type, EFI_IFR_TYPE_VALUE=20 > &Value, BOOLEAN &ListType] >=20 > Index++; >> )*-= "\}" + > "\}" ; > //************************************************************** > ***************@@ -1714,7 +1723,7 @@ vfrFormDefinition : > ; vfrFormMapDefinition :- << + << CIfrFormMap *FMapObj =3D NULL= ; > UINT32 FormMapMethodNumber =3D 0; EFI_GUID Guid;@@ -1775,11 > +1784,15 @@ vfrStatementDefault : > CIfrNumeric *NumericQst =3D NULL; >>- D:Default > + D:Default <<+ = if > (mIsCatchDefaultEnable) {+ > DefaultValueError(VFR_RETURN_UNSUPPORTED, D- > >getLine());+ }+ = >> > ( (- "=3D" vfrConstantValueField[_GET_CURRQEST_DATATYPE(), *Val, > ArrayType] "," - << += "=3D" > vfrConstantValueField[_GET_CURRQEST_DATATYPE(), *Val, ArrayType] ","+ > << if (gCurrentMi= nMaxData !=3D NULL && > gCurrentMinMaxData->IsNumericOpcode()) > { //check defau= lt value is valid for Numeric > Opcode NumericQ= st =3D (CIfrNumeric *) > gCurrentQuestion;@@ -1888,14 +1901,14 @@ vfrStatementDefault : > vfrStatementValue "," << CIfrEnd EndObj1; > EndObj1.SetLineNo(D->getLine()); >> ) {- DefaultStore "=3D" > SN:StringIdentifier "," << + DefaultStore "=3D" SN:StringIdenti= fier "," << > _PCATCH(gCVfrDefaultStore.GetDefaultId (SN->getText(), &DefaultId), SN); > if (DObj !=3D NULL) {- = DObj->SetDefaultId > (DefaultId); - } + > DObj->SetDefaultId (DefaultId);+ = } > if (DObj2 !=3D NULL) {- = DObj2->SetDefaultId > (DefaultId); + D= Obj2->SetDefaultId > (DefaultId); } = >> > }@@ -1917,8 +1930,8 @@ vfrStatementDefault : > ); = } > }- = if (DObj !=3D NULL) > {delete DObj;} - if= (DObj2 !=3D NULL) {delete > DObj2;} + if (DObj = !=3D NULL) {delete DObj;}+ > if (DObj2 !=3D NULL) {delete DObj2;} = >> ) ;@@ - > 1970,11 +1983,15 @@ vfrStatementInvalid : > ; flagsField :- Number - | InteractiveFlag - |=20 > ManufacturingFlag - | DefaultFlag - | ResetRequiredFlag + Number+ =20 > | InteractiveFlag+ | > ManufacturingFlag+ | D:DefaultFlag = <<+ > if (mIsCatchDefaultEnable) {+ > DefaultValueError(VFR_RETURN_UNSUPPORTED, D- > >getLine());+ }+ > >>+ | ResetRequiredFlag | ReconnectRequiredFlag | N:NVAccessFlag > << gCVfrErrorHa= ndle.HandleWarning (@@ - > 1989,7 +2006,7 @@ flagsField : > =20 > L->getLine(), > L->getText() = );- > >> + = >> ; > vfrStatementValue :@@ -2001,13 +2018,13 @@ vfrStatementValue : > vfrStatementRead : << CIfrRead RObj; >> R:Read > << RObj.SetLineNo(R->getLine()); >>- vfrStatementExpression[0] ";" + > vfrStatementExpression[0] ";" ; vfrStatementWrite : << CIfrWrite WOb= j; >> > W:Write << WObj.SetLineNo(W-= >getLine()); >>- > vfrStatementExpression[0] ";" + vfrStatementExpression[0] ";" ; > vfrStatementSubTitle :@@ -2140,7 +2157,7 @@ vfrStatementGoto : > FormId "=3D" F3:Number "," << RefType =3D = 2; FId =3D _STOFID(F3- > >getText(), F3->getLine()); >> Question "=3D" (- QN3= :StringIdentifier > "," << + QN3:StringIdentifier "," = << > mCVfrQuestionDB.GetQuestionId (QN3->getText (), NULL, QId, BitMask);=20 > if (QId =3D=3D EFI_QUESTION_ID_INVALID) > { _PCATCH(VFR= _RETURN_UNDEFINED, > QN3);@@ -2222,7 +2239,7 @@ vfrStatementGoto : > "," Key "=3D" KN:Number << AssignQuesti= onKey (*QHObj, > KN); >> } {- E:"," + E:"," vfrStatementQuestionOptionList= << > OHObj->SetScope(1); CRT_END_OP (E);>> } ";" > << if (R1Obj !=3D NULL) {delete R1Obj;} if (R2Obj !=3D NULL) {delete=20 > R2Obj;} if (R3Obj !=3D NULL) {delete R3Obj;} if (R4Obj !=3D NULL) {delete= =20 > R4Obj;} if (R5Obj !=3D > NULL) {delete R5Obj;}>>@@ -2511,20 +2528,20 @@=20 > minMaxDateStepDefault[EFI_HII_DATE & D, UINT8 KeyValue] : > { "default" "=3D" N:Number "," << > switch (KeyValue) {- = case 0: + > case 0: D.Yea= r =3D _STOU16(N->getText(), N- > >getLine()); = if (D.Year < _STOU16 (MinN- > >getText(), MinN->getLine()) || D.Year > _STOU16 (MaxN->getText(), MaxN- > >getLine())) { = _PCATCH > (VFR_RETURN_INVALID_PARAMETER, N->getLine(), "Year default value must > be between Min year and Max year."); = } > break;- case 1: = - > D.Month =3D _STOU8(N->getText(), N->getLine()); + > case 1:+ D.Mon= th =3D _STOU8(N->getText(), N- > >getLine()); = if (D.Month < 1 || D.Month > 12) > { _PCATCH > (VFR_RETURN_INVALID_PARAMETER, N->getLine(), "Month default value > must be between 1 and 12."); = } > break;- case 2: = - > D.Day =3D _STOU8(N->getText(), N->getLine()); + > case 2:+ D.Day= =3D _STOU8(N->getText(), N- > >getLine()); = if (D.Day < 1 || D.Day > 31) > { _PCATCH > (VFR_RETURN_INVALID_PARAMETER, N->getLine(), "Day default value must > be between 1 and 31."); = }@@ -2570,7 > +2587,7 @@ vfrSetMinMaxStep[CIfrMinMaxStepData & MMSDObj] : > BOOLEAN MinNegative =3D FALSE; BOOLEAN MaxNegative =3D FALSE; = >>- > Minimum "=3D" + Minimum "=3D" { "\-" = << > MinNegative =3D TRUE; >> }@@ -2659,8 +2676,8 @@ > vfrSetMinMaxStep[CIfrMinMaxStepData & MMSDObj] : > } = } > >>- Maximum "=3D" - { + Maximu= m "=3D"+ { "\-" > << MaxNegative =3D TRUE; >> } A:Number "," = <<@@ - > 2889,7 +2906,7 @@ vfrStatementNumeric : > } = >> > vfrStatementQuestionOptionList- E:EndNumeric = << + > E:EndNumeric << > CRT_END_OP (E); = if (GuidObj !=3D NULL) > { GuidObj->Se= tScope(1);@@ -3131,7 > +3148,7 @@ vfrStatementString : > { Key "=3D" KN:Number "," << AssignQu= estionKey (SObj, > KN); >> }- MinSize "=3D" MIN:Number "," << += MinSize "=3D" > MIN:Number "," << > VarArraySize =3D _GET_CURRQEST_ARRAY_SIZE(); StringMinSize =3D=20 > _STOU8(MIN->getText(), MIN->getLine()); if (_STOU64(MIN->getText(),=20 > MIN->getLine()) > StringMinSize) {@@ -3141,7 > +3158,7 @@ vfrStatementString : > } > SObj.SetMinSize (StringMinSize); = >>- MaxSize > "=3D" MAX:Number "," << + MaxSize "=3D" MAX:Nu= mber "," > << StringMaxSiz= e =3D _STOU8(MAX->getText(), > MAX->getLine()); = if (_STOU64(MAX- > >getText(), MAX->getLine()) > StringMaxSize) > { _PCATCH > (VFR_RETURN_INVALID_PARAMETER, MAX->getLine(), "String MaxSize takes=20 > only one byte, which can't be larger than 0xFF.");@@ -3185,7 +3202,7=20 > @@ vfrStatementPassword : > { Key "=3D" KN:Number "," << AssignQu= estionKey (PObj, > KN); >> }- MinSize "=3D" MIN:Number "," << += MinSize "=3D" > MIN:Number "," << > VarArraySize =3D _GET_CURRQEST_ARRAY_SIZE(); PasswordMinSize =3D=20 > _STOU16(MIN->getText(), MIN->getLine()); if (_STOU64(MIN->getText(),=20 > MIN->getLine()) > PasswordMinSize) {@@ - > 3195,7 +3212,7 @@ vfrStatementPassword : > } > PObj.SetMinSize (PasswordMinSize); = >>- > MaxSize "=3D" MAX:Number "," << + MaxSize "=3D= " MAX:Number > "," << = PasswordMaxSize =3D > _STOU16(MAX->getText(), MAX->getLine()); = if > (_STOU64(MAX->getText(), MAX->getLine()) > PasswordMaxSize) > { _PCATCH > (VFR_RETURN_INVALID_PARAMETER, MAX->getLine(), "Password MaxSize takes=20 > only two byte, which can't be larger than 0xFFFF.");@@ -3230,12 > +3247,12 @@ vfrStatementOrderedList : > >> L:OrderedList << OLObj.Set= LineNo(L->getLine()); > gIsOrderedList =3D TRUE;>> vfrQuestionHeader[OLObj] ","- > << + << > VarArraySize =3D _GET_CURRQEST_ARRAY_SIZE(); OLObj.SetMaxContainers=20 > ((UINT8) (VarArraySize > 0xFF ? 0xFF : > VarArraySize)); >>= {- MaxContainers "=3D" > M:Number "," << + MaxContainers "=3D" M:Number "," > << if (_STOU64(= M->getText(), M->getLine()) > > _STOU8(M->getText(), M->getLine())) > { _PCATCH > (VFR_RETURN_INVALID_PARAMETER, M->getLine(), "OrderedList=20 > MaxContainers takes only one byte, which can't be larger than > 0xFF."); } else= if (VarArraySize !=3D 0 && > _STOU8(M->getText(), M->getLine()) > VarArraySize) {@@ -3328,19=20 > +3345,19 @@ minMaxTimeStepDefault[EFI_HII_TIME & T, UINT8 KeyValue] : > { "default" "=3D" N:Number "," << > switch (KeyValue) {- = case 0: - > T.Hour =3D _STOU8(N->getText(), N->getLine()); + > case 0:+ T.Hou= r =3D _STOU8(N->getText(), N- > >getLine()); = if (T.Hour > 23) > { _PCATCH > (VFR_RETURN_INVALID_PARAMETER, N->getLine(), "Hour default value must > be between 0 and 23."); = } > break;- case 1: = - > T.Minute =3D _STOU8(N->getText(), N->getLine()); + > case 1:+ T.Min= ute =3D _STOU8(N->getText(), N- > >getLine()); = if (T.Minute > 59) > { _PCATCH > (VFR_RETURN_INVALID_PARAMETER, N->getLine(), "Minute default value > must be between 0 and 59."); = } > break;- case 2: = + > case 2: T.Sec= ond =3D _STOU8(N->getText(), N- > >getLine()); = if (T.Second > 59) > { _PCATCH > (VFR_RETURN_INVALID_PARAMETER, N->getLine(), "Second default value=20 > must be between 0 and 59.");@@ -3419,11 +3436,11 @@=20 > vfrStatementStatListOld : > ; vfrStatementDisableIfStat :- << - CIfrDisableIf DIObj; + <<+ > CIfrDisableIf DIObj; >> L:DisableIf = << > DIObj.SetLineNo(L->getLine()); >>- vfrStatementExpression[0] ";" + > vfrStatementExpression[0] ";" ( vfrStatementStatList )* E:EndIf > << CRT_END_OP (E); >> ";"@@ -3548,8 +3565,8 @@ > vfrStatementWarningIf : > ; vfrStatementDisableIfQuest :- << - CIfrDisableIf DIObj; + <<+ > CIfrDisableIf DIObj; >> L:DisableIf = << > DIObj.SetLineNo(L->getLine()); >> vfrStatementExpression[0] ";"@@ - > 3616,15 +3633,15 @@ vfrStatementOneOfOption : > UINT32 *Type32 =3D (UINT32 *) ValueList; UIN= T64 > *Type64 =3D (UINT64 *) ValueList; >>- L:Option = << > + L:Option << = if > (_GET_CURRQEST_DATATYPE() =3D=3D EFI_IFR_TYPE_OTHER) > { _PCATCH (VF= R_RETURN_FATAL_ERROR, L- > >getLine(), "Get data type > error."); } = >>- > Text "=3D" "STRING_TOKEN" "\(" S:Number "\)" "," + Text "=3D" > "STRING_TOKEN" "\(" S:Number "\)" "," Value "=3D" > vfrConstantValueField[_GET_CURRQEST_DATATYPE(), *Val, ArrayType] ","- > << + << = if > (gCurrentMinMaxData !=3D NULL) { = //set > min/max value for oneof opcode = UINT64 > Step =3D gCurrentMinMaxData->GetStepData(_GET_CURRQEST_DATATYPE(), > _GET_CURRQEST_VARTINFO().mIsBitVar);@@ -3696,7 +3713,7 @@=20 > vfrStatementOneOfOption : > Size +=3D OFFS= ET_OF > (EFI_IFR_ONE_OF_OPTION, Value); = OOOObj =3D > new CIfrOneOfOption((UINT8)Size); = OOOObj- > >SetLineNo(L->getLine());- = OOOObj- > >SetOption (_STOSID(S->getText(), S->getLine())); + > OOOObj->SetOption (_STOSID(S->getText(), S->getLine())); > if (ArrayType) { = OOOObj->SetType > (EFI_IFR_TYPE_BUFFER); = } else {@@ -3706,7 > +3723,7 @@ vfrStatementOneOfOption : > OOOObj->Se= tType > (_GET_CURRQEST_DATATYPE()); = } > }- = OOOObj->SetValue > (*Val); + OOOObj= ->SetValue > (*Val); >> F:FLA= GS "=3D" > vfrOneOfOptionFlags[*OOOObj, F->getLine()] <<@@ -3790,7 +3807,12 @@=20 > oneofoptionFlagsField [UINT8 & HFlags, UINT8 & LFlags] : > | RestStyleFlag << $HFlags |=3D 0= x20; >> | > ReconnectRequiredFlag << $HFlags |=3D 0x40; = >> | > ManufacturingFlag << $LFlags |=3D 0x20; = >>- | DefaultFlag > << $LFlags |=3D 0x10; >>+ | D:DefaultFlag = <<+ > $LFlags |=3D 0x10;+ = if (mIsCatchDefaultEnable) > {+ > DefaultValueError(VFR_RETURN_UNSUPPORTED, D- > >getLine());+ = }+ > >> | A:NVAccessFlag << > gCVfrErrorHandle.HandleWarning > ( VFR_WARNING= _OBSOLETED_FRAMEWORK > _OPCODE,@@ -3963,7 +3985,7 @@ vfrStatementExpression [UINT32=20 > RootLevel, UINT32 ExpOpCount =3D 0] : > } = } > }- = + > if ($RootLevel =3D=3D 0) { = _CLEAR_SAVED_OPHDR > (); mCIfrOpHd= rIndex --;@@ -4405,10 > +4427,10 @@ ideqvallistExp[UINT32 & RootLevel, UINT32 & ExpOpCount] : > for (Index = =3D 0; Index < ListLen; Index++) > { EILObj.Se= tValueList (Index, > ValueList[Index]); = }- > + =20 > + EILObj.UpdateIfrBuffer();- > _SAVE_OPHDR_COND (EILObj, ($ExpOpCount =3D=3D 0), L->getLine()); > - + > _SAVE_OPHDR_COND (EILObj, ($ExpOpCount =3D=3D 0), L->getLine());+ if (QId= =20 > =3D=3D EFI_QUESTION_ID_INVALID) > { EILObj.Se= tQuestionId (QId, VarIdStr, > LineNo); }@@ = -4458,9 +4480,9 @@ > stringref1Exp[UINT32 & RootLevel, UINT32 & ExpOpCount] : > >> L:StringRef "\("- ( + ( "STRING_TOKEN"- = "\(" + "\(" > S:Number << RefStringId =3D _STOSID(S->getText(), S->getLine()); >> = "\)" > | I:Number << RefStringId =3D _STOSID(I->getText(), I->getLine()); >>@@= =20 > | - > 4499,10 +4521,10 @@ getExp[UINT32 & RootLevel, UINT32 & ExpOpCount] : > Info.mVarStoreId =3D 0; >> L:Get- "\(" + "\(" vfrStorag= eVarId[Info, > VarIdStr, FALSE] {"\|" FLAGS "=3D" numericVarStoreType [VarType] }-= "\)" > << + "\)" << > { if (Info.mV= arStoreId =3D=3D 0) > { // suppor= t Date/Time question@@ - > 4549,9 +4571,9 @@ getExp[UINT32 & RootLevel, UINT32 & ExpOpCount] : > =20 > _PCATCH(VFR_RETURN_UNSUPPORTED, L- > >getLine(), "Get/Set opcode don't support data > array"); } = } > - CIfrGet GObj= (L->getLine()); - > _SAVE_OPHDR_COND (GObj, ($ExpOpCount =3D=3D 0), L->getLine()); - > GObj.SetVarInfo (&Info); + = CIfrGet GObj(L- > >getLine());+ = _SAVE_OPHDR_COND (GObj, > ($ExpOpCount =3D=3D 0), L->getLine());+ > GObj.SetVarInfo (&Info); = delete[] VarIdStr; > $ExpOpCount++; = }@@ -4608,7 +4630,7 @@ > question23refExp[UINT32 & RootLevel, UINT32 & ExpOpCount] : > { Uuid "=3D" guidDefinition[Guid] "," = << Type =3D 0x3; >> }- > vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount] + > vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount] "\)" > << switch (Type= ) {@@ -4675,9 +4697,9 @@ > setExp[UINT32 & RootLevel, UINT32 & ExpOpCount] : > "\(" vfrStorageVarId[Info, VarIdStr, FALSE] {"\|" FLAG "=3D" > numericVarStoreType [VarType] }- "," > vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount] + "," > vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount] "\)"- > << + << > { if (Info.mV= arStoreId =3D=3D 0) > { // suppor= t Date/Time question@@ - > 4724,8 +4746,8 @@ setExp[UINT32 & RootLevel, UINT32 & ExpOpCount] : > =20 > _PCATCH(VFR_RETURN_UNSUPPORTED, L- > >getLine(), "Get/Set opcode don't support data > array"); } = } > - CIfrSet TSOb= j(L->getLine()); - > TSObj.SetVarInfo (&Info); + = CIfrSet TSObj(L- > >getLine());+ = TSObj.SetVarInfo (&Info); > delete[] VarIdStr; > $ExpOpCount++; = }@@ -4808,9 +4830,9 @@ > spanExp[UINT32 & RootLevel, UINT32 & ExpOpCount] : > ; vfrExpressionMap [UINT32 & RootLevel, UINT32 & ExpOpCount]:- =20 > L:Map > - "\(" - vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount] + L:M= ap+ > "\("+ vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount] ":" > << { CIfrMap MObj(L->getLine()); } >> ( vfrStatementExpression[0]@@= - > 4837,6 +4859,7 @@ spanFlags [UINT8 & Flags] : > class EfiVfrParser { << private:+ BOOLEAN mIsCatchDefaultEn= able; > UINT8 mParserStatus; BOOLEAN mConstantOnlyInE= xpression; > @@ -4880,6 +4903,7 @@ public: > VOID _PCATCH (IN EFI_VFR_RETURN_CODE, IN ANTLRTokenPtr)= ; > VOID _PCATCH (IN EFI_VFR_RETURN_CODE, IN UINT32); VOID > _PCATCH (IN EFI_VFR_RETURN_CODE, IN UINT32, IN CONST CHAR8 *);+ VOID > DefaultValueError (IN EFI_VFR_RETURN_CODE, IN UINT32); VOID > syn (ANTLRAbstractToken *, ANTLRChar *, SetWordType *, > ANTLRTokenType, INT32); @@ -4909,6 +4933,7 @@ public: > VOID IdEqIdDoSpecial (IN UINT32 &, IN UINT32, IN > EFI_QUESTION_ID, IN CHAR8 *, IN UINT32, IN EFI_QUESTION_ID, IN CHAR8 *, > IN UINT32, IN EFI_COMPARE_TYPE); VOID IdEqListDoSpecial = (IN > UINT32 &, IN UINT32, IN EFI_QUESTION_ID, IN CHAR8 *, IN UINT32, IN > UINT16, IN UINT16 *); VOID SetOverrideClassGuid (IN EFI= _GUID *);+ > VOID SetIsCatchDefaultEnable (BOOLEAN IsCatchDefaultEnable= ); >> } > @@ -5086,6 +5111,17 @@ EfiVfrParser::_PCATCH ( > mParserStatus =3D mParserStatus + gCVfrErrorHandle.HandleError=20 > (ReturnCode, LineNum, (CHAR8 *) ErrorMsg); } > +VOID+EfiVfrParser::DefaultValueError (+ IN EFI_VFR_RETURN_CODE > ReturnCode,+ IN UINT32 LineNum+ )+{+ CHAR8 ErrorMsg[100];= + > sprintf(ErrorMsg, "please remove the default value / defaultstore in=20 > line %d", LineNum);+ mParserStatus =3D mParserStatus +=20 > gCVfrErrorHandle.HandleError (ReturnCode, LineNum, ErrorMsg);+}+ VOID Efi= VfrParser::syn > ( ANTLRAbstractToken *Tok,@@ -5682,12 +5718,18 @@ > EfiVfrParser::IdEqListDoSpecial ( > } } -VOID +VOID EfiVfrParser::SetOverrideClassGuid (IN EFI_GUID > *OverrideClassGuid) { mOverrideClassGuid =3D OverrideClassGuid; } > +VOID+EfiVfrParser::SetIsCatchDefaultEnable (BOOLEAN > IsCatchDefaultEnable)+{+ mIsCatchDefaultEnable =3D IsCatchDefaultEnable;= +}+ > VOID EfiVfrParser::CheckDuplicateDefaultValue ( IN EFI_DEFAULT_ID > DefaultId,-- > 2.26.2.windows.1 -=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 (#112435): https://edk2.groups.io/g/devel/message/112435 Mute This Topic: https://groups.io/mt/103126873/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-