public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Liming Gao" <liming.gao@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"Bi, Dandan" <dandan.bi@intel.com>
Cc: "Feng, Bob C" <bob.c.feng@intel.com>
Subject: Re: [edk2-devel] [patch 01/11] BaseTools/VfrCompile: Remove framework VFR support
Date: Tue, 7 May 2019 06:00:19 +0000	[thread overview]
Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E443E93@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <20190429021607.11304-2-dandan.bi@intel.com>

Reviewed-by: Liming Gao <liming.gao@intel.com>

>-----Original Message-----
>From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
>Dandan Bi
>Sent: Monday, April 29, 2019 10:16 AM
>To: devel@edk2.groups.io
>Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <liming.gao@intel.com>
>Subject: [edk2-devel] [patch 01/11] BaseTools/VfrCompile: Remove
>framework VFR support
>
>REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1464
>
>Currently there is no usage of framework VFR,
>remove the support from VfrCompile.
>
>Cc: Bob Feng <bob.c.feng@intel.com>
>Cc: Liming Gao <liming.gao@intel.com>
>Signed-off-by: Dandan Bi <dandan.bi@intel.com>
>---
> 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/Source/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
>
>   VfrCompiler main class and main function.
>
>-Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
>+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.<BR>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> **/
>
> #include "stdio.h"
>@@ -72,11 +72,10 @@ CVfrCompiler::OptionInitialization (
>   mOptions.PreprocessorOutputFileName    = NULL;
>   mOptions.VfrBaseFileName               = NULL;
>   mOptions.IncludePaths                  = NULL;
>   mOptions.SkipCPreprocessor             = TRUE;
>   mOptions.CPreprocessorOptions          = NULL;
>-  mOptions.CompatibleMode                = FALSE;
>   mOptions.HasOverrideClassGuid          = FALSE;
>   mOptions.WarningAsError                = FALSE;
>   mOptions.AutoDefault                   = FALSE;
>   mOptions.CheckDefault                  = FALSE;
>   memset (&mOptions.OverrideClassGuid, 0, sizeof (EFI_GUID));
>@@ -140,12 +139,10 @@ CVfrCompiler::OptionInitialization (
>         DebugError (NULL, 0, 1001, "Missing option", "-od - missing C-
>preprocessor argument");
>         goto Fail;
>       }
>
>       AppendCPreprocessorOptions (Argv[Index]);
>-    } else if (stricmp(Argv[Index], "-c") == 0 || stricmp(Argv[Index], "--
>compatible-framework") == 0) {
>-      mOptions.CompatibleMode = TRUE;
>     } else if (stricmp(Argv[Index], "-s") == 0|| stricmp(Argv[Index], "--string-
>db") == 0) {
>       Index++;
>       if ((Index >= Argc) || (Argv[Index][0] == '-')) {
>         DebugError (NULL, 0, 1001, "Missing option", "-s missing input string 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 = fopen (LongFilePath (InFileName), "r")) == NULL) {
>     DebugError (NULL, 0, 0001, "Error opening the input file", "%s", InFileName);
>     goto Fail;
>   }
>
>-  InputInfo.CompatibleMode = mOptions.CompatibleMode;
>   if (mOptions.HasOverrideClassGuid) {
>     InputInfo.OverrideClassGuid = &mOptions.OverrideClassGuid;
>   } else {
>     InputInfo.OverrideClassGuid = NULL;
>   }
>@@ -773,31 +767,10 @@ CVfrCompiler::AdjustBin (
>     //ok
>   } else {
>     DebugError (NULL, 0, 0001, "Error parsing vfr file", " %s.Buffer not
>allocated.", mOptions.VfrFileName);
>   }
>
>-  //
>-  // For UEFI mode, not do OpCode Adjust
>-  //
>-  if (mOptions.CompatibleMode) {
>-    //
>-    // Adjust Opcode to be compatible with framework vfr
>-    //
>-    Status = gCIfrRecordInfoDB.IfrRecordAdjust ();
>-    if (Status != VFR_RETURN_SUCCESS) {
>-      //
>-      // Record List Adjust Failed
>-      //
>-      SET_RUN_STATUS (STATUS_FAILED);
>-      return;
>-    }
>-    //
>-    // Re get the IfrRecord Buffer.
>-    //
>-    gCIfrRecordInfoDB.IfrRecordOutput (gRBuffer);
>-  }
>-
>   return;
> }
>
> VOID
> CVfrCompiler::GenBinary (
>@@ -851,24 +824,20 @@ CVfrCompiler::GenCFile (
>
>   if (!IS_RUN_STATUS(STATUS_GENBINARY)) {
>     goto Fail;
>   }
>
>-  if (!mOptions.CreateIfrPkgFile || mOptions.CompatibleMode) {
>+  if (!mOptions.CreateIfrPkgFile) {
>     if ((pFile = fopen (LongFilePath (mOptions.COutputFileName), "w")) ==
>NULL) {
>       DebugError (NULL, 0, 0001, "Error opening output C file", "%s",
>mOptions.COutputFileName);
>       goto Fail;
>     }
>
>     for (Index = 0; gSourceFileHeader[Index] != NULL; Index++) {
>       fprintf (pFile, "%s\n", gSourceFileHeader[Index]);
>     }
>
>-    if (mOptions.CompatibleMode) {
>-      gCVfrBufferConfig.OutputCFile (pFile, mOptions.VfrBaseFileName);
>-    }
>-
>     if (gCFormPkg.GenCFile (mOptions.VfrBaseFileName, pFile, &gRBuffer) !=
>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
>
>   VfrCompiler internal definitions.
>
>-Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
>+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.<BR>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> **/
>
> #ifndef _VFRCOMPILER_H_
>@@ -45,11 +45,10 @@ typedef struct {
>   CHAR8   *PreprocessorOutputFileName;
>   CHAR8   *VfrBaseFileName;  // name of input VFR file with no path or
>extension
>   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/Source/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
>
>   The definition of CFormPkg's member function
>
>-Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
>+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.<BR>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> **/
>
> #include "stdio.h"
>@@ -442,25 +442,14 @@ CFormPkg::GenCFile (
>
>   if ((Ret = BuildPkgHdr(&PkgHdr)) != VFR_RETURN_SUCCESS) {
>     return Ret;
>   }
>
>-  //
>-  // For framework vfr file, the extension framework header will be added.
>-  //
>-  if (VfrCompatibleMode) {
>-    fprintf (pFile, "  // FRAMEWORK PACKAGE HEADER Length\n");
>-    PkgLength = PkgHdr->Length + sizeof (UINT32) + 2;
>-    _WRITE_PKG_LINE(pFile, BYTES_PRE_LINE, "  ", (CHAR8 *)&PkgLength,
>sizeof (UINT32));
>-    fprintf (pFile, "\n\n  // FRAMEWORK PACKAGE HEADER Type\n");
>-    PkgLength = 3;
>-    _WRITE_PKG_LINE(pFile, BYTES_PRE_LINE, "  ", (CHAR8 *)&PkgLength,
>sizeof (UINT16));
>-  } else {
>-    fprintf (pFile, "  // ARRAY LENGTH\n");
>-    PkgLength = PkgHdr->Length + sizeof (UINT32);
>-    _WRITE_PKG_LINE(pFile, BYTES_PRE_LINE, "  ", (CHAR8 *)&PkgLength,
>sizeof (UINT32));
>-  }
>+
>+  fprintf (pFile, "  // ARRAY LENGTH\n");
>+  PkgLength = PkgHdr->Length + sizeof (UINT32);
>+  _WRITE_PKG_LINE(pFile, BYTES_PRE_LINE, "  ", (CHAR8 *)&PkgLength,
>sizeof (UINT32));
>
>   fprintf (pFile, "\n\n  // PACKAGE HEADER\n");
>   _WRITE_PKG_LINE(pFile, BYTES_PRE_LINE, "  ", (CHAR8 *)PkgHdr, sizeof
>(EFI_HII_PACKAGE_HEADER));
>   PkgLength = sizeof (EFI_HII_PACKAGE_HEADER);
>
>@@ -966,11 +955,11 @@ CFormPkg::DeclarePendingQuestion (
>
>       //
>       // For undefined Efi VarStore type question
>       // Append the extended guided opcode to contain VarName
>       //
>-      if (VarStoreType == EFI_VFR_VARSTORE_EFI || VfrCompatibleMode) {
>+      if (VarStoreType == EFI_VFR_VARSTORE_EFI) {
>         CIfrVarEqName CVNObj (QId, Info.mInfo.mVarName);
>         CVNObj.SetLineNo (LineNo);
>       }
>
>       //
>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
>
>   The definition of CFormPkg's member function
>
>-Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
>+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.<BR>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> **/
>
> #ifndef _EFIIFRCLASS_H_
>@@ -93,11 +93,10 @@ struct SBufferNode {
>   CHAR8              *mBufferFree;
>   struct SBufferNode *mNext;
> };
>
> typedef struct {
>-  BOOLEAN  CompatibleMode;
>   EFI_GUID *OverrideClassGuid;
> } INPUT_INFO_TO_SYNTAX;
>
> 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
>
>-Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
>+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.<BR>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> --*/
>
> #header<<
>@@ -47,11 +47,10 @@ VfrParserStart (
>   IN FILE *File,
>   IN INPUT_INFO_TO_SYNTAX *InputInfo
>   )
> {
>   ParserBlackBox<CVfrDLGLexer, EfiVfrParser, ANTLRToken> VfrParser(File);
>-  VfrParser.parser()->SetCompatibleMode (InputInfo->CompatibleMode);
>   VfrParser.parser()->SetOverrideClassGuid (InputInfo->OverrideClassGuid);
>   return VfrParser.parser()->vfrProgram();
> }
> >>
>
>@@ -673,17 +672,10 @@ vfrFormSetDefinition :
>                                                     <<
>                                                        _DeclareStandardDefaultStorage (GET_LINENO
>(L));
>                                                     >>
>   vfrFormSetList
>   E:EndFormSet                                      <<
>-                                                      if (mCompatibleMode) {
>-                                                        //
>-                                                        // declare all undefined varstore and efivarstore
>-                                                        //
>-                                                        _DeclareDefaultFrameworkVarStore
>(GET_LINENO(E));
>-                                                      }
>-
>                                                       //
>                                                       // Declare undefined Question so that they can be
>used in expression.
>                                                       //
>                                                       if (gCFormPkg.HavePendingUnassigned()) {
>                                                         mParserStatus +=
>gCFormPkg.DeclarePendingQuestion (
>@@ -5047,23 +5039,18 @@ public:
>
>   VOID                _STRCAT (IN OUT CHAR8 **, IN CONST CHAR8 *);
>
>   VOID                _DeclareDefaultLinearVarStore (IN UINT32);
>   VOID                _DeclareStandardDefaultStorage (IN UINT32);
>-  VOID                _DeclareDefaultFrameworkVarStore (IN UINT32);
>
>   VOID                AssignQuestionKey (IN CIfrQuestionHeader &, IN
>ANTLRTokenPtr);
>
>   VOID                ConvertIdExpr         (IN UINT32 &, IN UINT32, IN
>EFI_QUESTION_ID, IN CHAR8 *, IN UINT32);
>   VOID                IdEqValDoSpecial      (IN UINT32 &, IN UINT32, IN
>EFI_QUESTION_ID, IN CHAR8 *, IN UINT32, IN UINT16, IN
>EFI_COMPARE_TYPE);
>   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 *);
>-//
>-// For framework vfr compatibility
>-//
>-  VOID                SetCompatibleMode (IN BOOLEAN);
> >>
> }
>
> <<
> VOID
>@@ -5540,88 +5527,10 @@ EfiVfrParser::_STOR (
>   Ref.DevicePath  = _STOSID (DevicePath, LineNum);
>
>   return Ref;
> }
>
>-//
>-// framework vfr to default declare varstore for each structure
>-//
>-VOID
>-EfiVfrParser::_DeclareDefaultFrameworkVarStore (
>-  IN UINT32 LineNo
>-  )
>-{
>-  SVfrVarStorageNode    *pNode;
>-  UINT32                TypeSize;
>-  BOOLEAN               FirstNode;
>-  CONST CHAR8           VarName[] = "Setup";
>-
>-  FirstNode = TRUE;
>-  pNode = gCVfrDataStorage.GetBufferVarStoreList();
>-  if (pNode == NULL && gCVfrVarDataTypeDB.mFirstNewDataTypeName !=
>NULL) {
>-    //
>-    // Create the default Buffer Var Store when no VarStore is defined.
>-    // its name should be "Setup"
>-    //
>-    gCVfrVarDataTypeDB.GetDataTypeSize
>(gCVfrVarDataTypeDB.mFirstNewDataTypeName, &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 != NULL; pNode = 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 = 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-
>>mVarStoreName, pNode->mVarStoreId);
>-#endif
>-      }
>-    }
>-  }
>-
>-  pNode = gCVfrDataStorage.GetEfiVarStoreList();
>-  for (; pNode != NULL; pNode = 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_BOOTSERVICE_ACCESS attribute
>-      VSEObj.SetGuid (&pNode->mGuid);
>-      VSEObj.SetVarStoreId (pNode->mVarStoreId);
>-      // Generate old efi varstore storage structure for compatible with old
>"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 = OverrideClassGuid;
> }
>
>-//
>-// For framework vfr compatibility
>-//
>-VOID
>-EfiVfrParser::SetCompatibleMode (IN BOOLEAN Mode)
>-{
>-  mCompatibleMode = 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/Source/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
>
>   Vfr common library functions.
>
>-Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
>+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.<BR>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> **/
>
> #include "stdio.h"
>@@ -757,21 +757,10 @@ CVfrVarDataTypeDB::GetFieldOffset (
> {
>   if (Field == NULL) {
>     return VFR_RETURN_FATAL_ERROR;
>   }
>
>-  //
>-  // Framework Vfr file Array Index is from 1.
>-  // But Uefi Vfr file Array Index is from 0.
>-  //
>-  if (VfrCompatibleMode && ArrayIdx != INVALID_ARRAY_INDEX) {
>-    if (ArrayIdx == 0) {
>-      return VFR_RETURN_ERROR_ARRARY_NUM;
>-    }
>-    ArrayIdx = ArrayIdx - 1;
>-  }
>-
>   if ((ArrayIdx != INVALID_ARRAY_INDEX) && ((Field->mArrayNum == 0) ||
>(Field->mArrayNum <= ArrayIdx))) {
>     return VFR_RETURN_ERROR_ARRARY_NUM;
>   }
>
>   //
>@@ -1681,21 +1670,11 @@ CVfrDataStorage::GetFreeVarStoreId (
>   EFI_VFR_VARSTORE_TYPE VarType
>   )
> {
>   UINT32  Index, Mask, Offset;
>
>-  //
>-  // Assign the different ID range for the different type VarStore to support
>Framework Vfr
>-  //
>   Index = 0;
>-  if ((!VfrCompatibleMode) || (VarType == EFI_VFR_VARSTORE_BUFFER)) {
>-    Index = 0;
>-  } else if (VarType == EFI_VFR_VARSTORE_EFI) {
>-    Index = 1;
>-  } else if (VarType == EFI_VFR_VARSTORE_NAME) {
>-    Index = 2;
>-  }
>
>   for (; Index < EFI_FREE_VARSTORE_ID_BITMAP_SIZE; Index++) {
>     if (mFreeVarStoreIdBitMap[Index] != 0xFFFFFFFF) {
>       break;
>     }
>@@ -1913,17 +1892,10 @@ CVfrDataStorage::GetVarStoreByDataType (
>   )
> {
>   SVfrVarStorageNode    *pNode;
>   SVfrVarStorageNode    *MatchNode;
>
>-  //
>-  // Framework VFR uses Data type name as varstore name, so don't need
>check again.
>-  //
>-  if (VfrCompatibleMode) {
>-    return VFR_RETURN_UNDEFINED;
>-  }
>-
>   MatchNode = NULL;
>   for (pNode = mBufferVarStoreList; pNode != NULL; pNode = pNode->mNext)
>{
>     if (strcmp (pNode->mStorageInfo.mDataType->mTypeName,
>DataTypeName) != 0) {
>       continue;
>     }
>@@ -2287,20 +2259,10 @@ CVfrDataStorage::GetNameVarStoreInfo (
>
>   if (mCurrVarStorageNode == NULL) {
>     return VFR_RETURN_GET_NVVARSTORE_ERROR;
>   }
>
>-  //
>-  // Framework Vfr file Index is from 1, but Uefi Vfr file Index is from 0.
>-  //
>-  if (VfrCompatibleMode) {
>-    if (Index == 0) {
>-      return VFR_RETURN_ERROR_ARRARY_NUM;
>-    }
>-    Index --;
>-  }
>-
>   Info->mInfo.mVarName = mCurrVarStorageNode-
>>mStorageInfo.mNameSpace.mNameTable[Index];
>
>   return VFR_RETURN_SUCCESS;
> }
>
>@@ -2859,14 +2821,11 @@ CVfrQuestionDB::RegisterQuestion (
>   }
>
>   if (QuestionId == EFI_QUESTION_ID_INVALID) {
>     QuestionId = GetFreeQuestionId ();
>   } else {
>-    //
>-    // For Framework Vfr, don't check question ID conflict.
>-    //
>-    if (!VfrCompatibleMode && ChekQuestionIdFree (QuestionId) == FALSE) {
>+    if (ChekQuestionIdFree (QuestionId) == FALSE) {
>       delete pNode;
>       return VFR_RETURN_QUESTIONID_REDEFINED;
>     }
>     MarkQuestionIdUsed (QuestionId);
>   }
>@@ -3366,14 +3325,11 @@ CVfrQuestionDB::UpdateQuestionId (
>   if (QId == NewQId) {
>     // don't update
>     return VFR_RETURN_SUCCESS;
>   }
>
>-  //
>-  // For Framework Vfr, don't check question ID conflict.
>-  //
>-  if (!VfrCompatibleMode && ChekQuestionIdFree (NewQId) == FALSE) {
>+  if (ChekQuestionIdFree (NewQId) == FALSE) {
>     return VFR_RETURN_REDEFINED;
>   }
>
>   for (pNode = mQuestionList; pNode != NULL; pNode = pNode->mNext) {
>     if (pNode->mQuestionId == QId) {
>@@ -3955,12 +3911,10 @@ CVfrStringDB::GetUnicodeStringTextSize (
>   }
>
>   return StringSize;
> }
>
>-BOOLEAN  VfrCompatibleMode = FALSE;
>-
> CVfrVarDataTypeDB gCVfrVarDataTypeDB;
> CVfrDefaultStore  gCVfrDefaultStore;
> CVfrDataStorage  gCVfrDataStorage;
>
>
>diff --git a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.h
>b/BaseTools/Source/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
>
>   Vfr common library functions.
>
>-Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
>+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.<BR>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> **/
>
> #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"
>
>-extern BOOLEAN  VfrCompatibleMode;
> static EFI_GUID gEdkiiIfrBitVarGuid = EDKII_IFR_BIT_VARSTORE_GUID;
>
> #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);
>
>-  VOID SetCompatibleMode (IN BOOLEAN Mode) {
>-    VfrCompatibleMode = Mode;
>-  }
>-
> private:
>   CVfrQuestionDB (IN CONST CVfrQuestionDB&);             // Prevent copy-
>construction
>   CVfrQuestionDB& operator= (IN CONST CVfrQuestionDB&);  // Prevent
>assignment
> };
>
>diff --git a/BaseTools/UserManuals/VfrCompiler_Utility_Man_Page.rtf
>b/BaseTools/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
>directory 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\insrsid14166490
>\hich\af43\dbch\af31505\loch\f43 -n, --no-pre-processing
> \par }\pard \ltrpar\ql
>\li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0
>{\rtlch\fcs1 \af43\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490
>\hich\af43\dbch\af31505\loch\f43 Do not preprocess}{\rtlch\fcs1 \af43\afs18
>\ltrch\fcs0
> \fs18\cf1\insrsid2570438 \hich\af43\dbch\af31505\loch\f43  t}{\rtlch\fcs1
>\af43\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1204842
>\hich\af43\dbch\af31505\loch\f43 he}{\rtlch\fcs1 \af43\afs18 \ltrch\fcs0
>\fs18\cf1\insrsid14166490 \hich\af43\dbch\af31505\loch\f43
>  input vfr file. The input VFR file has been
>pro\hich\af43\dbch\af31505\loch\f43 cessed. If this option is not specified,
>the default behavior is same to set this option.
> \par }{\rtlch\fcs1 \af43\afs18 \ltrch\fcs0 \fs18\cf1\insrsid83254
>\hich\af43\dbch\af31505\loch\f43 Selecting this option disables preprocessing
>of VFR files. }{\rtlch\fcs1 \af43\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2570438
>-\par }\pard \ltrpar\ql
>\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1
>\ab\af43\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14166490
>\hich\af43\dbch\af31505\loch\f43 -c, --compatible-framework
>-\par }\pard \ltrpar\ql
>\li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0
>{\rtlch\fcs1 \af43\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490
>\hich\af43\dbch\af31505\loch\f43 Recognize}{\rtlch\fcs1 \af43\afs18
>\ltrch\fcs0 \fs18\cf1\insrsid83254
>-\hich\af43\dbch\af31505\loch\f43 s}{\rtlch\fcs1 \af43\afs18 \ltrch\fcs0
>\fs18\cf1\insrsid14166490 \hich\af43\dbch\af31505\loch\f43  the input VFR
>file is the framework VFR syntax. If this option is
>n\hich\af43\dbch\af31505\loch\f43
>-ot specified, the UEFI syntax is default }{\rtlch\fcs1 \af43\afs18 \ltrch\fcs0
>\fs18\cf1\insrsid83254 \hich\af43\dbch\af31505\loch\f43 the VFR }{\rtlch\fcs1
>\af43\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490
>\hich\af43\dbch\af31505\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\insrsid14166490
>\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\insrsid14166490
>\hich\af43\dbch\af31505\loch\f43 Print version and usage of this program and
>exit.
> \par }\pard \ltrpar\ql
>\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid129319
>70 {\rtlch\fcs1 \ab\af43\afs18 \ltrch\fcs0
>\b\fs18\insrsid12931970\charrsid6448922 \hich\af43\dbch\af31505\loch\f43 -s,
>--string-db
> \par }\pard \ltrpar\ql
>\fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid1
>2931970 {\rtlch\fcs1 \af43\afs18 \ltrch\fcs0
>\fs18\insrsid12931970\charrsid6448922 \hich\af43\dbch\af31505\loch\f43
>Input uni string package file.
> \par }\pard \ltrpar\ql
>\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid129319
>70 {\rtlch\fcs1 \ab\af43\afs18 \ltrch\fcs0
>\b\fs18\insrsid12931970\charrsid6448922 \hich\af43\dbch\af31505\loch\f43 -g,
>--guid
>--
>2.18.0.windows.1
>
>
>


  parent reply	other threads:[~2019-05-07  6:00 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-29  2:15 [patch 00/11] Remove PcdFrameworkCompatibilitySupport Dandan Bi
2019-04-29  2:15 ` [patch 01/11] BaseTools/VfrCompile: Remove framework VFR support Dandan Bi
2019-05-07  5:52   ` [edk2-devel] " Bob Feng
2019-05-07  6:00   ` Liming Gao [this message]
2019-04-29  2:15 ` [patch 02/11] FatPkg/FatPei: Remove PcdFrameworkCompatibilitySupport usage Dandan Bi
2019-05-05  3:25   ` [edk2-devel] " Ni, Ray
2019-04-29  2:15 ` [patch 03/11] IntelFrameworkModulePkg: " Dandan Bi
2019-05-07  5:59   ` Liming Gao
2019-04-29  2:16 ` [patch 04/11] MdeModulePkg/Core: " Dandan Bi
2019-05-06  1:22   ` [edk2-devel] " Wu, Hao A
2019-05-06  2:48     ` Dandan Bi
2019-05-06  2:54       ` Wu, Hao A
2019-05-07  7:08         ` Dandan Bi
2019-05-08  8:23           ` Liming Gao
2019-04-29  2:16 ` [patch 05/11] MdeModulePkg/CdExpress: " Dandan Bi
2019-05-06  1:05   ` Wu, Hao A
2019-04-29  2:16 ` [patch 06/11] MdeModulePkg/Setup: " Dandan Bi
2019-05-07  6:13   ` Dong, Eric
2019-04-29  2:16 ` [patch 07/11] QuarkPlatformPkg: " Dandan Bi
2019-05-07  5:58   ` [edk2-devel] " Liming Gao
2019-04-29  2:16 ` [patch 08/11] SignedCapsulePkg: " Dandan Bi
2019-04-29  2:16 ` [patch 09/11] UefiCpuPkg: " Dandan Bi
2019-04-29 15:15   ` Laszlo Ersek
2019-04-29  2:16 ` [patch 10/11] Vlv2TbltDevicePkg: " Dandan Bi
2019-05-07  8:35   ` Sun, Zailiang
2019-04-29  2:16 ` [patch 11/11] MdeModulePkg: Remove PcdFrameworkCompatibilitySupport Dandan Bi
2019-05-06  1:25   ` Wu, Hao A
     [not found] ` <1599D055711F0B7C.4588@groups.io>
     [not found]   ` <3C0D5C461C9E904E8F62152F6274C0BB40BD01BF@SHSMSX104.ccr.corp.intel.com>
2019-05-07  6:02     ` [edk2-devel] [patch 08/11] SignedCapsulePkg: Remove PcdFrameworkCompatibilitySupport usage Yao, Jiewen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A89E2EF3DFEDB4C8BFDE51014F606A14E443E93@SHSMSX104.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox