summaryrefslogtreecommitdiff
path: root/BaseTools/Source/C/VfrCompile/VfrSyntax.g
diff options
context:
space:
mode:
authorEric Dong <eric.dong@intel.com>2014-07-25 21:10:10 +0000
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2014-07-25 21:10:10 +0000
commit05154781676f8f591f4c0846ba6305ab9716c9e6 (patch)
treec31dfe211f3743f75aea1508dd45e05263b1bb34 /BaseTools/Source/C/VfrCompile/VfrSyntax.g
parent15be099aa7ccc1ee4ace69f71eecae38beadfc9d (diff)
downloadedk2-platforms-05154781676f8f591f4c0846ba6305ab9716c9e6.tar.xz
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
Diffstat (limited to 'BaseTools/Source/C/VfrCompile/VfrSyntax.g')
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrSyntax.g81
1 files changed, 74 insertions, 7 deletions
diff --git a/BaseTools/Source/C/VfrCompile/VfrSyntax.g b/BaseTools/Source/C/VfrCompile/VfrSyntax.g
index 4c42aa85c8..9688aad924 100644
--- a/BaseTools/Source/C/VfrCompile/VfrSyntax.g
+++ b/BaseTools/Source/C/VfrCompile/VfrSyntax.g
@@ -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 :