]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdeModulePkg / Universal / HiiDatabaseDxe / HiiDatabase.h
index c2917a9233ecaaca36351839eb74573f21385e48..421c293cfcc3dfe47d1ba44f3f87f36bb5b920e6 100644 (file)
@@ -1,14 +1,8 @@
 /** @file\r
 Private structures definitions in HiiDatabase.\r
 \r
-Copyright (c) 2007 - 2008, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -17,18 +11,23 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include <Uefi.h>\r
 \r
-#include <Protocol/ConsoleControl.h>\r
 #include <Protocol/DevicePath.h>\r
 #include <Protocol/HiiFont.h>\r
 #include <Protocol/HiiImage.h>\r
+#include <Protocol/HiiImageEx.h>\r
+#include <Protocol/HiiImageDecoder.h>\r
 #include <Protocol/HiiString.h>\r
 #include <Protocol/HiiDatabase.h>\r
 #include <Protocol/HiiConfigRouting.h>\r
 #include <Protocol/HiiConfigAccess.h>\r
+#include <Protocol/HiiConfigKeyword.h>\r
 #include <Protocol/SimpleTextOut.h>\r
 \r
 #include <Guid/HiiKeyBoardLayout.h>\r
-\r
+#include <Guid/GlobalVariable.h>\r
+#include <Guid/MdeModuleHii.h>\r
+#include <Guid/VariableFormat.h>\r
+#include <Guid/PcdDataBaseSignatureGuid.h>\r
 \r
 #include <Library/DebugLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
@@ -37,157 +36,222 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/BaseLib.h>\r
 #include <Library/DevicePathLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
-#include <Library/IfrSupportLib.h>\r
 #include <Library/UefiLib.h>\r
 #include <Library/PcdLib.h>\r
-#include <Library/HiiLib.h>\r
-\r
-#define HII_DATABASE_NOTIFY_GUID \\r
-  { \\r
-    0xc1c76, 0xd79e, 0x42fe, {0x86, 0xb, 0x8b, 0xe8, 0x7b, 0x3e, 0x7a, 0x78} \\r
-  }\r
-\r
-#define MAX_STRING_LENGTH                  1024\r
-#define MAX_FONT_NAME_LEN                  256\r
-#define NARROW_BASELINE                    15\r
-#define WIDE_BASELINE                      14\r
-#define SYS_FONT_INFO_MASK                 0x37\r
-#define REPLACE_UNKNOWN_GLYPH              0xFFFD\r
-#define PROPORTIONAL_GLYPH                 0x80\r
-#define NARROW_GLYPH                       0x40\r
-\r
-#define BITMAP_LEN_1_BIT(Width, Height)  (((Width) + 7) / 8 * (Height))\r
-#define BITMAP_LEN_4_BIT(Width, Height)  (((Width) + 1) / 2 * (Height))\r
-#define BITMAP_LEN_8_BIT(Width, Height)  ((Width) * (Height))\r
-#define BITMAP_LEN_24_BIT(Width, Height) ((Width) * (Height) * 3)\r
+#include <Library/UefiRuntimeServicesTableLib.h>\r
+#include <Library/PrintLib.h>\r
+\r
+#define MAX_STRING_LENGTH      1024\r
+#define MAX_FONT_NAME_LEN      256\r
+#define NARROW_BASELINE        15\r
+#define WIDE_BASELINE          14\r
+#define SYS_FONT_INFO_MASK     0x37\r
+#define REPLACE_UNKNOWN_GLYPH  0xFFFD\r
+#define PROPORTIONAL_GLYPH     0x80\r
+#define NARROW_GLYPH           0x40\r
+\r
+#define BITMAP_LEN_1_BIT(Width, Height)   (((Width) + 7) / 8 * (Height))\r
+#define BITMAP_LEN_4_BIT(Width, Height)   (((Width) + 1) / 2 * (Height))\r
+#define BITMAP_LEN_8_BIT(Width, Height)   ((Width) * (Height))\r
+#define BITMAP_LEN_24_BIT(Width, Height)  ((Width) * (Height) * 3)\r
+\r
+extern EFI_LOCK  mHiiDatabaseLock;\r
 \r
 //\r
-// Storage types\r
+// IFR data structure\r
 //\r
-#define EFI_HII_VARSTORE_BUFFER            0\r
-#define EFI_HII_VARSTORE_NAME_VALUE        1\r
-#define EFI_HII_VARSTORE_EFI_VARIABLE      2\r
+// BASE_CR (a, IFR_DEFAULT_VALUE_DATA, Entry) to get the whole structure.\r
 \r
-#define HII_FORMSET_STORAGE_SIGNATURE           EFI_SIGNATURE_32 ('H', 'S', 'T', 'G')\r
 typedef struct {\r
-  UINTN               Signature;\r
-  LIST_ENTRY          Entry;\r
+  LIST_ENTRY               Entry;          // Link to VarStorage Default Data\r
+  UINT16                   DefaultId;\r
+  VARIABLE_STORE_HEADER    *VariableStorage;\r
+} VARSTORAGE_DEFAULT_DATA;\r
 \r
-  EFI_HII_HANDLE      HiiHandle;\r
-  EFI_HANDLE          DriverHandle;\r
+typedef struct {\r
+  LIST_ENTRY    Entry;                   // Link to VarStorage\r
+  EFI_GUID      Guid;\r
+  CHAR16        *Name;\r
+  UINT16        Size;\r
+  UINT8         Type;\r
+  LIST_ENTRY    BlockEntry;              // Link to its Block array\r
+} IFR_VARSTORAGE_DATA;\r
 \r
-  UINT8               Type;   // EFI_HII_VARSTORE_BUFFER, EFI_HII_VARSTORE_NAME_VALUE, EFI_HII_VARSTORE_EFI_VARIABLE\r
-  EFI_GUID            Guid;\r
-  CHAR16              *Name;\r
-  UINT16              Size;\r
-} HII_FORMSET_STORAGE;\r
+typedef struct {\r
+  LIST_ENTRY         Entry;              // Link to Block array\r
+  UINT16             Offset;\r
+  UINT16             Width;\r
+  UINT16             BitOffset;\r
+  UINT16             BitWidth;\r
+  EFI_QUESTION_ID    QuestionId;\r
+  UINT8              OpCode;\r
+  UINT8              Scope;\r
+  LIST_ENTRY         DefaultValueEntry;  // Link to its default value array\r
+  CHAR16             *Name;\r
+  BOOLEAN            IsBitVar;\r
+} IFR_BLOCK_DATA;\r
+\r
+//\r
+// Get default value from IFR data.\r
+//\r
+typedef enum {\r
+  DefaultValueFromDefault = 0,     // Get from the minimum or first one when not set default value.\r
+  DefaultValueFromOtherDefault,    // Get default vale from other default when no default(When other\r
+                                   // defaults are more than one, use the default with smallest default id).\r
+  DefaultValueFromFlag,            // Get default value from the default flag.\r
+  DefaultValueFromOpcode           // Get default value from default opcode, highest priority.\r
+} DEFAULT_VALUE_TYPE;\r
+\r
+typedef struct {\r
+  LIST_ENTRY            Entry;\r
+  DEFAULT_VALUE_TYPE    Type;\r
+  BOOLEAN               Cleaned;     // Whether this value is cleaned\r
+                                     // TRUE  Cleaned, the value can't be used\r
+                                     // FALSE Not cleaned, the value can  be used.\r
+  UINT16                DefaultId;\r
+  EFI_IFR_TYPE_VALUE    Value;\r
+} IFR_DEFAULT_DATA;\r
+\r
+//\r
+// Storage types\r
+//\r
+#define EFI_HII_VARSTORE_BUFFER               0\r
+#define EFI_HII_VARSTORE_NAME_VALUE           1\r
+#define EFI_HII_VARSTORE_EFI_VARIABLE         2\r
+#define EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER  3\r
 \r
-#define HII_FORMSET_STORAGE_FROM_LINK(a)  CR (a, HII_FORMSET_STORAGE, Link, HII_FORMSET_STORAGE_SIGNATURE)\r
+//\r
+// Keyword handler protocol filter type.\r
+//\r
+#define EFI_KEYWORD_FILTER_READONY    0x01\r
+#define EFI_KEYWORD_FILTER_REAWRITE   0x02\r
+#define EFI_KEYWORD_FILTER_BUFFER     0x10\r
+#define EFI_KEYWORD_FILTER_NUMERIC    0x20\r
+#define EFI_KEYWORD_FILTER_NUMERIC_1  0x30\r
+#define EFI_KEYWORD_FILTER_NUMERIC_2  0x40\r
+#define EFI_KEYWORD_FILTER_NUMERIC_4  0x50\r
+#define EFI_KEYWORD_FILTER_NUMERIC_8  0x60\r
+\r
+#define HII_FORMSET_STORAGE_SIGNATURE  SIGNATURE_32 ('H', 'S', 'T', 'G')\r
+typedef struct {\r
+  UINTN             Signature;\r
+  LIST_ENTRY        Entry;\r
 \r
+  EFI_HII_HANDLE    HiiHandle;\r
+  EFI_HANDLE        DriverHandle;\r
+\r
+  UINT8             Type;     // EFI_HII_VARSTORE_BUFFER, EFI_HII_VARSTORE_NAME_VALUE, EFI_HII_VARSTORE_EFI_VARIABLE\r
+  EFI_GUID          Guid;\r
+  CHAR16            *Name;\r
+  UINT16            Size;\r
+} HII_FORMSET_STORAGE;\r
 \r
 //\r
 // String Package definitions\r
 //\r
-#define HII_STRING_PACKAGE_SIGNATURE    EFI_SIGNATURE_32 ('h','i','s','p')\r
+#define HII_STRING_PACKAGE_SIGNATURE  SIGNATURE_32 ('h','i','s','p')\r
 typedef struct _HII_STRING_PACKAGE_INSTANCE {\r
-  UINTN                                 Signature;\r
-  EFI_HII_STRING_PACKAGE_HDR            *StringPkgHdr;\r
-  UINT8                                 *StringBlock;\r
-  LIST_ENTRY                            StringEntry;\r
-  LIST_ENTRY                            FontInfoList;  // local font info list\r
-  UINT8                                 FontId;\r
+  UINTN                         Signature;\r
+  EFI_HII_STRING_PACKAGE_HDR    *StringPkgHdr;\r
+  UINT8                         *StringBlock;\r
+  LIST_ENTRY                    StringEntry;\r
+  LIST_ENTRY                    FontInfoList;          // local font info list\r
+  UINT8                         FontId;\r
+  EFI_STRING_ID                 MaxStringId;           // record StringId\r
 } HII_STRING_PACKAGE_INSTANCE;\r
 \r
 //\r
 // Form Package definitions\r
 //\r
-#define HII_IFR_PACKAGE_SIGNATURE       EFI_SIGNATURE_32 ('h','f','r','p')\r
+#define HII_IFR_PACKAGE_SIGNATURE  SIGNATURE_32 ('h','f','r','p')\r
 typedef struct _HII_IFR_PACKAGE_INSTANCE {\r
-  UINTN                                 Signature;\r
-  EFI_HII_PACKAGE_HEADER                FormPkgHdr;\r
-  UINT8                                 *IfrData;\r
-  LIST_ENTRY                            IfrEntry;\r
+  UINTN                     Signature;\r
+  EFI_HII_PACKAGE_HEADER    FormPkgHdr;\r
+  UINT8                     *IfrData;\r
+  LIST_ENTRY                IfrEntry;\r
 } HII_IFR_PACKAGE_INSTANCE;\r
 \r
 //\r
 // Simple Font Package definitions\r
 //\r
-#define HII_S_FONT_PACKAGE_SIGNATURE    EFI_SIGNATURE_32 ('h','s','f','p')\r
+#define HII_S_FONT_PACKAGE_SIGNATURE  SIGNATURE_32 ('h','s','f','p')\r
 typedef struct _HII_SIMPLE_FONT_PACKAGE_INSTANCE {\r
-  UINTN                                 Signature;\r
-  EFI_HII_SIMPLE_FONT_PACKAGE_HDR       *SimpleFontPkgHdr;\r
-  LIST_ENTRY                            SimpleFontEntry;\r
+  UINTN                              Signature;\r
+  EFI_HII_SIMPLE_FONT_PACKAGE_HDR    *SimpleFontPkgHdr;\r
+  LIST_ENTRY                         SimpleFontEntry;\r
 } HII_SIMPLE_FONT_PACKAGE_INSTANCE;\r
 \r
 //\r
 // Font Package definitions\r
 //\r
-#define HII_FONT_PACKAGE_SIGNATURE      EFI_SIGNATURE_32 ('h','i','f','p')\r
+#define HII_FONT_PACKAGE_SIGNATURE  SIGNATURE_32 ('h','i','f','p')\r
 typedef struct _HII_FONT_PACKAGE_INSTANCE {\r
-  UINTN                                 Signature;\r
-  EFI_HII_FONT_PACKAGE_HDR              *FontPkgHdr;\r
-  UINT8                                 *GlyphBlock;\r
-  LIST_ENTRY                            FontEntry;\r
-  LIST_ENTRY                            GlyphInfoList;\r
+  UINTN                       Signature;\r
+  EFI_HII_FONT_PACKAGE_HDR    *FontPkgHdr;\r
+  UINT16                      Height;\r
+  UINT16                      BaseLine;\r
+  UINT8                       *GlyphBlock;\r
+  LIST_ENTRY                  FontEntry;\r
+  LIST_ENTRY                  GlyphInfoList;\r
 } HII_FONT_PACKAGE_INSTANCE;\r
 \r
-#define HII_GLYPH_INFO_SIGNATURE        EFI_SIGNATURE_32 ('h','g','i','s')\r
+#define HII_GLYPH_INFO_SIGNATURE  SIGNATURE_32 ('h','g','i','s')\r
 typedef struct _HII_GLYPH_INFO {\r
-  UINTN                                 Signature;\r
-  LIST_ENTRY                            Entry;\r
-  CHAR16                                CharId;\r
-  EFI_HII_GLYPH_INFO                    Cell;\r
+  UINTN                 Signature;\r
+  LIST_ENTRY            Entry;\r
+  CHAR16                CharId;\r
+  EFI_HII_GLYPH_INFO    Cell;\r
 } HII_GLYPH_INFO;\r
 \r
-#define HII_FONT_INFO_SIGNATURE         EFI_SIGNATURE_32 ('h','l','f','i')\r
+#define HII_FONT_INFO_SIGNATURE  SIGNATURE_32 ('h','l','f','i')\r
 typedef struct _HII_FONT_INFO {\r
-  UINTN                                 Signature;\r
-  LIST_ENTRY                            Entry;\r
-  LIST_ENTRY                            *GlobalEntry;\r
-  UINT8                                 FontId;\r
+  UINTN         Signature;\r
+  LIST_ENTRY    Entry;\r
+  LIST_ENTRY    *GlobalEntry;\r
+  UINT8         FontId;\r
 } HII_FONT_INFO;\r
 \r
-#define HII_GLOBAL_FONT_INFO_SIGNATURE  EFI_SIGNATURE_32 ('h','g','f','i')\r
+#define HII_GLOBAL_FONT_INFO_SIGNATURE  SIGNATURE_32 ('h','g','f','i')\r
 typedef struct _HII_GLOBAL_FONT_INFO {\r
-  UINTN                                 Signature;\r
-  LIST_ENTRY                            Entry;\r
-  HII_FONT_PACKAGE_INSTANCE             *FontPackage;\r
-  UINTN                                 FontInfoSize;\r
-  EFI_FONT_INFO                         *FontInfo;\r
+  UINTN                        Signature;\r
+  LIST_ENTRY                   Entry;\r
+  HII_FONT_PACKAGE_INSTANCE    *FontPackage;\r
+  UINTN                        FontInfoSize;\r
+  EFI_FONT_INFO                *FontInfo;\r
 } HII_GLOBAL_FONT_INFO;\r
 \r
 //\r
 // Image Package definitions\r
 //\r
 \r
-#define HII_PIXEL_MASK                  0x80\r
+#define HII_PIXEL_MASK  0x80\r
 \r
 typedef struct _HII_IMAGE_PACKAGE_INSTANCE {\r
-  EFI_HII_IMAGE_PACKAGE_HDR             ImagePkgHdr;\r
-  UINT32                                ImageBlockSize;\r
-  UINT32                                PaletteInfoSize;\r
-  UINT8                                 *ImageBlock;\r
-  UINT8                                 *PaletteBlock;\r
+  EFI_HII_IMAGE_PACKAGE_HDR    ImagePkgHdr;\r
+  UINT32                       ImageBlockSize;\r
+  UINT32                       PaletteInfoSize;\r
+  EFI_HII_IMAGE_BLOCK          *ImageBlock;\r
+  UINT8                        *PaletteBlock;\r
 } HII_IMAGE_PACKAGE_INSTANCE;\r
 \r
 //\r
-// Keyboard Layout Pacakge definitions\r
+// Keyboard Layout Package definitions\r
 //\r
-#define HII_KB_LAYOUT_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','k','l','p')\r
+#define HII_KB_LAYOUT_PACKAGE_SIGNATURE  SIGNATURE_32 ('h','k','l','p')\r
 typedef struct _HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE {\r
-  UINTN                                 Signature;\r
-  UINT8                                 *KeyboardPkg;\r
-  LIST_ENTRY                            KeyboardEntry;\r
+  UINTN         Signature;\r
+  UINT8         *KeyboardPkg;\r
+  LIST_ENTRY    KeyboardEntry;\r
 } HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE;\r
 \r
 //\r
 // Guid Package definitions\r
 //\r
-#define HII_GUID_PACKAGE_SIGNATURE      EFI_SIGNATURE_32 ('h','i','g','p')\r
+#define HII_GUID_PACKAGE_SIGNATURE  SIGNATURE_32 ('h','i','g','p')\r
 typedef struct _HII_GUID_PACKAGE_INSTANCE {\r
-  UINTN                                 Signature;\r
-  UINT8                                 *GuidPkg;\r
-  LIST_ENTRY                            GuidEntry;\r
+  UINTN         Signature;\r
+  UINT8         *GuidPkg;\r
+  LIST_ENTRY    GuidEntry;\r
 } HII_GUID_PACKAGE_INSTANCE;\r
 \r
 //\r
@@ -195,26 +259,26 @@ typedef struct _HII_GUID_PACKAGE_INSTANCE {
 // This rule also applies to image package since ImageId can not be duplicate.\r
 //\r
 typedef struct _HII_DATABASE_PACKAGE_LIST_INSTANCE {\r
-  EFI_HII_PACKAGE_LIST_HEADER           PackageListHdr;\r
-  LIST_ENTRY                            GuidPkgHdr;\r
-  LIST_ENTRY                            FormPkgHdr;\r
-  LIST_ENTRY                            KeyboardLayoutHdr;\r
-  LIST_ENTRY                            StringPkgHdr;\r
-  LIST_ENTRY                            FontPkgHdr;\r
-  HII_IMAGE_PACKAGE_INSTANCE            *ImagePkg;\r
-  LIST_ENTRY                            SimpleFontPkgHdr;\r
-  UINT8                                 *DevicePathPkg;\r
+  EFI_HII_PACKAGE_LIST_HEADER    PackageListHdr;\r
+  LIST_ENTRY                     GuidPkgHdr;\r
+  LIST_ENTRY                     FormPkgHdr;\r
+  LIST_ENTRY                     KeyboardLayoutHdr;\r
+  LIST_ENTRY                     StringPkgHdr;\r
+  LIST_ENTRY                     FontPkgHdr;\r
+  HII_IMAGE_PACKAGE_INSTANCE     *ImagePkg;\r
+  LIST_ENTRY                     SimpleFontPkgHdr;\r
+  UINT8                          *DevicePathPkg;\r
 } HII_DATABASE_PACKAGE_LIST_INSTANCE;\r
 \r
-#define HII_HANDLE_SIGNATURE            EFI_SIGNATURE_32 ('h','i','h','l')\r
+#define HII_HANDLE_SIGNATURE  SIGNATURE_32 ('h','i','h','l')\r
 \r
 typedef struct {\r
-  UINTN               Signature;\r
-  LIST_ENTRY          Handle;\r
-  UINTN               Key;\r
+  UINTN         Signature;\r
+  LIST_ENTRY    Handle;\r
+  UINTN         Key;\r
 } HII_HANDLE;\r
 \r
-#define HII_DATABASE_RECORD_SIGNATURE   EFI_SIGNATURE_32 ('h','i','d','r')\r
+#define HII_DATABASE_RECORD_SIGNATURE  SIGNATURE_32 ('h','i','d','r')\r
 \r
 typedef struct _HII_DATABASE_RECORD {\r
   UINTN                                 Signature;\r
@@ -224,35 +288,37 @@ typedef struct _HII_DATABASE_RECORD {
   LIST_ENTRY                            DatabaseEntry;\r
 } HII_DATABASE_RECORD;\r
 \r
-#define HII_DATABASE_NOTIFY_SIGNATURE   EFI_SIGNATURE_32 ('h','i','d','n')\r
+#define HII_DATABASE_NOTIFY_SIGNATURE  SIGNATURE_32 ('h','i','d','n')\r
 \r
 typedef struct _HII_DATABASE_NOTIFY {\r
-  UINTN                                 Signature;\r
-  EFI_HANDLE                            NotifyHandle;\r
-  UINT8                                 PackageType;\r
-  EFI_GUID                              *PackageGuid;\r
-  EFI_HII_DATABASE_NOTIFY               PackageNotifyFn;\r
-  EFI_HII_DATABASE_NOTIFY_TYPE          NotifyType;\r
-  LIST_ENTRY                            DatabaseNotifyEntry;\r
+  UINTN                           Signature;\r
+  EFI_HANDLE                      NotifyHandle;\r
+  UINT8                           PackageType;\r
+  EFI_GUID                        *PackageGuid;\r
+  EFI_HII_DATABASE_NOTIFY         PackageNotifyFn;\r
+  EFI_HII_DATABASE_NOTIFY_TYPE    NotifyType;\r
+  LIST_ENTRY                      DatabaseNotifyEntry;\r
 } HII_DATABASE_NOTIFY;\r
 \r
-#define HII_DATABASE_PRIVATE_DATA_SIGNATURE EFI_SIGNATURE_32 ('H', 'i', 'D', 'p')\r
+#define HII_DATABASE_PRIVATE_DATA_SIGNATURE  SIGNATURE_32 ('H', 'i', 'D', 'p')\r
 \r
 typedef struct _HII_DATABASE_PRIVATE_DATA {\r
-  UINTN                                 Signature;\r
-  LIST_ENTRY                            DatabaseList;\r
-  LIST_ENTRY                            DatabaseNotifyList;\r
-  EFI_HII_FONT_PROTOCOL                 HiiFont;\r
-  EFI_HII_IMAGE_PROTOCOL                HiiImage;\r
-  EFI_HII_STRING_PROTOCOL               HiiString;\r
-  EFI_HII_DATABASE_PROTOCOL             HiiDatabase;\r
-  EFI_HII_CONFIG_ROUTING_PROTOCOL       ConfigRouting;\r
-  LIST_ENTRY                            HiiHandleList;\r
-  INTN                                  HiiHandleCount;\r
-  LIST_ENTRY                            FontInfoList;  // global font info list\r
-  UINTN                                 Attribute;     // default system color\r
-  EFI_GUID                              CurrentLayoutGuid;\r
-  EFI_HII_KEYBOARD_LAYOUT               *CurrentLayout;\r
+  UINTN                                  Signature;\r
+  LIST_ENTRY                             DatabaseList;\r
+  LIST_ENTRY                             DatabaseNotifyList;\r
+  EFI_HII_FONT_PROTOCOL                  HiiFont;\r
+  EFI_HII_IMAGE_PROTOCOL                 HiiImage;\r
+  EFI_HII_IMAGE_EX_PROTOCOL              HiiImageEx;\r
+  EFI_HII_STRING_PROTOCOL                HiiString;\r
+  EFI_HII_DATABASE_PROTOCOL              HiiDatabase;\r
+  EFI_HII_CONFIG_ROUTING_PROTOCOL        ConfigRouting;\r
+  EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL    ConfigKeywordHandler;\r
+  LIST_ENTRY                             HiiHandleList;\r
+  INTN                                   HiiHandleCount;\r
+  LIST_ENTRY                             FontInfoList; // global font info list\r
+  UINTN                                  Attribute;    // default system color\r
+  EFI_GUID                               CurrentLayoutGuid;\r
+  EFI_HII_KEYBOARD_LAYOUT                *CurrentLayout;\r
 } HII_DATABASE_PRIVATE_DATA;\r
 \r
 #define HII_FONT_DATABASE_PRIVATE_DATA_FROM_THIS(a) \\r
@@ -269,6 +335,13 @@ typedef struct _HII_DATABASE_PRIVATE_DATA {
       HII_DATABASE_PRIVATE_DATA_SIGNATURE \\r
       )\r
 \r
+#define HII_IMAGE_EX_DATABASE_PRIVATE_DATA_FROM_THIS(a) \\r
+  CR (a, \\r
+      HII_DATABASE_PRIVATE_DATA, \\r
+      HiiImageEx, \\r
+      HII_DATABASE_PRIVATE_DATA_SIGNATURE \\r
+      )\r
+\r
 #define HII_STRING_DATABASE_PRIVATE_DATA_FROM_THIS(a) \\r
   CR (a, \\r
       HII_DATABASE_PRIVATE_DATA, \\r
@@ -290,10 +363,48 @@ typedef struct _HII_DATABASE_PRIVATE_DATA {
       HII_DATABASE_PRIVATE_DATA_SIGNATURE \\r
       )\r
 \r
+#define CONFIG_KEYWORD_HANDLER_DATABASE_PRIVATE_DATA_FROM_THIS(a) \\r
+  CR (a, \\r
+      HII_DATABASE_PRIVATE_DATA, \\r
+      ConfigKeywordHandler, \\r
+      HII_DATABASE_PRIVATE_DATA_SIGNATURE \\r
+      )\r
+\r
 //\r
 // Internal function prototypes.\r
 //\r
 \r
+/**\r
+  Generate a sub string then output it.\r
+\r
+  This is a internal function.\r
+\r
+  @param  String                 A constant string which is the prefix of the to be\r
+                                 generated string, e.g. GUID=\r
+\r
+  @param  BufferLen              The length of the Buffer in bytes.\r
+\r
+  @param  Buffer                 Points to a buffer which will be converted to be the\r
+                                 content of the generated string.\r
+\r
+  @param  Flag                   If 1, the buffer contains data for the value of GUID or PATH stored in\r
+                                 UINT8 *; if 2, the buffer contains unicode string for the value of NAME;\r
+                                 if 3, the buffer contains other data.\r
+\r
+  @param  SubStr                 Points to the output string. It's caller's\r
+                                 responsibility to free this buffer.\r
+\r
+\r
+**/\r
+VOID\r
+GenerateSubStr (\r
+  IN CONST EFI_STRING  String,\r
+  IN  UINTN            BufferLen,\r
+  IN  VOID             *Buffer,\r
+  IN  UINT8            Flag,\r
+  OUT EFI_STRING       *SubStr\r
+  );\r
+\r
 /**\r
   This function checks whether a handle is a valid EFI_HII_HANDLE.\r
 \r
@@ -305,10 +416,9 @@ typedef struct _HII_DATABASE_PRIVATE_DATA {
 **/\r
 BOOLEAN\r
 IsHiiHandleValid (\r
-  EFI_HII_HANDLE Handle\r
+  EFI_HII_HANDLE  Handle\r
   );\r
 \r
