public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [patch] BaseTools/VfrCompile: clean Framework Vfr support
@ 2019-05-10  5:44 Dandan Bi
  2019-05-10  7:36 ` [edk2-devel] " Liming Gao
  0 siblings, 1 reply; 2+ messages in thread
From: Dandan Bi @ 2019-05-10  5:44 UTC (permalink / raw)
  To: devel; +Cc: Bob Feng, Liming Gao

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1464

This commit is to do the cleanup which are missing in
previous commit 1b72fd5121b5b31918be0a9a0868a39070d4c8d4
BaseTools/VfrCompile: Remove framework VFR support

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/VfrSyntax.g | 272 +++++-----------------
 1 file changed, 55 insertions(+), 217 deletions(-)

diff --git a/BaseTools/Source/C/VfrCompile/VfrSyntax.g b/BaseTools/Source/C/VfrCompile/VfrSyntax.g
index 24b30e3825..127cb8b2b2 100644
--- a/BaseTools/Source/C/VfrCompile/VfrSyntax.g
+++ b/BaseTools/Source/C/VfrCompile/VfrSyntax.g
@@ -652,16 +652,10 @@ vfrFormSetDefinition :
                                                         break;
                                                       }
 
                                                       SET_LINE_INFO (*FSObj, L);
                                                       FSObj->SetGuid (&Guid);
-                                                      //
-                                                      // for framework vfr to store formset guid used by varstore and efivarstore
-                                                      //
-                                                      if (mCompatibleMode) {
-                                                        memcpy (&mFormsetGuid, &Guid, sizeof (EFI_GUID));
-                                                      }
                                                       FSObj->SetFormSetTitle (_STOSID(S1->getText(), S1->getLine()));
                                                       FSObj->SetHelp (_STOSID(S2->getText(), S2->getLine()));
                                                     >>
   {
     FC:Class "=" classDefinition[C] ","             << {CIfrClass CObj;SET_LINE_INFO (CObj, FC); CObj.SetClass(C);} >>
@@ -1004,16 +998,10 @@ vfrStatementVarStoreLinear :
     | U64:"UINT64" ","                              << TypeName = U64->getText(); LineNum = U64->getLine(); >>
     | D:"EFI_HII_DATE" ","                          << TypeName = D->getText(); LineNum = D->getLine(); >>
     | T:"EFI_HII_TIME" ","                          << TypeName = T->getText(); LineNum = T->getLine(); >>
     | R:"EFI_HII_REF" ","                           << TypeName = R->getText(); LineNum = R->getLine(); >>
   )
-  { Key "=" FID:Number ","                          << // Key is used to assign Varid in Framework VFR but no use in UEFI2.1 VFR
-                                                       if (mCompatibleMode) {
-                                                         VarStoreId = _STOU16(FID->getText(), FID->getLine());
-                                                       }
-                                                    >>
-  }
   {
     VarId "=" ID:Number ","                         <<
                                                        _PCATCH(
                                                          (INTN)(VarStoreId = _STOU16(ID->getText(), ID->getLine())) != 0,
                                                          (INTN)TRUE,
@@ -1023,15 +1011,12 @@ vfrStatementVarStoreLinear :
                                                     >>
   }
   Name "=" SN:StringIdentifier ","
   Uuid "=" guidDefinition[Guid]
                                                     <<
-                                                       if (mCompatibleMode) {
-                                                         StoreName = TypeName;
-                                                       } else {
-                                                         StoreName = SN->getText();
-                                                       }
+
+                                                       StoreName = SN->getText();
                                                        _PCATCH(gCVfrDataStorage.DeclareBufferVarStore (
                                                                                 StoreName,
                                                                                 &Guid,
                                                                                 &gCVfrVarDataTypeDB,
                                                                                 TypeName,
@@ -1241,13 +1226,10 @@ vfrStatementDisableIfFormSet :
   ;
 
 vfrStatementSuppressIfFormSet :
   << CIfrSuppressIf SIObj;>>
   L:SuppressIf                                         <<
-                                                           if (mCompatibleMode) {
-                                                             _PCATCH (VFR_RETURN_UNSUPPORTED, L);
-                                                           }
                                                            SIObj.SetLineNo(L->getLine()); 
                                                        >>
   { FLAGS "=" flagsField ( "\|" flagsField )* "," }
   vfrStatementExpression[0] ";"
   vfrFormSetList
@@ -1338,38 +1320,30 @@ vfrQuestionHeader[CIfrQuestionHeader & QHObj, EFI_QUESION_TYPE QType = QUESTION_
 questionheaderFlagsField[UINT8 & Flags] :
     ReadOnlyFlag                                    << $Flags |= 0x01; >>
   | InteractiveFlag                                 << $Flags |= 0x04; >>
   | ResetRequiredFlag                               << $Flags |= 0x10; >>
   | ReconnectRequiredFlag                           << $Flags |= 0x40; >>
-  | O:OptionOnlyFlag                                << 
-                                                       if (mCompatibleMode) {
-                                                         $Flags |= 0x80;
-                                                       } else {
-                                                         gCVfrErrorHandle.HandleWarning (
-                                                            VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
-                                                            O->getLine(),
-                                                            O->getText()
-                                                            );
-                                                       }
+  | O:OptionOnlyFlag                                <<
+                                                       gCVfrErrorHandle.HandleWarning (
+                                                          VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
+                                                          O->getLine(),
+                                                          O->getText()
+                                                          );
                                                     >>
-  | N:NVAccessFlag                                  << 
-                                                       if (!mCompatibleMode) {
-                                                          gCVfrErrorHandle.HandleWarning (
-                                                            VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
-                                                            N->getLine(),
-                                                            N->getText()
-                                                            );
-                                                       }
+  | N:NVAccessFlag                                  <<
+                                                        gCVfrErrorHandle.HandleWarning (
+                                                          VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
+                                                          N->getLine(),
+                                                          N->getText()
+                                                          );
                                                     >>
-  | L:LateCheckFlag                                 << 
-                                                       if (!mCompatibleMode) {
-                                                          gCVfrErrorHandle.HandleWarning (
-                                                            VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
-                                                            L->getLine(),
-                                                            L->getText()
-                                                            );
-                                                       }
+  | L:LateCheckFlag                                 <<
+                                                        gCVfrErrorHandle.HandleWarning (
+                                                          VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
+                                                          L->getLine(),
+                                                          L->getText()
+                                                          );
                                                     >>
   ;
 
 vfrStorageVarId[EFI_VARSTORE_INFO & Info, CHAR8 *&QuestVarIdStr, BOOLEAN CheckFlag = TRUE] :
   <<
@@ -1392,22 +1366,10 @@ vfrStorageVarId[EFI_VARSTORE_INFO & Info, CHAR8 *&QuestVarIdStr, BOOLEAN CheckFl
                                                        _STRCAT(&VarIdStr, I1->getText());
                                                        _STRCAT(&VarIdStr, "]");
                                                     >>
                                                     <<
                                                        VfrReturnCode = gCVfrDataStorage.GetVarStoreId(SName, &$Info.mVarStoreId);
-                                                       if (mCompatibleMode && VfrReturnCode == VFR_RETURN_UNDEFINED) {
-                                                          gCVfrDataStorage.DeclareBufferVarStore (
-                                                                             SName,
-                                                                             &mFormsetGuid,
-                                                                             &gCVfrVarDataTypeDB,
-                                                                             SName,
-                                                                             EFI_VARSTORE_ID_INVALID,
-                                                                             FALSE,
-                                                                             FALSE
-                                                                             );
-                                                          VfrReturnCode = gCVfrDataStorage.GetVarStoreId(SName, &$Info.mVarStoreId, &mFormsetGuid);
-                                                       }
                                                        if (CheckFlag || VfrReturnCode == VFR_RETURN_SUCCESS) {
                                                          _PCATCH(VfrReturnCode, SN1);
                                                          _PCATCH(gCVfrDataStorage.GetNameVarStoreInfo (&$Info, Idx), SN1);
                                                        }
 
@@ -1417,21 +1379,10 @@ vfrStorageVarId[EFI_VARSTORE_INFO & Info, CHAR8 *&QuestVarIdStr, BOOLEAN CheckFl
   |
   (
     SN2:StringIdentifier                            << SName = SN2->getText(); _STRCAT(&VarIdStr, SName); >>
                                                     <<
                                                        VfrReturnCode = gCVfrDataStorage.GetVarStoreId(SName, &$Info.mVarStoreId);
-                                                       if (mCompatibleMode && VfrReturnCode == VFR_RETURN_UNDEFINED) {
-                                                          gCVfrDataStorage.DeclareBufferVarStore (
-                                                                             SName,
-                                                                             &mFormsetGuid,
-                                                                             &gCVfrVarDataTypeDB,
-                                                                             SName,
-                                                                             EFI_VARSTORE_ID_INVALID,
-                                                                             FALSE
-                                                                             );
-                                                          VfrReturnCode = gCVfrDataStorage.GetVarStoreId(SName, &$Info.mVarStoreId, &mFormsetGuid);
-                                                       }
                                                        if (CheckFlag || VfrReturnCode == VFR_RETURN_SUCCESS) {
                                                          _PCATCH(VfrReturnCode, SN2);
                                                          VarStoreType = gCVfrDataStorage.GetVarStoreType ($Info.mVarStoreId);
                                                          if (VarStoreType == EFI_VFR_VARSTORE_BUFFER || VarStoreType == EFI_VFR_VARSTORE_BUFFER_BITS) {
                                                            _PCATCH(gCVfrDataStorage.GetBufferVarStoreDataTypeName(Info.mVarStoreId, &TName), SN2);
@@ -1449,11 +1400,10 @@ vfrStorageVarId[EFI_VARSTORE_INFO & Info, CHAR8 *&QuestVarIdStr, BOOLEAN CheckFl
                                                     >>
       SF:StringIdentifier                           << _STRCAT(&VarIdStr, SF->getText()); _STRCAT(&VarStr, SF->getText()); >>
       {
         OpenBracket I2:Number CloseBracket          <<
                                                        Idx = _STOU32(I2->getText(), I2->getLine());
-                                                       if (mCompatibleMode) Idx --;
                                                        if (Idx > 0) {
                                                          //
                                                          // Idx == 0, [0] can be ignored.
                                                          // Array[0] is same to Array for unify the varid name to cover [0]
                                                          //
@@ -1531,11 +1481,10 @@ vfrQuestionDataFieldName [EFI_QUESTION_ID &QId, UINT32 &Mask, CHAR8 *&VarIdStr,
                                                     >>
       SF:StringIdentifier                           << _STRCAT (&VarIdStr, SF->getText()); >>
       {
         OpenBracket I2:Number CloseBracket          <<
                                                        Idx = _STOU32(I2->getText(), I2->getLine());
-                                                       if (mCompatibleMode) Idx --;
                                                        if (Idx > 0) {
                                                          //
                                                          // Idx == 0, [0] can be ignored.
                                                          // Array[0] is same to Array
                                                          //
@@ -1739,25 +1688,10 @@ vfrFormDefinition :
     vfrStatementExtension                    |
     vfrStatementModal                        |
     vfrStatementRefreshEvent ";"
   )*
   E:EndForm                                         <<
-                                                      if (mCompatibleMode) {
-                                                        //
-                                                        // Add Label for Framework Vfr
-                                                        //
-                                                        CIfrLabel LObj1;
-                                                        LObj1.SetLineNo(E->getLine());
-                                                        LObj1.SetNumber (0xffff);  //add end label for UEFI, label number hardcode 0xffff
-                                                        CIfrLabel LObj2;
-                                                        LObj2.SetLineNo(E->getLine());
-                                                        LObj2.SetNumber (0x0);     //add dummy label for UEFI, label number hardcode 0x0
-                                                        CIfrLabel LObj3;
-                                                        LObj3.SetLineNo(E->getLine());
-                                                        LObj3.SetNumber (0xffff);  //add end label for UEFI, label number hardcode 0xffff
-                                                      }
-
                                                       {CIfrEnd EObj; EObj.SetLineNo (E->getLine()); mLastFormEndAddr = EObj.GetObjBinAddr<CHAR8>(); gAdjustOpcodeOffset = EObj.GetObjBinOffset ();}
                                                     >>
   ";"
   ;
 
@@ -1999,17 +1933,15 @@ vfrStatementConditionalNew :
   vfrStatementGrayOutIfStatNew   |
   vfrStatementInconsistentIfStat   //to be compatible for framework
   ;
 
 vfrStatementSuppressIfStat :
-  <<mCompatibleMode>>? vfrStatementSuppressIfStatOld
-  | vfrStatementSuppressIfStatNew
+  vfrStatementSuppressIfStatNew
   ;
 
 vfrStatementGrayOutIfStat :
-  <<mCompatibleMode>>? vfrStatementGrayOutIfStatOld
-  | vfrStatementGrayOutIfStatNew
+  vfrStatementGrayOutIfStatNew
   ;
 
 vfrStatementInvalid :
   (
     vfrStatementInvalidHidden          |
@@ -2024,27 +1956,23 @@ flagsField :
   | InteractiveFlag 
   | ManufacturingFlag 
   | DefaultFlag 
   | ResetRequiredFlag 
   | ReconnectRequiredFlag
-  | N:NVAccessFlag                                     << 
-                                                          if (!mCompatibleMode) {
-                                                            gCVfrErrorHandle.HandleWarning (
-                                                              VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
-                                                              N->getLine(),
-                                                              N->getText()
-                                                              );
-                                                          }
+  | N:NVAccessFlag                                     <<
+                                                          gCVfrErrorHandle.HandleWarning (
+                                                            VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
+                                                            N->getLine(),
+                                                            N->getText()
+                                                            );
                                                        >>
-  | L:LateCheckFlag                                    << 
-                                                          if (!mCompatibleMode) {
-                                                            gCVfrErrorHandle.HandleWarning (
-                                                              VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
-                                                              L->getLine(),
-                                                              L->getText()
-                                                              );
-                                                          }
+  | L:LateCheckFlag                                    <<
+                                                          gCVfrErrorHandle.HandleWarning (
+                                                            VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
+                                                            L->getLine(),
+                                                            L->getText()
+                                                            );
                                                        >> 
   ;
 
 vfrStatementValue :
   << CIfrValue VObj; >>
@@ -2455,38 +2383,17 @@ vfrCheckBoxFlags [CIfrCheckBox & CBObj, UINT32 LineNum] :
                                                        << _PCATCH(CBObj.SetFlags (HFlags, LFlags), LineNum); >>
   ;
 
 checkboxFlagsField[UINT8 & LFlags, UINT8 & HFlags] :
     N:Number                                           <<
-                                                          if (mCompatibleMode) {
-                                                            //
-                                                            // set question flag
-                                                            //
-                                                            $LFlags |= _STOU8(N->getText(), N->getLine());
-                                                          } else {
-                                                            _PCATCH(_STOU8(N->getText(), N->getLine()) == 0 ? VFR_RETURN_SUCCESS : VFR_RETURN_UNSUPPORTED, N->getLine());
-                                                          }
+                                                          _PCATCH(_STOU8(N->getText(), N->getLine()) == 0 ? VFR_RETURN_SUCCESS : VFR_RETURN_UNSUPPORTED, N->getLine());
                                                        >>
   | D:"DEFAULT"                                        <<
-                                                          if (mCompatibleMode) {
-                                                            //
-                                                            // set question Default flag
-                                                            //
-                                                            $LFlags |= 0x01;
-                                                          } else {
-                                                            _PCATCH (VFR_RETURN_UNSUPPORTED, D);
-                                                          }
+                                                          _PCATCH (VFR_RETURN_UNSUPPORTED, D);
                                                        >>
   | M:"MANUFACTURING"                                  <<
-                                                          if (mCompatibleMode) {
-                                                            //
-                                                            // set question MFG flag
-                                                            //
-                                                            $LFlags |= 0x02;
-                                                          } else {
-                                                            _PCATCH (VFR_RETURN_UNSUPPORTED, M);
-                                                          }
+                                                          _PCATCH (VFR_RETURN_UNSUPPORTED, M);
                                                        >>
   | "CHECKBOX_DEFAULT"                                 << $LFlags |= 0x01; >>
   | "CHECKBOX_DEFAULT_MFG"                             << $LFlags |= 0x02; >>
   | questionheaderFlagsField[HFlags]
   ;
@@ -3502,13 +3409,11 @@ vfrStatementDisableIfStat :
   ;
 
 vfrStatementInconsistentIfStat :
   << CIfrInconsistentIf IIObj; >>
   L:InconsistentIf                                     <<
-                                                          if (!mCompatibleMode) {
-                                                            _PCATCH (VFR_RETURN_UNSUPPORTED, L);
-                                                          }
+                                                          _PCATCH (VFR_RETURN_UNSUPPORTED, L);
                                                           IIObj.SetLineNo(L->getLine());
                                                        >>
   Prompt "=" "STRING_TOKEN" "\(" S:Number "\)" ","     << IIObj.SetError (_STOSID(S->getText(), S->getLine())); >>
   { FLAGS "=" flagsField ( "\|" flagsField )* "," }
   vfrStatementExpression[0]
@@ -3553,44 +3458,10 @@ vfrStatementGrayOutIfStatNew :
   ";"
   ( vfrStatementStatList )*
   E: EndIf ";"                                       << CRT_END_OP (E); >>
   ;
 
-vfrStatementSuppressIfStatOld :
-  <<
-    CIfrSuppressIf SIObj;
-    BOOLEAN        GrayOutExist = FALSE;
-  >>
-  L:SuppressIf                                       << SIObj.SetLineNo(L->getLine()); >>
-  { FLAGS "=" flagsField ( "\|" flagsField )* "," }
-  vfrStatementExpression[0]
-  ";"
-  {
-    vfrStatementsuppressIfGrayOutIf
-                                                     << GrayOutExist = TRUE; >>
-  }
-  ( vfrStatementStatListOld )*
-  E: EndIf ";"                                       << if (GrayOutExist) CRT_END_OP (E); CRT_END_OP (E);>>
-  ;
-
-vfrStatementGrayOutIfStatOld :
-  <<
-    CIfrGrayOutIf  GOIObj;
-    BOOLEAN        SuppressExist = FALSE;
-  >>
-  L:GrayOutIf                                          << GOIObj.SetLineNo(L->getLine()); >>
-  { FLAGS "=" flagsField ( "\|" flagsField )* "," }
-  vfrStatementExpression[0]
-  ";"
-  {
-    vfrStatementgrayoutIfSuppressIf
-                                                       << SuppressExist = TRUE; >>
-  }
-  ( vfrStatementStatListOld )*
-  E: EndIf ";"                                         << if (SuppressExist) CRT_END_OP (E); CRT_END_OP (E); >>
-  ;
-
 vfrImageTag :
   << CIfrImage IObj; >>
   L:Image "=" "IMAGE_TOKEN" "\(" S1:Number "\)"        << IObj.SetImageId (_STOSID(S1->getText(), S1->getLine())); IObj.SetLineNo(L->getLine()); >>
   ;
 
@@ -3859,13 +3730,11 @@ vfrStatementOneOfOption :
                                                             }
                                                           }
                                                        >>
   {
     "," Key "=" KN:Number                              <<
-                                                         if (!mCompatibleMode) {
-                                                           _PCATCH (VFR_RETURN_UNSUPPORTED, KN);
-                                                         }
+                                                         _PCATCH (VFR_RETURN_UNSUPPORTED, KN);
                                                          //
                                                          // Guid Option Key
                                                          //
                                                          CIfrOptionKey IfrOptionKey (
                                                                          gCurrentQuestion->QUESTION_ID(),
@@ -3898,46 +3767,29 @@ oneofoptionFlagsField [UINT8 & HFlags, UINT8 & LFlags] :
   | InteractiveFlag                                    << $HFlags |= 0x04; >>
   | ResetRequiredFlag                                  << $HFlags |= 0x10; >>
   | ReconnectRequiredFlag                              << $HFlags |= 0x40; >>
   | ManufacturingFlag                                  << $LFlags |= 0x20; >>
   | DefaultFlag                                        << $LFlags |= 0x10; >>
-  | A:NVAccessFlag                                     << 
-                                                          if (mCompatibleMode) {
-                                                            $HFlags |= 0x08;
-                                                          } else {
-                                                            gCVfrErrorHandle.HandleWarning (
-                                                              VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
-                                                              A->getLine(),
-                                                              A->getText()
-                                                              );
-                                                          }
+  | A:NVAccessFlag                                     <<
+                                                          gCVfrErrorHandle.HandleWarning (
+                                                            VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
+                                                            A->getLine(),
+                                                            A->getText()
+                                                            );
                                                        >>
-  | L:LateCheckFlag                                    << 
-                                                          if (mCompatibleMode) {
-                                                            $HFlags |= 0x20;
-                                                          } else {
-                                                            gCVfrErrorHandle.HandleWarning (
-                                                              VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
-                                                              L->getLine(),
-                                                              L->getText()
-                                                              );
-                                                          }
+  | L:LateCheckFlag                                    <<
+                                                          gCVfrErrorHandle.HandleWarning (
+                                                            VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
+                                                            L->getLine(),
+                                                            L->getText()
+                                                            );
                                                        >>
   ;
 
 vfrStatementLabel :
   L:Label
   N:Number                                             <<
-                                                          if (mCompatibleMode) {
-                                                            //
-                                                            // Add end Label for Framework Vfr
-                                                            //
-                                                            CIfrLabel LObj1;
-                                                            LObj1.SetLineNo(L->getLine());
-                                                            LObj1.SetNumber (0xffff);  //add end label for UEFI, label number hardcode 0xffff
-                                                          }
-
                                                           {
                                                             CIfrLabel LObj2;
                                                             LObj2.SetLineNo(L->getLine());
                                                             LObj2.SetNumber (_STOU16(N->getText(), N->getLine()));
                                                           }
@@ -3970,13 +3822,11 @@ vfrStatementBanner :
 //
 // keep some syntax for compatibility but not generate any IFR object
 //
 vfrStatementInvalidHidden :
   L:Hidden               <<
-                            if (!mCompatibleMode) {
-                              _PCATCH (VFR_RETURN_UNSUPPORTED, L);
-                            }
+                            _PCATCH (VFR_RETURN_UNSUPPORTED, L);
                          >>
   Value "=" Number ","
   Key "=" Number ";"
   ;
 
@@ -3989,13 +3839,11 @@ vfrStatementInvalidInconsistentIf :
   ";"
   ;
 
 vfrStatementInvalidInventory :
   L:Inventory                                      <<
-                                                      if (!mCompatibleMode) {
-                                                        _PCATCH (VFR_RETURN_UNSUPPORTED, L);
-                                                      }
+                                                      _PCATCH (VFR_RETURN_UNSUPPORTED, L);
                                                    >>
   Help "=" "STRING_TOKEN" "\(" Number "\)" ","
   Text "=" "STRING_TOKEN" "\(" Number "\)" ","
   {
     Text  "=" "STRING_TOKEN" "\(" Number "\)"
@@ -4004,19 +3852,15 @@ vfrStatementInvalidInventory :
   ;
 
 vfrStatementInvalidSaveRestoreDefaults :
   (
    L:Save                                          <<
-                                                      if (!mCompatibleMode) {
-                                                        _PCATCH (VFR_RETURN_UNSUPPORTED, L);
-                                                      }
+                                                      _PCATCH (VFR_RETURN_UNSUPPORTED, L);
                                                    >>
   |
    K:Restore                                       <<
-                                                      if (!mCompatibleMode) {
-                                                        _PCATCH (VFR_RETURN_UNSUPPORTED, K);
-                                                      }
+                                                      _PCATCH (VFR_RETURN_UNSUPPORTED, K);
                                                    >>
   )
   Defaults ","
   FormId "=" Number  ","
   Prompt "=" "STRING_TOKEN" "\(" Number "\)" ","
@@ -4317,13 +4161,11 @@ vareqvalExp [UINT32 & RootLevel, UINT32 & ExpOpCount] :
      UINT32          LineNo;
      EFI_VFR_RETURN_CODE   VfrReturnCode = VFR_RETURN_SUCCESS;
      EFI_VARSTORE_ID       VarStoreId   = EFI_VARSTORE_ID_INVALID;
   >>
   L:VarEqVal                                          <<
-                                                        if (!mCompatibleMode) {
                                                           _PCATCH (VFR_RETURN_UNSUPPORTED, L);
-                                                        }
                                                       >>
   VK:Var
   OpenParen
   VN:Number                                           <<
                                                           VarIdStr = NULL; _STRCAT(&VarIdStr, VK->getText()); _STRCAT(&VarIdStr, VN->getText());
@@ -4996,14 +4838,10 @@ private:
 // Whether the question already has default value.
 //
   UINT16              mUsedDefaultArray[EFI_IFR_MAX_DEFAULT_TYPE];
   UINT16              mUsedDefaultCount;
 
-//
-// For framework vfr compatibility
-//
-  BOOLEAN             mCompatibleMode;
   EFI_GUID            mFormsetGuid;
 
   VOID                _CRT_OP (IN BOOLEAN);
 
   VOID                _SAVE_CURRQEST_VARINFO (IN EFI_VARSTORE_INFO &);
-- 
2.18.0.windows.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [edk2-devel] [patch] BaseTools/VfrCompile: clean Framework Vfr support
  2019-05-10  5:44 [patch] BaseTools/VfrCompile: clean Framework Vfr support Dandan Bi
@ 2019-05-10  7:36 ` Liming Gao
  0 siblings, 0 replies; 2+ messages in thread
