Skip to content

Commit

Permalink
BaseTools/VfrCompile: Correct Bit Field Flags for numeric/one of
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Yuwei Chen <[email protected]>
Cc: Dandan Bi <[email protected]>

Signed-off-by: Long1 Huang <[email protected]>
Reviewed-by: Dandan Bi <[email protected]>
  • Loading branch information
long1huang authored and mergify[bot] committed Dec 9, 2021
1 parent d25b803 commit c82ab4d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion BaseTools/Source/C/VfrCompile/VfrFormPkg.h
Original file line number Diff line number Diff line change
Expand Up @@ -1455,7 +1455,7 @@ class CIfrOneOf : public CIfrObj, public CIfrOpHeader, public CIfrQuestionHeader
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;
Expand Down
3 changes: 3 additions & 0 deletions BaseTools/Source/C/VfrCompile/VfrSyntax.g
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
>>
Expand Down

0 comments on commit c82ab4d

Please sign in to comment.