diff options
author | Huang, Long1 <long1.huang@intel.com> | 2021-11-30 09:54:55 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-12-09 03:31:26 +0000 |
commit | c82ab4d8c148c4009e0b31d1dd2ea6f7d4aea80d (patch) | |
tree | 9a34142af50b030f20c46cf7fb359ae753bec8bd /BaseTools | |
parent | d25b803e514a11a25de91d4174b289d2ae783338 (diff) | |
download | edk2-c82ab4d8c148c4009e0b31d1dd2ea6f7d4aea80d.tar.gz edk2-c82ab4d8c148c4009e0b31d1dd2ea6f7d4aea80d.tar.bz2 edk2-c82ab4d8c148c4009e0b31d1dd2ea6f7d4aea80d.zip |
BaseTools/VfrCompile: Correct Bit Field Flags for numeric/one of
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3752
Add Bit mask to numeric/one of opcode to set correctly Flags for Bit Field.
VfrSyntax.g: Set "LFlags &= EDKII_IFR_DISPLAY_BIT" before "LFlags |= (EDKII_IFR_NUMERIC_SIZE_BIT & (_GET_CURRQEST_VARSIZE()));"
VfrFormPkg.h: update "if (LFlags & EFI_IFR_DISPLAY)" with "if (LFlags & EDKII_IFR_DISPLAY_BIT)" in SetFlagsForBitField()
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Long1 Huang <long1.huang@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
Diffstat (limited to 'BaseTools')
-rw-r--r-- | BaseTools/Source/C/VfrCompile/VfrFormPkg.h | 2 | ||||
-rw-r--r-- | BaseTools/Source/C/VfrCompile/VfrSyntax.g | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/BaseTools/Source/C/VfrCompile/VfrFormPkg.h b/BaseTools/Source/C/VfrCompile/VfrFormPkg.h index 1cea4f0e25..9ef6f07787 100644 --- a/BaseTools/Source/C/VfrCompile/VfrFormPkg.h +++ b/BaseTools/Source/C/VfrCompile/VfrFormPkg.h @@ -1455,7 +1455,7 @@ public: return Ret;
}
- if (LFlags & EFI_IFR_DISPLAY) {
+ if (LFlags & EDKII_IFR_DISPLAY_BIT) {
mOneOf->Flags = LFlags;
} else {
mOneOf->Flags = LFlags | EDKII_IFR_DISPLAY_UINT_DEC_BIT;
diff --git a/BaseTools/Source/C/VfrCompile/VfrSyntax.g b/BaseTools/Source/C/VfrCompile/VfrSyntax.g index 3f896c6f1a..55fd067f8a 100644 --- a/BaseTools/Source/C/VfrCompile/VfrSyntax.g +++ b/BaseTools/Source/C/VfrCompile/VfrSyntax.g @@ -2930,6 +2930,7 @@ vfrNumericFlags [CIfrNumeric & NObj, UINT32 LineNum] : }
_PCATCH(NObj.SetFlags (HFlags, LFlags, IsDisplaySpecified), LineNum);
} else if ((_GET_CURRQEST_VARTINFO().mVarStoreId != EFI_VARSTORE_ID_INVALID) && (_GET_CURRQEST_VARTINFO().mIsBitVar)) {
+ LFlags &= EDKII_IFR_DISPLAY_BIT;
LFlags |= (EDKII_IFR_NUMERIC_SIZE_BIT & (_GET_CURRQEST_VARSIZE()));
_PCATCH(NObj.SetFlagsForBitField (HFlags, LFlags, IsDisplaySpecified), LineNum);
}
@@ -3105,6 +3106,8 @@ vfrOneofFlagsField [CIfrOneOf & OObj, UINT32 LineNum] : }
_PCATCH(OObj.SetFlags (HFlags, LFlags), LineNum);
} else if (_GET_CURRQEST_VARTINFO().mVarStoreId != EFI_VARSTORE_ID_INVALID) {
+ LFlags &= EDKII_IFR_DISPLAY_BIT;
+ LFlags |= (EDKII_IFR_NUMERIC_SIZE_BIT & (_GET_CURRQEST_VARSIZE()));
_PCATCH(OObj.SetFlagsForBitField (HFlags, LFlags), LineNum);
}
>>
|