-\r
 /**\r
   This function checks whether EFI_FONT_INFO exists in current database. If\r
   FontInfoMask is specified, check what options can be used to make a match.\r
@@ -324,7 +434,7 @@ IsHiiHandleValid (
   @param  FontHandle              On entry, Points to the font handle returned by a\r
                                   previous  call to GetFontInfo() or NULL to start\r
                                   with the first font.\r
-  @param  GlobalFontInfo          If not NULL, output the corresponding globa font\r
+  @param  GlobalFontInfo          If not NULL, output the corresponding global font\r
                                   info.\r
 \r
   @retval TRUE                    Existed\r
@@ -333,35 +443,35 @@ IsHiiHandleValid (
 **/\r
 BOOLEAN\r
 IsFontInfoExisted (\r
-  IN  HII_DATABASE_PRIVATE_DATA *Private,\r
-  IN  EFI_FONT_INFO             *FontInfo,\r
-  IN  EFI_FONT_INFO_MASK        *FontInfoMask,   OPTIONAL\r
-  IN  EFI_FONT_HANDLE           FontHandle,      OPTIONAL\r
-  OUT HII_GLOBAL_FONT_INFO      **GlobalFontInfo OPTIONAL\r
+  IN  HII_DATABASE_PRIVATE_DATA  *Private,\r
+  IN  EFI_FONT_INFO              *FontInfo,\r
+  IN  EFI_FONT_INFO_MASK         *FontInfoMask    OPTIONAL,\r
+  IN  EFI_FONT_HANDLE            FontHandle       OPTIONAL,\r
+  OUT HII_GLOBAL_FONT_INFO       **GlobalFontInfo OPTIONAL\r
   );\r
 \r
 /**\r
 \r
    This function invokes the matching registered function.\r
-    \r
+\r
    @param  Private           HII Database driver private structure.\r
    @param  NotifyType        The type of change concerning the database.\r
    @param  PackageInstance   Points to the package referred to by the notification.\r
    @param  PackageType       Package type\r
    @param  Handle            The handle of the package list which contains the specified package.\r
-    \r
-   @retval EFI_SUCCESS            Already checked all registered function and invoked \r
+\r
+   @retval EFI_SUCCESS            Already checked all registered function and invoked\r
                                   if matched.\r
    @retval EFI_INVALID_PARAMETER  Any input parameter is not valid.\r
-     \r
+\r
 **/\r
 EFI_STATUS\r
 InvokeRegisteredFunction (\r
-  IN HII_DATABASE_PRIVATE_DATA    *Private, \r
-  IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType,\r
-  IN VOID                         *PackageInstance,\r
-  IN UINT8                        PackageType,\r
-  IN EFI_HII_HANDLE               Handle\r
+  IN HII_DATABASE_PRIVATE_DATA     *Private,\r
+  IN EFI_HII_DATABASE_NOTIFY_TYPE  NotifyType,\r
+  IN VOID                          *PackageInstance,\r
+  IN UINT8                         PackageType,\r
+  IN EFI_HII_HANDLE                Handle\r
   )\r
 ;\r
 \r
