public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: long1.huang@intel.com
To: devel@edk2.groups.io
Cc: Long1 Huang <long1.huang@intel.com>
Subject: [PATCH] BaseTools/VfrCompile: Correct Bit Field Flags for numeric/one of
Date: Mon, 29 Nov 2021 10:35:58 +0800	[thread overview]
Message-ID: <e9f4c77e3803234f12284f00812846cd321faec9.1638153094.git.long1.huang@intel.com> (raw)

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()

Signed-off-by: Long1 Huang <long1.huang@intel.com>
---
 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;
     }
 
-    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);
                                                           }
                                                        >>
-- 
2.32.0.windows.1


             reply	other threads:[~2021-11-29  2:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-29  2:35 long1.huang [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-11-30  1:54 [PATCH] BaseTools/VfrCompile: Correct Bit Field Flags for numeric/one of Long1 Huang
2021-12-01  2:20 ` Dandan Bi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e9f4c77e3803234f12284f00812846cd321faec9.1638153094.git.long1.huang@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox