Report warning info if vfr file use the flags used for framework code only.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15684 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Eric Dong 2014-07-25 21:10:10 +00:00 committed by jljusten
parent 15be099aa7
commit 0515478167
3 changed files with 76 additions and 7 deletions

View File

@ -53,6 +53,7 @@ static SVFR_WARNING_HANDLE VFR_WARNING_HANDLE_TABLE [] = {
{ VFR_WARNING_DEFAULT_VALUE_REDEFINED, ": default value re-defined with different value"},
{ VFR_WARNING_STRING_TO_UINT_OVERFLOW, ": String to UINT* Overflow"},
{ VFR_WARNING_ACTION_WITH_TEXT_TWO, ": Action opcode should not have TextTwo part"},
{ VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE, ": Not recommend to use obsoleted framework opcode"},
{ VFR_WARNING_CODEUNDEFINED, ": undefined Warning Code" }
};

View File

@ -51,6 +51,7 @@ typedef enum {
VFR_WARNING_DEFAULT_VALUE_REDEFINED = 0,
VFR_WARNING_STRING_TO_UINT_OVERFLOW,
VFR_WARNING_ACTION_WITH_TEXT_TWO,
VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
VFR_WARNING_CODEUNDEFINED
} EFI_VFR_WARNING_CODE;

View File

@ -1184,9 +1184,35 @@ questionheaderFlagsField[UINT8 & Flags] :
ReadOnlyFlag << $Flags |= 0x01; >>
| InteractiveFlag << $Flags |= 0x04; >>
| ResetRequiredFlag << $Flags |= 0x10; >>
| OptionOnlyFlag << $Flags |= 0x80; >>
| NVAccessFlag
| LateCheckFlag
| O:OptionOnlyFlag <<
if (mCompatibleMode) {
$Flags |= 0x80;
} else {
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()
);
}
>>
| L:LateCheckFlag <<
if (!mCompatibleMode) {
gCVfrErrorHandle.HandleWarning (
VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE,
L->getLine(),
L->getText()
);
}
>>
;
vfrStorageVarId[EFI_VARSTORE_INFO & Info, CHAR8 *&QuestVarIdStr, BOOLEAN CheckFlag = TRUE] :
@ -1617,8 +1643,29 @@ vfrStatementInvalid :
;
flagsField :
Number | InteractiveFlag | ManufacturingFlag | DefaultFlag |
NVAccessFlag | ResetRequiredFlag | LateCheckFlag
Number
| InteractiveFlag
| ManufacturingFlag
| DefaultFlag
| ResetRequiredFlag
| N:NVAccessFlag <<
if (!mCompatibleMode) {
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()
);
}
>>
;
vfrStatementValue :
@ -3042,11 +3089,31 @@ oneofoptionFlagsField [UINT8 & HFlags, UINT8 & LFlags] :
| "OPTION_DEFAULT" << $LFlags |= 0x10; >>
| "OPTION_DEFAULT_MFG" << $LFlags |= 0x20; >>
| InteractiveFlag << $HFlags |= 0x04; >>
| NVAccessFlag << $HFlags |= 0x08; >>
| ResetRequiredFlag << $HFlags |= 0x10; >>
| LateCheckFlag << $HFlags |= 0x20; >>
| ManufacturingFlag << $LFlags |= 0x20; >>
| DefaultFlag << $LFlags |= 0x10; >>
| A:NVAccessFlag <<
if (mCompatibleMode) {
$HFlags |= 0x08;
} else {
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()
);
}
>>
;
vfrStatementLabel :