From: Liming Gao @ 2019-05-10  7:36 UTC (permalink / raw)
  To: devel@edk2.groups.io, Bi, Dandan; +Cc: Feng, Bob C

This change is good. 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: Friday, May 10, 2019 1:44 PM
>To: devel@edk2.groups.io
>Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <liming.gao@intel.com>
>Subject: [edk2-devel] [patch] BaseTools/VfrCompile: clean Framework Vfr
>support
>
>REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1464
>
>This commit is to do the cleanup which are missing in
>previous commit 1b72fd5121b5b31918be0a9a0868a39070d4c8d4
>BaseTools/VfrCompile: Remove framework VFR support
>
>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/VfrSyntax.g | 272 +++++-----------------
> 1 file changed, 55 insertions(+), 217 deletions(-)
>
>diff --git a/BaseTools/Source/C/VfrCompile/VfrSyntax.g
>b/BaseTools/Source/C/VfrCompile/VfrSyntax.g
>index 24b30e3825..127cb8b2b2 100644
>--- a/BaseTools/Source/C/VfrCompile/VfrSyntax.g
>+++ b/BaseTools/Source/C/VfrCompile/VfrSyntax.g
>@@ -652,16 +652,10 @@ vfrFormSetDefinition :
>                                                         break;
>                                                       }
>
>                                                       SET_LINE_INFO (*FSObj, L);
>                                                       FSObj->SetGuid (&Guid);
>-                                                      //
>-                                                      // for framework vfr to store formset guid used by
>varstore and efivarstore
>-                                                      //
>-                                                      if (mCompatibleMode) {
>-                                                        memcpy (&mFormsetGuid, &Guid, sizeof
>(EFI_GUID));
>-                                                      }
>                                                       FSObj->SetFormSetTitle (_STOSID(S1->getText(),
>S1->getLine()));
>                                                       FSObj->SetHelp (_STOSID(S2->getText(), S2-
>>getLine()));
>                                                     >>
>   {
>     FC:Class "=" classDefinition[C] ","             << {CIfrClass CObj;SET_LINE_INFO
>(CObj, FC); CObj.SetClass(C);} >>
>@@ -1004,16 +998,10 @@ vfrStatementVarStoreLinear :
>     | U64:"UINT64" ","                              << TypeName = U64->getText(); LineNum
>= U64->getLine(); >>
>     | D:"EFI_HII_DATE" ","                          << TypeName = D->getText(); LineNum
>= D->getLine(); >>
>     | T:"EFI_HII_TIME" ","                          << TypeName = T->getText(); LineNum
>= T->getLine(); >>
>     | R:"EFI_HII_REF" ","                           << TypeName = R->getText(); LineNum =
>R->getLine(); >>
>   )
>-  { Key "=" FID:Number ","                          << // Key is used to assign Varid in
>Framework VFR but no use in UEFI2.1 VFR
>-                                                       if (mCompatibleMode) {
>-                                                         VarStoreId = _STOU16(FID->getText(), FID-
>>getLine());
>-                                                       }
>-                                                    >>
>-  }
>   {
>     VarId "=" ID:Number ","                         <<
>                                                        _PCATCH(
>                                                          (INTN)(VarStoreId = _STOU16(ID->getText(), ID-
>>getLine())) != 0,
>                                                          (INTN)TRUE,
>@@ -1023,15 +1011,12 @@ vfrStatementVarStoreLinear :
>                                                     >>
>   }
>   Name "=" SN:StringIdentifier ","
>   Uuid "=" guidDefinition[Guid]
>                                                     <<
>-                                                       if (mCompatibleMode) {
>-                                                         StoreName = TypeName;
>-                                                       } else {
>-                                                         StoreName = SN->getText();
>-                                                       }
>+
>+                                                       StoreName = SN->getText();
>
>_PCATCH(gCVfrDataStorage.DeclareBufferVarStore (
>                                                                                 StoreName,
>                                                                                 &Guid,
>                                                                                 &gCVfrVarDataTypeDB,
>                                                                                 TypeName,
>@@ -1241,13 +1226,10 @@ vfrStatementDisableIfFormSet :
>   ;
>
> vfrStatementSuppressIfFormSet :
>   << CIfrSuppressIf SIObj;>>
>   L:SuppressIf                                         <<
>-                                                           if (mCompatibleMode) {
>-                                                             _PCATCH (VFR_RETURN_UNSUPPORTED, L);
>-                                                           }
>                                                            SIObj.SetLineNo(L->getLine());
>                                                        >>
>   { FLAGS "=" flagsField ( "\|" flagsField )* "," }
>   vfrStatementExpression[0] ";"
>   vfrFormSetList
>@@ -1338,38 +1320,30 @@ vfrQuestionHeader[CIfrQuestionHeader & QHObj,
>EFI_QUESION_TYPE QType = QUESTION_
> questionheaderFlagsField[UINT8 & Flags] :
>     ReadOnlyFlag                                    << $Flags |= 0x01; >>
>   | InteractiveFlag                                 << $Flags |= 0x04; >>
>   | ResetRequiredFlag                               << $Flags |= 0x10; >>
>   | ReconnectRequiredFlag                           << $Flags |= 0x40; >>
>-  | O:OptionOnlyFlag                                <<
>-                                                       if (mCompatibleMode) {
>-                                                         $Flags |= 0x80;
>-                                                       } else {
>-                                                         gCVfrErrorHandle.HandleWarning (
>-
>VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
>-                                                            O->getLine(),
>-                                                            O->getText()
>-                                                            );
>-                                                       }
>+  | O:OptionOnlyFlag                                <<
>+                                                       gCVfrErrorHandle.HandleWarning (
>+
>VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
>+                                                          O->getLine(),
>+                                                          O->getText()
>+                                                          );
>                                                     >>
>-  | N:NVAccessFlag                                  <<
>-                                                       if (!mCompatibleMode) {
>-                                                          gCVfrErrorHandle.HandleWarning (
>-
>VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
>-                                                            N->getLine(),
>-                                                            N->getText()
>-                                                            );
>-                                                       }
>+  | N:NVAccessFlag                                  <<
>+                                                        gCVfrErrorHandle.HandleWarning (
>+
>VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
>+                                                          N->getLine(),
>+                                                          N->getText()
>+                                                          );
>                                                     >>
>-  | L:LateCheckFlag                                 <<
>-                                                       if (!mCompatibleMode) {
>-                                                          gCVfrErrorHandle.HandleWarning (
>-
>VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
>-                                                            L->getLine(),
>-                                                            L->getText()
>-                                                            );
>-                                                       }
>+  | L:LateCheckFlag                                 <<
>+                                                        gCVfrErrorHandle.HandleWarning (
>+
>VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
>+                                                          L->getLine(),
>+                                                          L->getText()
>+                                                          );
>                                                     >>
>   ;
>
> vfrStorageVarId[EFI_VARSTORE_INFO & Info, CHAR8 *&QuestVarIdStr,
>BOOLEAN CheckFlag = TRUE] :
>   <<
>@@ -1392,22 +1366,10 @@ vfrStorageVarId[EFI_VARSTORE_INFO & Info,
>CHAR8 *&QuestVarIdStr, BOOLEAN CheckFl
>                                                        _STRCAT(&VarIdStr, I1->getText());
>                                                        _STRCAT(&VarIdStr, "]");
>                                                     >>
>                                                     <<
>                                                        VfrReturnCode =
>gCVfrDataStorage.GetVarStoreId(SName, &$Info.mVarStoreId);
>-                                                       if (mCompatibleMode && VfrReturnCode ==
>VFR_RETURN_UNDEFINED) {
>-                                                          gCVfrDataStorage.DeclareBufferVarStore (
>-                                                                             SName,
>-                                                                             &mFormsetGuid,
>-                                                                             &gCVfrVarDataTypeDB,
>-                                                                             SName,
>-                                                                             EFI_VARSTORE_ID_INVALID,
>-                                                                             FALSE,
>-                                                                             FALSE
>-                                                                             );
>-                                                          VfrReturnCode =
>gCVfrDataStorage.GetVarStoreId(SName, &$Info.mVarStoreId,
>&mFormsetGuid);
>-                                                       }
>                                                        if (CheckFlag || VfrReturnCode ==
>VFR_RETURN_SUCCESS) {
>                                                          _PCATCH(VfrReturnCode, SN1);
>
>_PCATCH(gCVfrDataStorage.GetNameVarStoreInfo (&$Info, Idx), SN1);
>                                                        }
>
>@@ -1417,21 +1379,10 @@ vfrStorageVarId[EFI_VARSTORE_INFO & Info,
>CHAR8 *&QuestVarIdStr, BOOLEAN CheckFl
>   |
>   (
>     SN2:StringIdentifier                            << SName = SN2->getText();
>_STRCAT(&VarIdStr, SName); >>
>                                                     <<
>                                                        VfrReturnCode =
>gCVfrDataStorage.GetVarStoreId(SName, &$Info.mVarStoreId);
>-                                                       if (mCompatibleMode && VfrReturnCode ==
>VFR_RETURN_UNDEFINED) {
>-                                                          gCVfrDataStorage.DeclareBufferVarStore (
>-                                                                             SName,
>-                                                                             &mFormsetGuid,
>-                                                                             &gCVfrVarDataTypeDB,
>-                                                                             SName,
>-                                                                             EFI_VARSTORE_ID_INVALID,
>-                                                                             FALSE
>-                                                                             );
>-                                                          VfrReturnCode =
>gCVfrDataStorage.GetVarStoreId(SName, &$Info.mVarStoreId,
>&mFormsetGuid);
>-                                                       }
>                                                        if (CheckFlag || VfrReturnCode ==
>VFR_RETURN_SUCCESS) {
>                                                          _PCATCH(VfrReturnCode, SN2);
>                                                          VarStoreType =
>gCVfrDataStorage.GetVarStoreType ($Info.mVarStoreId);
>                                                          if (VarStoreType == EFI_VFR_VARSTORE_BUFFER
>|| VarStoreType == EFI_VFR_VARSTORE_BUFFER_BITS) {
>
>_PCATCH(gCVfrDataStorage.GetBufferVarStoreDataTypeName(Info.mVarSto
>reId, &TName), SN2);
>@@ -1449,11 +1400,10 @@ vfrStorageVarId[EFI_VARSTORE_INFO & Info,
>CHAR8 *&QuestVarIdStr, BOOLEAN CheckFl
>                                                     >>
>       SF:StringIdentifier                           << _STRCAT(&VarIdStr, SF->getText());
>_STRCAT(&VarStr, SF->getText()); >>
>       {
>         OpenBracket I2:Number CloseBracket          <<
>                                                        Idx = _STOU32(I2->getText(), I2->getLine());
>-                                                       if (mCompatibleMode) Idx --;
>                                                        if (Idx > 0) {
>                                                          //
>                                                          // Idx == 0, [0] can be ignored.
>                                                          // Array[0] is same to Array for unify the varid
>name to cover [0]
>                                                          //
>@@ -1531,11 +1481,10 @@ vfrQuestionDataFieldName [EFI_QUESTION_ID
>&QId, UINT32 &Mask, CHAR8 *&VarIdStr,
>                                                     >>
>       SF:StringIdentifier                           << _STRCAT (&VarIdStr, SF->getText()); >>
>       {
>         OpenBracket I2:Number CloseBracket          <<
>                                                        Idx = _STOU32(I2->getText(), I2->getLine());
>-                                                       if (mCompatibleMode) Idx --;
>                                                        if (Idx > 0) {
>                                                          //
>                                                          // Idx == 0, [0] can be ignored.
>                                                          // Array[0] is same to Array
>                                                          //
>@@ -1739,25 +1688,10 @@ vfrFormDefinition :
>     vfrStatementExtension                    |
>     vfrStatementModal                        |
>     vfrStatementRefreshEvent ";"
>   )*
>   E:EndForm                                         <<
>-                                                      if (mCompatibleMode) {
>-                                                        //
>-                                                        // Add Label for Framework Vfr
>-                                                        //
>-                                                        CIfrLabel LObj1;
>-                                                        LObj1.SetLineNo(E->getLine());
>-                                                        LObj1.SetNumber (0xffff);  //add end label for
>UEFI, label number hardcode 0xffff
>-                                                        CIfrLabel LObj2;
>-                                                        LObj2.SetLineNo(E->getLine());
>-                                                        LObj2.SetNumber (0x0);     //add dummy label for
>UEFI, label number hardcode 0x0
>-                                                        CIfrLabel LObj3;
>-                                                        LObj3.SetLineNo(E->getLine());
>-                                                        LObj3.SetNumber (0xffff);  //add end label for
>UEFI, label number hardcode 0xffff
>-                                                      }
>-
>                                                       {CIfrEnd EObj; EObj.SetLineNo (E->getLine());
>mLastFormEndAddr = EObj.GetObjBinAddr<CHAR8>(); gAdjustOpcodeOffset
>= EObj.GetObjBinOffset ();}
>                                                     >>
>   ";"
>   ;
>
>@@ -1999,17 +1933,15 @@ vfrStatementConditionalNew :
>   vfrStatementGrayOutIfStatNew   |
>   vfrStatementInconsistentIfStat   //to be compatible for framework
>   ;
>
> vfrStatementSuppressIfStat :
>-  <<mCompatibleMode>>? vfrStatementSuppressIfStatOld
>-  | vfrStatementSuppressIfStatNew
>+  vfrStatementSuppressIfStatNew
>   ;
>
> vfrStatementGrayOutIfStat :
>-  <<mCompatibleMode>>? vfrStatementGrayOutIfStatOld
>-  | vfrStatementGrayOutIfStatNew
>+  vfrStatementGrayOutIfStatNew
>   ;
>
> vfrStatementInvalid :
>   (
>     vfrStatementInvalidHidden          |
>@@ -2024,27 +1956,23 @@ flagsField :
>   | InteractiveFlag
>   | ManufacturingFlag
>   | DefaultFlag
>   | ResetRequiredFlag
>   | ReconnectRequiredFlag
>-  | N:NVAccessFlag                                     <<
>-                                                          if (!mCompatibleMode) {
>-                                                            gCVfrErrorHandle.HandleWarning (
>-
>VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
>-                                                              N->getLine(),
>-                                                              N->getText()
>-                                                              );
>-                                                          }
>+  | N:NVAccessFlag                                     <<
>+                                                          gCVfrErrorHandle.HandleWarning (
>+
>VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
>+                                                            N->getLine(),
>+                                                            N->getText()
>+                                                            );
>                                                        >>
>-  | L:LateCheckFlag                                    <<
>-                                                          if (!mCompatibleMode) {
>-                                                            gCVfrErrorHandle.HandleWarning (
>-
>VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
>-                                                              L->getLine(),
>-                                                              L->getText()
>-                                                              );
>-                                                          }
>+  | L:LateCheckFlag                                    <<
>+                                                          gCVfrErrorHandle.HandleWarning (
>+
>VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
>+                                                            L->getLine(),
>+                                                            L->getText()
>+                                                            );
>                                                        >>
>   ;
>
> vfrStatementValue :
>   << CIfrValue VObj; >>
>@@ -2455,38 +2383,17 @@ vfrCheckBoxFlags [CIfrCheckBox & CBObj, UINT32
>LineNum] :
>                                                        << _PCATCH(CBObj.SetFlags (HFlags, LFlags),
>LineNum); >>
>   ;
>
> checkboxFlagsField[UINT8 & LFlags, UINT8 & HFlags] :
>     N:Number                                           <<
>-                                                          if (mCompatibleMode) {
>-                                                            //
>-                                                            // set question flag
>-                                                            //
>-                                                            $LFlags |= _STOU8(N->getText(), N->getLine());
>-                                                          } else {
>-                                                            _PCATCH(_STOU8(N->getText(), N->getLine())
>== 0 ? VFR_RETURN_SUCCESS : VFR_RETURN_UNSUPPORTED, N->getLine());
>-                                                          }
>+                                                          _PCATCH(_STOU8(N->getText(), N->getLine())
>== 0 ? VFR_RETURN_SUCCESS : VFR_RETURN_UNSUPPORTED, N->getLine());
>                                                        >>
>   | D:"DEFAULT"                                        <<
>-                                                          if (mCompatibleMode) {
>-                                                            //
>-                                                            // set question Default flag
>-                                                            //
>-                                                            $LFlags |= 0x01;
>-                                                          } else {
>-                                                            _PCATCH (VFR_RETURN_UNSUPPORTED, D);
>-                                                          }
>+                                                          _PCATCH (VFR_RETURN_UNSUPPORTED, D);
>                                                        >>
>   | M:"MANUFACTURING"                                  <<
>-                                                          if (mCompatibleMode) {
>-                                                            //
>-                                                            // set question MFG flag
>-                                                            //
>-                                                            $LFlags |= 0x02;
>-                                                          } else {
>-                                                            _PCATCH (VFR_RETURN_UNSUPPORTED, M);
>-                                                          }
>+                                                          _PCATCH (VFR_RETURN_UNSUPPORTED, M);
>                                                        >>
>   | "CHECKBOX_DEFAULT"                                 << $LFlags |= 0x01; >>
>   | "CHECKBOX_DEFAULT_MFG"                             << $LFlags |= 0x02; >>
>   | questionheaderFlagsField[HFlags]
>   ;
>@@ -3502,13 +3409,11 @@ vfrStatementDisableIfStat :
>   ;
>
> vfrStatementInconsistentIfStat :
>   << CIfrInconsistentIf IIObj; >>
>   L:InconsistentIf                                     <<
>-                                                          if (!mCompatibleMode) {
>-                                                            _PCATCH (VFR_RETURN_UNSUPPORTED, L);
>-                                                          }
>+                                                          _PCATCH (VFR_RETURN_UNSUPPORTED, L);
>                                                           IIObj.SetLineNo(L->getLine());
>                                                        >>
>   Prompt "=" "STRING_TOKEN" "\(" S:Number "\)" ","     << IIObj.SetError
>(_STOSID(S->getText(), S->getLine())); >>
>   { FLAGS "=" flagsField ( "\|" flagsField )* "," }
>   vfrStatementExpression[0]
>@@ -3553,44 +3458,10 @@ vfrStatementGrayOutIfStatNew :
>   ";"
>   ( vfrStatementStatList )*
>   E: EndIf ";"                                       << CRT_END_OP (E); >>
>   ;
>
>-vfrStatementSuppressIfStatOld :
>-  <<
>-    CIfrSuppressIf SIObj;
>-    BOOLEAN        GrayOutExist = FALSE;
>-  >>
>-  L:SuppressIf                                       << SIObj.SetLineNo(L->getLine()); >>
>-  { FLAGS "=" flagsField ( "\|" flagsField )* "," }
>-  vfrStatementExpression[0]
>-  ";"
>-  {
>-    vfrStatementsuppressIfGrayOutIf
>-                                                     << GrayOutExist = TRUE; >>
>-  }
>-  ( vfrStatementStatListOld )*
>-  E: EndIf ";"                                       << if (GrayOutExist) CRT_END_OP (E);
>CRT_END_OP (E);>>
>-  ;
>-
>-vfrStatementGrayOutIfStatOld :
>-  <<
>-    CIfrGrayOutIf  GOIObj;
>-    BOOLEAN        SuppressExist = FALSE;
>-  >>
>-  L:GrayOutIf                                          << GOIObj.SetLineNo(L->getLine()); >>
>-  { FLAGS "=" flagsField ( "\|" flagsField )* "," }
>-  vfrStatementExpression[0]
>-  ";"
>-  {
>-    vfrStatementgrayoutIfSuppressIf
>-                                                       << SuppressExist = TRUE; >>
>-  }
>-  ( vfrStatementStatListOld )*
>-  E: EndIf ";"                                         << if (SuppressExist) CRT_END_OP (E);
>CRT_END_OP (E); >>
>-  ;
>-
> vfrImageTag :
>   << CIfrImage IObj; >>
>   L:Image "=" "IMAGE_TOKEN" "\(" S1:Number "\)"        << IObj.SetImageId
>(_STOSID(S1->getText(), S1->getLine())); IObj.SetLineNo(L->getLine()); >>
>   ;
>
>@@ -3859,13 +3730,11 @@ vfrStatementOneOfOption :
>                                                             }
>                                                           }
>                                                        >>
>   {
>     "," Key "=" KN:Number                              <<
>-                                                         if (!mCompatibleMode) {
>-                                                           _PCATCH (VFR_RETURN_UNSUPPORTED, KN);
>-                                                         }
>+                                                         _PCATCH (VFR_RETURN_UNSUPPORTED, KN);
>                                                          //
>                                                          // Guid Option Key
>                                                          //
>                                                          CIfrOptionKey IfrOptionKey (
>                                                                          gCurrentQuestion->QUESTION_ID(),
>@@ -3898,46 +3767,29 @@ oneofoptionFlagsField [UINT8 & HFlags, UINT8 &
>LFlags] :
>   | InteractiveFlag                                    << $HFlags |= 0x04; >>
>   | ResetRequiredFlag                                  << $HFlags |= 0x10; >>
>   | ReconnectRequiredFlag                              << $HFlags |= 0x40; >>
>   | ManufacturingFlag                                  << $LFlags |= 0x20; >>
>   | DefaultFlag                                        << $LFlags |= 0x10; >>
>-  | A:NVAccessFlag                                     <<
>-                                                          if (mCompatibleMode) {
>-                                                            $HFlags |= 0x08;
>-                                                          } else {
>-                                                            gCVfrErrorHandle.HandleWarning (
>-
>VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
>-                                                              A->getLine(),
>-                                                              A->getText()
>-                                                              );
>-                                                          }
>+  | A:NVAccessFlag                                     <<
>+                                                          gCVfrErrorHandle.HandleWarning (
>+
>VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
>+                                                            A->getLine(),
>+                                                            A->getText()
>+                                                            );
>                                                        >>
>-  | L:LateCheckFlag                                    <<
>-                                                          if (mCompatibleMode) {
>-                                                            $HFlags |= 0x20;
>-                                                          } else {
>-                                                            gCVfrErrorHandle.HandleWarning (
>-
>VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
>-                                                              L->getLine(),
>-                                                              L->getText()
>-                                                              );
>-                                                          }
>+  | L:LateCheckFlag                                    <<
>+                                                          gCVfrErrorHandle.HandleWarning (
>+
>VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
>+                                                            L->getLine(),
>+                                                            L->getText()
>+                                                            );
>                                                        >>
>   ;
>
> vfrStatementLabel :
>   L:Label
>   N:Number                                             <<
>-                                                          if (mCompatibleMode) {
>-                                                            //
>-                                                            // Add end Label for Framework Vfr
>-                                                            //
>-                                                            CIfrLabel LObj1;
>-                                                            LObj1.SetLineNo(L->getLine());
>-                                                            LObj1.SetNumber (0xffff);  //add end label for
>UEFI, label number hardcode 0xffff
>-                                                          }
>-
>                                                           {
>                                                             CIfrLabel LObj2;
>                                                             LObj2.SetLineNo(L->getLine());
>                                                             LObj2.SetNumber (_STOU16(N->getText(), N-
>>getLine()));
>                                                           }
>@@ -3970,13 +3822,11 @@ vfrStatementBanner :
> //
> // keep some syntax for compatibility but not generate any IFR object
> //
> vfrStatementInvalidHidden :
>   L:Hidden               <<
>-                            if (!mCompatibleMode) {
>-                              _PCATCH (VFR_RETURN_UNSUPPORTED, L);
>-                            }
>+                            _PCATCH (VFR_RETURN_UNSUPPORTED, L);
>                          >>
>   Value "=" Number ","
>   Key "=" Number ";"
>   ;
>
>@@ -3989,13 +3839,11 @@ vfrStatementInvalidInconsistentIf :
>   ";"
>   ;
>
> vfrStatementInvalidInventory :
>   L:Inventory                                      <<
>-                                                      if (!mCompatibleMode) {
>-                                                        _PCATCH (VFR_RETURN_UNSUPPORTED, L);
>-                                                      }
>+                                                      _PCATCH (VFR_RETURN_UNSUPPORTED, L);
>                                                    >>
>   Help "=" "STRING_TOKEN" "\(" Number "\)" ","
>   Text "=" "STRING_TOKEN" "\(" Number "\)" ","
>   {
>     Text  "=" "STRING_TOKEN" "\(" Number "\)"
>@@ -4004,19 +3852,15 @@ vfrStatementInvalidInventory :
>   ;
>
> vfrStatementInvalidSaveRestoreDefaults :
>   (
>    L:Save                                          <<
>-                                                      if (!mCompatibleMode) {
>-                                                        _PCATCH (VFR_RETURN_UNSUPPORTED, L);
>-                                                      }
>+                                                      _PCATCH (VFR_RETURN_UNSUPPORTED, L);
>                                                    >>
>   |
>    K:Restore                                       <<
>-                                                      if (!mCompatibleMode) {
>-                                                        _PCATCH (VFR_RETURN_UNSUPPORTED, K);
>-                                                      }
>+                                                      _PCATCH (VFR_RETURN_UNSUPPORTED, K);
>                                                    >>
>   )
>   Defaults ","
>   FormId "=" Number  ","
>   Prompt "=" "STRING_TOKEN" "\(" Number "\)" ","
>@@ -4317,13 +4161,11 @@ vareqvalExp [UINT32 & RootLevel, UINT32 &
>ExpOpCount] :
>      UINT32          LineNo;
>      EFI_VFR_RETURN_CODE   VfrReturnCode = VFR_RETURN_SUCCESS;
>      EFI_VARSTORE_ID       VarStoreId   = EFI_VARSTORE_ID_INVALID;
>   >>
>   L:VarEqVal                                          <<
>-                                                        if (!mCompatibleMode) {
>                                                           _PCATCH (VFR_RETURN_UNSUPPORTED, L);
>-                                                        }
>                                                       >>
>   VK:Var
>   OpenParen
>   VN:Number                                           <<
>                                                           VarIdStr = NULL; _STRCAT(&VarIdStr, VK-
>>getText()); _STRCAT(&VarIdStr, VN->getText());
>@@ -4996,14 +4838,10 @@ private:
> // Whether the question already has default value.
> //
>   UINT16              mUsedDefaultArray[EFI_IFR_MAX_DEFAULT_TYPE];
>   UINT16              mUsedDefaultCount;
>
>-//
>-// For framework vfr compatibility
>-//
>-  BOOLEAN             mCompatibleMode;
>   EFI_GUID            mFormsetGuid;
>
>   VOID                _CRT_OP (IN BOOLEAN);
>
>   VOID                _SAVE_CURRQEST_VARINFO (IN EFI_VARSTORE_INFO &);
>--
>2.18.0.windows.1
>
>
>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-10  7:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-10  5:44 [patch] BaseTools/VfrCompile: clean Framework Vfr support Dandan Bi
2019-05-10  7:36 ` [edk2-devel] " Liming Gao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox