public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] BaseTools/VfrCompile: Correct Bit Field Flags for numeric/one of
@ 2021-11-29  2:35 long1.huang
  0 siblings, 0 replies; 3+ messages in thread
From: long1.huang @ 2021-11-29  2:35 UTC (permalink / raw)
  To: devel; +Cc: Long1 Huang

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [PATCH] BaseTools/VfrCompile: Correct Bit Field Flags for numeric/one of
@ 2021-11-30  1:54 Long1 Huang
  2021-12-01  2:20 ` Dandan Bi
  0 siblings, 1 reply; 3+ messages in thread
From: Long1 Huang @ 2021-11-30  1:54 UTC (permalink / raw)
  To: devel; +Cc: Long1 Huang, Bob Feng, Liming Gao, Yuwei Chen, Dandan Bi

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-01  2:20 UTC | newest]

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox