public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Dandan Bi <dandan.bi@intel.com>
To: edk2-devel@lists.01.org
Cc: Eric Dong <eric.dong@intel.com>, Liming Gao <liming.gao@intel.com>
Subject: [PATCH v2 4/6] MdeModulePkg/HiiDatabase: Handle questions with Bit VarStore
Date: Tue, 12 Sep 2017 11:44:06 +0800	[thread overview]
Message-ID: <1505187848-389908-5-git-send-email-dandan.bi@intel.com> (raw)
In-Reply-To: <1505187848-389908-1-git-send-email-dandan.bi@intel.com>

V2: Merge block data value with same offset/width
or offset/width has overlap region.

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=545

For oneof/numeric/checkbox, their storage may be bit field.
When generating <ConfigAltResp> string to get default value
for these questions, we need to parse the Ifr data to get
the bit Varstore info,and then generating the correct
<ConfigAltResp> string.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
 .../Universal/HiiDatabaseDxe/ConfigRouting.c       | 247 ++++++++++++++++++---
 .../Universal/HiiDatabaseDxe/HiiDatabase.h         |   7 +-
 .../Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf    |   3 +-
 3 files changed, 226 insertions(+), 31 deletions(-)

diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
index c9ff1cf..daf22bf 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
@@ -13,10 +13,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 **/
 
 
 #include "HiiDatabase.h"
 extern HII_DATABASE_PRIVATE_DATA mPrivate;
+BOOLEAN mQuestionReferBitVar = FALSE;
 
 /**
   Calculate the number of Unicode characters of the incoming Configuration string,
   not including NULL terminator.
 
@@ -1223,19 +1224,19 @@ InsertBlockData (
   // Insert block data in its Offset and Width order.
   //
   for (Link = BlockLink->ForwardLink; Link != BlockLink; Link = Link->ForwardLink) {
     BlockArray = BASE_CR (Link, IFR_BLOCK_DATA, Entry);
     if (BlockArray->Offset == BlockSingleData->Offset) {
-      if (BlockArray->Width > BlockSingleData->Width) {
+      if ((BlockArray->Width > BlockSingleData->Width) || (BlockSingleData->IsBitVar && BlockArray->Width == BlockSingleData->Width)) {
         //
         // Insert this block data in the front of block array
         //
         InsertTailList (Link, &BlockSingleData->Entry);
         return;
       }
 
-      if (BlockArray->Width == BlockSingleData->Width) {
+      if ((!BlockSingleData->IsBitVar) && BlockArray->Width == BlockSingleData->Width) {
         //
         // The same block array has been added.
         //
         if (BlockSingleData != BlockArray) {
           FreePool (BlockSingleData);
@@ -1978,10 +1979,11 @@ Done:
   @param  HiiHandle              The hii handle for this form package.
   @param  VarStorageData         The varstore data structure.
   @param  IfrOpHdr               Ifr opcode header for this opcode.
   @param  VarWidth               The buffer width for this opcode.
   @param  ReturnData             The data block added for this opcode.
+  @param  IsBitVar               Whether the the opcode refers to bit storage.
 
   @retval  EFI_SUCCESS           This opcode is required.
   @retval  EFI_NOT_FOUND         This opcode is not required.
   @retval  Others                Contain some error.
                                  
@@ -1991,20 +1993,26 @@ IsThisOpcodeRequired (
   IN     IFR_BLOCK_DATA           *RequestBlockArray,
   IN     EFI_HII_HANDLE           HiiHandle,
   IN OUT IFR_VARSTORAGE_DATA      *VarStorageData,
   IN     EFI_IFR_OP_HEADER        *IfrOpHdr,
   IN     UINT16                   VarWidth,
-  OUT    IFR_BLOCK_DATA           **ReturnData
+  OUT    IFR_BLOCK_DATA           **ReturnData,
+  IN     BOOLEAN                  IsBitVar
   )
 {
   IFR_BLOCK_DATA           *BlockData;
   UINT16                   VarOffset;
   EFI_STRING_ID            NameId;
   EFI_IFR_QUESTION_HEADER  *IfrQuestionHdr;
+  UINT16                   BitOffset;
+  UINT16                   BitWidth;
+  UINT16                   TotalBits;
 
   NameId    = 0;
   VarOffset = 0;
+  BitOffset = 0;
+  BitWidth = 0;
   IfrQuestionHdr = (EFI_IFR_QUESTION_HEADER  *)((CHAR8 *) IfrOpHdr + sizeof (EFI_IFR_OP_HEADER));
 
   if (VarStorageData->Type == EFI_HII_VARSTORE_NAME_VALUE) {
     NameId = IfrQuestionHdr->VarStoreInfo.VarName;
 
@@ -2016,11 +2024,27 @@ IsThisOpcodeRequired (
       // This question is not in the requested string. Skip it.
       //
       return EFI_NOT_FOUND;
     }
   } else {
-    VarOffset = IfrQuestionHdr->VarStoreInfo.VarOffset;
+    //
+    // Get the byte offset/with and bit offset/width
+    //
+    if (IsBitVar) {
+      BitOffset = IfrQuestionHdr->VarStoreInfo.VarOffset;
+      BitWidth = VarWidth;
+      VarOffset = BitOffset / 8;
+      //
+      // Use current bit width and the bit width before current bit (with same byte offset) to calculate the byte width.
+      //
+      TotalBits = BitOffset - (VarOffset * 8) + BitWidth;
+      VarWidth = (TotalBits % 8 == 0 ? TotalBits / 8: TotalBits / 8 + 1);
+    } else {
+      VarOffset = IfrQuestionHdr->VarStoreInfo.VarOffset;
+      BitWidth = VarWidth;
+      BitOffset = VarOffset * 8;
+    }
     
     //
     // Check whether this question is in requested block array.
     //
     if (!BlockArrayCheck (RequestBlockArray, VarOffset, VarWidth, FALSE, HiiHandle)) {
@@ -2051,10 +2075,14 @@ IsThisOpcodeRequired (
 
   BlockData->Width      = VarWidth;
   BlockData->QuestionId = IfrQuestionHdr->QuestionId;
   BlockData->OpCode     = IfrOpHdr->OpCode;
   BlockData->Scope      = IfrOpHdr->Scope;
+  BlockData->IsBitVar   = IsBitVar;
+  BlockData->BitOffset  = BitOffset;
+  BlockData->BitWidth   = BitWidth;
+  BlockData->DefaultValueUpdated = FALSE;
   InitializeListHead (&BlockData->DefaultValueEntry);
   //
   // Add Block Data into VarStorageData BlockEntry
   //
   InsertBlockData (&VarStorageData->BlockEntry, &BlockData);
@@ -2124,10 +2152,11 @@ ParseIfrData (
   EFI_HII_PACKAGE_HEADER   *PackageHeader;
   EFI_VARSTORE_ID          VarStoreId;
   UINT16                   SmallestDefaultId;
   BOOLEAN                  SmallestIdFromFlag;
   BOOLEAN                  FromOtherDefaultOpcode;
+  BOOLEAN                  IsBitVar;
 
   Status           = EFI_SUCCESS;
   BlockData        = NULL;
   DefaultDataPtr   = NULL;
   FirstOneOfOption = FALSE;
@@ -2135,10 +2164,11 @@ ParseIfrData (
   FirstOrderedList = FALSE;
   VarStoreName     = NULL;
   ZeroMem (&DefaultData, sizeof (IFR_DEFAULT_DATA));
   SmallestDefaultId = 0xFFFF;
   FromOtherDefaultOpcode = FALSE;
+  IsBitVar = FALSE;
 
   //
   // Go through the form package to parse OpCode one by one.
   //
   PackageOffset = sizeof (EFI_HII_PACKAGE_HEADER);
@@ -2309,11 +2339,11 @@ ParseIfrData (
       //
       if (BlockData != NULL){
         BlockData = NULL;
       }
 
-      Status = IsThisOpcodeRequired(RequestBlockArray, HiiHandle, VarStorageData, IfrOpHdr, VarWidth, &BlockData);
+      Status = IsThisOpcodeRequired(RequestBlockArray, HiiHandle, VarStorageData, IfrOpHdr, VarWidth, &BlockData, FALSE);
       if (EFI_ERROR (Status)) {
         if (Status == EFI_NOT_FOUND){
           //
           //The opcode is not required,exit and parse other opcode.
           //
@@ -2341,20 +2371,27 @@ ParseIfrData (
       //
       IfrOneOf = (EFI_IFR_ONE_OF *) IfrOpHdr;
       if (IfrOneOf->Question.VarStoreId != VarStoreId) {
         break;
       }
-      VarWidth  = (UINT16) (1 << (IfrOneOf->Flags & EFI_IFR_NUMERIC_SIZE));
+
+      if (mQuestionReferBitVar) {
+        VarWidth = IfrOneOf->Flags & EFI_IFR_NUMERIC_SIZE_BIT ;
+        IsBitVar = TRUE;
+      } else {
+        VarWidth  = (UINT16) (1 << (IfrOneOf->Flags & EFI_IFR_NUMERIC_SIZE));
+        IsBitVar = FALSE;
+      }
 
       //
       // The BlockData may allocate by other opcode,need to clean.
       //
       if (BlockData != NULL){
         BlockData = NULL;
       }
 
-      Status = IsThisOpcodeRequired(RequestBlockArray, HiiHandle, VarStorageData, IfrOpHdr, VarWidth, &BlockData);
+      Status = IsThisOpcodeRequired(RequestBlockArray, HiiHandle, VarStorageData, IfrOpHdr, VarWidth, &BlockData, IsBitVar);
       if (EFI_ERROR (Status)) {
         if (Status == EFI_NOT_FOUND){
           //
           //The opcode is not required,exit and parse other opcode.
           //
@@ -2376,30 +2413,38 @@ ParseIfrData (
       } else if (IfrOpHdr->OpCode == EFI_IFR_NUMERIC_OP) {
         //
         // Numeric minimum value will be used as default value when no default is specified. 
         //
         DefaultData.Type        = DefaultValueFromDefault;
-        switch (IfrOneOf->Flags & EFI_IFR_NUMERIC_SIZE) {
-        case EFI_IFR_NUMERIC_SIZE_1:
-          DefaultData.Value.u8 = IfrOneOf->data.u8.MinValue;
-          break;
+        if (mQuestionReferBitVar) {
+          //
+          // Since default value in bit field was stored as UINT32 type.
+          //
+          mQuestionReferBitVar = FALSE;
+          CopyMem (&DefaultData.Value.u32, &IfrOneOf->data.u32.MinValue, sizeof (UINT32));
+        } else {
+          switch (IfrOneOf->Flags & EFI_IFR_NUMERIC_SIZE) {
+          case EFI_IFR_NUMERIC_SIZE_1:
+            DefaultData.Value.u8 = IfrOneOf->data.u8.MinValue;
+            break;
 
-        case EFI_IFR_NUMERIC_SIZE_2:
-          CopyMem (&DefaultData.Value.u16, &IfrOneOf->data.u16.MinValue, sizeof (UINT16));
-          break;
+          case EFI_IFR_NUMERIC_SIZE_2:
+           CopyMem (&DefaultData.Value.u16, &IfrOneOf->data.u16.MinValue, sizeof (UINT16));
+           break;
 
-        case EFI_IFR_NUMERIC_SIZE_4:
-          CopyMem (&DefaultData.Value.u32, &IfrOneOf->data.u32.MinValue, sizeof (UINT32));
-          break;
+          case EFI_IFR_NUMERIC_SIZE_4:
+            CopyMem (&DefaultData.Value.u32, &IfrOneOf->data.u32.MinValue, sizeof (UINT32));
+            break;
 
-        case EFI_IFR_NUMERIC_SIZE_8:
-          CopyMem (&DefaultData.Value.u64, &IfrOneOf->data.u64.MinValue, sizeof (UINT64));
-          break;
+          case EFI_IFR_NUMERIC_SIZE_8:
+            CopyMem (&DefaultData.Value.u64, &IfrOneOf->data.u64.MinValue, sizeof (UINT64));
+            break;
 
-        default:
-          Status = EFI_INVALID_PARAMETER;
-          goto Done;
+          default:
+            Status = EFI_INVALID_PARAMETER;
+            goto Done;
+         }
         }
         //
         // Set default value base on the DefaultId list get from IFR data.
         //        
         for (LinkData = DefaultIdArray->Entry.ForwardLink; LinkData != &DefaultIdArray->Entry; LinkData = LinkData->ForwardLink) {
@@ -2439,11 +2484,11 @@ ParseIfrData (
       //
       if (BlockData != NULL){
         BlockData = NULL;
       }
 
-      Status = IsThisOpcodeRequired(RequestBlockArray, HiiHandle, VarStorageData, IfrOpHdr, VarWidth, &BlockData);
+      Status = IsThisOpcodeRequired(RequestBlockArray, HiiHandle, VarStorageData, IfrOpHdr, VarWidth, &BlockData, FALSE);
       if (EFI_ERROR (Status)) {
         if (Status == EFI_NOT_FOUND){
           //
           //The opcode is not required,exit and parse other opcode.
           //
@@ -2484,11 +2529,19 @@ ParseIfrData (
       //
       if (BlockData != NULL){
         BlockData = NULL;
       }
 
-      Status = IsThisOpcodeRequired(RequestBlockArray, HiiHandle, VarStorageData, IfrOpHdr, VarWidth, &BlockData);
+      if (mQuestionReferBitVar) {
+        mQuestionReferBitVar = FALSE;
+        VarWidth = 1;
+        IsBitVar = TRUE;
+      } else {
+        IsBitVar = FALSE;
+      }
+
+      Status = IsThisOpcodeRequired(RequestBlockArray, HiiHandle, VarStorageData, IfrOpHdr, VarWidth, &BlockData, IsBitVar);
       if (EFI_ERROR (Status)) {
         if (Status == EFI_NOT_FOUND){
           //
           //The opcode is not required,exit and parse other opcode.
           //
@@ -2612,11 +2665,11 @@ ParseIfrData (
       if (BlockData != NULL){
         BlockData = NULL;
       }
 
       VarWidth  = (UINT16) sizeof (EFI_HII_DATE);
-      Status = IsThisOpcodeRequired(RequestBlockArray, HiiHandle, VarStorageData, IfrOpHdr, VarWidth, &BlockData);
+      Status = IsThisOpcodeRequired(RequestBlockArray, HiiHandle, VarStorageData, IfrOpHdr, VarWidth, &BlockData, FALSE);
       if (EFI_ERROR (Status)) {
         if (Status == EFI_NOT_FOUND){
           //
           //The opcode is not required,exit and parse other opcode.
           //
@@ -2654,11 +2707,11 @@ ParseIfrData (
       if (BlockData != NULL){
         BlockData = NULL;
       }
 
       VarWidth  = (UINT16) sizeof (EFI_HII_TIME);
-      Status = IsThisOpcodeRequired(RequestBlockArray, HiiHandle, VarStorageData, IfrOpHdr, VarWidth, &BlockData);
+      Status = IsThisOpcodeRequired(RequestBlockArray, HiiHandle, VarStorageData, IfrOpHdr, VarWidth, &BlockData, FALSE);
       if (EFI_ERROR (Status)) {
         if (Status == EFI_NOT_FOUND){
           //
           //The opcode is not required,exit and parse other opcode.
           //
@@ -2696,11 +2749,11 @@ ParseIfrData (
       if (BlockData != NULL){
         BlockData = NULL;
       }
 
       VarWidth  = (UINT16) (IfrString->MaxSize * sizeof (UINT16));
-      Status = IsThisOpcodeRequired(RequestBlockArray, HiiHandle, VarStorageData, IfrOpHdr, VarWidth, &BlockData);
+      Status = IsThisOpcodeRequired(RequestBlockArray, HiiHandle, VarStorageData, IfrOpHdr, VarWidth, &BlockData, FALSE);
       if (EFI_ERROR (Status)) {
         if (Status == EFI_NOT_FOUND){
           //
           //The opcode is not required,exit and parse other opcode.
           //
@@ -2738,11 +2791,11 @@ ParseIfrData (
       if (BlockData != NULL){
         BlockData = NULL;
       }
 
       VarWidth  = (UINT16) (IfrPassword->MaxSize * sizeof (UINT16));
-      Status = IsThisOpcodeRequired(RequestBlockArray, HiiHandle, VarStorageData, IfrOpHdr, VarWidth, &BlockData);
+      Status = IsThisOpcodeRequired(RequestBlockArray, HiiHandle, VarStorageData, IfrOpHdr, VarWidth, &BlockData, FALSE);
       if (EFI_ERROR (Status)) {
         if (Status == EFI_NOT_FOUND){
           //
           //The opcode is not required,exit and parse other opcode.
           //
@@ -2985,13 +3038,20 @@ ParseIfrData (
           //
           SmallestDefaultId = 0xFFFF;
           FromOtherDefaultOpcode = FALSE;
         }
       }
+      mQuestionReferBitVar = FALSE;
 
       break;
 
+    case EFI_IFR_GUID_OP:
+      if (CompareGuid ((EFI_GUID *)((UINT8*)IfrOpHdr + sizeof (EFI_IFR_OP_HEADER)), &gEfiIfrBitvarstoreGuid)) {
+        mQuestionReferBitVar = TRUE;
+      }
+      break;
+
     default:
       if (BlockData != NULL) {
         if (BlockData->Scope > 0) {
           BlockData->Scope = (UINT8) (BlockData->Scope + IfrOpHdr->Scope);
         }
@@ -3566,10 +3626,137 @@ GetStorageWidth (
   }
 
   return StorageWidth;
 }
 
+
+/**
+  Update Block data.
+
+  For some question (oneof/numeric/checkbox),their storage may be bit filed, their block data
+  may have same byte OFFSET and WIDTH or their offset and width has overlap region, this function
+  merge the value in these blocks.
+
+  @param  BlockLink     The Link of the block data.
+
+**/
+VOID
+UpdateBlockDataArray (
+  IN LIST_ENTRY        *BlockLink
+)
+{
+  LIST_ENTRY          *Link;
+  LIST_ENTRY          *TempLink;
+  LIST_ENTRY          *ListEntry;
+  LIST_ENTRY          *NextListEntry;
+  LIST_ENTRY          *LinkDefault;
+  LIST_ENTRY          *NextLinkDefault;
+  IFR_BLOCK_DATA      *BlockData;
+  IFR_BLOCK_DATA      *NextBlockData;
+  IFR_DEFAULT_DATA    *DefaultValueData;
+  IFR_DEFAULT_DATA    *NextDefaultValueData;
+  UINT32              Mask;
+  UINT32              PreBits;
+  UINT16              MinOffset;
+  UINT16              OffsetShift;
+  UINT32              TempValue;
+  UINT32              *BlockDefaultValue;
+  UINT32              *NextBlockDefaultValue;
+  UINT32              TempBlockDefaultValue;
+  UINT32              TempNextBlockDefaultValue;
+  UINT32              TotalValue;
+
+  Link = BlockLink->ForwardLink;
+
+  while (Link != BlockLink) {
+    BlockData = BASE_CR (Link, IFR_BLOCK_DATA, Entry);
+    TempLink = Link->ForwardLink;
+    if (!BlockData ->IsBitVar) {
+      Link = Link->ForwardLink;
+      continue;
+    }
+    //
+    // Find the block data with Bit VarStore. Need to set default value to related bit fields in the block.
+    //
+    if (!BlockData->DefaultValueUpdated){
+      ListEntry  = &BlockData->DefaultValueEntry;
+      for (LinkDefault = ListEntry->ForwardLink; LinkDefault != ListEntry; LinkDefault = LinkDefault->ForwardLink) {
+        TempValue = 0;
+        DefaultValueData = BASE_CR (LinkDefault, IFR_DEFAULT_DATA, Entry);
+        Mask = (1 << BlockData->BitWidth) - 1;
+        PreBits = BlockData->BitOffset - BlockData->Offset * 8;
+        BlockDefaultValue = (UINT32*)&(DefaultValueData->Value);
+        *BlockDefaultValue <<= PreBits;
+        Mask <<= PreBits;
+        *BlockDefaultValue = (TempValue & (~Mask)) | *BlockDefaultValue;
+      }
+    }
+
+    while (TempLink != BlockLink) {
+      NextBlockData = BASE_CR (TempLink, IFR_BLOCK_DATA, Entry);
+      TempLink = TempLink->ForwardLink;
+      if (!NextBlockData->IsBitVar || NextBlockData->Offset >= BlockData->Offset + BlockData->Width || BlockData->Offset >= NextBlockData->Offset + NextBlockData->Width) {
+        continue;
+      }
+      //
+      // Find blocks with same byte offset and width, or their offset and width has overlap region.
+      // We need to merge the default value in these blocks
+      //
+      ListEntry     = &BlockData->DefaultValueEntry;
+      for (LinkDefault = ListEntry->ForwardLink; LinkDefault != ListEntry; LinkDefault = LinkDefault->ForwardLink) {
+        DefaultValueData = BASE_CR (LinkDefault, IFR_DEFAULT_DATA, Entry);
+        NextListEntry = &NextBlockData->DefaultValueEntry;
+        for (NextLinkDefault = NextListEntry->ForwardLink; NextLinkDefault != NextListEntry; NextLinkDefault = NextLinkDefault->ForwardLink) {
+          NextDefaultValueData = BASE_CR (NextLinkDefault, IFR_DEFAULT_DATA, Entry);
+          if (DefaultValueData->DefaultId != NextDefaultValueData->DefaultId) {
+            continue;
+          }
+          //
+          // Find the default value in BlockData and NextBlockData with same Default Id.
+          //
+          // Set the default value to the bit fileds in NextBlock.
+          //
+          MinOffset = MIN (NextBlockData->Offset, BlockData->Offset);
+          OffsetShift = (BlockData->Offset > NextBlockData->Offset)? BlockData->Offset - NextBlockData->Offset: NextBlockData->Offset - BlockData->Offset;
+          Mask = (1 << NextBlockData->BitWidth) - 1;
+          PreBits = NextBlockData->BitOffset - MinOffset * 8;
+          NextBlockDefaultValue = (UINT32*) & (NextDefaultValueData->Value);
+          *NextBlockDefaultValue <<= PreBits;
+          NextBlockData->DefaultValueUpdated = TRUE;
+
+          //
+          // Merge the default value in NextBlockData with the value in BlockData.
+          //
+          BlockDefaultValue = (UINT32*) & (DefaultValueData->Value);
+          Mask <<= PreBits;
+          TotalValue = (*BlockDefaultValue & (~Mask)) | *NextBlockDefaultValue;
+
+          //
+          // Set the total value to the BlockData and NextBlockData respectively.
+          //
+          if (BlockData->Offset == MinOffset) {
+            TempBlockDefaultValue = TotalValue;
+          } else {
+            TempBlockDefaultValue = TotalValue >> OffsetShift * 8;
+          }
+          Mask = (1 << BlockData->Width * 8) - 1;
+          *BlockDefaultValue = TempBlockDefaultValue & Mask;
+
+          if (NextBlockData->Offset == MinOffset) {
+            TempNextBlockDefaultValue = TotalValue;
+          } else {
+            TempNextBlockDefaultValue = TotalValue >> OffsetShift * 8;
+          }
+          Mask = (1 << NextBlockData->Width * 8) - 1;
+          *NextBlockDefaultValue = TempNextBlockDefaultValue & Mask;
+        }
+      }
+    }
+    Link = Link->ForwardLink;
+  }
+}
+
 /**
   Generate ConfigAltResp string base on the varstore info.
 
   @param      HiiHandle             Hii Handle for this hii package.
   @param      ConfigHdr             The config header for this varstore.
@@ -3610,10 +3797,12 @@ GenerateAltConfigResp (
   //
   // Add length for <ConfigHdr> + '\0'
   //
   Length = StrLen (ConfigHdr) + 1;
 
+  UpdateBlockDataArray (&VarStorageData->BlockEntry);
+
   for (Link = DefaultIdArray->Entry.ForwardLink; Link != &DefaultIdArray->Entry; Link = Link->ForwardLink) {
     DefaultId = BASE_CR (Link, IFR_DEFAULT_DATA, Entry);
     //
     // Add length for "&<ConfigHdr>&ALTCFG=XXXX"
     //                |1| StrLen (ConfigHdr) | 8 | 4 |
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h b/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h
index e6760c3..5ce7d73 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h
@@ -1,9 +1,9 @@
 /** @file
 Private structures definitions in HiiDatabase.
 
-Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 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
 http://opensource.org/licenses/bsd-license.php
 
@@ -29,10 +29,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Protocol/HiiConfigKeyword.h>
 #include <Protocol/SimpleTextOut.h>
 
 #include <Guid/HiiKeyBoardLayout.h>
 #include <Guid/GlobalVariable.h>
+#include <Guid/MdeModuleHii.h>
 
 
 #include <Library/DebugLib.h>
 #include <Library/BaseMemoryLib.h>
 #include <Library/UefiDriverEntryPoint.h>
@@ -75,15 +76,19 @@ typedef struct {
 
 typedef struct {
   LIST_ENTRY          Entry;             // Link to Block array
   UINT16              Offset;
   UINT16              Width;
+  UINT16              BitOffset;
+  UINT16              BitWidth;
   EFI_QUESTION_ID     QuestionId;
   UINT8               OpCode;
   UINT8               Scope;
   LIST_ENTRY          DefaultValueEntry; // Link to its default value array
   CHAR16              *Name;
+  BOOLEAN             IsBitVar;
+  BOOLEAN             DefaultValueUpdated;
 } IFR_BLOCK_DATA;
 
 //
 // Get default value from IFR data.
 //
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf b/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
index 6bb1d03..9f99c2c 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
@@ -2,11 +2,11 @@
 # The DXE driver produces HII protocols defined in UEFI specification.
 #
 # This driver produces all required HII serivces that includes HiiDataBase, HiiString,
 # HiiFont, HiiConfigRouting. To support UEFI HII, this driver is required.
 #
-# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 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  
 #  http://opensource.org/licenses/bsd-license.php           
@@ -88,10 +88,11 @@
   ## CONSUMES  ## Event
   ## PRODUCES  ## Event
   gEfiHiiKeyBoardLayoutGuid
   gEfiHiiImageDecoderNameJpegGuid |gEfiMdeModulePkgTokenSpaceGuid.PcdSupportHiiImageProtocol  ## SOMETIMES_CONSUMES ## GUID
   gEfiHiiImageDecoderNamePngGuid  |gEfiMdeModulePkgTokenSpaceGuid.PcdSupportHiiImageProtocol  ## SOMETIMES_CONSUMES ## GUID
+  gEfiIfrBitvarstoreGuid                                                                      ## SOMETIMES_CONSUMES ## GUID
 
 [Depex]
   TRUE
 
 [UserExtensions.TianoCore."ExtraFiles"]
-- 
1.9.5.msysgit.1



  parent reply	other threads:[~2017-09-12  3:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-12  3:44 [PATCH v2 0/6] Support bitfield in storage of vfr Dandan Bi
2017-09-12  3:44 ` [PATCH v2 1/6] BaseTool/VfrCompiler: Support Bit fields in EFI/Buffer VarStore Dandan Bi
2017-09-12  3:44 ` [PATCH v2 2/6] MdeModulePkg: Add GUID/flags to implement BitField support Dandan Bi
2017-09-12  3:44 ` [PATCH v2 3/6] MdeModulePkg/UefiHiiLib: Add codes to validate question with bit fields Dandan Bi
2017-09-12  3:44 ` Dandan Bi [this message]
2017-09-12  3:44 ` [PATCH v2 5/6] MdeModulePkg/SetupBrowser: Handle questions with Bit VarStore Dandan Bi
2017-09-12  3:44 ` [PATCH v2 6/6] MdeModulePkg/DriverSample: Add sample questions with bit/union VarStore 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=1505187848-389908-5-git-send-email-dandan.bi@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