diff options
author | Dandan Bi <dandan.bi@intel.com> | 2017-11-03 16:34:25 +0800 |
---|---|---|
committer | Star Zeng <star.zeng@intel.com> | 2017-11-07 10:02:51 +0800 |
commit | 8182e9f446882c421ae7b2b6e456642cee644d8b (patch) | |
tree | 15ffd040038f6692f79a9e1ca8a5d1fe3bf37fb0 /MdeModulePkg | |
parent | c9a7f34356c12c873d1737b7d3366fc7e1cadd50 (diff) | |
download | edk2-8182e9f446882c421ae7b2b6e456642cee644d8b.tar.gz edk2-8182e9f446882c421ae7b2b6e456642cee644d8b.tar.bz2 edk2-8182e9f446882c421ae7b2b6e456642cee644d8b.zip |
MdeModulePkg/VarCheckHii: Enhance VarCheckHiiLib to support bit check
V3:
(1) Reset QuestionStoredInBitField to FALSE at end opcode(EFI_IFR_END_OP)
(2) Fix typo and format issues(line alignment for debug print message
and value assignment...)
V2:
(1)Remove the VarOffsetBitLevel/StorageWidthBitLevel to reduce the final
VarCheckBinSize and update the implementation accordingly.
(2)Update the VAR_CHECK_HII_REVISION
(3)Refine the Debug message and function comments,like update oneof",
"checkbox", "numeric" to "OneOf", "CheckBox", "Numeric".
VarCheckHiiLib check the value set to storage based on the possible value
listed in the vfr file. Since we have enhanced vfr to support Question
value stored in bit field, so now enhance VarCheckHiiLib to support bit
field check.
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Diffstat (limited to 'MdeModulePkg')
5 files changed, 310 insertions, 130 deletions
diff --git a/MdeModulePkg/Library/VarCheckHiiLib/InternalVarCheckStructure.h b/MdeModulePkg/Library/VarCheckHiiLib/InternalVarCheckStructure.h index a9faed48d9..8878e4aef8 100644 --- a/MdeModulePkg/Library/VarCheckHiiLib/InternalVarCheckStructure.h +++ b/MdeModulePkg/Library/VarCheckHiiLib/InternalVarCheckStructure.h @@ -1,7 +1,7 @@ /** @file
Internal structure for Var Check Hii.
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -23,7 +23,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #pragma pack (1)
-#define VAR_CHECK_HII_REVISION 0x0001
+#define VAR_CHECK_HII_REVISION 0x0002
typedef struct {
UINT16 Revision;
@@ -42,6 +42,7 @@ typedef struct { UINT8 Length; // Length include this header
UINT16 VarOffset;
UINT8 StorageWidth;
+ BOOLEAN BitFieldStore; // Whether the Question is stored in bit field, if TRUE, the VarOffset/StorageWidth will be saved as bit level, otherwise in byte level.
} VAR_CHECK_HII_QUESTION_HEADER;
typedef struct {
@@ -49,6 +50,7 @@ typedef struct { UINT8 Length; // Length include this header
UINT16 VarOffset;
UINT8 StorageWidth;
+ BOOLEAN BitFieldStore; // Whether the Question is stored in bit field, if TRUE, the VarOffset/StorageWidth will be saved as bit level, otherwise in byte level.
//UINTx Data[]; // x = UINT8/UINT16/UINT32/UINT64;
} VAR_CHECK_HII_QUESTION_ONEOF;
@@ -57,6 +59,7 @@ typedef struct { UINT8 Length; // Length include this header
UINT16 VarOffset;
UINT8 StorageWidth;
+ BOOLEAN BitFieldStore; // Whether the Question is stored in bit field, if TRUE, the VarOffset/StorageWidth will be saved as bit level, otherwise in byte level.
} VAR_CHECK_HII_QUESTION_CHECKBOX;
typedef struct {
@@ -64,6 +67,7 @@ typedef struct { UINT8 Length; // Length include this header
UINT16 VarOffset;
UINT8 StorageWidth;
+ BOOLEAN BitFieldStore; // Whether the Question is stored in bit field, if TRUE, the VarOffset/StorageWidth will be saved as bit level, otherwise in byte level.
//UINTx Minimum; // x = UINT8/UINT16/UINT32/UINT64;
//UINTx Maximum; // x = UINT8/UINT16/UINT32/UINT64;
} VAR_CHECK_HII_QUESTION_NUMERIC;
@@ -73,6 +77,7 @@ typedef struct { UINT8 Length; // Length include this header
UINT16 VarOffset;
UINT8 StorageWidth;
+ BOOLEAN BitFieldStore; // Whether the Question is stored in bit field, if TRUE, the VarOffset/StorageWidth will be saved as bit level, otherwise in byte level.
UINT8 MaxContainers;
//UINTx Data[]; // x = UINT8/UINT16/UINT32/UINT64;
} VAR_CHECK_HII_QUESTION_ORDEREDLIST;
diff --git a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHii.h b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHii.h index a54b867983..7363edf028 100644 --- a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHii.h +++ b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHii.h @@ -1,7 +1,7 @@ /** @file
Include file for Var Check Hii handler and bin.
-Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -22,6 +22,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include <Library/UefiBootServicesTableLib.h>
#include <Library/MemoryAllocationLib.h>
+#include <Guid/MdeModuleHii.h>
+
#include <Protocol/HiiDatabase.h>
#include <Protocol/FirmwareVolume2.h>
#include <Protocol/FirmwareVolumeBlock.h>
diff --git a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c index 0e91e98219..c0efed450b 100644 --- a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c +++ b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c @@ -1,7 +1,7 @@ /** @file
Var Check Hii bin generation.
-Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -120,8 +120,10 @@ DumpHiiPackage ( EFI_IFR_OP_HEADER *IfrOpCodeHeader;
EFI_IFR_VARSTORE *IfrVarStore;
EFI_IFR_VARSTORE_EFI *IfrEfiVarStore;
+ BOOLEAN QuestionStoredInBitField;
HiiPackageHeader = (EFI_HII_PACKAGE_HEADER *) HiiPackage;
+ QuestionStoredInBitField = FALSE;
DEBUG ((DEBUG_INFO, " HiiPackageHeader->Type - 0x%02x (%a)\n", HiiPackageHeader->Type, HiiPackageTypeToStr ((UINT8) HiiPackageHeader->Type)));
DEBUG ((DEBUG_INFO, " HiiPackageHeader->Length - 0x%06x\n", HiiPackageHeader->Length));
@@ -157,18 +159,24 @@ DumpHiiPackage ( }
break;
+ case EFI_IFR_GUID_OP:
+ if (CompareGuid ((EFI_GUID *)((UINTN)IfrOpCodeHeader + sizeof (EFI_IFR_OP_HEADER)), &gEdkiiIfrBitVarstoreGuid)) {
+ QuestionStoredInBitField = TRUE;
+ }
+ break;
+
case EFI_IFR_ONE_OF_OP:
case EFI_IFR_CHECKBOX_OP:
case EFI_IFR_NUMERIC_OP:
case EFI_IFR_ORDERED_LIST_OP:
- DEBUG ((DEBUG_INFO, " IfrOpCodeHeader->OpCode - 0x%02x (%a)\n", IfrOpCodeHeader->OpCode, IfrOpCodeToStr (IfrOpCodeHeader->OpCode)));
+ DEBUG ((DEBUG_INFO, " IfrOpCodeHeader->OpCode - 0x%02x (%a) (%a)\n", IfrOpCodeHeader->OpCode, IfrOpCodeToStr (IfrOpCodeHeader->OpCode), (QuestionStoredInBitField? "bit level": "byte level")));
DEBUG ((DEBUG_INFO, " IfrOpCodeHeader->Length - 0x%02x\n", IfrOpCodeHeader->Length));
DEBUG ((DEBUG_INFO, " IfrOpCodeHeader->Scope - 0x%02x\n", IfrOpCodeHeader->Scope));
DEBUG ((DEBUG_INFO, " Prompt - 0x%04x\n", ((EFI_IFR_ONE_OF *) IfrOpCodeHeader)->Question.Header.Prompt));
DEBUG ((DEBUG_INFO, " Help - 0x%04x\n", ((EFI_IFR_ONE_OF *) IfrOpCodeHeader)->Question.Header.Help));
DEBUG ((DEBUG_INFO, " QuestionId - 0x%04x\n", ((EFI_IFR_ONE_OF *) IfrOpCodeHeader)->Question.QuestionId));
DEBUG ((DEBUG_INFO, " VarStoreId - 0x%04x\n", ((EFI_IFR_ONE_OF *) IfrOpCodeHeader)->Question.VarStoreId));
- DEBUG ((DEBUG_INFO, " VarStoreInfo - 0x%04x\n", ((EFI_IFR_ONE_OF * )IfrOpCodeHeader)->Question.VarStoreInfo.VarOffset));
+ DEBUG ((DEBUG_INFO, " VarStoreInfo - 0x%04x (%a)\n", ((EFI_IFR_ONE_OF * )IfrOpCodeHeader)->Question.VarStoreInfo.VarOffset, (QuestionStoredInBitField? "bit level": "byte level")));
{
EFI_IFR_ONE_OF *IfrOneOf;
EFI_IFR_CHECKBOX *IfrCheckBox;
@@ -179,27 +187,36 @@ DumpHiiPackage ( case EFI_IFR_ONE_OF_OP:
IfrOneOf = (EFI_IFR_ONE_OF *) IfrOpCodeHeader;
DEBUG ((DEBUG_INFO, " Flags - 0x%02x\n", IfrOneOf->Flags));
- switch (IfrOneOf->Flags & EFI_IFR_NUMERIC_SIZE) {
- case EFI_IFR_NUMERIC_SIZE_1:
- DEBUG ((DEBUG_INFO, " MinValue - 0x%02x\n", IfrOneOf->data.u8.MinValue));
- DEBUG ((DEBUG_INFO, " MaxValue - 0x%02x\n", IfrOneOf->data.u8.MaxValue));
- DEBUG ((DEBUG_INFO, " Step - 0x%02x\n", IfrOneOf->data.u8.Step));
- break;
- case EFI_IFR_NUMERIC_SIZE_2:
- DEBUG ((DEBUG_INFO, " MinValue - 0x%04x\n", IfrOneOf->data.u16.MinValue));
- DEBUG ((DEBUG_INFO, " MaxValue - 0x%04x\n", IfrOneOf->data.u16.MaxValue));
- DEBUG ((DEBUG_INFO, " Step - 0x%04x\n", IfrOneOf->data.u16.Step));
- break;
- case EFI_IFR_NUMERIC_SIZE_4:
+ if (QuestionStoredInBitField) {
+ //
+ // For OneOf stored in bit field, the option value are saved as UINT32 type.
+ //
DEBUG ((DEBUG_INFO, " MinValue - 0x%08x\n", IfrOneOf->data.u32.MinValue));
DEBUG ((DEBUG_INFO, " MaxValue - 0x%08x\n", IfrOneOf->data.u32.MaxValue));
DEBUG ((DEBUG_INFO, " Step - 0x%08x\n", IfrOneOf->data.u32.Step));
- break;
- case EFI_IFR_NUMERIC_SIZE_8:
- DEBUG ((DEBUG_INFO, " MinValue - 0x%016lx\n", IfrOneOf->data.u64.MinValue));
- DEBUG ((DEBUG_INFO, " MaxValue - 0x%016lx\n", IfrOneOf->data.u64.MaxValue));
- DEBUG ((DEBUG_INFO, " Step - 0x%016lx\n", IfrOneOf->data.u64.Step));
- break;
+ } else {
+ switch (IfrOneOf->Flags & EFI_IFR_NUMERIC_SIZE) {
+ case EFI_IFR_NUMERIC_SIZE_1:
+ DEBUG ((DEBUG_INFO, " MinValue - 0x%02x\n", IfrOneOf->data.u8.MinValue));
+ DEBUG ((DEBUG_INFO, " MaxValue - 0x%02x\n", IfrOneOf->data.u8.MaxValue));
+ DEBUG ((DEBUG_INFO, " Step - 0x%02x\n", IfrOneOf->data.u8.Step));
+ break;
+ case EFI_IFR_NUMERIC_SIZE_2:
+ DEBUG ((DEBUG_INFO, " MinValue - 0x%04x\n", IfrOneOf->data.u16.MinValue));
+ DEBUG ((DEBUG_INFO, " MaxValue - 0x%04x\n", IfrOneOf->data.u16.MaxValue));
+ DEBUG ((DEBUG_INFO, " Step - 0x%04x\n", IfrOneOf->data.u16.Step));
+ break;
+ case EFI_IFR_NUMERIC_SIZE_4:
+ DEBUG ((DEBUG_INFO, " MinValue - 0x%08x\n", IfrOneOf->data.u32.MinValue));
+ DEBUG ((DEBUG_INFO, " MaxValue - 0x%08x\n", IfrOneOf->data.u32.MaxValue));
+ DEBUG ((DEBUG_INFO, " Step - 0x%08x\n", IfrOneOf->data.u32.Step));
+ break;
+ case EFI_IFR_NUMERIC_SIZE_8:
+ DEBUG ((DEBUG_INFO, " MinValue - 0x%016lx\n", IfrOneOf->data.u64.MinValue));
+ DEBUG ((DEBUG_INFO, " MaxValue - 0x%016lx\n", IfrOneOf->data.u64.MaxValue));
+ DEBUG ((DEBUG_INFO, " Step - 0x%016lx\n", IfrOneOf->data.u64.Step));
+ break;
+ }
}
break;
case EFI_IFR_CHECKBOX_OP:
@@ -209,27 +226,36 @@ DumpHiiPackage ( case EFI_IFR_NUMERIC_OP:
IfrNumeric = (EFI_IFR_NUMERIC *) IfrOpCodeHeader;
DEBUG ((DEBUG_INFO, " Flags - 0x%02x\n", IfrNumeric->Flags));
- switch (IfrNumeric->Flags & EFI_IFR_NUMERIC_SIZE) {
- case EFI_IFR_NUMERIC_SIZE_1:
- DEBUG ((DEBUG_INFO, " MinValue - 0x%02x\n", IfrNumeric->data.u8.MinValue));
- DEBUG ((DEBUG_INFO, " MaxValue - 0x%02x\n", IfrNumeric->data.u8.MaxValue));
- DEBUG ((DEBUG_INFO, " Step - 0x%02x\n", IfrNumeric->data.u8.Step));
- break;
- case EFI_IFR_NUMERIC_SIZE_2:
- DEBUG ((DEBUG_INFO, " MinValue - 0x%04x\n", IfrNumeric->data.u16.MinValue));
- DEBUG ((DEBUG_INFO, " MaxValue - 0x%04x\n", IfrNumeric->data.u16.MaxValue));
- DEBUG ((DEBUG_INFO, " Step - 0x%04x\n", IfrNumeric->data.u16.Step));
- break;
- case EFI_IFR_NUMERIC_SIZE_4:
+ if (QuestionStoredInBitField) {
+ //
+ // For Numeric stored in bit field, the MinValue,MaxValue and Step are saved as UINT32 type.
+ //
DEBUG ((DEBUG_INFO, " MinValue - 0x%08x\n", IfrNumeric->data.u32.MinValue));
DEBUG ((DEBUG_INFO, " MaxValue - 0x%08x\n", IfrNumeric->data.u32.MaxValue));
DEBUG ((DEBUG_INFO, " Step - 0x%08x\n", IfrNumeric->data.u32.Step));
- break;
- case EFI_IFR_NUMERIC_SIZE_8:
- DEBUG ((DEBUG_INFO, " MinValue - 0x%016lx\n", IfrNumeric->data.u64.MinValue));
- DEBUG ((DEBUG_INFO, " MaxValue - 0x%016lx\n", IfrNumeric->data.u64.MaxValue));
- DEBUG ((DEBUG_INFO, " Step - 0x%016lx\n", IfrNumeric->data.u64.Step));
- break;
+ } else {
+ switch (IfrNumeric->Flags & EFI_IFR_NUMERIC_SIZE) {
+ case EFI_IFR_NUMERIC_SIZE_1:
+ DEBUG ((DEBUG_INFO, " MinValue - 0x%02x\n", IfrNumeric->data.u8.MinValue));
+ DEBUG ((DEBUG_INFO, " MaxValue - 0x%02x\n", IfrNumeric->data.u8.MaxValue));
+ DEBUG ((DEBUG_INFO, " Step - 0x%02x\n", IfrNumeric->data.u8.Step));
+ break;
+ case EFI_IFR_NUMERIC_SIZE_2:
+ DEBUG ((DEBUG_INFO, " MinValue - 0x%04x\n", IfrNumeric->data.u16.MinValue));
+ DEBUG ((DEBUG_INFO, " MaxValue - 0x%04x\n", IfrNumeric->data.u16.MaxValue));
+ DEBUG ((DEBUG_INFO, " Step - 0x%04x\n", IfrNumeric->data.u16.Step));
+ break;
+ case EFI_IFR_NUMERIC_SIZE_4:
+ DEBUG ((DEBUG_INFO, " MinValue - 0x%08x\n", IfrNumeric->data.u32.MinValue));
+ DEBUG ((DEBUG_INFO, " MaxValue - 0x%08x\n", IfrNumeric->data.u32.MaxValue));
+ DEBUG ((DEBUG_INFO, " Step - 0x%08x\n", IfrNumeric->data.u32.Step));
+ break;
+ case EFI_IFR_NUMERIC_SIZE_8:
+ DEBUG ((DEBUG_INFO, " MinValue - 0x%016lx\n", IfrNumeric->data.u64.MinValue));
+ DEBUG ((DEBUG_INFO, " MaxValue - 0x%016lx\n", IfrNumeric->data.u64.MaxValue));
+ DEBUG ((DEBUG_INFO, " Step - 0x%016lx\n", IfrNumeric->data.u64.Step));
+ break;
+ }
}
break;
case EFI_IFR_ORDERED_LIST_OP:
@@ -279,6 +305,7 @@ DumpHiiPackage ( }
if (IfrOpCodeHeader->OpCode == EFI_IFR_END_OP) {
+ QuestionStoredInBitField = FALSE;
ASSERT (Scope > 0);
Scope--;
if (Scope == 0) {
@@ -488,6 +515,7 @@ MergeHiiQuestion ( UINT8 *Ptr;
UINT8 *Ptr1;
UINT8 *Ptr2;
+ UINT16 ArrayIndex;
//
// Hii Question from Hii Database has high priority.
@@ -498,14 +526,20 @@ MergeHiiQuestion ( return;
}
- HiiQuestion1 = HiiVariableNode->HiiQuestionArray[HiiQuestion->VarOffset];
+ if (HiiQuestion->BitFieldStore) {
+ ArrayIndex = HiiQuestion->VarOffset;
+ } else {
+ ArrayIndex = HiiQuestion->VarOffset * 8;
+ }
+
+ HiiQuestion1 = HiiVariableNode->HiiQuestionArray[ArrayIndex];
HiiQuestion2 = HiiQuestion;
ASSERT ((HiiQuestion1->OpCode == HiiQuestion2->OpCode) && (HiiQuestion1->StorageWidth == HiiQuestion2->StorageWidth));
switch (HiiQuestion1->OpCode) {
case EFI_IFR_ONE_OF_OP:
- DEBUG ((DEBUG_INFO, "MergeHiiQuestion - EFI_IFR_ONE_OF_OP VarOffset = 0x%04x\n", HiiQuestion1->VarOffset));
+ DEBUG ((DEBUG_INFO, "MergeHiiQuestion - EFI_IFR_ONE_OF_OP VarOffset = 0x%04x (%a)\n", HiiQuestion1->VarOffset, (HiiQuestion1->BitFieldStore? "bit level": "byte level")));
//
// Get the length of Hii Question 1.
//
@@ -580,17 +614,17 @@ MergeHiiQuestion ( Ptr2 += HiiQuestion2->StorageWidth;
}
- HiiVariableNode->HiiQuestionArray[HiiQuestion1->VarOffset] = NewHiiQuestion;
+ HiiVariableNode->HiiQuestionArray[ArrayIndex] = NewHiiQuestion;
InternalVarCheckFreePool (HiiQuestion1);
}
break;
case EFI_IFR_CHECKBOX_OP:
- DEBUG ((DEBUG_INFO, "MergeHiiQuestion - EFI_IFR_CHECKBOX_OP VarOffset = 0x%04x\n", HiiQuestion1->VarOffset));
+ DEBUG ((DEBUG_INFO, "MergeHiiQuestion - EFI_IFR_CHECKBOX_OP VarOffset = 0x%04x (%a)\n", HiiQuestion1->VarOffset, (HiiQuestion1->BitFieldStore? "bit level": "byte level")));
break;
case EFI_IFR_NUMERIC_OP:
- DEBUG ((DEBUG_INFO, "MergeHiiQuestion - EFI_IFR_NUMERIC_OP VarOffset = 0x%04x\n", HiiQuestion1->VarOffset));
+ DEBUG ((DEBUG_INFO, "MergeHiiQuestion - EFI_IFR_NUMERIC_OP VarOffset = 0x%04x (%a)\n", HiiQuestion1->VarOffset, (HiiQuestion1->BitFieldStore? "bit level": "byte level")));
//
// Get minimum and maximum of Hii Question 1.
//
@@ -705,7 +739,7 @@ MergeHiiQuestion ( Ptr2 += HiiQuestion2->StorageWidth;
}
- HiiVariableNode->HiiQuestionArray[HiiQuestion1->VarOffset] = NewHiiQuestion;
+ HiiVariableNode->HiiQuestionArray[ArrayIndex] = NewHiiQuestion;
InternalVarCheckFreePool (HiiQuestion1);
}
break;
@@ -831,13 +865,15 @@ GetOneOfOption ( Parse Hii Question Oneof.
@param[in] IfrOpCodeHeader Pointer to Ifr OpCode header.
+ @param[in] StoredInBitField Whether the OneOf is stored in bit field Storage.
return Pointer to Hii Question.
**/
VAR_CHECK_HII_QUESTION_HEADER *
ParseHiiQuestionOneOf (
- IN EFI_IFR_OP_HEADER *IfrOpCodeHeader
+ IN EFI_IFR_OP_HEADER *IfrOpCodeHeader,
+ IN BOOLEAN StoredInBitField
)
{
EFI_IFR_ONE_OF *IfrOneOf;
@@ -846,10 +882,21 @@ ParseHiiQuestionOneOf ( UINT8 Width;
UINTN OptionCount;
UINT8 OptionWidth;
+ UINT8 BitWidth;
IfrOneOf = (EFI_IFR_ONE_OF *) IfrOpCodeHeader;
+ BitWidth = 0;
- Width = (UINT8) (1 << (IfrOneOf->Flags & EFI_IFR_NUMERIC_SIZE));
+ if (StoredInBitField) {
+ //
+ // When OneOf stored in bit field, the bit width is saved in the lower six bits of the flag.
+ // And the options in the OneOf is saved as UINT32 type.
+ //
+ BitWidth = IfrOneOf->Flags & EDKII_IFR_NUMERIC_SIZE_BIT;
+ Width = sizeof (UINT32);
+ } else {
+ Width = (UINT8) (1 << (IfrOneOf->Flags & EFI_IFR_NUMERIC_SIZE));
+ }
GetOneOfOption (IfrOpCodeHeader, &OptionCount, &OptionWidth, NULL);
ASSERT (Width == OptionWidth);
@@ -858,10 +905,15 @@ ParseHiiQuestionOneOf ( OneOf = InternalVarCheckAllocateZeroPool (Length);
ASSERT (OneOf != NULL);
- OneOf->OpCode = EFI_IFR_ONE_OF_OP;
- OneOf->Length = (UINT8) Length;
- OneOf->VarOffset = IfrOneOf->Question.VarStoreInfo.VarOffset;
- OneOf->StorageWidth = Width;
+ OneOf->OpCode = EFI_IFR_ONE_OF_OP;
+ OneOf->Length = (UINT8) Length;
+ OneOf->VarOffset = IfrOneOf->Question.VarStoreInfo.VarOffset;
+ OneOf->BitFieldStore = StoredInBitField;
+ if (StoredInBitField) {
+ OneOf->StorageWidth = BitWidth;
+ } else {
+ OneOf->StorageWidth = Width;
+ }
GetOneOfOption (IfrOpCodeHeader, &OptionCount, &OptionWidth, OneOf + 1);
@@ -872,13 +924,15 @@ ParseHiiQuestionOneOf ( Parse Hii Question CheckBox.
@param[in] IfrOpCodeHeader Pointer to Ifr OpCode header.
+ @param[in] StoredInBitField Whether the CheckBox is stored in bit field Storage.
return Pointer to Hii Question.
**/
VAR_CHECK_HII_QUESTION_HEADER *
ParseHiiQuestionCheckBox (
- IN EFI_IFR_OP_HEADER *IfrOpCodeHeader
+ IN EFI_IFR_OP_HEADER *IfrOpCodeHeader,
+ IN BOOLEAN StoredInBitField
)
{
EFI_IFR_CHECKBOX *IfrCheckBox;
@@ -888,10 +942,15 @@ ParseHiiQuestionCheckBox ( CheckBox = InternalVarCheckAllocateZeroPool (sizeof (*CheckBox));
ASSERT (CheckBox != NULL);
- CheckBox->OpCode = EFI_IFR_CHECKBOX_OP;
- CheckBox->Length = (UINT8) sizeof (*CheckBox);;
- CheckBox->VarOffset = IfrCheckBox->Question.VarStoreInfo.VarOffset;
- CheckBox->StorageWidth = (UINT8) sizeof (BOOLEAN);
+ CheckBox->OpCode = EFI_IFR_CHECKBOX_OP;
+ CheckBox->Length = (UINT8) sizeof (*CheckBox);;
+ CheckBox->VarOffset = IfrCheckBox->Question.VarStoreInfo.VarOffset;
+ CheckBox->BitFieldStore = StoredInBitField;
+ if (StoredInBitField) {
+ CheckBox->StorageWidth = 1;
+ } else {
+ CheckBox->StorageWidth = (UINT8) sizeof (BOOLEAN);
+ }
return (VAR_CHECK_HII_QUESTION_HEADER *) CheckBox;
}
@@ -900,30 +959,48 @@ ParseHiiQuestionCheckBox ( Parse Hii Question Numeric.
@param[in] IfrOpCodeHeader Pointer to Ifr OpCode header.
+ @param[in] StoredInBitField Whether the Numeric is stored in bit field Storage.
return Pointer to Hii Question.
**/
VAR_CHECK_HII_QUESTION_HEADER *
ParseHiiQuestionNumeric (
- IN EFI_IFR_OP_HEADER *IfrOpCodeHeader
+ IN EFI_IFR_OP_HEADER *IfrOpCodeHeader,
+ IN BOOLEAN StoredInBitField
)
{
EFI_IFR_NUMERIC *IfrNumeric;
VAR_CHECK_HII_QUESTION_NUMERIC *Numeric;
UINT8 Width;
+ UINT8 BitWidth;
IfrNumeric = (EFI_IFR_NUMERIC *) IfrOpCodeHeader;
+ BitWidth = 0;
Numeric = InternalVarCheckAllocateZeroPool (sizeof (VAR_CHECK_HII_QUESTION_NUMERIC) + 2 * sizeof (UINT64));
ASSERT (Numeric != NULL);
- Width = (UINT8) (1 << (IfrNumeric->Flags & EFI_IFR_NUMERIC_SIZE));
+ if (StoredInBitField) {
+ //
+ // When Numeric stored in bit field, the bit field width is saved in the lower six bits of the flag.
+ // And the Minimum Maximum of Numeric is saved as UINT32 type.
+ //
+ BitWidth = IfrNumeric->Flags & EDKII_IFR_NUMERIC_SIZE_BIT;
+ Width = sizeof (UINT32);
+ } else {
+ Width = (UINT8) (1 << (IfrNumeric->Flags & EFI_IFR_NUMERIC_SIZE));
+ }
- Numeric->OpCode = EFI_IFR_NUMERIC_OP;
- Numeric->Length = (UINT8) (sizeof (VAR_CHECK_HII_QUESTION_NUMERIC) + 2 * Width);
- Numeric->VarOffset = IfrNumeric->Question.VarStoreInfo.VarOffset;
- Numeric->StorageWidth = Width;
+ Numeric->OpCode = EFI_IFR_NUMERIC_OP;
+ Numeric->Length = (UINT8) (sizeof (VAR_CHECK_HII_QUESTION_NUMERIC) + 2 * Width);
+ Numeric->VarOffset = IfrNumeric->Question.VarStoreInfo.VarOffset;
+ Numeric->BitFieldStore = StoredInBitField;
+ if (StoredInBitField) {
+ Numeric->StorageWidth = BitWidth;
+ } else {
+ Numeric->StorageWidth = Width;
+ }
CopyMem (Numeric + 1, &IfrNumeric->data, Width * 2);
@@ -962,6 +1039,7 @@ ParseHiiQuestionOrderedList ( OrderedList->VarOffset = IfrOrderedList->Question.VarStoreInfo.VarOffset;
OrderedList->StorageWidth = OptionWidth;
OrderedList->MaxContainers = IfrOrderedList->MaxContainers;
+ OrderedList->BitFieldStore = FALSE;
GetOneOfOption (IfrOpCodeHeader, &OptionCount, &OptionWidth, OrderedList + 1);
@@ -974,28 +1052,34 @@ ParseHiiQuestionOrderedList ( @param[in] HiiVariableNode Pointer to Hii Variable node.
@param[in] IfrOpCodeHeader Pointer to Ifr OpCode header.
@param[in] FromFv Hii Question from FV.
+ @param[in] StoredInBitField Whether the Question is stored in bit field Storage.
**/
VOID
ParseHiiQuestion (
IN VAR_CHECK_HII_VARIABLE_NODE *HiiVariableNode,
IN EFI_IFR_OP_HEADER *IfrOpCodeHeader,
- IN BOOLEAN FromFv
+ IN BOOLEAN FromFv,
+ IN BOOLEAN StoredInBitField
)
{
VAR_CHECK_HII_QUESTION_HEADER *HiiQuestion;
+ UINT16 ArrayIndex;
+ //
+ // Currently only OneOf, CheckBox and Numeric can be stored in bit field.
+ //
switch (IfrOpCodeHeader->OpCode) {
case EFI_IFR_ONE_OF_OP:
- HiiQuestion = ParseHiiQuestionOneOf (IfrOpCodeHeader);
+ HiiQuestion = ParseHiiQuestionOneOf (IfrOpCodeHeader, StoredInBitField);
break;
case EFI_IFR_CHECKBOX_OP:
- HiiQuestion = ParseHiiQuestionCheckBox (IfrOpCodeHeader);
+ HiiQuestion = ParseHiiQuestionCheckBox (IfrOpCodeHeader, StoredInBitField);
break;
case EFI_IFR_NUMERIC_OP:
- HiiQuestion = ParseHiiQuestionNumeric (IfrOpCodeHeader);
+ HiiQuestion = ParseHiiQuestionNumeric (IfrOpCodeHeader, StoredInBitField);
break;
case EFI_IFR_ORDERED_LIST_OP:
@@ -1008,10 +1092,15 @@ ParseHiiQuestion ( break;
}
- if (HiiVariableNode->HiiQuestionArray[HiiQuestion->VarOffset] != NULL) {
+ if (StoredInBitField) {
+ ArrayIndex = HiiQuestion->VarOffset;
+ } else {
+ ArrayIndex = HiiQuestion->VarOffset * 8;
+ }
+ if (HiiVariableNode->HiiQuestionArray[ArrayIndex] != NULL) {
MergeHiiQuestion (HiiVariableNode, HiiQuestion, FromFv);
} else {
- HiiVariableNode->HiiQuestionArray[HiiQuestion->VarOffset] = HiiQuestion;
+ HiiVariableNode->HiiQuestionArray[ArrayIndex] = HiiQuestion;
}
}
@@ -1166,7 +1255,7 @@ CreateHiiVariableNode ( // The variable store identifier, which is unique within the current form set.
//
HiiVariableNode->VarStoreId = IfrEfiVarStore->VarStoreId;
- HiiVariableNode->HiiQuestionArray = InternalVarCheckAllocateZeroPool (IfrEfiVarStore->Size * sizeof (VAR_CHECK_HII_QUESTION_HEADER *));
+ HiiVariableNode->HiiQuestionArray = InternalVarCheckAllocateZeroPool (IfrEfiVarStore->Size * 8 * sizeof (VAR_CHECK_HII_QUESTION_HEADER *));
InsertTailList (&mVarCheckHiiList, &HiiVariableNode->Link);
} else {
@@ -1239,6 +1328,7 @@ VarCheckParseHiiPackage ( EFI_HII_PACKAGE_HEADER *HiiPackageHeader;
EFI_IFR_OP_HEADER *IfrOpCodeHeader;
VAR_CHECK_HII_VARIABLE_NODE *HiiVariableNode;
+ BOOLEAN QuestionStoredInBitField;
//
// Parse and create Hii Variable node list for this Hii Package.
@@ -1247,12 +1337,24 @@ VarCheckParseHiiPackage ( HiiPackageHeader = (EFI_HII_PACKAGE_HEADER *) HiiPackage;
+ QuestionStoredInBitField = FALSE;
+
switch (HiiPackageHeader->Type) {
case EFI_HII_PACKAGE_FORMS:
IfrOpCodeHeader = (EFI_IFR_OP_HEADER *) (HiiPackageHeader + 1);
while ((UINTN) IfrOpCodeHeader < (UINTN) HiiPackageHeader + HiiPackageHeader->Length) {
switch (IfrOpCodeHeader->OpCode) {
+ case EFI_IFR_GUID_OP:
+ if (CompareGuid ((EFI_GUID *)((UINTN)IfrOpCodeHeader + sizeof (EFI_IFR_OP_HEADER)), &gEdkiiIfrBitVarstoreGuid)) {
+ QuestionStoredInBitField = TRUE;
+ }
+ break;
+
+ case EFI_IFR_END_OP:
+ QuestionStoredInBitField = FALSE;
+ break;
+
case EFI_IFR_ONE_OF_OP:
case EFI_IFR_CHECKBOX_OP:
case EFI_IFR_NUMERIC_OP:
@@ -1270,7 +1372,7 @@ VarCheckParseHiiPackage ( //
// Normal IFR
//
- ParseHiiQuestion (HiiVariableNode, IfrOpCodeHeader, FromFv);
+ ParseHiiQuestion (HiiVariableNode, IfrOpCodeHeader, FromFv, QuestionStoredInBitField);
}
default:
break;
@@ -1341,7 +1443,7 @@ DestroyHiiVariableNode ( //
// Free the allocated buffer.
//
- for (Index = 0; Index < HiiVariableNode->HiiVariable->Size; Index++) {
+ for (Index = 0; Index < HiiVariableNode->HiiVariable->Size * (UINTN) 8; Index++) {
if (HiiVariableNode->HiiQuestionArray[Index] != NULL) {
InternalVarCheckFreePool (HiiVariableNode->HiiQuestionArray[Index]);
}
@@ -1389,7 +1491,7 @@ BuildVarCheckHiiBin ( HiiVariableNode = VAR_CHECK_HII_VARIABLE_FROM_LINK (HiiVariableLink);
HiiVariableLength = HiiVariableNode->HiiVariable->HeaderLength;
- for (Index = 0; Index < HiiVariableNode->HiiVariable->Size; Index++) {
+ for (Index = 0; Index < HiiVariableNode->HiiVariable->Size * (UINTN) 8; Index++) {
if (HiiVariableNode->HiiQuestionArray[Index] != NULL) {
//
// For Hii Question header align.
@@ -1434,7 +1536,7 @@ BuildVarCheckHiiBin ( CopyMem (Ptr, HiiVariableNode->HiiVariable, HiiVariableNode->HiiVariable->HeaderLength);
Ptr += HiiVariableNode->HiiVariable->HeaderLength;
- for (Index = 0; Index < HiiVariableNode->HiiVariable->Size; Index++) {
+ for (Index = 0; Index < HiiVariableNode->HiiVariable->Size * (UINTN) 8; Index++) {
if (HiiVariableNode->HiiQuestionArray[Index] != NULL) {
//
// For Hii Question header align.
diff --git a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLib.inf b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLib.inf index 98e6983f6c..aeca3ef7d5 100644 --- a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLib.inf +++ b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLib.inf @@ -1,7 +1,7 @@ ## @file
# NULL class library to register var check HII handler.
#
-# Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions
@@ -46,6 +46,9 @@ PcdLib
VarCheckLib
+[Guids]
+ gEdkiiIfrBitVarstoreGuid ## SOMETIMES_CONSUMES ## GUID
+
[Protocols]
gEfiFirmwareVolume2ProtocolGuid ## SOMETIMES_CONSUMES
gEfiFirmwareVolumeBlock2ProtocolGuid ## SOMETIMES_CONSUMES
diff --git a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLibNullClass.c b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLibNullClass.c index 46a93bdb8a..93ac5ec8f1 100644 --- a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLibNullClass.c +++ b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLibNullClass.c @@ -93,28 +93,61 @@ VarCheckHiiQuestion ( UINT8 *Ptr;
UINT8 Index;
UINT8 MaxContainers;
+ UINT8 StartBit;
+ UINT8 EndBit;
+ UINT8 TotalBits;
+ UINT16 VarOffsetByteLevel;
+ UINT8 StorageWidthByteLevel;
+
+ if (HiiQuestion->BitFieldStore) {
+ VarOffsetByteLevel = HiiQuestion->VarOffset / 8;
+ TotalBits = HiiQuestion->VarOffset % 8 + HiiQuestion->StorageWidth;
+ StorageWidthByteLevel = (TotalBits % 8 == 0 ? TotalBits / 8: TotalBits / 8 + 1);
+ } else {
+ VarOffsetByteLevel = HiiQuestion->VarOffset;
+ StorageWidthByteLevel = HiiQuestion->StorageWidth;
+ }
- if (((UINT32) HiiQuestion->VarOffset + HiiQuestion->StorageWidth) > DataSize) {
- DEBUG ((DEBUG_INFO , "VarCheckHiiQuestion fail: (VarOffset(0x%04x) + StorageWidth(0x%02x)) > Size(0x%x)\n", HiiQuestion->VarOffset, HiiQuestion->StorageWidth, DataSize));
+ if (((UINT32) VarOffsetByteLevel + StorageWidthByteLevel) > DataSize) {
+ DEBUG ((DEBUG_INFO , "VarCheckHiiQuestion fail: (VarOffset(0x%04x) + StorageWidth(0x%02x)) > Size(0x%x)\n", VarOffsetByteLevel, StorageWidthByteLevel, DataSize));
return FALSE;
}
OneData = 0;
- CopyMem (&OneData, (UINT8 *) Data + HiiQuestion->VarOffset, HiiQuestion->StorageWidth);
+ CopyMem (&OneData, (UINT8 *) Data + VarOffsetByteLevel, StorageWidthByteLevel);
+ if (HiiQuestion->BitFieldStore) {
+ //
+ // Get the value from the bit field.
+ //
+ StartBit = HiiQuestion->VarOffset % 8;
+ EndBit = StartBit + HiiQuestion->StorageWidth - 1;
+ OneData = BitFieldRead64 (OneData, StartBit, EndBit);
+ }
switch (HiiQuestion->OpCode) {
case EFI_IFR_ONE_OF_OP:
Ptr = (UINT8 *) ((VAR_CHECK_HII_QUESTION_ONEOF *) HiiQuestion + 1);
while ((UINTN) Ptr < (UINTN) HiiQuestion + HiiQuestion->Length) {
OneValue = 0;
- CopyMem (&OneValue, Ptr, HiiQuestion->StorageWidth);
+ if (HiiQuestion->BitFieldStore) {
+ //
+ // For OneOf stored in bit field, the value of options are saved as UINT32 type.
+ //
+ CopyMem (&OneValue, Ptr, sizeof (UINT32));
+ } else {
+ CopyMem (&OneValue, Ptr, HiiQuestion->StorageWidth);
+ }
if (OneData == OneValue) {
//
// Match
//
break;
}
- Ptr += HiiQuestion->StorageWidth;
+ if (HiiQuestion->BitFieldStore) {
+ Ptr += sizeof (UINT32);
+ } else {
+ Ptr += HiiQuestion->StorageWidth;
+ }
}
if ((UINTN) Ptr >= ((UINTN) HiiQuestion + HiiQuestion->Length)) {
//
@@ -138,10 +171,20 @@ VarCheckHiiQuestion ( Minimum = 0;
Maximum = 0;
Ptr = (UINT8 *) ((VAR_CHECK_HII_QUESTION_NUMERIC *) HiiQuestion + 1);
- CopyMem (&Minimum, Ptr, HiiQuestion->StorageWidth);
- Ptr += HiiQuestion->StorageWidth;
- CopyMem (&Maximum, Ptr, HiiQuestion->StorageWidth);
- Ptr += HiiQuestion->StorageWidth;
+ if (HiiQuestion->BitFieldStore) {
+ //
+ // For Numeric stored in bit field, the value of Maximum/Minimum are saved as UINT32 type.
+ //
+ CopyMem (&Minimum, Ptr, sizeof (UINT32));
+ Ptr += sizeof (UINT32);
+ CopyMem (&Maximum, Ptr, sizeof (UINT32));
+ Ptr += sizeof (UINT32);
+ } else {
+ CopyMem (&Minimum, Ptr, HiiQuestion->StorageWidth);
+ Ptr += HiiQuestion->StorageWidth;
+ CopyMem (&Maximum, Ptr, HiiQuestion->StorageWidth);
+ Ptr += HiiQuestion->StorageWidth;
+ }
//
// No need to check Step, because it is ONLY for UI.
@@ -344,70 +387,95 @@ DumpHiiQuestion ( UINT8 *Ptr;
DEBUG ((DEBUG_INFO, " VAR_CHECK_HII_QUESTION_HEADER\n"));
- DEBUG ((DEBUG_INFO, " OpCode - 0x%02x (%a)\n", HiiQuestion->OpCode, HiiOpCodeToStr (HiiQuestion->OpCode)));
+ DEBUG ((DEBUG_INFO, " OpCode - 0x%02x (%a) (%a)\n", HiiQuestion->OpCode, HiiOpCodeToStr (HiiQuestion->OpCode), (HiiQuestion->BitFieldStore? "bit level": "byte level")));
DEBUG ((DEBUG_INFO, " Length - 0x%02x\n", HiiQuestion->Length));
- DEBUG ((DEBUG_INFO, " VarOffset - 0x%04x\n", HiiQuestion->VarOffset));
- DEBUG ((DEBUG_INFO, " StorageWidth - 0x%02x\n", HiiQuestion->StorageWidth));
+ DEBUG ((DEBUG_INFO, " VarOffset - 0x%04x (%a)\n", HiiQuestion->VarOffset, (HiiQuestion->BitFieldStore? "bit level": "byte level")));
+ DEBUG ((DEBUG_INFO, " StorageWidth - 0x%02x (%a)\n", HiiQuestion->StorageWidth, (HiiQuestion->BitFieldStore? "bit level": "byte level")));
switch (HiiQuestion->OpCode) {
case EFI_IFR_ONE_OF_OP:
Ptr = (UINT8 *) ((VAR_CHECK_HII_QUESTION_ONEOF *) HiiQuestion + 1);
while ((UINTN) Ptr < ((UINTN) HiiQuestion + HiiQuestion->Length)) {
OneValue = 0;
- CopyMem (&OneValue, Ptr, HiiQuestion->StorageWidth);
+ if (HiiQuestion->BitFieldStore) {
+ //
+ // For OneOf stored in bit field, the value of options are saved as UINT32 type.
+ //
+ CopyMem (&OneValue, Ptr, sizeof (UINT32));
+ DEBUG ((DEBUG_INFO, " OneOfOption - 0x%08x\n", OneValue));
+ } else {
+ CopyMem (&OneValue, Ptr, HiiQuestion->StorageWidth);
+ switch (HiiQuestion->StorageWidth) {
+ case sizeof (UINT8):
+ DEBUG ((DEBUG_INFO, " OneOfOption - 0x%02x\n", OneValue));
+ break;
+ case sizeof (UINT16):
+ DEBUG ((DEBUG_INFO, " OneOfOption - 0x%04x\n", OneValue));
+ break;
+ case sizeof (UINT32):
+ DEBUG ((DEBUG_INFO, " OneOfOption - 0x%08x\n", OneValue));
+ break;
+ case sizeof (UINT64):
+ DEBUG ((DEBUG_INFO, " OneOfOption - 0x%016lx\n", OneValue));
+ break;
+ default:
+ ASSERT (FALSE);
+ break;
+ }
+ }
+ if (HiiQuestion->BitFieldStore) {
+ Ptr += sizeof (UINT32);
+ } else {
+ Ptr += HiiQuestion->StorageWidth;
+ }
+ }
+ break;
+
+ case EFI_IFR_CHECKBOX_OP:
+ break;
+
+ case EFI_IFR_NUMERIC_OP:
+ Minimum = 0;
+ Maximum = 0;
+ Ptr = (UINT8 *) ((VAR_CHECK_HII_QUESTION_NUMERIC *) HiiQuestion + 1);
+ if(HiiQuestion->BitFieldStore) {
+ //
+ // For Numeric stored in bit field, the value of Maximum/Minimum are saved as UINT32 type.
+ //
+ CopyMem (&Minimum, Ptr, sizeof (UINT32));
+ Ptr += sizeof (UINT32);
+ CopyMem (&Maximum, Ptr, sizeof (UINT32));
+ Ptr += sizeof (UINT32);
+
+ DEBUG ((DEBUG_INFO, " Minimum - 0x%08x\n", Minimum));
+ DEBUG ((DEBUG_INFO, " Maximum - 0x%08x\n", Maximum));
+ } else {
+ CopyMem (&Minimum, Ptr, HiiQuestion->StorageWidth);
+ Ptr += HiiQuestion->StorageWidth;
+ CopyMem (&Maximum, Ptr, HiiQuestion->StorageWidth);
+ Ptr += HiiQuestion->StorageWidth;
+
switch (HiiQuestion->StorageWidth) {
case sizeof (UINT8):
- DEBUG ((DEBUG_INFO, " OneOfOption - 0x%02x\n", OneValue));
+ DEBUG ((DEBUG_INFO, " Minimum - 0x%02x\n", Minimum));
+ DEBUG ((DEBUG_INFO, " Maximum - 0x%02x\n", Maximum));
break;
case sizeof (UINT16):
- DEBUG ((DEBUG_INFO, " OneOfOption - 0x%04x\n", OneValue));
+ DEBUG ((DEBUG_INFO, " Minimum - 0x%04x\n", Minimum));
+ DEBUG ((DEBUG_INFO, " Maximum - 0x%04x\n", Maximum));
break;
case sizeof (UINT32):
- DEBUG ((DEBUG_INFO, " OneOfOption - 0x%08x\n", OneValue));
+ DEBUG ((DEBUG_INFO, " Minimum - 0x%08x\n", Minimum));
+ DEBUG ((DEBUG_INFO, " Maximum - 0x%08x\n", Maximum));
break;
case sizeof (UINT64):
- DEBUG ((DEBUG_INFO, " OneOfOption - 0x%016lx\n", OneValue));
+ DEBUG ((DEBUG_INFO, " Minimum - 0x%016lx\n", Minimum));
+ DEBUG ((DEBUG_INFO, " Maximum - 0x%016lx\n", Maximum));
break;
default:
ASSERT (FALSE);
break;
}
- Ptr += HiiQuestion->StorageWidth;
- }
- break;
-
- case EFI_IFR_CHECKBOX_OP:
- break;
-
- case EFI_IFR_NUMERIC_OP:
- Minimum = 0;
- Maximum = 0;
- Ptr = (UINT8 *) ((VAR_CHECK_HII_QUESTION_NUMERIC *) HiiQuestion + 1);
- CopyMem (&Minimum, Ptr, HiiQuestion->StorageWidth);
- Ptr += HiiQuestion->StorageWidth;
- CopyMem (&Maximum, Ptr, HiiQuestion->StorageWidth);
- Ptr += HiiQuestion->StorageWidth;
-
- switch (HiiQuestion->StorageWidth) {
- case sizeof (UINT8):
- DEBUG ((DEBUG_INFO, " Minimum - 0x%02x\n", Minimum));
- DEBUG ((DEBUG_INFO, " Maximum - 0x%02x\n", Maximum));
- break;
- case sizeof (UINT16):
- DEBUG ((DEBUG_INFO, " Minimum - 0x%04x\n", Minimum));
- DEBUG ((DEBUG_INFO, " Maximum - 0x%04x\n", Maximum));
- break;
- case sizeof (UINT32):
- DEBUG ((DEBUG_INFO, " Minimum - 0x%08x\n", Minimum));
- DEBUG ((DEBUG_INFO, " Maximum - 0x%08x\n", Maximum));
- break;
- case sizeof (UINT64):
- DEBUG ((DEBUG_INFO, " Minimum - 0x%016lx\n", Minimum));
- DEBUG ((DEBUG_INFO, " Maximum - 0x%016lx\n", Maximum));
- break;
- default:
- ASSERT (FALSE);
- break;
}
break;
|