1. Set the first framework var store name to “Setup”
authorlgao4 <lgao4@7335b38e-4728-0410-8992-fb3ffe349368>
Fri, 21 Nov 2008 06:10:36 +0000 (06:10 +0000)
committerlgao4 <lgao4@7335b38e-4728-0410-8992-fb3ffe349368>
Fri, 21 Nov 2008 06:10:36 +0000 (06:10 +0000)
 2. Support DEFAULT and MANUFACTURING for framework CheckBox flags value

git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1366 7335b38e-4728-0410-8992-fb3ffe349368

Source/C/VfrCompile/VfrSyntax.g

index 67ce111..a9b1ab6 100644 (file)
@@ -1427,6 +1427,26 @@ checkboxFlagsField[UINT8 & LFlags, UINT8 & HFlags] :
                                                             _PCATCH(_STOU8(N->getText()) == 0 ? VFR_RETURN_SUCCESS : VFR_RETURN_UNSUPPORTED, N->getLine());\r
                                                           }\r
                                                        >>\r
+  | D:"DEFAULT"                                        <<\r
+                                                          if (mCompatibleMode) {\r
+                                                            //\r
+                                                            // set question Default flag\r
+                                                            //\r
+                                                            $LFlags |= 0x01;\r
+                                                          } else {\r
+                                                            _PCATCH (VFR_RETURN_UNSUPPORTED, D);\r
+                                                          }\r
+                                                       >>\r
+  | M:"MANUFACTURING"                                  <<\r
+                                                          if (mCompatibleMode) {\r
+                                                            //\r
+                                                            // set question MFG flag\r
+                                                            //\r
+                                                            $LFlags |= 0x02;\r
+                                                          } else {\r
+                                                            _PCATCH (VFR_RETURN_UNSUPPORTED, M);\r
+                                                          }\r
+                                                       >>\r
   | "CHECKBOX_DEFAULT"                                 << $LFlags |= 0x01; >>\r
   | "CHECKBOX_DEFAULT_MFG"                             << $LFlags |= 0x02; >>\r
   | questionheaderFlagsField[HFlags]\r
@@ -3410,18 +3430,22 @@ EfiVfrParser::_DeclareDefaultFrameworkVarStore (
 {\r
   SVfrVarStorageNode    *pNode;\r
   UINT32                TypeSize;\r
-\r
+  BOOLEAN               FirstNode;\r
+  \r
+  FirstNode = TRUE; \r
   pNode = mCVfrDataStorage.GetBufferVarStoreList();\r
   if (pNode == NULL && mCVfrVarDataTypeDB.mFirstNewDataTypeName != NULL) {\r
     //\r
     // Create the default Buffer Var Store when no VarStore is defined.\r
+    // its name should be "Setup"\r
     //\r
     mCVfrVarDataTypeDB.GetDataTypeSize (mCVfrVarDataTypeDB.mFirstNewDataTypeName, &TypeSize);\r
     CIfrVarStore      VSObj;\r
     VSObj.SetLineNo (LineNo);\r
     VSObj.SetVarStoreId (0x1); //the first and only one Buffer Var Store\r
     VSObj.SetSize (TypeSize);\r
-    VSObj.SetName (mCVfrVarDataTypeDB.mFirstNewDataTypeName);\r
+    //VSObj.SetName (mCVfrVarDataTypeDB.mFirstNewDataTypeName);\r
+    VSObj.SetName ("Setup");\r
     VSObj.SetGuid (&mFormsetGuid);\r
 #ifdef VFREXP_DEBUG\r
     printf ("Create the default VarStoreName is %s\n", mCVfrVarDataTypeDB.mFirstNewDataTypeName);\r
@@ -3430,13 +3454,19 @@ EfiVfrParser::_DeclareDefaultFrameworkVarStore (
     for (; pNode != NULL; pNode = pNode->mNext) {\r
       //\r
       // create the default varstore opcode for not declared varstore\r
+      // the first varstore name should be "Setup"\r
       //\r
       if (!pNode->mAssignedFlag) {\r
         CIfrVarStore      VSObj;\r
         VSObj.SetLineNo (LineNo);\r
         VSObj.SetVarStoreId (pNode->mVarStoreId);\r
         VSObj.SetSize (pNode->mStorageInfo.mDataType->mTotalSize);\r
-        VSObj.SetName (pNode->mVarStoreName);\r
+        if (FirstNode) {\r
+               VSObj.SetName ("Setup");\r
+               FirstNode = FALSE;\r
+        } else {\r
+          VSObj.SetName (pNode->mVarStoreName);\r
+        }\r
         VSObj.SetGuid (&pNode->mGuid);\r
 #ifdef VFREXP_DEBUG\r
         printf ("undefined VarStoreName is %s and Id is 0x%x\n", pNode->mVarStoreName, pNode->mVarStoreId);\r