diff options
-rw-r--r-- | BaseTools/Source/C/VfrCompile/VfrSyntax.g | 272 |
1 files 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 @@ -654,12 +654,6 @@ vfrFormSetDefinition : 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()));
>>
@@ -1006,12 +1000,6 @@ vfrStatementVarStoreLinear : | 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(
@@ -1025,11 +1013,8 @@ vfrStatementVarStoreLinear : Name "=" SN:StringIdentifier ","
Uuid "=" guidDefinition[Guid]
<<
- if (mCompatibleMode) {
- StoreName = TypeName;
- } else {
- StoreName = SN->getText();
- }
+
+ StoreName = SN->getText();
_PCATCH(gCVfrDataStorage.DeclareBufferVarStore (
StoreName,
&Guid,
@@ -1243,9 +1228,6 @@ vfrStatementDisableIfFormSet : vfrStatementSuppressIfFormSet :
<< CIfrSuppressIf SIObj;>>
L:SuppressIf <<
- if (mCompatibleMode) {
- _PCATCH (VFR_RETURN_UNSUPPORTED, L);
- }
SIObj.SetLineNo(L->getLine());
>>
{ FLAGS "=" flagsField ( "\|" flagsField )* "," }
@@ -1340,34 +1322,26 @@ questionheaderFlagsField[UINT8 & Flags] : | 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()
+ );
>>
;
@@ -1394,18 +1368,6 @@ vfrStorageVarId[EFI_VARSTORE_INFO & Info, CHAR8 *&QuestVarIdStr, BOOLEAN CheckFl >>
<<
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);
@@ -1419,17 +1381,6 @@ 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);
@@ -1451,7 +1402,6 @@ vfrStorageVarId[EFI_VARSTORE_INFO & Info, CHAR8 *&QuestVarIdStr, BOOLEAN CheckFl {
OpenBracket I2:Number CloseBracket <<
Idx = _STOU32(I2->getText(), I2->getLine());
- if (mCompatibleMode) Idx --;
if (Idx > 0) {
//
// Idx == 0, [0] can be ignored.
@@ -1533,7 +1483,6 @@ vfrQuestionDataFieldName [EFI_QUESTION_ID &QId, UINT32 &Mask, CHAR8 *&VarIdStr, {
OpenBracket I2:Number CloseBracket <<
Idx = _STOU32(I2->getText(), I2->getLine());
- if (mCompatibleMode) Idx --;
if (Idx > 0) {
//
// Idx == 0, [0] can be ignored.
@@ -1741,21 +1690,6 @@ vfrFormDefinition : 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 ();}
>>
";"
@@ -2001,13 +1935,11 @@ vfrStatementConditionalNew : ;
vfrStatementSuppressIfStat :
- <<mCompatibleMode>>? vfrStatementSuppressIfStatOld
- | vfrStatementSuppressIfStatNew
+ vfrStatementSuppressIfStatNew
;
vfrStatementGrayOutIfStat :
- <<mCompatibleMode>>? vfrStatementGrayOutIfStatOld
- | vfrStatementGrayOutIfStatNew
+ vfrStatementGrayOutIfStatNew
;
vfrStatementInvalid :
@@ -2026,23 +1958,19 @@ flagsField : | 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()
+ );
>>
;
@@ -2457,34 +2385,13 @@ vfrCheckBoxFlags [CIfrCheckBox & CBObj, UINT32 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; >>
@@ -3504,9 +3411,7 @@ 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())); >>
@@ -3555,40 +3460,6 @@ vfrStatementGrayOutIfStatNew : 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()); >>
@@ -3861,9 +3732,7 @@ vfrStatementOneOfOption : >>
{
"," Key "=" KN:Number <<
- if (!mCompatibleMode) {
- _PCATCH (VFR_RETURN_UNSUPPORTED, KN);
- }
+ _PCATCH (VFR_RETURN_UNSUPPORTED, KN);
//
// Guid Option Key
//
@@ -3900,42 +3769,25 @@ oneofoptionFlagsField [UINT8 & HFlags, UINT8 & LFlags] : | 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());
@@ -3972,9 +3824,7 @@ vfrStatementBanner : //
vfrStatementInvalidHidden :
L:Hidden <<
- if (!mCompatibleMode) {
- _PCATCH (VFR_RETURN_UNSUPPORTED, L);
- }
+ _PCATCH (VFR_RETURN_UNSUPPORTED, L);
>>
Value "=" Number ","
Key "=" Number ";"
@@ -3991,9 +3841,7 @@ vfrStatementInvalidInconsistentIf : vfrStatementInvalidInventory :
L:Inventory <<
- if (!mCompatibleMode) {
- _PCATCH (VFR_RETURN_UNSUPPORTED, L);
- }
+ _PCATCH (VFR_RETURN_UNSUPPORTED, L);
>>
Help "=" "STRING_TOKEN" "\(" Number "\)" ","
Text "=" "STRING_TOKEN" "\(" Number "\)" ","
@@ -4006,15 +3854,11 @@ 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 ","
@@ -4319,9 +4163,7 @@ vareqvalExp [UINT32 & RootLevel, UINT32 & ExpOpCount] : EFI_VARSTORE_ID VarStoreId = EFI_VARSTORE_ID_INVALID;
>>
L:VarEqVal <<
- if (!mCompatibleMode) {
_PCATCH (VFR_RETURN_UNSUPPORTED, L);
- }
>>
VK:Var
OpenParen
@@ -4998,10 +4840,6 @@ private: UINT16 mUsedDefaultArray[EFI_IFR_MAX_DEFAULT_TYPE];
UINT16 mUsedDefaultCount;
-//
-// For framework vfr compatibility
-//
- BOOLEAN mCompatibleMode;
EFI_GUID mFormsetGuid;
VOID _CRT_OP (IN BOOLEAN);
|