From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web09.56050.1638153419725269000 for ; Sun, 28 Nov 2021 18:37:00 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: long1.huang@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10181"; a="296694837" X-IronPort-AV: E=Sophos;i="5.87,271,1631602800"; d="scan'208";a="296694837" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Nov 2021 18:36:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,272,1631602800"; d="scan'208";a="511486990" Received: from unknown (HELO longh.ccr.corp.intel.com) ([10.239.154.78]) by orsmga008.jf.intel.com with ESMTP; 28 Nov 2021 18:36:57 -0800 From: long1.huang@intel.com To: devel@edk2.groups.io Cc: Long1 Huang Subject: [PATCH] BaseTools/VfrCompile: Correct Bit Field Flags for numeric/one of Date: Mon, 29 Nov 2021 10:35:58 +0800 Message-Id: X-Mailer: git-send-email 2.32.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3752 Add Bit mask to numeric/one of opcode to set correctly Flags for Bit Field. VfrSyntax.g: Set "LFlags &=3D EDKII_IFR_DISPLAY_BIT" before "LFlags |=3D (E= DKII_IFR_NUMERIC_SIZE_BIT & (_GET_CURRQEST_VARSIZE()));" VfrFormPkg.h: update "if (LFlags & EFI_IFR_DISPLAY)" with "if (LFlags & EDK= II_IFR_DISPLAY_BIT)" in SetFlagsForBitField() Signed-off-by: Long1 Huang --- BaseTools/Source/C/VfrCompile/VfrFormPkg.h | 2 +- BaseTools/Source/C/VfrCompile/VfrSyntax.g | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) 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;=0D }=0D =0D - if (LFlags & EFI_IFR_DISPLAY) {=0D + if (LFlags & EDKII_IFR_DISPLAY_BIT) {=0D mOneOf->Flags =3D LFlags;=0D } else {=0D mOneOf->Flags =3D LFlags | EDKII_IFR_DISPLAY_UINT_DEC_BIT;=0D 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] : }=0D _PCATCH(NObj.S= etFlags (HFlags, LFlags, IsDisplaySpecified), LineNum);=0D } else if ((_GET= _CURRQEST_VARTINFO().mVarStoreId !=3D EFI_VARSTORE_ID_INVALID) && (_GET_CUR= RQEST_VARTINFO().mIsBitVar)) {=0D + LFlags &=3D ED= KII_IFR_DISPLAY_BIT;=0D LFlags |=3D (E= DKII_IFR_NUMERIC_SIZE_BIT & (_GET_CURRQEST_VARSIZE()));=0D _PCATCH(NObj.S= etFlagsForBitField (HFlags, LFlags, IsDisplaySpecified), LineNum);=0D }=0D @@ -3105,6 +3106,8 @@ vfrOneofFlagsField [CIfrOneOf & OObj, UINT32 LineNum]= : }=0D _PCATCH(OObj.S= etFlags (HFlags, LFlags), LineNum);=0D } else if (_GET_= CURRQEST_VARTINFO().mVarStoreId !=3D EFI_VARSTORE_ID_INVALID) {=0D + LFlags &=3D ED= KII_IFR_DISPLAY_BIT;=0D + LFlags |=3D (E= DKII_IFR_NUMERIC_SIZE_BIT & (_GET_CURRQEST_VARSIZE()));=0D _PCATCH(OObj.S= etFlagsForBitField (HFlags, LFlags), LineNum);=0D }=0D >>=0D --=20 2.32.0.windows.1