From nobody Mon Feb 9 00:43:17 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+39720+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+39720+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1556504191; cv=none; d=zoho.com; s=zohoarc; b=aY7n62oLzO6UOgDpzlmoW92sMXlSjYtcCB/kQG1JHndsairgDVBacTxVOahoKp6RLQslN6qWNgmMeBDozBvuKTXHWVXxBOGtLnFWrLbhAbo8sOfiKPMA8t5+Ke1dwCtjFvfZIw4tGSLFU9lVw0c2ciPZiaCLEcbZ3SNuIonVQJk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556504191; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=Y9pXitX+4cBN0GvoLlfiW8LwdpliSvInPBgqKvR3lVo=; b=O2vP2RSflbqv9GZzYMb2JR7OPOfkGCdbsKbi0eN1IhyCWwW4XGIswP7lK3fkR4mwBR6GXLO3EBBpkeqSn2C6hvN/ThESPw5Ieb5VCOJL2xpZtja4Qf2nSxOjLz5UnPud7BY3uRMDIOsfNDslkozJYpKystAThbaAa4n1q7g9mZo= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+39720+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 155650419141237.37606404302494; Sun, 28 Apr 2019 19:16:31 -0700 (PDT) Return-Path: X-Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by groups.io with SMTP; Sun, 28 Apr 2019 19:16:30 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Apr 2019 19:16:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,408,1549958400"; d="scan'208";a="139631891" X-Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.147]) by orsmga006.jf.intel.com with ESMTP; 28 Apr 2019 19:16:29 -0700 From: "Dandan Bi" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao Subject: [edk2-devel] [patch 01/11] BaseTools/VfrCompile: Remove framework VFR support Date: Mon, 29 Apr 2019 10:15:57 +0800 Message-Id: <20190429021607.11304-2-dandan.bi@intel.com> In-Reply-To: <20190429021607.11304-1-dandan.bi@intel.com> References: <20190429021607.11304-1-dandan.bi@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,dandan.bi@intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1556504191; bh=ItM6fB4UgOVpU44n5P1wncfLDk1gQkJ5lmc3KZ8QM6Q=; h=Cc:Date:From:Reply-To:Subject:To; b=D4dv5NESGeTvgBsqRTCdkKsN3q1yYqiQSUd5NaUwh10zv3ijmTO/VyaTTruD6OPIiOy VCFImVH7db17sFNLu3b9xzyvFsG2SlMoNeWhhqU3ornoRcwXcyRtPgzIA3ntEfwMEQ1/c HjE1SGNm0CpAwqxl+9g59JKdKkB1mjW/LpI= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1464 Currently there is no usage of framework VFR, remove the support from VfrCompile. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Dandan Bi Reviewed-by: Bob Feng Reviewed-by: Liming Gao --- BaseTools/Source/C/VfrCompile/VfrCompiler.cpp | 35 +----- BaseTools/Source/C/VfrCompile/VfrCompiler.h | 3 +- BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp | 23 +--- BaseTools/Source/C/VfrCompile/VfrFormPkg.h | 3 +- BaseTools/Source/C/VfrCompile/VfrSyntax.g | 103 +----------------- .../Source/C/VfrCompile/VfrUtilityLib.cpp | 52 +-------- BaseTools/Source/C/VfrCompile/VfrUtilityLib.h | 7 +- .../VfrCompiler_Utility_Man_Page.rtf | 4 - 8 files changed, 15 insertions(+), 215 deletions(-) diff --git a/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp b/BaseTools/Sour= ce/C/VfrCompile/VfrCompiler.cpp index c4d4d261ad..5f4d262d85 100644 --- a/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp +++ b/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp @@ -1,10 +1,10 @@ /** @file =20 VfrCompiler main class and main function. =20 -Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 #include "stdio.h" @@ -72,11 +72,10 @@ CVfrCompiler::OptionInitialization ( mOptions.PreprocessorOutputFileName =3D NULL; mOptions.VfrBaseFileName =3D NULL; mOptions.IncludePaths =3D NULL; mOptions.SkipCPreprocessor =3D TRUE; mOptions.CPreprocessorOptions =3D NULL; - mOptions.CompatibleMode =3D FALSE; mOptions.HasOverrideClassGuid =3D FALSE; mOptions.WarningAsError =3D FALSE; mOptions.AutoDefault =3D FALSE; mOptions.CheckDefault =3D FALSE; memset (&mOptions.OverrideClassGuid, 0, sizeof (EFI_GUID)); @@ -140,12 +139,10 @@ CVfrCompiler::OptionInitialization ( DebugError (NULL, 0, 1001, "Missing option", "-od - missing C-prep= rocessor argument"); goto Fail; } =20 AppendCPreprocessorOptions (Argv[Index]); - } else if (stricmp(Argv[Index], "-c") =3D=3D 0 || stricmp(Argv[Index],= "--compatible-framework") =3D=3D 0) { - mOptions.CompatibleMode =3D TRUE; } else if (stricmp(Argv[Index], "-s") =3D=3D 0|| stricmp(Argv[Index], = "--string-db") =3D=3D 0) { Index++; if ((Index >=3D Argc) || (Argv[Index][0] =3D=3D '-')) { DebugError (NULL, 0, 1001, "Missing option", "-s missing input str= ing file name"); goto Fail; @@ -559,12 +556,10 @@ CVfrCompiler::Usage ( " default is current directory", " -b, --create-ifr-package", " create an IFR HII pack file", " -n, --no-pre-processing", " do not preprocessing input file", - " -c, --compatible-framework", - " compatible framework vfr file", " -s, --string-db", " input uni string package file", " -g, --guid", " override class guid input", " format is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", @@ -683,11 +678,10 @@ CVfrCompiler::Compile ( if ((pInFile =3D fopen (LongFilePath (InFileName), "r")) =3D=3D NULL) { DebugError (NULL, 0, 0001, "Error opening the input file", "%s", InFil= eName); goto Fail; } =20 - InputInfo.CompatibleMode =3D mOptions.CompatibleMode; if (mOptions.HasOverrideClassGuid) { InputInfo.OverrideClassGuid =3D &mOptions.OverrideClassGuid; } else { InputInfo.OverrideClassGuid =3D NULL; } @@ -773,31 +767,10 @@ CVfrCompiler::AdjustBin ( //ok } else { DebugError (NULL, 0, 0001, "Error parsing vfr file", " %s.Buffer not a= llocated.", mOptions.VfrFileName); } =20 - // - // For UEFI mode, not do OpCode Adjust - // - if (mOptions.CompatibleMode) { - // - // Adjust Opcode to be compatible with framework vfr - // - Status =3D gCIfrRecordInfoDB.IfrRecordAdjust (); - if (Status !=3D VFR_RETURN_SUCCESS) { - // - // Record List Adjust Failed - // - SET_RUN_STATUS (STATUS_FAILED); - return; - } - // - // Re get the IfrRecord Buffer. - // - gCIfrRecordInfoDB.IfrRecordOutput (gRBuffer); - } - return; } =20 VOID CVfrCompiler::GenBinary ( @@ -851,24 +824,20 @@ CVfrCompiler::GenCFile ( =20 if (!IS_RUN_STATUS(STATUS_GENBINARY)) { goto Fail; } =20 - if (!mOptions.CreateIfrPkgFile || mOptions.CompatibleMode) { + if (!mOptions.CreateIfrPkgFile) { if ((pFile =3D fopen (LongFilePath (mOptions.COutputFileName), "w")) = =3D=3D NULL) { DebugError (NULL, 0, 0001, "Error opening output C file", "%s", mOpt= ions.COutputFileName); goto Fail; } =20 for (Index =3D 0; gSourceFileHeader[Index] !=3D NULL; Index++) { fprintf (pFile, "%s\n", gSourceFileHeader[Index]); } =20 - if (mOptions.CompatibleMode) { - gCVfrBufferConfig.OutputCFile (pFile, mOptions.VfrBaseFileName); - } - if (gCFormPkg.GenCFile (mOptions.VfrBaseFileName, pFile, &gRBuffer) != =3D VFR_RETURN_SUCCESS) { fclose (pFile); goto Fail; } fclose (pFile); diff --git a/BaseTools/Source/C/VfrCompile/VfrCompiler.h b/BaseTools/Source= /C/VfrCompile/VfrCompiler.h index b8cccca4b0..b6e207d2ce 100644 --- a/BaseTools/Source/C/VfrCompile/VfrCompiler.h +++ b/BaseTools/Source/C/VfrCompile/VfrCompiler.h @@ -1,10 +1,10 @@ /** @file =20 VfrCompiler internal definitions. =20 -Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 #ifndef _VFRCOMPILER_H_ @@ -45,11 +45,10 @@ typedef struct { CHAR8 *PreprocessorOutputFileName; CHAR8 *VfrBaseFileName; // name of input VFR file with no path or ext= ension CHAR8 *IncludePaths; bool SkipCPreprocessor; CHAR8 *CPreprocessorOptions; - BOOLEAN CompatibleMode; BOOLEAN HasOverrideClassGuid; EFI_GUID OverrideClassGuid; BOOLEAN WarningAsError; BOOLEAN AutoDefault; BOOLEAN CheckDefault; diff --git a/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp b/BaseTools/Sourc= e/C/VfrCompile/VfrFormPkg.cpp index 5948dc0883..36d3baaf10 100644 --- a/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp +++ b/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp @@ -1,10 +1,10 @@ /** @file =20 The definition of CFormPkg's member function =20 -Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 #include "stdio.h" @@ -442,25 +442,14 @@ CFormPkg::GenCFile ( =20 if ((Ret =3D BuildPkgHdr(&PkgHdr)) !=3D VFR_RETURN_SUCCESS) { return Ret; } =20 - // - // For framework vfr file, the extension framework header will be added. - // - if (VfrCompatibleMode) { - fprintf (pFile, " // FRAMEWORK PACKAGE HEADER Length\n"); - PkgLength =3D PkgHdr->Length + sizeof (UINT32) + 2; - _WRITE_PKG_LINE(pFile, BYTES_PRE_LINE, " ", (CHAR8 *)&PkgLength, size= of (UINT32)); - fprintf (pFile, "\n\n // FRAMEWORK PACKAGE HEADER Type\n"); - PkgLength =3D 3; - _WRITE_PKG_LINE(pFile, BYTES_PRE_LINE, " ", (CHAR8 *)&PkgLength, size= of (UINT16)); - } else { - fprintf (pFile, " // ARRAY LENGTH\n"); - PkgLength =3D PkgHdr->Length + sizeof (UINT32); - _WRITE_PKG_LINE(pFile, BYTES_PRE_LINE, " ", (CHAR8 *)&PkgLength, size= of (UINT32)); - } + + fprintf (pFile, " // ARRAY LENGTH\n"); + PkgLength =3D PkgHdr->Length + sizeof (UINT32); + _WRITE_PKG_LINE(pFile, BYTES_PRE_LINE, " ", (CHAR8 *)&PkgLength, sizeof= (UINT32)); =20 fprintf (pFile, "\n\n // PACKAGE HEADER\n"); _WRITE_PKG_LINE(pFile, BYTES_PRE_LINE, " ", (CHAR8 *)PkgHdr, sizeof (EF= I_HII_PACKAGE_HEADER)); PkgLength =3D sizeof (EFI_HII_PACKAGE_HEADER); =20 @@ -966,11 +955,11 @@ CFormPkg::DeclarePendingQuestion ( =20 // // For undefined Efi VarStore type question // Append the extended guided opcode to contain VarName // - if (VarStoreType =3D=3D EFI_VFR_VARSTORE_EFI || VfrCompatibleMode) { + if (VarStoreType =3D=3D EFI_VFR_VARSTORE_EFI) { CIfrVarEqName CVNObj (QId, Info.mInfo.mVarName); CVNObj.SetLineNo (LineNo); } =20 // diff --git a/BaseTools/Source/C/VfrCompile/VfrFormPkg.h b/BaseTools/Source/= C/VfrCompile/VfrFormPkg.h index 68df87ba88..1cea4f0e25 100644 --- a/BaseTools/Source/C/VfrCompile/VfrFormPkg.h +++ b/BaseTools/Source/C/VfrCompile/VfrFormPkg.h @@ -1,10 +1,10 @@ /** @file =20 The definition of CFormPkg's member function =20 -Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 #ifndef _EFIIFRCLASS_H_ @@ -93,11 +93,10 @@ struct SBufferNode { CHAR8 *mBufferFree; struct SBufferNode *mNext; }; =20 typedef struct { - BOOLEAN CompatibleMode; EFI_GUID *OverrideClassGuid; } INPUT_INFO_TO_SYNTAX; =20 class CFormPkg { private: diff --git a/BaseTools/Source/C/VfrCompile/VfrSyntax.g b/BaseTools/Source/C= /VfrCompile/VfrSyntax.g index 04fe030b61..24b30e3825 100644 --- a/BaseTools/Source/C/VfrCompile/VfrSyntax.g +++ b/BaseTools/Source/C/VfrCompile/VfrSyntax.g @@ -1,9 +1,9 @@ /*++ @file Vfr Syntax =20 -Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 --*/ =20 #header<< @@ -47,11 +47,10 @@ VfrParserStart ( IN FILE *File, IN INPUT_INFO_TO_SYNTAX *InputInfo ) { ParserBlackBox VfrParser(File); - VfrParser.parser()->SetCompatibleMode (InputInfo->CompatibleMode); VfrParser.parser()->SetOverrideClassGuid (InputInfo->OverrideClassGuid); return VfrParser.parser()->vfrProgram(); } >> =20 @@ -673,17 +672,10 @@ vfrFormSetDefinition : << _DeclareStandardDef= aultStorage (GET_LINENO (L)); >> vfrFormSetList E:EndFormSet << - if (mCompatibleMode)= { - // - // declare all und= efined varstore and efivarstore - // - _DeclareDefaultFra= meworkVarStore (GET_LINENO(E)); - } - =20 // // Declare undefined= Question so that they can be used in expression. // if (gCFormPkg.HavePe= ndingUnassigned()) { mParserStatus +=3D= gCFormPkg.DeclarePendingQuestion ( @@ -5047,23 +5039,18 @@ public: =20 VOID _STRCAT (IN OUT CHAR8 **, IN CONST CHAR8 *); =20 VOID _DeclareDefaultLinearVarStore (IN UINT32); VOID _DeclareStandardDefaultStorage (IN UINT32); - VOID _DeclareDefaultFrameworkVarStore (IN UINT32); =20 VOID AssignQuestionKey (IN CIfrQuestionHeader &, IN ANTLR= TokenPtr); =20 VOID ConvertIdExpr (IN UINT32 &, IN UINT32, IN EF= I_QUESTION_ID, IN CHAR8 *, IN UINT32); VOID IdEqValDoSpecial (IN UINT32 &, IN UINT32, IN EF= I_QUESTION_ID, IN CHAR8 *, IN UINT32, IN UINT16, IN EFI_COMPARE_TYPE); VOID IdEqIdDoSpecial (IN UINT32 &, IN UINT32, IN EF= I_QUESTION_ID, IN CHAR8 *, IN UINT32, IN EFI_QUESTION_ID, IN CHAR8 *, IN UI= NT32, IN EFI_COMPARE_TYPE); VOID IdEqListDoSpecial (IN UINT32 &, IN UINT32, IN EF= I_QUESTION_ID, IN CHAR8 *, IN UINT32, IN UINT16, IN UINT16 *); VOID SetOverrideClassGuid (IN EFI_GUID *); -// -// For framework vfr compatibility -// - VOID SetCompatibleMode (IN BOOLEAN); >> } =20 << VOID @@ -5540,88 +5527,10 @@ EfiVfrParser::_STOR ( Ref.DevicePath =3D _STOSID (DevicePath, LineNum); =20 return Ref; } =20 -// -// framework vfr to default declare varstore for each structure -// -VOID -EfiVfrParser::_DeclareDefaultFrameworkVarStore ( - IN UINT32 LineNo - ) -{ - SVfrVarStorageNode *pNode; - UINT32 TypeSize; - BOOLEAN FirstNode; - CONST CHAR8 VarName[] =3D "Setup"; - - FirstNode =3D TRUE; - pNode =3D gCVfrDataStorage.GetBufferVarStoreList(); - if (pNode =3D=3D NULL && gCVfrVarDataTypeDB.mFirstNewDataTypeName !=3D N= ULL) { - // - // Create the default Buffer Var Store when no VarStore is defined. - // its name should be "Setup" - // - gCVfrVarDataTypeDB.GetDataTypeSize (gCVfrVarDataTypeDB.mFirstNewDataTy= peName, &TypeSize); - CIfrVarStore VSObj; - VSObj.SetLineNo (LineNo); - VSObj.SetVarStoreId (0x1); //the first and only one Buffer Var Store - VSObj.SetSize ((UINT16) TypeSize); - //VSObj.SetName (gCVfrVarDataTypeDB.mFirstNewDataTypeName); - VSObj.SetName ((CHAR8 *) VarName); - VSObj.SetGuid (&mFormsetGuid); -#ifdef VFREXP_DEBUG - printf ("Create the default VarStoreName is %s\n", gCVfrVarDataTypeDB.= mFirstNewDataTypeName); -#endif - } else { - for (; pNode !=3D NULL; pNode =3D pNode->mNext) { - // - // create the default varstore opcode for not declared varstore - // the first varstore name should be "Setup" - // - if (!pNode->mAssignedFlag) { - CIfrVarStore VSObj; - VSObj.SetLineNo (LineNo); - VSObj.SetVarStoreId (pNode->mVarStoreId); - VSObj.SetSize ((UINT16) pNode->mStorageInfo.mDataType->mTotalSize); - if (FirstNode) { - VSObj.SetName ((CHAR8 *) VarName); - FirstNode =3D FALSE; - } else { - VSObj.SetName (pNode->mVarStoreName); - } - VSObj.SetGuid (&pNode->mGuid); -#ifdef VFREXP_DEBUG - printf ("undefined VarStoreName is %s and Id is 0x%x\n", pNode->mV= arStoreName, pNode->mVarStoreId); -#endif - } - } - } - - pNode =3D gCVfrDataStorage.GetEfiVarStoreList(); - for (; pNode !=3D NULL; pNode =3D pNode->mNext) { - // - // create the default efi varstore opcode for not exist varstore - // - if (!pNode->mAssignedFlag) { - CIfrVarStoreEfi VSEObj; - VSEObj.SetLineNo (LineNo); - VSEObj.SetAttributes (0x00000002); //hardcode EFI_VARIABLE_BOOTSERVI= CE_ACCESS attribute - VSEObj.SetGuid (&pNode->mGuid); - VSEObj.SetVarStoreId (pNode->mVarStoreId); - // Generate old efi varstore storage structure for compatible with o= ld "VarEqVal" opcode, - // which is 3 bytes less than new structure define in UEFI Spec 2.3.= 1. - VSEObj.SetBinaryLength (sizeof (EFI_IFR_VARSTORE_EFI) - 3); -#ifdef VFREXP_DEBUG - printf ("undefined Efi VarStoreName is %s and Id is 0x%x\n", pNode->= mVarStoreName, pNode->mVarStoreId); -#endif - } - } - -} - VOID EfiVfrParser::_DeclareDefaultLinearVarStore ( IN UINT32 LineNo ) { @@ -5917,20 +5826,10 @@ VOID EfiVfrParser::SetOverrideClassGuid (IN EFI_GUID *OverrideClassGuid) { mOverrideClassGuid =3D OverrideClassGuid; } =20 -// -// For framework vfr compatibility -// -VOID -EfiVfrParser::SetCompatibleMode (IN BOOLEAN Mode) -{ - mCompatibleMode =3D Mode; - mCVfrQuestionDB.SetCompatibleMode (Mode); -} - VOID EfiVfrParser::CheckDuplicateDefaultValue ( IN EFI_DEFAULT_ID DefaultId, IN ANTLRTokenPtr Tok ) diff --git a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp b/BaseTools/So= urce/C/VfrCompile/VfrUtilityLib.cpp index 9c9c4d4054..2b9b5dbb1c 100644 --- a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp +++ b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp @@ -1,10 +1,10 @@ /** @file =20 Vfr common library functions. =20 -Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 #include "stdio.h" @@ -757,21 +757,10 @@ CVfrVarDataTypeDB::GetFieldOffset ( { if (Field =3D=3D NULL) { return VFR_RETURN_FATAL_ERROR; } =20 - // - // Framework Vfr file Array Index is from 1. - // But Uefi Vfr file Array Index is from 0. - // - if (VfrCompatibleMode && ArrayIdx !=3D INVALID_ARRAY_INDEX) { - if (ArrayIdx =3D=3D 0) { - return VFR_RETURN_ERROR_ARRARY_NUM; - } - ArrayIdx =3D ArrayIdx - 1; - } - if ((ArrayIdx !=3D INVALID_ARRAY_INDEX) && ((Field->mArrayNum =3D=3D 0) = || (Field->mArrayNum <=3D ArrayIdx))) { return VFR_RETURN_ERROR_ARRARY_NUM; } =20 // @@ -1681,21 +1670,11 @@ CVfrDataStorage::GetFreeVarStoreId ( EFI_VFR_VARSTORE_TYPE VarType ) { UINT32 Index, Mask, Offset; =20 - // - // Assign the different ID range for the different type VarStore to supp= ort Framework Vfr - // Index =3D 0; - if ((!VfrCompatibleMode) || (VarType =3D=3D EFI_VFR_VARSTORE_BUFFER)) { - Index =3D 0; - } else if (VarType =3D=3D EFI_VFR_VARSTORE_EFI) { - Index =3D 1; - } else if (VarType =3D=3D EFI_VFR_VARSTORE_NAME) { - Index =3D 2; - } =20 for (; Index < EFI_FREE_VARSTORE_ID_BITMAP_SIZE; Index++) { if (mFreeVarStoreIdBitMap[Index] !=3D 0xFFFFFFFF) { break; } @@ -1913,17 +1892,10 @@ CVfrDataStorage::GetVarStoreByDataType ( ) { SVfrVarStorageNode *pNode; SVfrVarStorageNode *MatchNode; =20 - // - // Framework VFR uses Data type name as varstore name, so don't need che= ck again. - // - if (VfrCompatibleMode) { - return VFR_RETURN_UNDEFINED; - } - MatchNode =3D NULL; for (pNode =3D mBufferVarStoreList; pNode !=3D NULL; pNode =3D pNode->mN= ext) { if (strcmp (pNode->mStorageInfo.mDataType->mTypeName, DataTypeName) != =3D 0) { continue; } @@ -2287,20 +2259,10 @@ CVfrDataStorage::GetNameVarStoreInfo ( =20 if (mCurrVarStorageNode =3D=3D NULL) { return VFR_RETURN_GET_NVVARSTORE_ERROR; } =20 - // - // Framework Vfr file Index is from 1, but Uefi Vfr file Index is from 0. - // - if (VfrCompatibleMode) { - if (Index =3D=3D 0) { - return VFR_RETURN_ERROR_ARRARY_NUM; - } - Index --; - } - Info->mInfo.mVarName =3D mCurrVarStorageNode->mStorageInfo.mNameSpace.mN= ameTable[Index]; =20 return VFR_RETURN_SUCCESS; } =20 @@ -2859,14 +2821,11 @@ CVfrQuestionDB::RegisterQuestion ( } =20 if (QuestionId =3D=3D EFI_QUESTION_ID_INVALID) { QuestionId =3D GetFreeQuestionId (); } else { - // - // For Framework Vfr, don't check question ID conflict. - // - if (!VfrCompatibleMode && ChekQuestionIdFree (QuestionId) =3D=3D FALSE= ) { + if (ChekQuestionIdFree (QuestionId) =3D=3D FALSE) { delete pNode; return VFR_RETURN_QUESTIONID_REDEFINED; } MarkQuestionIdUsed (QuestionId); } @@ -3366,14 +3325,11 @@ CVfrQuestionDB::UpdateQuestionId ( if (QId =3D=3D NewQId) { // don't update return VFR_RETURN_SUCCESS; } =20 - // - // For Framework Vfr, don't check question ID conflict. - // - if (!VfrCompatibleMode && ChekQuestionIdFree (NewQId) =3D=3D FALSE) { + if (ChekQuestionIdFree (NewQId) =3D=3D FALSE) { return VFR_RETURN_REDEFINED; } =20 for (pNode =3D mQuestionList; pNode !=3D NULL; pNode =3D pNode->mNext) { if (pNode->mQuestionId =3D=3D QId) { @@ -3955,12 +3911,10 @@ CVfrStringDB::GetUnicodeStringTextSize ( } =20 return StringSize; } =20 -BOOLEAN VfrCompatibleMode =3D FALSE; - CVfrVarDataTypeDB gCVfrVarDataTypeDB; CVfrDefaultStore gCVfrDefaultStore; CVfrDataStorage gCVfrDataStorage; =20 =20 diff --git a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.h b/BaseTools/Sour= ce/C/VfrCompile/VfrUtilityLib.h index e2b2917e99..57bb0c424d 100644 --- a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.h +++ b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.h @@ -1,10 +1,10 @@ /** @file =20 Vfr common library functions. =20 -Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 #ifndef _VFRUTILITYLIB_H_ @@ -13,11 +13,10 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include "string.h" #include "Common/UefiBaseTypes.h" #include "EfiVfr.h" #include "VfrError.h" =20 -extern BOOLEAN VfrCompatibleMode; static EFI_GUID gEdkiiIfrBitVarGuid =3D EDKII_IFR_BIT_VARSTORE_GUID; =20 #define MAX_BIT_WIDTH 32 #define MAX_NAME_LEN 64 #define MAX_STRING_LEN 0x100 @@ -422,14 +421,10 @@ public: EFI_VFR_RETURN_CODE FindQuestion (IN EFI_QUESTION_ID); EFI_VFR_RETURN_CODE FindQuestion (IN CHAR8 *); VOID PrintAllQuestion (IN VOID); VOID ResetInit (IN VOID); =20 - VOID SetCompatibleMode (IN BOOLEAN Mode) { - VfrCompatibleMode =3D Mode; - } - private: CVfrQuestionDB (IN CONST CVfrQuestionDB&); // Prevent copy-c= onstruction CVfrQuestionDB& operator=3D (IN CONST CVfrQuestionDB&); // Prevent assi= gnment }; =20 diff --git a/BaseTools/UserManuals/VfrCompiler_Utility_Man_Page.rtf b/BaseT= ools/UserManuals/VfrCompiler_Utility_Man_Page.rtf index fa0beebb9c..2b056f8f26 100644 --- a/BaseTools/UserManuals/VfrCompiler_Utility_Man_Page.rtf +++ b/BaseTools/UserManuals/VfrCompiler_Utility_Man_Page.rtf @@ -145,14 +145,10 @@ The generated file will be placed into the output dir= ectory sp\hich\af43\dbch\af \par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\= lin0\itap0 {\rtlch\fcs1 \ab\af43\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14166= 490 \hich\af43\dbch\af31505\loch\f43 -n, --no-pre-processing \par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin= 0\lin360\itap0 {\rtlch\fcs1 \af43\afs18 \ltrch\fcs0 \fs18\cf1\insrsid141664= 90 \hich\af43\dbch\af31505\loch\f43 Do not preprocess}{\rtlch\fcs1 \af43\af= s18 \ltrch\fcs0=20 \fs18\cf1\insrsid2570438 \hich\af43\dbch\af31505\loch\f43 t}{\rtlch\fcs1 = \af43\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1204842 \hich\af43\dbch\af31505\lo= ch\f43 he}{\rtlch\fcs1 \af43\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \h= ich\af43\dbch\af31505\loch\f43=20 input vfr file. The input VFR file has been pro\hich\af43\dbch\af31505\lo= ch\f43 cessed. If this option is not specified, the default behavior is sam= e to set this option.=20 \par }{\rtlch\fcs1 \af43\afs18 \ltrch\fcs0 \fs18\cf1\insrsid83254 \hich\af= 43\dbch\af31505\loch\f43 Selecting this option disables preprocessing of VF= R files. }{\rtlch\fcs1 \af43\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2570438=20 -\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\= lin0\itap0 {\rtlch\fcs1 \ab\af43\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14166= 490 \hich\af43\dbch\af31505\loch\f43 -c, --compatible-framework -\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin= 0\lin360\itap0 {\rtlch\fcs1 \af43\afs18 \ltrch\fcs0 \fs18\cf1\insrsid141664= 90 \hich\af43\dbch\af31505\loch\f43 Recognize}{\rtlch\fcs1 \af43\afs18 \ltr= ch\fcs0 \fs18\cf1\insrsid83254=20 -\hich\af43\dbch\af31505\loch\f43 s}{\rtlch\fcs1 \af43\afs18 \ltrch\fcs0 \f= s18\cf1\insrsid14166490 \hich\af43\dbch\af31505\loch\f43 the input VFR fil= e is the framework VFR syntax. If this option is n\hich\af43\dbch\af31505\l= och\f43=20 -ot specified, the UEFI syntax is default }{\rtlch\fcs1 \af43\afs18 \ltrch\= fcs0 \fs18\cf1\insrsid83254 \hich\af43\dbch\af31505\loch\f43 the VFR }{\rtl= ch\fcs1 \af43\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af43\dbch\a= f31505\loch\f43 syntax. \par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\= lin0\itap0 {\rtlch\fcs1 \ab\af43\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14166= 490 \hich\af43\dbch\af31505\loch\f43 -h, --help \par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto= \rin0\lin0\itap0 {\rtlch\fcs1 \af43\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1416= 6490 \hich\af43\dbch\af31505\loch\f43 Print version and usage of this progr= am and exit. \par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\= lin0\itap0\pararsid12931970 {\rtlch\fcs1 \ab\af43\afs18 \ltrch\fcs0 \b\fs18= \insrsid12931970\charrsid6448922 \hich\af43\dbch\af31505\loch\f43 -s, --str= ing-db \par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto= \rin0\lin0\itap0\pararsid12931970 {\rtlch\fcs1 \af43\afs18 \ltrch\fcs0 \fs1= 8\insrsid12931970\charrsid6448922 \hich\af43\dbch\af31505\loch\f43 Input un= i string package file. \par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\= lin0\itap0\pararsid12931970 {\rtlch\fcs1 \ab\af43\afs18 \ltrch\fcs0 \b\fs18= \insrsid12931970\charrsid6448922 \hich\af43\dbch\af31505\loch\f43 -g, --guid --=20 2.18.0.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 (#39720): https://edk2.groups.io/g/devel/message/39720 Mute This Topic: https://groups.io/mt/31378993/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-