@@ -382,17 +492,17 @@ InvokeRegisteredFunction (
 **/\r
 EFI_STATUS\r
 GetSystemFont (\r
-  IN  HII_DATABASE_PRIVATE_DATA      *Private,\r
-  OUT EFI_FONT_DISPLAY_INFO          **FontInfo,\r
-  OUT UINTN                          *FontInfoSize OPTIONAL\r
+  IN  HII_DATABASE_PRIVATE_DATA  *Private,\r
+  OUT EFI_FONT_DISPLAY_INFO      **FontInfo,\r
+  OUT UINTN                      *FontInfoSize OPTIONAL\r
   );\r
 \r
-\r
 /**\r
   Parse all string blocks to find a String block specified by StringId.\r
   If StringId = (EFI_STRING_ID) (-1), find out all EFI_HII_SIBT_FONT blocks\r
-  within this string package and backup its information.\r
-  If StringId = 0, output the string id of last string block (EFI_HII_SIBT_END).\r
+  within this string package and backup its information. If LastStringId is\r
+  specified, the string id of last string block will also be output.\r
+  If StringId = 0, output the string id of last string block (EFI_HII_SIBT_STRING).\r
 \r
   @param  Private                 Hii database private structure.\r
   @param  StringPackage           Hii string package instance.\r
@@ -402,7 +512,8 @@ GetSystemFont (
   @param  StringBlockAddr         Output the block address of found string block.\r
   @param  StringTextOffset        Offset, relative to the found block address, of\r
                                   the  string text information.\r
-  @param  LastStringId            Output the last string id when StringId = 0.\r
+  @param  LastStringId            Output the last string id when StringId = 0 or StringId = -1.\r
+  @param  StartStringId           The first id in the skip block which StringId in the block.\r
 \r
   @retval EFI_SUCCESS             The string text and font is retrieved\r
                                   successfully.\r
@@ -414,16 +525,16 @@ GetSystemFont (
 **/\r
 EFI_STATUS\r
 FindStringBlock (\r
-  IN HII_DATABASE_PRIVATE_DATA        *Private,\r
-  IN  HII_STRING_PACKAGE_INSTANCE     *StringPackage,\r
-  IN  EFI_STRING_ID                   StringId,\r
-  OUT UINT8                           *BlockType, OPTIONAL\r
-  OUT UINT8                           **StringBlockAddr, OPTIONAL\r
-  OUT UINTN                           *StringTextOffset, OPTIONAL\r
-  OUT EFI_STRING_ID                   *LastStringId OPTIONAL\r
+  IN HII_DATABASE_PRIVATE_DATA     *Private,\r
+  IN  HII_STRING_PACKAGE_INSTANCE  *StringPackage,\r
+  IN  EFI_STRING_ID                StringId,\r
+  OUT UINT8                        *BlockType  OPTIONAL,\r
+  OUT UINT8                        **StringBlockAddr  OPTIONAL,\r
+  OUT UINTN                        *StringTextOffset  OPTIONAL,\r
+  OUT EFI_STRING_ID                *LastStringId  OPTIONAL,\r
+  OUT EFI_STRING_ID                *StartStringId OPTIONAL\r
   );\r
 \r
-\r
 /**\r
   Parse all glyph blocks to find a glyph block specified by CharValue.\r
   If CharValue = (CHAR16) (-1), collect all default character cell information\r
@@ -433,7 +544,7 @@ FindStringBlock (
   @param  CharValue               Unicode character value, which identifies a glyph\r
                                   block.\r
   @param  GlyphBuffer             Output the corresponding bitmap data of the found\r
-                                  block. It is the caller's responsiblity to free\r
+                                  block. It is the caller's responsibility to free\r
                                   this buffer.\r
   @param  Cell                    Output cell information of the encoded bitmap.\r
   @param  GlyphBufferLen          If not NULL, output the length of GlyphBuffer.\r
@@ -447,18 +558,45 @@ FindStringBlock (
 **/\r
 EFI_STATUS\r
 FindGlyphBlock (\r
-  IN  HII_FONT_PACKAGE_INSTANCE      *FontPackage,\r
-  IN  CHAR16                         CharValue,\r
-  OUT UINT8                          **GlyphBuffer, OPTIONAL\r
-  OUT EFI_HII_GLYPH_INFO             *Cell, OPTIONAL\r
-  OUT UINTN                          *GlyphBufferLen OPTIONAL\r
+  IN  HII_FONT_PACKAGE_INSTANCE  *FontPackage,\r
+  IN  CHAR16                     CharValue,\r
+  OUT UINT8                      **GlyphBuffer  OPTIONAL,\r
+  OUT EFI_HII_GLYPH_INFO         *Cell  OPTIONAL,\r
+  OUT UINTN                      *GlyphBufferLen OPTIONAL\r
+  );\r
+\r
+/**\r
+  This function exports Form packages to a buffer.\r
+  This is a internal function.\r
+\r
+  @param  Private                Hii database private structure.\r
+  @param  Handle                 Identification of a package list.\r
+  @param  PackageList            Pointer to a package list which will be exported.\r
+  @param  UsedSize               The length of buffer be used.\r
+  @param  BufferSize             Length of the Buffer.\r
+  @param  Buffer                 Allocated space for storing exported data.\r
+  @param  ResultSize             The size of the already exported content of  this\r
+                                 package list.\r
+\r
+  @retval EFI_SUCCESS            Form Packages are exported successfully.\r
+  @retval EFI_INVALID_PARAMETER  Any input parameter is invalid.\r
+\r
+**/\r
+EFI_STATUS\r
+ExportFormPackages (\r
+  IN HII_DATABASE_PRIVATE_DATA           *Private,\r
+  IN EFI_HII_HANDLE                      Handle,\r
+  IN HII_DATABASE_PACKAGE_LIST_INSTANCE  *PackageList,\r
+  IN UINTN                               UsedSize,\r
+  IN UINTN                               BufferSize,\r
+  IN OUT VOID                            *Buffer,\r
+  IN OUT UINTN                           *ResultSize\r
   );\r
 \r
 //\r
 // EFI_HII_FONT_PROTOCOL protocol interfaces\r
 //\r
 \r
-\r
 /**\r
   Renders a string to a bitmap or to the display.\r
 \r
@@ -516,19 +654,18 @@ FindGlyphBlock (
 EFI_STATUS\r
 EFIAPI\r
 HiiStringToImage (\r
-  IN  CONST EFI_HII_FONT_PROTOCOL    *This,\r
-  IN  EFI_HII_OUT_FLAGS              Flags,\r
-  IN  CONST EFI_STRING               String,\r
-  IN  CONST EFI_FONT_DISPLAY_INFO    *StringInfo       OPTIONAL,\r
-  IN  OUT EFI_IMAGE_OUTPUT           **Blt,\r
-  IN  UINTN                          BltX,\r
-  IN  UINTN                          BltY,\r
-  OUT EFI_HII_ROW_INFO               **RowInfoArray    OPTIONAL,\r
-  OUT UINTN                          *RowInfoArraySize OPTIONAL,\r
-  OUT UINTN                          *ColumnInfoArray  OPTIONAL\r
+  IN  CONST EFI_HII_FONT_PROTOCOL  *This,\r
+  IN  EFI_HII_OUT_FLAGS            Flags,\r
+  IN  CONST EFI_STRING             String,\r
+  IN  CONST EFI_FONT_DISPLAY_INFO  *StringInfo       OPTIONAL,\r
+  IN  OUT EFI_IMAGE_OUTPUT         **Blt,\r
+  IN  UINTN                        BltX,\r
+  IN  UINTN                        BltY,\r
+  OUT EFI_HII_ROW_INFO             **RowInfoArray    OPTIONAL,\r
+  OUT UINTN                        *RowInfoArraySize OPTIONAL,\r
+  OUT UINTN                        *ColumnInfoArray  OPTIONAL\r
   );\r
 \r
-\r
 /**\r
   Render a string to a bitmap or the screen containing the contents of the specified string.\r
 \r
@@ -586,28 +723,27 @@ HiiStringToImage (
                                   RowInfoArray or Blt.\r
   @retval EFI_INVALID_PARAMETER The Blt or PackageList was NULL.\r
   @retval EFI_INVALID_PARAMETER Flags were invalid combination.\r
-  @retval EFI_NOT_FOUND         The specified PackageList is not in the Database or the stringid is not \r
-                          in the specified PackageList. \r
+  @retval EFI_NOT_FOUND         The specified PackageList is not in the Database or the stringid is not\r
+                          in the specified PackageList.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 HiiStringIdToImage (\r
-  IN  CONST EFI_HII_FONT_PROTOCOL    *This,\r
-  IN  EFI_HII_OUT_FLAGS              Flags,\r
-  IN  EFI_HII_HANDLE                 PackageList,\r
-  IN  EFI_STRING_ID                  StringId,\r
-  IN  CONST CHAR8*                   Language,\r
-  IN  CONST EFI_FONT_DISPLAY_INFO    *StringInfo       OPTIONAL,\r
-  IN  OUT EFI_IMAGE_OUTPUT           **Blt,\r
-  IN  UINTN                          BltX,\r
-  IN  UINTN                          BltY,\r
-  OUT EFI_HII_ROW_INFO               **RowInfoArray    OPTIONAL,\r
-  OUT UINTN                          *RowInfoArraySize OPTIONAL,\r
-  OUT UINTN                          *ColumnInfoArray  OPTIONAL\r
+  IN  CONST EFI_HII_FONT_PROTOCOL  *This,\r
+  IN  EFI_HII_OUT_FLAGS            Flags,\r
+  IN  EFI_HII_HANDLE               PackageList,\r
+  IN  EFI_STRING_ID                StringId,\r
+  IN  CONST CHAR8                  *Language,\r
+  IN  CONST EFI_FONT_DISPLAY_INFO  *StringInfo       OPTIONAL,\r
+  IN  OUT EFI_IMAGE_OUTPUT         **Blt,\r
+  IN  UINTN                        BltX,\r
+  IN  UINTN                        BltY,\r
+  OUT EFI_HII_ROW_INFO             **RowInfoArray    OPTIONAL,\r
+  OUT UINTN                        *RowInfoArraySize OPTIONAL,\r
+  OUT UINTN                        *ColumnInfoArray  OPTIONAL\r
   );\r
 \r
-\r
 /**\r
   Convert the glyph for a single character into a bitmap.\r
 \r
@@ -633,14 +769,13 @@ HiiStringIdToImage (
 EFI_STATUS\r
 EFIAPI\r
 HiiGetGlyph (\r
-  IN  CONST EFI_HII_FONT_PROTOCOL    *This,\r
-  IN  CHAR16                         Char,\r
-  IN  CONST EFI_FONT_DISPLAY_INFO    *StringInfo,\r
-  OUT EFI_IMAGE_OUTPUT               **Blt,\r
-  OUT UINTN                          *Baseline OPTIONAL\r
+  IN  CONST EFI_HII_FONT_PROTOCOL  *This,\r
+  IN  CHAR16                       Char,\r
+  IN  CONST EFI_FONT_DISPLAY_INFO  *StringInfo,\r
+  OUT EFI_IMAGE_OUTPUT             **Blt,\r
+  OUT UINTN                        *Baseline OPTIONAL\r
   );\r
 \r
-\r
 /**\r
   This function iterates through fonts which match the specified font, using\r
   the specified criteria. If String is non-NULL, then all of the characters in\r
@@ -652,13 +787,15 @@ HiiGetGlyph (
                                   with the  first font. On return, points to the\r
                                   returned font handle or points to NULL if there\r
                                   are no more matching fonts.\r
-  @param  StringInfoIn            Upon entry, points to the font to return\r
-                                  information about. If NULL, then the information about the system default \r
-                                  font will be returned.\r
-  @param  StringInfoOut           Upon return, contains the matching font's\r
-                                  information.  If NULL, then no information is\r
-                                  returned. It's caller's responsibility to free\r
-                                  this buffer.\r
+  @param  StringInfoIn            Upon entry, points to the font to return information\r
+                                  about. If NULL, then the information about the system\r
+                                  default font will be returned.\r
+  @param  StringInfoOut           Upon return, contains the matching font's information.\r
+                                  If NULL, then no information is returned. This buffer\r
+                                  is allocated with a call to the Boot Service AllocatePool().\r
+                                  It is the caller's responsibility to call the Boot\r
+                                  Service FreePool() when the caller no longer requires\r
+                                  the contents of StringInfoOut.\r
   @param  String                  Points to the string which will be tested to\r
                                   determine  if all characters are available. If\r
                                   NULL, then any font  is acceptable.\r
@@ -666,24 +803,100 @@ HiiGetGlyph (
   @retval EFI_SUCCESS             Matching font returned successfully.\r
   @retval EFI_NOT_FOUND           No matching font was found.\r
   @retval EFI_INVALID_PARAMETER   StringInfoIn is NULL.\r
-  @retval EFI_INVALID_PARAMETER  StringInfoIn->FontInfoMask is an invalid combination.\r
+  @retval EFI_INVALID_PARAMETER   StringInfoIn->FontInfoMask is an invalid combination.\r
   @retval EFI_OUT_OF_RESOURCES    There were insufficient resources to complete the\r
                                   request.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 HiiGetFontInfo (\r
-  IN  CONST EFI_HII_FONT_PROTOCOL    *This,\r
-  IN  OUT   EFI_FONT_HANDLE          *FontHandle,\r
-  IN  CONST EFI_FONT_DISPLAY_INFO    *StringInfoIn, OPTIONAL\r
-  OUT       EFI_FONT_DISPLAY_INFO    **StringInfoOut,\r
-  IN  CONST EFI_STRING               String OPTIONAL\r
+  IN  CONST EFI_HII_FONT_PROTOCOL  *This,\r
+  IN  OUT   EFI_FONT_HANDLE        *FontHandle,\r
+  IN  CONST EFI_FONT_DISPLAY_INFO  *StringInfoIn  OPTIONAL,\r
+  OUT       EFI_FONT_DISPLAY_INFO  **StringInfoOut,\r
+  IN  CONST EFI_STRING             String OPTIONAL\r
   );\r
 \r
 //\r
 // EFI_HII_IMAGE_PROTOCOL interfaces\r
 //\r
 \r
+/**\r
+  Get the image id of last image block: EFI_HII_IIBT_END_BLOCK when input\r
+  ImageId is zero, otherwise return the address of the\r
+  corresponding image block with identifier specified by ImageId.\r
+\r
+  This is a internal function.\r
+\r
+  @param ImageBlocks     Points to the beginning of a series of image blocks stored in order.\r
+  @param ImageId         If input ImageId is 0, output the image id of the EFI_HII_IIBT_END_BLOCK;\r
+                         else use this id to find its corresponding image block address.\r
+\r
+  @return The image block address when input ImageId is not zero; otherwise return NULL.\r
+\r
+**/\r
+EFI_HII_IMAGE_BLOCK *\r
+GetImageIdOrAddress (\r
+  IN EFI_HII_IMAGE_BLOCK  *ImageBlocks,\r
+  IN OUT EFI_IMAGE_ID     *ImageId\r
+  );\r
+\r
+/**\r
+  Return the HII package list identified by PackageList HII handle.\r
+\r
+  @param Database    Pointer to HII database list header.\r
+  @param PackageList HII handle of the package list to locate.\r
+\r
+  @retval The HII package list instance.\r
+**/\r
+HII_DATABASE_PACKAGE_LIST_INSTANCE *\r
+LocatePackageList (\r
+  IN  LIST_ENTRY      *Database,\r
+  IN  EFI_HII_HANDLE  PackageList\r
+  );\r
+\r
+/**\r
+  This function retrieves the image specified by ImageId which is associated with\r
+  the specified PackageList and copies it into the buffer specified by Image.\r
+\r
+  @param  Database               A pointer to the database list header.\r
+  @param  PackageList            Handle of the package list where this image will\r
+                                 be searched.\r
+  @param  ImageId                The image's id,, which is unique within\r
+                                 PackageList.\r
+  @param  Image                  Points to the image.\r
+  @param  BitmapOnly             TRUE to only return the bitmap type image.\r
+                                 FALSE to locate image decoder instance to decode image.\r
+\r
+  @retval EFI_SUCCESS            The new image was returned successfully.\r
+  @retval EFI_NOT_FOUND          The image specified by ImageId is not in the\r
+                                 database. The specified PackageList is not in the database.\r
+  @retval EFI_BUFFER_TOO_SMALL   The buffer specified by ImageSize is too small to\r
+                                 hold the image.\r
+  @retval EFI_INVALID_PARAMETER  The Image or ImageSize was NULL.\r
+  @retval EFI_OUT_OF_RESOURCES   The bitmap could not be retrieved because there was not\r
+                                 enough memory.\r
+**/\r
+EFI_STATUS\r
+IGetImage (\r
+  IN  LIST_ENTRY       *Database,\r
+  IN  EFI_HII_HANDLE   PackageList,\r
+  IN  EFI_IMAGE_ID     ImageId,\r
+  OUT EFI_IMAGE_INPUT  *Image,\r
+  IN  BOOLEAN          BitmapOnly\r
+  );\r
+\r
+/**\r
+  Return the first HII image decoder instance which supports the DecoderName.\r
+\r
+  @param BlockType  The image block type.\r
+\r
+  @retval Pointer to the HII image decoder instance.\r
+**/\r
+EFI_HII_IMAGE_DECODER_PROTOCOL *\r
+LocateHiiImageDecoder (\r
+  UINT8  BlockType\r
+  );\r
 \r
 /**\r
   This function adds the image Image to the group of images owned by PackageList, and returns\r
@@ -706,13 +919,12 @@ HiiGetFontInfo (
 EFI_STATUS\r
 EFIAPI\r
 HiiNewImage (\r
-  IN  CONST EFI_HII_IMAGE_PROTOCOL   *This,\r
-  IN  EFI_HII_HANDLE                 PackageList,\r
-  OUT EFI_IMAGE_ID                   *ImageId,\r
-  IN  CONST EFI_IMAGE_INPUT          *Image\r
+  IN  CONST EFI_HII_IMAGE_PROTOCOL  *This,\r
+  IN  EFI_HII_HANDLE                PackageList,\r
+  OUT EFI_IMAGE_ID                  *ImageId,\r
+  IN  CONST EFI_IMAGE_INPUT         *Image\r
   );\r
 \r
-\r
 /**\r
   This function retrieves the image specified by ImageId which is associated with\r
   the specified PackageList and copies it into the buffer specified by Image.\r
@@ -737,13 +949,12 @@ HiiNewImage (
 EFI_STATUS\r
 EFIAPI\r
 HiiGetImage (\r
-  IN  CONST EFI_HII_IMAGE_PROTOCOL   *This,\r
-  IN  EFI_HII_HANDLE                 PackageList,\r
-  IN  EFI_IMAGE_ID                   ImageId,\r
-  OUT EFI_IMAGE_INPUT                *Image\r
+  IN  CONST EFI_HII_IMAGE_PROTOCOL  *This,\r
+  IN  EFI_HII_HANDLE                PackageList,\r
+  IN  EFI_IMAGE_ID                  ImageId,\r
+  OUT EFI_IMAGE_INPUT               *Image\r
   );\r
 \r
-\r
 /**\r
   This function updates the image specified by ImageId in the specified PackageListHandle to\r
   the image specified by Image.\r
@@ -763,13 +974,12 @@ HiiGetImage (
 EFI_STATUS\r
 EFIAPI\r
 HiiSetImage (\r
-  IN CONST EFI_HII_IMAGE_PROTOCOL    *This,\r
-  IN EFI_HII_HANDLE                  PackageList,\r
-  IN EFI_IMAGE_ID                    ImageId,\r
-  IN CONST EFI_IMAGE_INPUT           *Image\r
+  IN CONST EFI_HII_IMAGE_PROTOCOL  *This,\r
+  IN EFI_HII_HANDLE                PackageList,\r
+  IN EFI_IMAGE_ID                  ImageId,\r
+  IN CONST EFI_IMAGE_INPUT         *Image\r
   );\r
 \r
-\r
 /**\r
   This function renders an image to a bitmap or the screen using the specified\r
   color and options. It draws the image on an existing bitmap, allocates a new\r
@@ -802,15 +1012,14 @@ HiiSetImage (
 EFI_STATUS\r
 EFIAPI\r
 HiiDrawImage (\r
-  IN CONST EFI_HII_IMAGE_PROTOCOL    *This,\r
-  IN EFI_HII_DRAW_FLAGS              Flags,\r
-  IN CONST EFI_IMAGE_INPUT           *Image,\r
-  IN OUT EFI_IMAGE_OUTPUT            **Blt,\r
-  IN UINTN                           BltX,\r
-  IN UINTN                           BltY\r
+  IN CONST EFI_HII_IMAGE_PROTOCOL  *This,\r
+  IN EFI_HII_DRAW_FLAGS            Flags,\r
+  IN CONST EFI_IMAGE_INPUT         *Image,\r
+  IN OUT EFI_IMAGE_OUTPUT          **Blt,\r
+  IN UINTN                         BltX,\r
+  IN UINTN                         BltY\r
   );\r
 \r
-\r
 /**\r
   This function renders an image to a bitmap or the screen using the specified\r
   color and options. It draws the image on an existing bitmap, allocates a new\r
@@ -841,29 +1050,232 @@ HiiDrawImage (
   @retval EFI_SUCCESS             The image was successfully drawn.\r
   @retval EFI_OUT_OF_RESOURCES    Unable to allocate an output buffer for Blt.\r
   @retval EFI_INVALID_PARAMETER  The Blt was NULL.\r
-  @retval EFI_NOT_FOUND          The image specified by ImageId is not in the database. \r
+  @retval EFI_NOT_FOUND          The image specified by ImageId is not in the database.\r
                            The specified PackageList is not in the database.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 HiiDrawImageId (\r
-  IN CONST EFI_HII_IMAGE_PROTOCOL    *This,\r
-  IN EFI_HII_DRAW_FLAGS              Flags,\r
-  IN EFI_HII_HANDLE                  PackageList,\r
-  IN EFI_IMAGE_ID                    ImageId,\r
-  IN OUT EFI_IMAGE_OUTPUT            **Blt,\r
-  IN UINTN                           BltX,\r
-  IN UINTN                           BltY\r
-  )\r
+  IN CONST EFI_HII_IMAGE_PROTOCOL  *This,\r
+  IN EFI_HII_DRAW_FLAGS            Flags,\r
+  IN EFI_HII_HANDLE                PackageList,\r
+  IN EFI_IMAGE_ID                  ImageId,\r
+  IN OUT EFI_IMAGE_OUTPUT          **Blt,\r
+  IN UINTN                         BltX,\r
+  IN UINTN                         BltY\r
+  );\r
 \r
-;\r
+/**\r
+  The prototype of this extension function is the same with EFI_HII_IMAGE_PROTOCOL.NewImage().\r
+  This protocol invokes EFI_HII_IMAGE_PROTOCOL.NewImage() implicitly.\r
+\r
+  @param  This                   A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.\r
+  @param  PackageList            Handle of the package list where this image will\r
+                                 be added.\r
+  @param  ImageId                On return, contains the new image id, which is\r
+                                 unique within PackageList.\r
+  @param  Image                  Points to the image.\r
+\r
+  @retval EFI_SUCCESS            The new image was added successfully.\r
+  @retval EFI_NOT_FOUND          The PackageList could not be found.\r
+  @retval EFI_OUT_OF_RESOURCES   Could not add the image due to lack of resources.\r
+  @retval EFI_INVALID_PARAMETER  Image is NULL or ImageId is NULL.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+HiiNewImageEx (\r
+  IN  CONST EFI_HII_IMAGE_EX_PROTOCOL  *This,\r
+  IN  EFI_HII_HANDLE                   PackageList,\r
+  OUT EFI_IMAGE_ID                     *ImageId,\r
+  IN  CONST EFI_IMAGE_INPUT            *Image\r
+  );\r
+\r
+/**\r
+  Return the information about the image, associated with the package list.\r
+  The prototype of this extension function is the same with EFI_HII_IMAGE_PROTOCOL.GetImage().\r
+\r
+  This function is similar to EFI_HII_IMAGE_PROTOCOL.GetImage(). The difference is that\r
+  this function will locate all EFI_HII_IMAGE_DECODER_PROTOCOL instances installed in the\r
+  system if the decoder of the certain image type is not supported by the\r
+  EFI_HII_IMAGE_EX_PROTOCOL. The function will attempt to decode the image to the\r
+  EFI_IMAGE_INPUT using the first EFI_HII_IMAGE_DECODER_PROTOCOL instance that\r
+  supports the requested image type.\r
+\r
+  @param  This                   A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.\r
+  @param  PackageList            The package list in the HII database to search for the\r
+                                 specified image.\r
+  @param  ImageId                The image's id, which is unique within PackageList.\r
+  @param  Image                  Points to the image.\r
+\r
+  @retval EFI_SUCCESS            The new image was returned successfully.\r
+  @retval EFI_NOT_FOUND          The image specified by ImageId is not available. The specified\r
+                                 PackageList is not in the Database.\r
+  @retval EFI_INVALID_PARAMETER  Image was NULL or ImageId was 0.\r
+  @retval EFI_OUT_OF_RESOURCES   The bitmap could not be retrieved because there\r
+                                 was not enough memory.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+HiiGetImageEx (\r
+  IN  CONST EFI_HII_IMAGE_EX_PROTOCOL  *This,\r
+  IN  EFI_HII_HANDLE                   PackageList,\r
+  IN  EFI_IMAGE_ID                     ImageId,\r
+  OUT EFI_IMAGE_INPUT                  *Image\r
+  );\r
+\r
+/**\r
+  Change the information about the image.\r
+\r
+  Same with EFI_HII_IMAGE_PROTOCOL.SetImage(), this protocol invokes\r
+  EFI_HII_IMAGE_PROTOCOL.SetImage()implicitly.\r
+\r
+  @param  This                   A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.\r
+  @param  PackageList            The package list containing the images.\r
+  @param  ImageId                The image's id, which is unique within PackageList.\r
+  @param  Image                  Points to the image.\r
+\r
+  @retval EFI_SUCCESS            The new image was successfully updated.\r
+  @retval EFI_NOT_FOUND          The image specified by ImageId is not in the\r
+                                 database. The specified PackageList is not in\r
+                                 the database.\r
+  @retval EFI_INVALID_PARAMETER  The Image was NULL, the ImageId was 0 or\r
+                                 the Image->Bitmap was NULL.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+HiiSetImageEx (\r
+  IN CONST EFI_HII_IMAGE_EX_PROTOCOL  *This,\r
+  IN EFI_HII_HANDLE                   PackageList,\r
+  IN EFI_IMAGE_ID                     ImageId,\r
+  IN CONST EFI_IMAGE_INPUT            *Image\r
+  );\r
+\r
+/**\r
+  Renders an image to a bitmap or to the display.\r
+\r
+  The prototype of this extension function is the same with\r
+  EFI_HII_IMAGE_PROTOCOL.DrawImage(). This protocol invokes\r
+  EFI_HII_IMAGE_PROTOCOL.DrawImage() implicitly.\r
+\r
+  @param  This                   A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.\r
+  @param  Flags                  Describes how the image is to be drawn.\r
+  @param  Image                  Points to the image to be displayed.\r
+  @param  Blt                    If this points to a non-NULL on entry, this points\r
+                                 to the image, which is Width pixels wide and\r
+                                 Height pixels high.  The image will be drawn onto\r
+                                 this image and  EFI_HII_DRAW_FLAG_CLIP is implied.\r
+                                 If this points to a NULL on entry, then a buffer\r
+                                 will be allocated to hold the generated image and\r
+                                 the pointer updated on exit. It is the caller's\r
+                                 responsibility to free this buffer.\r
+  @param  BltX                   Specifies the offset from the left and top edge of\r
+                                 the output image of the first pixel in the image.\r
+  @param  BltY                   Specifies the offset from the left and top edge of\r
+                                 the output image of the first pixel in the image.\r
+\r
+  @retval EFI_SUCCESS            The image was successfully drawn.\r
+  @retval EFI_OUT_OF_RESOURCES   Unable to allocate an output buffer for Blt.\r
+  @retval EFI_INVALID_PARAMETER  The Image or Blt was NULL.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+HiiDrawImageEx (\r
+  IN CONST EFI_HII_IMAGE_EX_PROTOCOL  *This,\r
+  IN EFI_HII_DRAW_FLAGS               Flags,\r
+  IN CONST EFI_IMAGE_INPUT            *Image,\r
+  IN OUT EFI_IMAGE_OUTPUT             **Blt,\r
+  IN UINTN                            BltX,\r
+  IN UINTN                            BltY\r
+  );\r
+\r
+/**\r
+  Renders an image to a bitmap or the screen containing the contents of the specified\r
+  image.\r
+\r
+  This function is similar to EFI_HII_IMAGE_PROTOCOL.DrawImageId(). The difference is that\r
+  this function will locate all EFI_HII_IMAGE_DECODER_PROTOCOL instances installed in the\r
+  system if the decoder of the certain image type is not supported by the\r
+  EFI_HII_IMAGE_EX_PROTOCOL. The function will attempt to decode the image to the\r
+  EFI_IMAGE_INPUT using the first EFI_HII_IMAGE_DECODER_PROTOCOL instance that\r
+  supports the requested image type.\r
+\r
+  @param  This                   A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.\r
+  @param  Flags                  Describes how the image is to be drawn.\r
+  @param  PackageList            The package list in the HII database to search for\r
+                                 the  specified image.\r
+  @param  ImageId                The image's id, which is unique within PackageList.\r
+  @param  Blt                    If this points to a non-NULL on entry, this points\r
+                                 to the image, which is Width pixels wide and\r
+                                 Height pixels high. The image will be drawn onto\r
+                                 this image and EFI_HII_DRAW_FLAG_CLIP is implied.\r
+                                 If this points to a NULL on entry, then a buffer\r
+                                 will be allocated to hold  the generated image\r
+                                 and the pointer updated on exit. It is the caller's\r
+                                 responsibility to free this buffer.\r
+  @param  BltX                   Specifies the offset from the left and top edge of\r
+                                 the output image of the first pixel in the image.\r
+  @param  BltY                   Specifies the offset from the left and top edge of\r
+                                 the output image of the first pixel in the image.\r
+\r
+  @retval EFI_SUCCESS            The image was successfully drawn.\r
+  @retval EFI_OUT_OF_RESOURCES   Unable to allocate an output buffer for Blt.\r
+  @retval EFI_INVALID_PARAMETER  The Blt was NULL or ImageId was 0.\r
+  @retval EFI_NOT_FOUND          The image specified by ImageId is not in the database.\r
+                                 The specified PackageList is not in the database.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+HiiDrawImageIdEx (\r
+  IN CONST EFI_HII_IMAGE_EX_PROTOCOL  *This,\r
+  IN EFI_HII_DRAW_FLAGS               Flags,\r
+  IN EFI_HII_HANDLE                   PackageList,\r
+  IN EFI_IMAGE_ID                     ImageId,\r
+  IN OUT EFI_IMAGE_OUTPUT             **Blt,\r
+  IN UINTN                            BltX,\r
+  IN UINTN                            BltY\r
+  );\r
+\r
+/**\r
+  This function returns the image information to EFI_IMAGE_OUTPUT. Only the width\r
+  and height are returned to the EFI_IMAGE_OUTPUT instead of decoding the image\r
+  to the buffer. This function is used to get the geometry of the image. This function\r
+  will try to locate all of the EFI_HII_IMAGE_DECODER_PROTOCOL installed on the\r
+  system if the decoder of image type is not supported by the EFI_HII_IMAGE_EX_PROTOCOL.\r
+\r
+  @param  This                   A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.\r
+  @param  PackageList            Handle of the package list where this image will\r
+                                 be searched.\r
+  @param  ImageId                The image's id, which is unique within PackageList.\r
+  @param  Image                  Points to the image.\r
+\r
+  @retval EFI_SUCCESS            The new image was returned successfully.\r
+  @retval EFI_NOT_FOUND          The image specified by ImageId is not in the\r
+                                 database. The specified PackageList is not in the database.\r
+  @retval EFI_BUFFER_TOO_SMALL   The buffer specified by ImageSize is too small to\r
+                                 hold the image.\r
+  @retval EFI_INVALID_PARAMETER  The Image was NULL or the ImageId was 0.\r
+  @retval EFI_OUT_OF_RESOURCES   The bitmap could not be retrieved because there\r
+                                 was not enough memory.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+HiiGetImageInfo (\r
+  IN CONST  EFI_HII_IMAGE_EX_PROTOCOL  *This,\r
+  IN        EFI_HII_HANDLE             PackageList,\r
+  IN        EFI_IMAGE_ID               ImageId,\r
+  OUT       EFI_IMAGE_OUTPUT           *Image\r
+  );\r
 \r
 //\r
 // EFI_HII_STRING_PROTOCOL\r
 //\r
 \r
-\r
 /**\r
   This function adds the string String to the group of strings owned by PackageList, with the\r
   specified font information StringFontInfo and returns a new string id.\r
@@ -898,16 +1310,15 @@ HiiDrawImageId (
 EFI_STATUS\r
 EFIAPI\r
 HiiNewString (\r
-  IN  CONST EFI_HII_STRING_PROTOCOL   *This,\r
-  IN  EFI_HII_HANDLE                  PackageList,\r
-  OUT EFI_STRING_ID                   *StringId,\r
-  IN  CONST CHAR8                     *Language,\r
-  IN  CONST CHAR16                    *LanguageName, OPTIONAL\r
-  IN  CONST EFI_STRING                String,\r
-  IN  CONST EFI_FONT_INFO             *StringFontInfo OPTIONAL\r
+  IN  CONST EFI_HII_STRING_PROTOCOL  *This,\r
+  IN  EFI_HII_HANDLE                 PackageList,\r
+  OUT EFI_STRING_ID                  *StringId,\r
+  IN  CONST CHAR8                    *Language,\r
+  IN  CONST CHAR16                   *LanguageName  OPTIONAL,\r
+  IN  CONST EFI_STRING               String,\r
+  IN  CONST EFI_FONT_INFO            *StringFontInfo OPTIONAL\r
   );\r
 \r
-\r
 /**\r
   This function retrieves the string specified by StringId which is associated\r
   with the specified PackageList in the language Language and copies it into\r
@@ -931,13 +1342,14 @@ HiiNewString (
   @retval EFI_SUCCESS             The string was returned successfully.\r
   @retval EFI_NOT_FOUND           The string specified by StringId is not\r
                                   available.\r
-  @retval EFI_NOT_FOUND           The string specified by StringId is available but\r
-                                                not in the specified language.\r
-                                                The specified PackageList is not in the database.\r
-  @retval EFI_INVALID_LANGUAGE   - The string specified by StringId is available but\r
+                                  The specified PackageList is not in the database.\r
+  @retval EFI_INVALID_LANGUAGE    The string specified by StringId is available but\r
+                                  not in the specified language.\r
   @retval EFI_BUFFER_TOO_SMALL    The buffer specified by StringSize is too small\r
                                   to  hold the string.\r
-  @retval EFI_INVALID_PARAMETER   The String or Language or StringSize was NULL.\r
+  @retval EFI_INVALID_PARAMETER   The Language or StringSize was NULL.\r
+  @retval EFI_INVALID_PARAMETER   The value referenced by StringSize was not zero\r
+                                  and String was NULL.\r
   @retval EFI_OUT_OF_RESOURCES    There were insufficient resources to complete the\r
                                    request.\r
 \r
@@ -945,16 +1357,15 @@ HiiNewString (
 EFI_STATUS\r
 EFIAPI\r
 HiiGetString (\r
-  IN  CONST EFI_HII_STRING_PROTOCOL   *This,\r
-  IN  CONST CHAR8                     *Language,\r
-  IN  EFI_HII_HANDLE                  PackageList,\r
-  IN  EFI_STRING_ID                   StringId,\r
-  OUT EFI_STRING                      String,\r
-  IN  OUT UINTN                       *StringSize,\r
-  OUT EFI_FONT_INFO                   **StringFontInfo OPTIONAL\r
+  IN  CONST EFI_HII_STRING_PROTOCOL  *This,\r
+  IN  CONST CHAR8                    *Language,\r
+  IN  EFI_HII_HANDLE                 PackageList,\r
+  IN  EFI_STRING_ID                  StringId,\r
+  OUT EFI_STRING                     String,\r
+  IN  OUT UINTN                      *StringSize,\r
+  OUT EFI_FONT_INFO                  **StringFontInfo OPTIONAL\r
   );\r
 \r
-\r
 /**\r
   This function updates the string specified by StringId in the specified PackageList to the text\r
   specified by String and, optionally, the font information specified by StringFontInfo.\r
@@ -980,15 +1391,14 @@ HiiGetString (
 EFI_STATUS\r
 EFIAPI\r
 HiiSetString (\r
-  IN CONST EFI_HII_STRING_PROTOCOL    *This,\r
-  IN EFI_HII_HANDLE                   PackageList,\r
-  IN EFI_STRING_ID                    StringId,\r
-  IN CONST CHAR8                      *Language,\r
-  IN CONST EFI_STRING                 String,\r
-  IN CONST EFI_FONT_INFO              *StringFontInfo OPTIONAL\r
+  IN CONST EFI_HII_STRING_PROTOCOL  *This,\r
+  IN EFI_HII_HANDLE                 PackageList,\r
+  IN EFI_STRING_ID                  StringId,\r
+  IN CONST CHAR8                    *Language,\r
+  IN CONST EFI_STRING               String,\r
+  IN CONST EFI_FONT_INFO            *StringFontInfo OPTIONAL\r
   );\r
 \r
-\r
 /**\r
   This function returns the list of supported languages, in the format specified\r
   in Appendix M of UEFI 2.1 spec.\r
@@ -996,13 +1406,15 @@ HiiSetString (
   @param  This                    A pointer to the EFI_HII_STRING_PROTOCOL\r
                                   instance.\r
   @param  PackageList             The package list to examine.\r
-  @param  Languages               Points to the buffer to hold the returned string.\r
+  @param  Languages               Points to the buffer to hold the returned\r
+                                  null-terminated ASCII string.\r
   @param  LanguagesSize           On entry, points to the size of the buffer\r
                                   pointed to by  Languages, in bytes. On  return,\r
                                   points to the length of Languages, in bytes.\r
 \r
   @retval EFI_SUCCESS             The languages were returned successfully.\r
-  @retval EFI_INVALID_PARAMETER   The Languages or LanguagesSize was NULL.\r
+  @retval EFI_INVALID_PARAMETER   The LanguagesSize was NULL.\r
+  @retval EFI_INVALID_PARAMETER   The value referenced by LanguagesSize is not zero and Languages is NULL.\r
   @retval EFI_BUFFER_TOO_SMALL    The LanguagesSize is too small to hold the list\r
                                   of  supported languages. LanguageSize is updated\r
                                   to contain the required size.\r
@@ -1013,13 +1425,12 @@ HiiSetString (
 EFI_STATUS\r
 EFIAPI\r
 HiiGetLanguages (\r
-  IN CONST EFI_HII_STRING_PROTOCOL    *This,\r
-  IN EFI_HII_HANDLE                   PackageList,\r
-  IN OUT CHAR8                        *Languages,\r
-  IN OUT UINTN                        *LanguagesSize\r
+  IN CONST EFI_HII_STRING_PROTOCOL  *This,\r
+  IN EFI_HII_HANDLE                 PackageList,\r
+  IN OUT CHAR8                      *Languages,\r
+  IN OUT UINTN                      *LanguagesSize\r
   );\r
 \r
-\r
 /**\r
   Each string package has associated with it a single primary language and zero\r
   or more secondary languages. This routine returns the secondary languages\r
@@ -1028,44 +1439,47 @@ HiiGetLanguages (
   @param  This                    A pointer to the EFI_HII_STRING_PROTOCOL\r
                                   instance.\r
   @param  PackageList             The package list to examine.\r
-  @param  FirstLanguage           Points to the primary language.\r
-  @param  SecondaryLanguages      Points to the buffer to hold the returned list of\r
-                                   secondary languages for the specified\r
-                                  FirstLanguage. If there are no secondary\r
-                                  languages, the function  returns successfully,\r
+  @param  PrimaryLanguage         Points to the null-terminated ASCII string that specifies\r
+                                  the primary language. Languages are specified in the\r
+                                  format specified in Appendix M of the UEFI 2.0 specification.\r
+  @param  SecondaryLanguages      Points to the buffer to hold the returned null-terminated\r
+                                  ASCII string that describes the list of\r
+                                  secondary languages for the specified\r
+                                  PrimaryLanguage. If there are no secondary\r
+                                  languages, the function returns successfully,\r
                                   but this is set to NULL.\r
   @param  SecondaryLanguagesSize  On entry, points to the size of the buffer\r
-                                  pointed to  by SecondLanguages, in bytes. On\r
-                                  return, points to the length of SecondLanguages\r
+                                  pointed to by SecondaryLanguages, in bytes. On\r
+                                  return, points to the length of SecondaryLanguages\r
                                   in bytes.\r
 \r
   @retval EFI_SUCCESS             Secondary languages were correctly returned.\r
-  @retval EFI_INVALID_PARAMETER   FirstLanguage or SecondLanguages or\r
-                                  SecondLanguagesSize was NULL.\r
-  @retval EFI_BUFFER_TOO_SMALL    The buffer specified by SecondLanguagesSize is\r
+  @retval EFI_INVALID_PARAMETER   PrimaryLanguage or SecondaryLanguagesSize was NULL.\r
+  @retval EFI_INVALID_PARAMETER   The value referenced by SecondaryLanguagesSize is not\r
+                                  zero and SecondaryLanguages is NULL.\r
+  @retval EFI_BUFFER_TOO_SMALL    The buffer specified by SecondaryLanguagesSize is\r
                                   too small to hold the returned information.\r
-                                  SecondLanguageSize is updated to hold the size of\r
+                                  SecondaryLanguageSize is updated to hold the size of\r
                                   the buffer required.\r
-  @retval EFI_INVALID_LANGUAGE           The language specified by FirstLanguage is not\r
+  @retval EFI_INVALID_LANGUAGE    The language specified by PrimaryLanguage is not\r
                                   present in the specified package list.\r
-  @retval EFI_NOT_FOUND          The specified PackageList is not in the Database.                                \r
+  @retval EFI_NOT_FOUND           The specified PackageList is not in the Database.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 HiiGetSecondaryLanguages (\r
-  IN CONST EFI_HII_STRING_PROTOCOL   *This,\r
-  IN EFI_HII_HANDLE                  PackageList,\r
-  IN CONST CHAR8                     *FirstLanguage,\r
-  IN OUT CHAR8                       *SecondaryLanguages,\r
-  IN OUT UINTN                       *SecondaryLanguagesSize\r
+  IN CONST EFI_HII_STRING_PROTOCOL  *This,\r
+  IN EFI_HII_HANDLE                 PackageList,\r
+  IN CONST CHAR8                    *PrimaryLanguage,\r
+  IN OUT CHAR8                      *SecondaryLanguages,\r
+  IN OUT UINTN                      *SecondaryLanguagesSize\r
   );\r
 \r
 //\r
 // EFI_HII_DATABASE_PROTOCOL protocol interfaces\r
 //\r
 \r
-\r
 /**\r
   This function adds the packages in the package list to the database and returns a handle. If there is a\r
   EFI_DEVICE_PATH_PROTOCOL associated with the DriverHandle, then this function will\r
@@ -1076,6 +1490,8 @@ HiiGetSecondaryLanguages (
   @param  PackageList             A pointer to an EFI_HII_PACKAGE_LIST_HEADER\r
                                   structure.\r
   @param  DriverHandle            Associate the package list with this EFI handle.\r
+                                  If a NULL is specified, this data will not be associate\r
+                                  with any drivers and cannot have a callback induced.\r
   @param  Handle                  A pointer to the EFI_HII_HANDLE instance.\r
 \r
   @retval EFI_SUCCESS             The package list associated with the Handle was\r
@@ -1090,11 +1506,10 @@ EFIAPI
 HiiNewPackageList (\r
   IN CONST EFI_HII_DATABASE_PROTOCOL    *This,\r
   IN CONST EFI_HII_PACKAGE_LIST_HEADER  *PackageList,\r
-  IN CONST EFI_HANDLE                   DriverHandle,\r
+  IN CONST EFI_HANDLE                   DriverHandle  OPTIONAL,\r
   OUT EFI_HII_HANDLE                    *Handle\r
   );\r
 \r
-\r
 /**\r
   This function removes the package list that is associated with a handle Handle\r
   from the HII database. Before removing the package, any registered functions\r
@@ -1113,11 +1528,10 @@ HiiNewPackageList (
 EFI_STATUS\r
 EFIAPI\r
 HiiRemovePackageList (\r
-  IN CONST EFI_HII_DATABASE_PROTOCOL    *This,\r
-  IN EFI_HII_HANDLE                     Handle\r
+  IN CONST EFI_HII_DATABASE_PROTOCOL  *This,\r
+  IN EFI_HII_HANDLE                   Handle\r
   );\r
 \r
-\r
 /**\r
   This function updates the existing package list (which has the specified Handle)\r
   in the HII databases, using the new package list specified by PackageList.\r
@@ -1144,7 +1558,6 @@ HiiUpdatePackageList (
   IN CONST EFI_HII_PACKAGE_LIST_HEADER  *PackageList\r
   );\r
 \r
-\r
 /**\r
   This function returns a list of the package handles of the specified type\r
   that are currently active in the database. The pseudo-type\r
@@ -1164,32 +1577,32 @@ HiiUpdatePackageList (
                                   buffer that is required for the handles found.\r
   @param  Handle                  An array of EFI_HII_HANDLE instances returned.\r
 \r
-  @retval EFI_SUCCESS             The matching handles are outputed successfully.\r
-                                                HandleBufferLength is updated with the actual length.\r
+  @retval EFI_SUCCESS             The matching handles are outputted successfully.\r
+                                  HandleBufferLength is updated with the actual length.\r
   @retval EFI_BUFFER_TO_SMALL     The HandleBufferLength parameter indicates that\r
                                   Handle is too small to support the number of\r
                                   handles. HandleBufferLength is updated with a\r
                                   value that will  enable the data to fit.\r
   @retval EFI_NOT_FOUND           No matching handle could not be found in\r
                                   database.\r
-  @retval EFI_INVALID_PARAMETER   Handle or HandleBufferLength was NULL.\r
-  @retval EFI_INVALID_PARAMETER  PackageType is not a EFI_HII_PACKAGE_TYPE_GUID but\r
-                         PackageGuid is not NULL, PackageType is a EFI_HII_\r
-                         PACKAGE_TYPE_GUID but PackageGuid is NULL.\r
-  \r
+  @retval EFI_INVALID_PARAMETER   HandleBufferLength was NULL.\r
+  @retval EFI_INVALID_PARAMETER   The value referenced by HandleBufferLength was not\r
+                                  zero and Handle was NULL.\r
+  @retval EFI_INVALID_PARAMETER   PackageType is not a EFI_HII_PACKAGE_TYPE_GUID but\r
+                                  PackageGuid is not NULL, PackageType is a EFI_HII_\r
+                                  PACKAGE_TYPE_GUID but PackageGuid is NULL.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 HiiListPackageLists (\r
-  IN  CONST EFI_HII_DATABASE_PROTOCOL   *This,\r
-  IN  UINT8                             PackageType,\r
-  IN  CONST EFI_GUID                    *PackageGuid,\r
-  IN  OUT UINTN                         *HandleBufferLength,\r
-  OUT EFI_HII_HANDLE                    *Handle\r
+  IN  CONST EFI_HII_DATABASE_PROTOCOL  *This,\r
+  IN  UINT8                            PackageType,\r
+  IN  CONST EFI_GUID                   *PackageGuid,\r
+  IN  OUT UINTN                        *HandleBufferLength,\r
+  OUT EFI_HII_HANDLE                   *Handle\r
   );\r
 \r
-\r
 /**\r
   This function will export one or all package lists in the database to a buffer.\r
   For each package list exported, this function will call functions registered\r
@@ -1212,21 +1625,22 @@ HiiListPackageLists (
                                   Handle is too small to support the number of\r
                                   handles.      HandleBufferLength is updated with\r
                                   a value that will enable the data to fit.\r
-  @retval EFI_NOT_FOUND           The specifiecd Handle could not be found in the\r
+  @retval EFI_NOT_FOUND           The specified Handle could not be found in the\r
                                   current database.\r
-  @retval EFI_INVALID_PARAMETER   Handle or Buffer or BufferSize was NULL.\r
+  @retval EFI_INVALID_PARAMETER   BufferSize was NULL.\r
+  @retval EFI_INVALID_PARAMETER   The value referenced by BufferSize was not zero\r
+                                  and Buffer was NULL.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 HiiExportPackageLists (\r
-  IN  CONST EFI_HII_DATABASE_PROTOCOL   *This,\r
-  IN  EFI_HII_HANDLE                    Handle,\r
-  IN  OUT UINTN                         *BufferSize,\r
-  OUT EFI_HII_PACKAGE_LIST_HEADER       *Buffer\r
+  IN  CONST EFI_HII_DATABASE_PROTOCOL  *This,\r
+  IN  EFI_HII_HANDLE                   Handle,\r
+  IN  OUT UINTN                        *BufferSize,\r
+  OUT EFI_HII_PACKAGE_LIST_HEADER      *Buffer\r
   );\r
 \r
-\r
 /**\r
   This function registers a function which will be called when specified actions related to packages of\r
   the specified type occur in the HII database. By registering a function, other HII-related drivers are\r
@@ -1266,15 +1680,14 @@ HiiExportPackageLists (
 EFI_STATUS\r
 EFIAPI\r
 HiiRegisterPackageNotify (\r
-  IN  CONST EFI_HII_DATABASE_PROTOCOL   *This,\r
-  IN  UINT8                             PackageType,\r
-  IN  CONST EFI_GUID                    *PackageGuid,\r
-  IN  CONST EFI_HII_DATABASE_NOTIFY     PackageNotifyFn,\r
-  IN  EFI_HII_DATABASE_NOTIFY_TYPE      NotifyType,\r
-  OUT EFI_HANDLE                        *NotifyHandle\r
+  IN  CONST EFI_HII_DATABASE_PROTOCOL  *This,\r
+  IN  UINT8                            PackageType,\r
+  IN  CONST EFI_GUID                   *PackageGuid,\r
+  IN  CONST EFI_HII_DATABASE_NOTIFY    PackageNotifyFn,\r
+  IN  EFI_HII_DATABASE_NOTIFY_TYPE     NotifyType,\r
+  OUT EFI_HANDLE                       *NotifyHandle\r
   );\r
 \r
-\r
 /**\r
   Removes the specified HII database package-related notification.\r
 \r
@@ -1284,18 +1697,17 @@ HiiRegisterPackageNotify (
                                   unregistered.\r
 \r
   @retval EFI_SUCCESS             Notification is unregistered successfully.\r
-  @retval EFI_NOT_FOUND          The incoming notification handle does not exist \r
+  @retval EFI_NOT_FOUND          The incoming notification handle does not exist\r
                            in current hii database.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 HiiUnregisterPackageNotify (\r
-  IN CONST EFI_HII_DATABASE_PROTOCOL    *This,\r
-  IN EFI_HANDLE                         NotificationHandle\r
+  IN CONST EFI_HII_DATABASE_PROTOCOL  *This,\r
+  IN EFI_HANDLE                       NotificationHandle\r
   );\r
 \r
-\r
 /**\r
   This routine retrieves an array of GUID values for each keyboard layout that\r
   was previously registered in the system.\r
@@ -1314,20 +1726,20 @@ HiiUnregisterPackageNotify (
                                   number of GUIDs. KeyGuidBufferLength is\r
                                   updated with a value that will enable the data to\r
                                   fit.\r
-  @retval EFI_INVALID_PARAMETER   The KeyGuidBuffer or KeyGuidBufferLength was\r
-                                  NULL.\r
+  @retval EFI_INVALID_PARAMETER   The KeyGuidBufferLength is NULL.\r
+  @retval EFI_INVALID_PARAMETER   The value referenced by KeyGuidBufferLength is not\r
+                                  zero and KeyGuidBuffer is NULL.\r
   @retval EFI_NOT_FOUND           There was no keyboard layout.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 HiiFindKeyboardLayouts (\r
-  IN  CONST EFI_HII_DATABASE_PROTOCOL   *This,\r
-  IN  OUT UINT16                        *KeyGuidBufferLength,\r
-  OUT EFI_GUID                          *KeyGuidBuffer\r
+  IN  CONST EFI_HII_DATABASE_PROTOCOL  *This,\r
+  IN  OUT UINT16                       *KeyGuidBufferLength,\r
+  OUT EFI_GUID                         *KeyGuidBuffer\r
   );\r
 \r
-\r
 /**\r
   This routine retrieves the requested keyboard layout. The layout is a physical description of the keys\r
   on a keyboard and the character(s) that are associated with a particular set of key strokes.\r
@@ -1352,13 +1764,12 @@ HiiFindKeyboardLayouts (
 EFI_STATUS\r
 EFIAPI\r
 HiiGetKeyboardLayout (\r
-  IN  CONST EFI_HII_DATABASE_PROTOCOL   *This,\r
-  IN  CONST EFI_GUID                          *KeyGuid,\r
-  IN OUT UINT16                         *KeyboardLayoutLength,\r
-  OUT EFI_HII_KEYBOARD_LAYOUT           *KeyboardLayout\r
+  IN  CONST EFI_HII_DATABASE_PROTOCOL  *This,\r
+  IN  CONST EFI_GUID                   *KeyGuid,\r
+  IN OUT UINT16                        *KeyboardLayoutLength,\r
+  OUT EFI_HII_KEYBOARD_LAYOUT          *KeyboardLayout\r
   );\r
 \r
-\r
 /**\r
   This routine sets the default keyboard layout to the one referenced by KeyGuid. When this routine\r
   is called, an event will be signaled of the EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID\r
@@ -1379,11 +1790,10 @@ HiiGetKeyboardLayout (
 EFI_STATUS\r
 EFIAPI\r
 HiiSetKeyboardLayout (\r
-  IN CONST EFI_HII_DATABASE_PROTOCOL          *This,\r
-  IN CONST EFI_GUID                           *KeyGuid\r
+  IN CONST EFI_HII_DATABASE_PROTOCOL  *This,\r
+  IN CONST EFI_GUID                   *KeyGuid\r
   );\r
 \r
-\r
 /**\r
   Return the EFI handle associated with a package list.\r
 \r
@@ -1403,16 +1813,15 @@ HiiSetKeyboardLayout (
 EFI_STATUS\r
 EFIAPI\r
 HiiGetPackageListHandle (\r
-  IN  CONST EFI_HII_DATABASE_PROTOCOL         *This,\r
-  IN  EFI_HII_HANDLE                    PackageListHandle,\r
-  OUT EFI_HANDLE                        *DriverHandle\r
+  IN  CONST EFI_HII_DATABASE_PROTOCOL  *This,\r
+  IN  EFI_HII_HANDLE                   PackageListHandle,\r
+  OUT EFI_HANDLE                       *DriverHandle\r
   );\r
 \r
 //\r
 // EFI_HII_CONFIG_ROUTING_PROTOCOL interfaces\r
 //\r
 \r
-\r
 /**\r
   This function allows a caller to extract the current configuration\r
   for one or more named elements from one or more drivers.\r
@@ -1461,7 +1870,6 @@ HiiConfigRoutingExtractConfig (
   OUT EFI_STRING                             *Results\r
   );\r
 \r
-\r
 /**\r
   This function allows the caller to request the current configuration for the\r
   entirety of the current HII database and returns the data in a null-terminated Unicode string.\r
@@ -1470,9 +1878,9 @@ HiiConfigRoutingExtractConfig (
                                   instance.\r
   @param  Results                 Null-terminated Unicode string in\r
                                   <MultiConfigAltResp> format which has all values\r
-                                  filled in for the names in the Request string.\r
-                                  String to be allocated by the  called function.\r
-                                  De-allocation is up to the caller.\r
+                                  filled in for the entirety of the current HII\r
+                                  database. String to be allocated by the  called\r
+                                  function. De-allocation is up to the caller.\r
 \r
   @retval EFI_SUCCESS             The Results string is filled with the values\r
                                   corresponding to all requested names.\r
@@ -1490,7 +1898,6 @@ HiiConfigRoutingExportConfig (
   OUT EFI_STRING                             *Results\r
   );\r
 \r
-\r
 /**\r
   This function processes the results of processing forms and routes it to the\r
   appropriate handlers or storage.\r
@@ -1524,8 +1931,6 @@ HiiConfigRoutingRouteConfig (
   OUT EFI_STRING                             *Progress\r
   );\r
 \r
-\r
-\r
 /**\r
   This helper function is to be called by drivers to map configuration data stored\r
   in byte array ("block") formats such as UEFI Variables into current configuration strings.\r
@@ -1576,7 +1981,6 @@ HiiBlockToConfig (
   OUT EFI_STRING                             *Progress\r
   );\r
 \r
-\r
 /**\r
   This helper function is to be called by drivers to map configuration strings\r
   to configurations stored in byte array ("block") formats such as UEFI Variables.\r
@@ -1595,8 +1999,9 @@ HiiBlockToConfig (
                                   (see below)  is returned.\r
   @param  BlockSize               The length of the Block in units of UINT8.  On\r
                                   input, this is the size of the Block. On output,\r
-                                  if successful, contains the index of the  last\r
-                                  modified byte in the Block.\r
+                                  if successful, contains the largest index of the\r
+                                  modified byte in the Block, or the required buffer\r
+                                  size if the Block is not large enough.\r
   @param  Progress                On return, points to an element of the ConfigResp\r
                                    string filled in with the offset of the most\r
                                   recent '&' before the first failing name / value\r
@@ -1621,19 +2026,20 @@ HiiBlockToConfig (
                                   value pair. Block is left updated and\r
                                   Progress points at the '&' preceding the first\r
                                   non-<BlockName>.\r
+  @retval EFI_BUFFER_TOO_SMALL    Block not large enough. Progress undefined.\r
+                                  BlockSize is updated with the required buffer size.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 HiiConfigToBlock (\r
-  IN     CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r
-  IN     CONST EFI_STRING                      ConfigResp,\r
-  IN OUT UINT8                                 *Block,\r
-  IN OUT UINTN                                 *BlockSize,\r
-  OUT    EFI_STRING                            *Progress\r
+  IN     CONST EFI_HII_CONFIG_ROUTING_PROTOCOL  *This,\r
+  IN     CONST EFI_STRING                       ConfigResp,\r
+  IN OUT UINT8                                  *Block,\r
+  IN OUT UINTN                                  *BlockSize,\r
+  OUT    EFI_STRING                             *Progress\r
   );\r
 \r
-\r
 /**\r
   This helper function is to be called by drivers to extract portions of\r
   a larger configuration string.\r
@@ -1677,21 +2083,258 @@ HiiConfigToBlock (
 EFI_STATUS\r
 EFIAPI\r
 HiiGetAltCfg (\r
-  IN  CONST EFI_HII_CONFIG_ROUTING_PROTOCOL    *This,\r
-  IN  CONST EFI_STRING                         Configuration,\r
-  IN  CONST EFI_GUID                           *Guid,\r
-  IN  CONST EFI_STRING                         Name,\r
-  IN  CONST EFI_DEVICE_PATH_PROTOCOL           *DevicePath,\r
-  IN  CONST UINT16                             *AltCfgId,\r
-  OUT EFI_STRING                               *AltCfgResp\r
+  IN  CONST EFI_HII_CONFIG_ROUTING_PROTOCOL  *This,\r
+  IN  CONST EFI_STRING                       Configuration,\r
+  IN  CONST EFI_GUID                         *Guid,\r
+  IN  CONST EFI_STRING                       Name,\r
+  IN  CONST EFI_DEVICE_PATH_PROTOCOL         *DevicePath,\r
+  IN  CONST UINT16                           *AltCfgId,\r
+  OUT EFI_STRING                             *AltCfgResp\r
+  );\r
+\r
+/**\r
+\r
+  This function accepts a <MultiKeywordResp> formatted string, finds the associated\r
+  keyword owners, creates a <MultiConfigResp> string from it and forwards it to the\r
+  EFI_HII_ROUTING_PROTOCOL.RouteConfig function.\r
+\r
+  If there is an issue in resolving the contents of the KeywordString, then the\r
+  function returns an error and also sets the Progress and ProgressErr with the\r
+  appropriate information about where the issue occurred and additional data about\r
+  the nature of the issue.\r
+\r
+  In the case when KeywordString containing multiple keywords, when an EFI_NOT_FOUND\r
+  error is generated during processing the second or later keyword element, the system\r
+  storage associated with earlier keywords is not modified. All elements of the\r
+  KeywordString must successfully pass all tests for format and access prior to making\r
+  any modifications to storage.\r
+\r
+  In the case when EFI_DEVICE_ERROR is returned from the processing of a KeywordString\r
+  containing multiple keywords, the state of storage associated with earlier keywords\r
+  is undefined.\r
+\r
+\r
+  @param This             Pointer to the EFI_KEYWORD_HANDLER _PROTOCOL instance.\r
+\r
+  @param KeywordString    A null-terminated string in <MultiKeywordResp> format.\r
+\r
+  @param Progress         On return, points to a character in the KeywordString.\r
+                          Points to the string's NULL terminator if the request\r
+                          was successful. Points to the most recent '&' before\r
+                          the first failing name / value pair (or the beginning\r
+                          of the string if the failure is in the first name / value\r
+                          pair) if the request was not successful.\r
+\r
+  @param ProgressErr      If during the processing of the KeywordString there was\r
+                          a failure, this parameter gives additional information\r
+                          about the possible source of the problem. The various\r
+                          errors are defined in "Related Definitions" below.\r
+\r
+\r
+  @retval EFI_SUCCESS             The specified action was completed successfully.\r
+\r
+  @retval EFI_INVALID_PARAMETER   One or more of the following are TRUE:\r
+                                  1. KeywordString is NULL.\r
+                                  2. Parsing of the KeywordString resulted in an\r
+                                     error. See Progress and ProgressErr for more data.\r
+\r
+  @retval EFI_NOT_FOUND           An element of the KeywordString was not found.\r
+                                  See ProgressErr for more data.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES    Required system resources could not be allocated.\r
+                                  See ProgressErr for more data.\r
+\r
+  @retval EFI_ACCESS_DENIED       The action violated system policy. See ProgressErr\r
+                                  for more data.\r
+\r
+  @retval EFI_DEVICE_ERROR        An unexpected system error occurred. See ProgressErr\r
+                                  for more data.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiConfigKeywordHandlerSetData (\r
+  IN EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL  *This,\r
+  IN CONST EFI_STRING                     KeywordString,\r
+  OUT EFI_STRING                          *Progress,\r
+  OUT UINT32                              *ProgressErr\r
+  );\r
+\r
+/**\r
+\r
+  This function accepts a <MultiKeywordRequest> formatted string, finds the underlying\r
+  keyword owners, creates a <MultiConfigRequest> string from it and forwards it to the\r
+  EFI_HII_ROUTING_PROTOCOL.ExtractConfig function.\r
+\r
+  If there is an issue in resolving the contents of the KeywordString, then the function\r
+  returns an EFI_INVALID_PARAMETER and also set the Progress and ProgressErr with the\r
+  appropriate information about where the issue occurred and additional data about the\r
+  nature of the issue.\r
+\r
+  In the case when KeywordString is NULL, or contains multiple keywords, or when\r
+  EFI_NOT_FOUND is generated while processing the keyword elements, the Results string\r
+  contains values returned for all keywords processed prior to the keyword generating the\r
+  error but no values for the keyword with error or any following keywords.\r
+\r
+\r
+  @param This           Pointer to the EFI_KEYWORD_HANDLER _PROTOCOL instance.\r
+\r
+  @param NameSpaceId    A null-terminated string containing the platform configuration\r
+                        language to search through in the system. If a NULL is passed\r
+                        in, then it is assumed that any platform configuration language\r
+                        with the prefix of "x-UEFI-" are searched.\r
+\r
+  @param KeywordString  A null-terminated string in <MultiKeywordRequest> format. If a\r
+                        NULL is passed in the KeywordString field, all of the known\r
+                        keywords in the system for the NameSpaceId specified are\r
+                        returned in the Results field.\r
+\r
+  @param Progress       On return, points to a character in the KeywordString. Points\r
+                        to the string's NULL terminator if the request was successful.\r
+                        Points to the most recent '&' before the first failing name / value\r
+                        pair (or the beginning of the string if the failure is in the first\r
+                        name / value pair) if the request was not successful.\r
+\r
+  @param ProgressErr    If during the processing of the KeywordString there was a\r
+                        failure, this parameter gives additional information about the\r
+                        possible source of the problem. See the definitions in SetData()\r
+                        for valid value definitions.\r
+\r
+  @param Results        A null-terminated string in <MultiKeywordResp> format is returned\r
+                        which has all the values filled in for the keywords in the\r
+                        KeywordString. This is a callee-allocated field, and must be freed\r
+                        by the caller after being used.\r
+\r
+  @retval EFI_SUCCESS             The specified action was completed successfully.\r
+\r
+  @retval EFI_INVALID_PARAMETER   One or more of the following are TRUE:\r
+                                  1.Progress, ProgressErr, or Results is NULL.\r
+                                  2.Parsing of the KeywordString resulted in an error. See\r
+                                    Progress and ProgressErr for more data.\r
+\r
+\r
+  @retval EFI_NOT_FOUND           An element of the KeywordString was not found. See\r
+                                  ProgressErr for more data.\r
+\r
+  @retval EFI_NOT_FOUND           The NamespaceId specified was not found.  See ProgressErr\r
+                                  for more data.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES    Required system resources could not be allocated.  See\r
+                                  ProgressErr for more data.\r
+\r
+  @retval EFI_ACCESS_DENIED       The action violated system policy.  See ProgressErr for\r
+                                  more data.\r
+\r
+  @retval EFI_DEVICE_ERROR        An unexpected system error occurred.  See ProgressErr\r
+                                  for more data.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiConfigKeywordHandlerGetData (\r
+  IN EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL  *This,\r
+  IN CONST EFI_STRING                     NameSpaceId  OPTIONAL,\r
+  IN CONST EFI_STRING                     KeywordString  OPTIONAL,\r
+  OUT EFI_STRING                          *Progress,\r
+  OUT UINT32                              *ProgressErr,\r
+  OUT EFI_STRING                          *Results\r
   );\r
 \r
+/**\r
+  Compare whether two names of languages are identical.\r
+\r
+  @param  Language1              Name of language 1 from StringPackage\r
+  @param  Language2              Name of language 2 to be compared with language 1.\r
+\r
+  @retval TRUE                   same\r
+  @retval FALSE                  not same\r
+\r
+**/\r
+BOOLEAN\r
+HiiCompareLanguage (\r
+  IN  CHAR8  *Language1,\r
+  IN  CHAR8  *Language2\r
+  )\r
+;\r
+\r
+/**\r
+  Retrieves a pointer to a Null-terminated ASCII string containing the list\r
+  of languages that an HII handle in the HII Database supports.  The returned\r
+  string is allocated using AllocatePool().  The caller is responsible for freeing\r
+  the returned string using FreePool().  The format of the returned string follows\r
+  the language format assumed the HII Database.\r
+\r
+  If HiiHandle is NULL, then ASSERT().\r
+\r
+  @param[in]  HiiHandle  A handle that was previously registered in the HII Database.\r
+\r
+  @retval NULL   HiiHandle is not registered in the HII database\r
+  @retval NULL   There are not enough resources available to retrieve the supported\r
+                 languages.\r
+  @retval NULL   The list of supported languages could not be retrieved.\r
+  @retval Other  A pointer to the Null-terminated ASCII string of supported languages.\r
+\r
+**/\r
+CHAR8 *\r
+GetSupportedLanguages (\r
+  IN EFI_HII_HANDLE  HiiHandle\r
+  );\r
+\r
+/**\r
+This function mainly use to get HiiDatabase information.\r
+\r
+@param  This                   A pointer to the EFI_HII_DATABASE_PROTOCOL instance.\r
+\r
+@retval EFI_SUCCESS            Get the information successfully.\r
+@retval EFI_OUT_OF_RESOURCES   Not enough memory to store the Hiidatabase data.\r
+\r
+**/\r
+EFI_STATUS\r
+HiiGetDatabaseInfo (\r
+  IN CONST EFI_HII_DATABASE_PROTOCOL  *This\r
+  );\r
+\r
+/**\r
+This function mainly use to get and update ConfigResp string.\r
+\r
+@param  This                   A pointer to the EFI_HII_DATABASE_PROTOCOL instance.\r
+\r
+@retval EFI_SUCCESS            Get the information successfully.\r
+@retval EFI_OUT_OF_RESOURCES   Not enough memory to store the Configuration Setting data.\r
+\r
+**/\r
+EFI_STATUS\r
+HiiGetConfigRespInfo (\r
+  IN CONST EFI_HII_DATABASE_PROTOCOL  *This\r
+  );\r
+\r
+/**\r
+  Find question default value from PcdNvStoreDefaultValueBuffer\r
+\r
+  @param DefaultId          Default store ID\r
+  @param EfiVarStore        Point to EFI VarStore header\r
+  @param IfrQuestionHdr     Point to Question header\r
+  @param ValueBuffer        Point to Buffer includes the found default setting\r
+  @param Width              Width of the default value\r
+  @param BitFieldQuestion   Whether the Question is stored in Bit field.\r
+\r
+  @retval EFI_SUCCESS       Question default value is found.\r
+  @retval EFI_NOT_FOUND     Question default value is not found.\r
+**/\r
+EFI_STATUS\r
+FindQuestionDefaultSetting (\r
+  IN  UINT16                   DefaultId,\r
+  IN  EFI_IFR_VARSTORE_EFI     *EfiVarStore,\r
+  IN  EFI_IFR_QUESTION_HEADER  *IfrQuestionHdr,\r
+  OUT VOID                     *ValueBuffer,\r
+  IN  UINTN                    Width,\r
+  IN  BOOLEAN                  BitFieldQuestion\r
+  );\r
 \r
 //\r
 // Global variables\r
 //\r
-extern EFI_EVENT gHiiKeyboardLayoutChanged;\r
-\r
-#include "R8Lib.h"\r
+extern EFI_EVENT  gHiiKeyboardLayoutChanged;\r
+extern BOOLEAN    gExportAfterReadyToBoot;\r
 \r
 #endif\r