]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UEFI HII: Merge UEFI HII support changes from branch.
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 21 Jan 2008 14:41:31 +0000 (14:41 +0000)
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 21 Jan 2008 14:41:31 +0000 (14:41 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4600 6f19259b-4bc3-4df7-8a09-765794883524

21 files changed:
MdePkg/Include/Library/GraphicsLib.h
MdePkg/Include/Library/HiiLib.h
MdePkg/Include/Library/IfrSupportLib.h
MdePkg/Include/Library/MemoryAllocationLib.h
MdePkg/Include/Protocol/DevicePath.h
MdePkg/Include/Protocol/FormBrowser2.h
MdePkg/Include/Protocol/HiiConfigAccess.h
MdePkg/Include/Protocol/HiiConfigRouting.h
MdePkg/Include/Protocol/HiiDatabase.h
MdePkg/Include/Protocol/HiiFont.h
MdePkg/Include/Protocol/HiiImage.h
MdePkg/Include/Protocol/HiiString.h
MdePkg/Include/Uefi/UefiBaseType.h
MdePkg/Include/Uefi/UefiInternalFormRepresentation.h
MdePkg/Library/DxeMemoryAllocationLib/MemoryAllocationLib.c
MdePkg/Library/HiiLib/HiiLib.c
MdePkg/Library/HiiLib/HiiLib.inf
MdePkg/Library/HiiLib/InternalHiiLib.h [new file with mode: 0644]
MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c
MdePkg/MdePkg.dec
MdePkg/MdePkg.dsc

index f503561708754af5a8c2e299641461241b9f0e91..c9fa564a8c01337e31c7958621cabb9ccbc7f833 100644 (file)
   Return the graphics image file named FileNameGuid into Image and return it's\r
   size in ImageSize. All Firmware Volumes (FV) in the system are searched for the\r
   file name.\r
-
-  @param[in]  FileNameGuid  File Name of graphics file in the FV(s).
+\r
+  @param[in]  FileNameGuid  File Name of graphics file in the FV(s).\r
   @param[out] Image         Pointer to pointer to return graphics image.  If NULL, a \r
-                            buffer will be allocated.
+                            buffer will be allocated.\r
   @param[out] ImageSize     Size of the graphics Image in bytes. Zero if no image found.\r
-
-  @retval   EFI_INVALID_PARAMETER  invalid parameter
+\r
+  @retval   EFI_INVALID_PARAMETER  invalid parameter\r
   @retval   EFI_UNSUPPORTED        Range can not be erased\r
   @retval   EFI_SUCCESS            Image and ImageSize are valid. \r
   @retval   EFI_BUFFER_TOO_SMALL   Image not big enough. ImageSize has required size\r
   @retval   EFI_NOT_FOUND          FileNameGuid not found\r
-
+\r
 **/\r
 EFI_STATUS\r
 GetGraphicsBitMapFromFV (\r
@@ -42,23 +42,50 @@ GetGraphicsBitMapFromFV (
   OUT UINTN         *ImageSize\r
   );\r
 \r
+/**\r
+  Return the graphics image file named FileNameGuid into Image and return it's\r
+  size in ImageSize. All Firmware Volumes (FV) in the system are searched for the\r
+  file name.\r
+\r
+  @param[in]  ImageHandle   The driver image handle of the caller. The parameter is used to\r
+                            optimize the loading of the image file so that the FV from which\r
+                            the driver image is loaded will be tried first. \r
+  @param[in]  FileNameGuid  File Name of graphics file in the FV(s).\r
+  @param[out] Image         Pointer to pointer to return graphics image.  If NULL, a \r
+                            buffer will be allocated.\r
+  @param[out] ImageSize     Size of the graphics Image in bytes. Zero if no image found.\r
+\r
+  @retval   EFI_INVALID_PARAMETER  invalid parameter\r
+  @retval   EFI_UNSUPPORTED        Range can not be erased\r
+  @retval   EFI_SUCCESS            Image and ImageSize are valid. \r
+  @retval   EFI_BUFFER_TOO_SMALL   Image not big enough. ImageSize has required size\r
+  @retval   EFI_NOT_FOUND          FileNameGuid not found\r
+\r
+**/\r
+EFI_STATUS\r
+GetGraphicsBitMapFromFVEx (\r
+  IN  EFI_HANDLE    ImageHandle,\r
+  IN  EFI_GUID      *FileNameGuid,\r
+  OUT VOID          **Image,\r
+  OUT UINTN         *ImageSize\r
+  );\r
 \r
 /**\r
   Convert a *.BMP graphics image to a UGA blt buffer. If a NULL UgaBlt buffer\r
   is passed in a UgaBlt buffer will be allocated by this routine. If a UgaBlt\r
   buffer is passed in it will be used if it is big enough.\r
-
-  @param[in]      BmpImage      Pointer to BMP file
-  @param[in]      BmpImageSize  Number of bytes in BmpImage
-  @param[in,out]  UgaBlt        Buffer containing UGA version of BmpImage.
-  @param[in,out]  UgaBltSize    Size of UgaBlt in bytes.
-  @param[out]     PixelHeight   Height of UgaBlt/BmpImage in pixels
-  @param[out]     PixelWidth    Width of UgaBlt/BmpImage in pixels
-
+\r
+  @param[in]      BmpImage      Pointer to BMP file\r
+  @param[in]      BmpImageSize  Number of bytes in BmpImage\r
+  @param[in,out]  UgaBlt        Buffer containing UGA version of BmpImage.\r
+  @param[in,out]  UgaBltSize    Size of UgaBlt in bytes.\r
+  @param[out]     PixelHeight   Height of UgaBlt/BmpImage in pixels\r
+  @param[out]     PixelWidth    Width of UgaBlt/BmpImage in pixels\r
+\r
   @retval EFI_SUCCESS           UgaBlt and UgaBltSize are returned. \r
   @retval EFI_UNSUPPORTED       BmpImage is not a valid *.BMP image\r
   @retval EFI_BUFFER_TOO_SMALL  The passed in UgaBlt buffer is not big enough.\r
-                                UgaBltSize will contain the required size.
+                                UgaBltSize will contain the required size.\r
 **/\r
 EFI_STATUS\r
 ConvertBmpToUgaBlt (\r
@@ -74,9 +101,9 @@ ConvertBmpToUgaBlt (
 /**\r
   Use Console Control to turn off UGA based Simple Text Out consoles from going\r
   to the UGA device. Put up LogoFile on every UGA device that is a console\r
-
-  @param[in]  LogoFile   File name of logo to display on the center of the screen.
-
+\r
+  @param[in]  LogoFile   File name of logo to display on the center of the screen.\r
+\r
   @retval EFI_SUCCESS     ConsoleControl has been flipped to graphics and logo displayed.\r
   @retval EFI_UNSUPPORTED Logo not found\r
 \r
@@ -86,11 +113,30 @@ EnableQuietBoot (
   IN  EFI_GUID  *LogoFile\r
   );\r
 \r
+/**\r
+  Use Console Control to turn off GOP/UGA based Simple Text Out consoles from going\r
+  to the UGA device. Put up LogoFile on every UGA device that is a console\r
+\r
+  @param  LogoFile    File name of logo to display on the center of the screen.\r
+  @param  ImageHandle The driver image handle of the caller. The parameter is used to\r
+                      optimize the loading of the logo file so that the FV from which\r
+                      the driver image is loaded will be tried first.\r
+\r
+  @retval EFI_SUCCESS     ConsoleControl has been flipped to graphics and logo displayed.\r
+  @retval EFI_UNSUPPORTED Logo not found\r
+\r
+**/\r
+EFI_STATUS\r
+EnableQuietBootEx (\r
+  IN  EFI_GUID    *LogoFile,\r
+  IN  EFI_HANDLE  ImageHandle\r
+  );\r
+\r
 \r
 /**\r
   Use Console Control to turn on UGA based Simple Text Out consoles. The UGA \r
   Simple Text Out screens will now be synced up with all non UGA output devices\r
-
+\r
   @retval EFI_SUCCESS     UGA devices are back in text mode and synced up.\r
 \r
 **/\r
@@ -105,9 +151,9 @@ DisableQuietBoot (
   This is the ConInHandle and ConIn handle in the EFI system table. All key\r
   presses will be ignored until the Password is typed in. The only way to\r
   disable the password is to type it in to a ConIn device.\r
-
-  @param[in]  Password   Password used to lock ConIn device.
-
+\r
+  @param[in]  Password   Password used to lock ConIn device.\r
+\r
   @retval EFI_SUCCESS     ConsoleControl has been flipped to graphics and logo\r
                           displayed.\r
   @retval EFI_UNSUPPORTED Password not found\r
@@ -120,16 +166,16 @@ LockKeyboards (
 \r
 \r
 /**\r
-  Print to graphics screen at the given X,Y coordinates of the graphics screen.
-  see definition of Print to find rules for constructing Fmt.
-
-  @param[in]  X            Row to start printing at
-  @param[in]  Y            Column to start printing at
-  @param[in]  Foreground   Foreground color
-  @param[in]  Background   background color
-  @param[in]  Fmt          Print format sting. See definition of Print
-  @param[in]  ...          Argumnet stream defined by Fmt string
-
+  Print to graphics screen at the given X,Y coordinates of the graphics screen.\r
+  see definition of Print to find rules for constructing Fmt.\r
+\r
+  @param[in]  X            Row to start printing at\r
+  @param[in]  Y            Column to start printing at\r
+  @param[in]  Foreground   Foreground color\r
+  @param[in]  Background   background color\r
+  @param[in]  Fmt          Print format sting. See definition of Print\r
+  @param[in]  ...          Argumnet stream defined by Fmt string\r
+\r
   @retval UINTN     Number of Characters printed\r
 \r
 **/\r
index c32ad6d64d2dfafa9b84d2bb4ee2bf9ef6b58393..dc557af31b5a58415e670d2ca29a735efe5dcb68 100644 (file)
 #ifndef __HII_LIB_H__\r
 #define __HII_LIB_H__\r
 \r
-#error "UEFI 2.1 HII is not fully implemented for now, Please don't include this file now."\r
+//#include <PiDxe.h>\r
 \r
-#include <Protocol/HiiDatabase.h>\r
+//\r
+// Limited buffer size recommended by RFC4646 (4.3.  Length Considerations)\r
+// (42 characters plus a NULL terminator)\r
+//\r
+#define RFC_3066_ENTRY_SIZE             (42 + 1)\r
 \r
 /**\r
-  This function allocates pool for an EFI_HII_PACKAGES structure\r
-  with enough space for the variable argument list of package pointers.\r
-  The allocated structure is initialized using NumberOfPackages, Guid\r
-  and the variable length argument list of package pointers.\r
+  This function allocates pool for an EFI_HII_PACKAGE_LIST structure\r
+  with additional space that is big enough to host all packages described by the variable \r
+  argument list of package pointers.  The allocated structure is initialized using NumberOfPackages\r
+  GuidId,  and the variable length argument list of package pointers.\r
 \r
-  @param  NumberOfPackages The number of HII packages to prepare.\r
-  @param  Guid Package GUID.\r
+  Then, EFI_HII_PACKAGE_LIST will be register to the default System HII Database. The\r
+  Handle to the newly registered Package List is returned throught HiiHandle.\r
+\r
+  @param  NumberOfPackages  The number of HII packages to register.\r
+  @param  GuidId                    Package List GUID ID.\r
+  @param  HiiHandle                The ID used to retrieve the Package List later.\r
+  @param  ...                          The variable argument list describing all HII Package.\r
 \r
   @return\r
   The allocated and initialized packages.\r
 \r
 **/\r
-EFI_HII_PACKAGE_LIST_HEADER *\r
+\r
+EFI_STATUS\r
 EFIAPI\r
-PreparePackages (\r
-  IN CONST  UINTN     NumberOfPackages,\r
-  IN CONST  EFI_GUID  *Guid OPTIONAL,\r
+HiiLibAddPackagesToHiiDatabase (\r
+  IN       UINTN               NumberOfPackages,\r
+  IN CONST EFI_GUID            *GuidId,\r
+  IN       EFI_HANDLE          DriverHandle, OPTIONAL\r
+  OUT      EFI_HII_HANDLE      *HiiHandle, OPTIONAL\r
   ...\r
-  );\r
+  )\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+HiiLibAddFontPackageToHiiDatabase (\r
+  IN       UINTN               FontSize,\r
+  IN CONST UINT8               *FontBinary,\r
+  IN CONST EFI_GUID            *GuidId,\r
+  OUT      EFI_HII_HANDLE      *HiiHandle OPTIONAL\r
+  )\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+HiiLibRemovePackagesFromHiiDatabase (\r
+  IN      EFI_HII_HANDLE      HiiHandle\r
+  )\r
+;\r
+\r
+/**\r
+  This function adds the string into String Package of each language.\r
+\r
+  @param  PackageList            Handle of the package list where this string will\r
+                                 be added.\r
+  @param  StringId               On return, contains the new strings id, which is\r
+                                 unique within PackageList.\r
+  @param  String                 Points to the new null-terminated string.\r
+\r
+  @retval EFI_SUCCESS            The new string was added successfully.\r
+  @retval EFI_NOT_FOUND          The specified PackageList could not be found in\r
+                                 database.\r
+  @retval EFI_OUT_OF_RESOURCES   Could not add the string due to lack of resources.\r
+  @retval EFI_INVALID_PARAMETER  String is NULL or StringId is NULL is NULL.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+HiiLibCreateString (\r
+  IN  EFI_HII_HANDLE                  PackageList,\r
+  OUT EFI_STRING_ID                   *StringId,\r
+  IN  CONST EFI_STRING                String\r
+  )\r
+;\r
+\r
+/**\r
+  This function update the specified string in String Package of each language.\r
+\r
+  @param  PackageList            Handle of the package list where this string will\r
+                                 be added.\r
+  @param  StringId               Ths String Id to be updated.\r
+  @param  String                 Points to the new null-terminated string.\r
+\r
+  @retval EFI_SUCCESS            The new string was added successfully.\r
+  @retval EFI_NOT_FOUND          The specified PackageList could not be found in\r
+                                 database.\r
+  @retval EFI_OUT_OF_RESOURCES   Could not add the string due to lack of resources.\r
+  @retval EFI_INVALID_PARAMETER  String is NULL or StringId is NULL is NULL.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+HiiLibUpdateString (\r
+  IN  EFI_HII_HANDLE                  PackageList,\r
+  IN  EFI_STRING_ID                   StringId,\r
+  IN  CONST EFI_STRING                String\r
+  )\r
+;\r
+\r
+\r
+\r
+//\r
+// Just use the UEFI prototype\r
+//\r
+EFI_STATUS\r
+EFIAPI\r
+HiiLibGetStringFromGuidId (\r
+  IN  EFI_GUID                        *ProducerGuid,\r
+  IN  EFI_STRING_ID                   StringId,\r
+  OUT EFI_STRING                      *String\r
+  )\r
+;\r
+\r
+//\r
+// This function is Implementation Specifc. HII_VENDOR_DEVICE_PATH\r
+// This should be moved to MdeModulepkg.\r
+//\r
+EFI_STATUS\r
+EFIAPI\r
+HiiLibCreateHiiDriverHandle (\r
+  OUT EFI_HANDLE               *DriverHandle\r
+  )\r
+;\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+HiiLibDestroyHiiDriverHandle (\r
+  IN EFI_HANDLE                 DriverHandle\r
+  )\r
+;\r
+\r
+\r
+EFI_STATUS\r
+HiiLibExtractClassFromHiiHandle (\r
+  IN      EFI_HII_HANDLE      Handle,\r
+  OUT     UINT16              *Class,\r
+  OUT     EFI_STRING_ID       *FormSetTitle,\r
+  OUT     EFI_STRING_ID       *FormSetHelp\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+  Extract formset class for given HII handle.\r
+\r
+Arguments:\r
+  HiiHandle       - Hii handle\r
+  Class           - Class of the formset\r
+  FormSetTitle    - Formset title string\r
+  FormSetHelp     - Formset help string\r
+\r
+Returns:\r
+  EFI_SUCCESS     - Successfully extract Class for specified Hii handle.\r
+\r
+--*/\r
+;\r
 \r
 #endif\r
index 4ef638a9544c8e7b391f27fdc139ea3036ff27bc..0b54a8eb9bbba31251c85ec6bdfe630ffeef0d94 100644 (file)
-/** @file\r
+/*++\r
+\r
+Copyright (c) 2007, 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
+\r
+Module Name:\r
+\r
+  UefiIfrLibrary.h\r
+\r
+Abstract:\r
+\r
   The file contain all library function for Ifr Operations.\r
-  \r
-  Copyright (c) 2006 - 2007, 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
+--*/\r
+\r
+#ifndef _IFRLIBRARY_H\r
+#define _IFRLIBRARY_H\r
+\r
+\r
+#include <Protocol/HiiFont.h>\r
+#include <Protocol/HiiImage.h>\r
+#include <Protocol/HiiString.h>\r
+#include <Protocol/HiiDatabase.h>\r
+#include <Protocol/HiiConfigRouting.h>\r
+#include <Protocol/HiiConfigAccess.h>\r
+#include <Protocol/FormBrowser2.h>\r
+#include <Protocol/SimpleTextOut.h>\r
 \r
-**/\r
+#include <Guid/GlobalVariable.h>\r
 \r
-#ifndef __IFRSUPPORTLIBRARY_H__\r
-#define __IFRSUPPORTLIBRARY_H__\r
+#define IFR_LIB_DEFAULT_STRING_SIZE     0x200\r
 \r
-#error "UEFI 2.1 HII is not fully implemented for now, Please don't include this file now."\r
+//\r
+// The architectural variable "Lang" and "LangCodes" are deprecated in UEFI\r
+// specification. While, UEFI specification also states that these deprecated\r
+// variables may be provided for backwards compatibility.\r
+// If "LANG_SUPPORT" is defined, "Lang" and "LangCodes" will be produced;\r
+// If "LANG_SUPPORT" is undefined, "Lang" and "LangCodes" will not be produced.\r
+//\r
+#define LANG_SUPPORT\r
 \r
-#define DEFAULT_FORM_BUFFER_SIZE    0xFFFF\r
-#define DEFAULT_STRING_BUFFER_SIZE  0xFFFF\r
+#define EFI_LANGUAGE_VARIABLE           L"Lang"\r
+#define EFI_LANGUAGE_CODES_VARIABLE     L"LangCodes"\r
+\r
+#define UEFI_LANGUAGE_VARIABLE          L"PlatformLang"\r
+#define UEFI_LANGUAGE_CODES_VARIABLE    L"PlatformLangCodes"\r
+\r
+//\r
+// Limited buffer size recommended by RFC4646 (4.3.  Length Considerations)\r
+// (42 characters plus a NULL terminator)\r
+//\r
+#define RFC_3066_ENTRY_SIZE             (42 + 1)\r
+#define ISO_639_2_ENTRY_SIZE            3\r
+\r
+#define INVALID_VARSTORE_ID             0\r
+\r
+#define QUESTION_FLAGS              (EFI_IFR_FLAG_READ_ONLY | EFI_IFR_FLAG_CALLBACK | EFI_IFR_FLAG_RESET_REQUIRED | EFI_IFR_FLAG_OPTIONS_ONLY)\r
+#define QUESTION_FLAGS_MASK         (~QUESTION_FLAGS)\r
+\r
+extern EFI_HII_DATABASE_PROTOCOL *gIfrLibHiiDatabase;\r
+extern EFI_HII_STRING_PROTOCOL   *gIfrLibHiiString;\r
 \r
 #pragma pack(1)\r
 typedef struct {\r
-  CHAR16      *OptionString;  // Passed in string to generate a token for in a truly dynamic form creation\r
-  STRING_REF  StringToken;    // This is used when creating a single op-code without generating a StringToken (have one already)\r
-  UINT16      Value;\r
-  UINT8       Flags;\r
-  UINT16      Key;\r
+  EFI_STRING_ID       StringToken;\r
+  EFI_IFR_TYPE_VALUE  Value;\r
+  UINT8               Flags;\r
 } IFR_OPTION;\r
 #pragma pack()\r
 \r
+typedef struct {\r
+  //\r
+  // Buffer size allocated for Data.\r
+  //\r
+  UINT32                BufferSize;\r
+\r
+  //\r
+  // Offset in Data to append the newly created opcode binary.\r
+  // It will be adjusted automatically in Create***OpCode(), and should be\r
+  // initialized to 0 before invocation of a serial of Create***OpCode()\r
+  //\r
+  UINT32                Offset;\r
+\r
+  //\r
+  // The destination buffer for created op-codes\r
+  //\r
+  UINT8                 *Data;\r
+} EFI_HII_UPDATE_DATA;\r
+\r
+\r
+//\r
+// Exported Library functions\r
+//\r
 EFI_STATUS\r
-GetCurrentLanguage (\r
-  OUT     CHAR16              *Lang\r
+CreateEndOpCode (\r
+  IN OUT EFI_HII_UPDATE_DATA *Data\r
   )\r
 /*++\r
 \r
 Routine Description:\r
+  Create EFI_IFR_END_OP opcode.\r
 \r
-  Determine what is the current language setting\r
-  \r
 Arguments:\r
+  Data            - Destination for the created opcode binary\r
 \r
-  Lang      - Pointer of system language\r
-  \r
-Returns: \r
-  \r
-  Status code\r
+Returns:\r
+  EFI_SUCCESS     - Opcode create success\r
 \r
 --*/\r
 ;\r
 \r
 EFI_STATUS\r
-AddString (\r
-  IN      VOID                *StringBuffer,\r
-  IN      CHAR16              *Language,\r
-  IN      CHAR16              *String,\r
-  IN OUT  STRING_REF          *StringToken\r
+CreateDefaultOpCode (\r
+  IN     EFI_IFR_TYPE_VALUE  *Value,\r
+  IN     UINT8               Type,\r
+  IN OUT EFI_HII_UPDATE_DATA *Data\r
   )\r
 /*++\r
 \r
 Routine Description:\r
+  Create EFI_IFR_DEFAULT_OP opcode.\r
 \r
-  Add a string to the incoming buffer and return the token and offset data\r
-  \r
 Arguments:\r
+  Value           - Value for the default\r
+  Type            - Type for the default\r
+  Data            - Destination for the created opcode binary\r
 \r
-  StringBuffer      - The incoming buffer\r
-  \r
-  Language          - Currrent language\r
-  \r
-  String            - The string to be added\r
-  \r
-  StringToken       - The index where the string placed\r
-  \r
-Returns: \r
-\r
-  EFI_OUT_OF_RESOURCES    - No enough buffer to allocate\r
-  \r
-  EFI_SUCCESS             - String successfully added to the incoming buffer\r
+Returns:\r
+  EFI_SUCCESS     - Opcode create success\r
 \r
 --*/\r
 ;\r
 \r
 EFI_STATUS\r
-AddOpCode (\r
-  IN      VOID                *FormBuffer,\r
-  IN OUT  VOID                *OpCodeData\r
+CreateActionOpCode (\r
+  IN     EFI_QUESTION_ID      QuestionId,\r
+  IN     EFI_STRING_ID        Prompt,\r
+  IN     EFI_STRING_ID        Help,\r
+  IN     UINT8                QuestionFlags,\r
+  IN     EFI_STRING_ID        QuestionConfig,\r
+  IN OUT EFI_HII_UPDATE_DATA  *Data\r
   )\r
 /*++\r
 \r
 Routine Description:\r
+  Create EFI_IFR_ACTION_OP opcode.\r
 \r
-  Add op-code data to the FormBuffer\r
-  \r
 Arguments:\r
+  QuestionId      - Question ID\r
+  Prompt          - String ID for Prompt\r
+  Help            - String ID for Help\r
+  QuestionFlags   - Flags in Question Header\r
+  QuestionConfig  - String ID for configuration\r
+  Data            - Destination for the created opcode binary\r
 \r
-  FormBuffer      - Form buffer to be inserted to\r
-  \r
-  OpCodeData      - Op-code data to be inserted\r
-  \r
-Returns: \r
-\r
-  EFI_OUT_OF_RESOURCES    - No enough buffer to allocate\r
-  \r
-  EFI_SUCCESS             - Op-code data successfully inserted\r
+Returns:\r
+  EFI_SUCCESS     - Opcode create success\r
 \r
 --*/\r
 ;\r
 \r
 EFI_STATUS\r
-CreateFormSet (\r
-  IN      CHAR16              *FormSetTitle,\r
-  IN      EFI_GUID            *Guid,\r
-  IN      UINT8               Class,\r
-  IN      UINT8               SubClass,\r
-  IN OUT  VOID                **FormBuffer,\r
-  IN OUT  VOID                **StringBuffer\r
+CreateSubTitleOpCode (\r
+  IN      EFI_STRING_ID       Prompt,\r
+  IN      EFI_STRING_ID       Help,\r
+  IN      UINT8               Flags,\r
+  IN      UINT8               Scope,\r
+  IN OUT EFI_HII_UPDATE_DATA  *Data\r
   )\r
 /*++\r
 \r
 Routine Description:\r
+  Create EFI_IFR_SUBTITLE_OP opcode.\r
 \r
-  Create a formset\r
-  \r
 Arguments:\r
+  Prompt          - String ID for Prompt\r
+  Help            - String ID for Help\r
+  Flags           - Subtitle opcode flags\r
+  Scope           - Subtitle Scope bit\r
+  Data            - Destination for the created opcode binary\r
 \r
-  FormSetTitle        - Title of formset\r
-  \r
-  Guid                - Guid of formset\r
-  \r
-  Class               - Class of formset\r
-  \r
-  SubClass            - Sub class of formset\r
-  \r
-  FormBuffer          - Pointer of the formset created\r
-  \r
-  StringBuffer        - Pointer of FormSetTitile string created\r
-  \r
-Returns: \r
-\r
-  EFI_OUT_OF_RESOURCES    - No enough buffer to allocate\r
-  \r
-  EFI_SUCCESS             - Formset successfully created\r
+Returns:\r
+  EFI_SUCCESS     - Opcode create success\r
 \r
 --*/\r
 ;\r
 \r
 EFI_STATUS\r
-CreateForm (\r
-  IN      CHAR16              *FormTitle,\r
-  IN      UINT16              FormId,\r
-  IN OUT  VOID                *FormBuffer,\r
-  IN OUT  VOID                *StringBuffer\r
+CreateTextOpCode (\r
+  IN      EFI_STRING_ID       Prompt,\r
+  IN      EFI_STRING_ID       Help,\r
+  IN      EFI_STRING_ID       TextTwo,\r
+  IN OUT  EFI_HII_UPDATE_DATA *Data\r
   )\r
 /*++\r
 \r
 Routine Description:\r
+  Create EFI_IFR_TEXT_OP opcode.\r
 \r
-  Create a form\r
-  \r
 Arguments:\r
+  Prompt          - String ID for Prompt\r
+  Help            - String ID for Help\r
+  TextTwo         - String ID for text two\r
+  Data            - Destination for the created opcode binary\r
 \r
-  FormTitle       - Title of the form\r
-  \r
-  FormId          - Id of the form\r
-  \r
-  FormBuffer          - Pointer of the form created\r
-  \r
-  StringBuffer        - Pointer of FormTitil string created\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Form successfully created\r
+Returns:\r
+  EFI_SUCCESS     - Opcode create success\r
 \r
 --*/\r
 ;\r
 \r
 EFI_STATUS\r
-CreateSubTitle (\r
-  IN      CHAR16              *SubTitle,\r
-  IN OUT  VOID                *FormBuffer,\r
-  IN OUT  VOID                *StringBuffer\r
+CreateGotoOpCode (\r
+  IN      EFI_FORM_ID         FormId,\r
+  IN      EFI_STRING_ID       Prompt,\r
+  IN      EFI_STRING_ID       Help,\r
+  IN      UINT8               QuestionFlags,\r
+  IN      EFI_QUESTION_ID     QuestionId,\r
+  IN OUT  EFI_HII_UPDATE_DATA *Data\r
   )\r
 /*++\r
 \r
 Routine Description:\r
+  Create EFI_IFR_REF_OP opcode.\r
 \r
-  Create a SubTitle\r
-  \r
 Arguments:\r
+  FormId          - Destination Form ID\r
+  Prompt          - String ID for Prompt\r
+  Help            - String ID for Help\r
+  QuestionFlags   - Flags in Question Header\r
+  QuestionId      - Question ID\r
+  Data            - Destination for the created opcode binary\r
 \r
-  SubTitle        - Sub title to be created\r
-  \r
-  FormBuffer      - Where this subtitle to add to\r
-  \r
-  StringBuffer    - String buffer created for subtitle\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Subtitle successfully created\r
+Returns:\r
+  EFI_SUCCESS     - Opcode create success\r
 \r
 --*/\r
 ;\r
 \r
 EFI_STATUS\r
-CreateText (\r
-  IN      CHAR16              *String,\r
-  IN      CHAR16              *String2,\r
-  IN      CHAR16              *String3,\r
-  IN      UINT8               Flags,\r
-  IN      UINT16              Key,\r
-  IN OUT  VOID                *FormBuffer,\r
-  IN OUT  VOID                *StringBuffer\r
+CreateOneOfOptionOpCode (\r
+  IN     UINTN                OptionCount,\r
+  IN     IFR_OPTION           *OptionsList,\r
+  IN     UINT8                Type,\r
+  IN OUT EFI_HII_UPDATE_DATA  *Data\r
+  )\r
+;\r
+\r
+EFI_STATUS\r
+CreateOneOfOpCode (\r
+  IN     EFI_QUESTION_ID      QuestionId,\r
+  IN     EFI_VARSTORE_ID      VarStoreId,\r
+  IN     UINT16               VarOffset,\r
+  IN     EFI_STRING_ID        Prompt,\r
+  IN     EFI_STRING_ID        Help,\r
+  IN     UINT8                QuestionFlags,\r
+  IN     UINT8                OneOfFlags,\r
+  IN     IFR_OPTION           *OptionsList,\r
+  IN     UINTN                OptionCount,\r
+  IN OUT EFI_HII_UPDATE_DATA  *Data\r
   )\r
 /*++\r
 \r
 Routine Description:\r
+  Create EFI_IFR_ONE_OF_OP opcode.\r
 \r
-  Create a line of text\r
-  \r
 Arguments:\r
+  QuestionId      - Question ID\r
+  VarStoreId      - Storage ID\r
+  VarOffset       - Offset in Storage\r
+  Prompt          - String ID for Prompt\r
+  Help            - String ID for Help\r
+  QuestionFlags   - Flags in Question Header\r
+  OneOfFlags      - Flags for oneof opcode\r
+  OptionsList     - List of options\r
+  OptionCount     - Number of options in option list\r
+  Data            - Destination for the created opcode binary\r
 \r
-  String          - First string of the text\r
-  \r
-  String2         - Second string of the text\r
-  \r
-  String3         - Help string of the text\r
-  \r
-  Flags           - Flag of the text\r
-  \r
-  Key             - Key of the text\r
-  \r
-  FormBuffer      - The form where this text adds to\r
-  \r
-  StringBuffer    - String buffer created for String, String2 and String3\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Text successfully created\r
+Returns:\r
+  EFI_SUCCESS     - Opcode create success\r
 \r
 --*/\r
 ;\r
 \r
 EFI_STATUS\r
-CreateGoto (\r
-  IN      UINT16              FormId,\r
-  IN      CHAR16              *Prompt,\r
-  IN OUT  VOID                *FormBuffer,\r
-  IN OUT  VOID                *StringBuffer\r
+CreateOrderedListOpCode (\r
+  IN      EFI_QUESTION_ID     QuestionId,\r
+  IN      EFI_VARSTORE_ID     VarStoreId,\r
+  IN      UINT16              VarOffset,\r
+  IN      EFI_STRING_ID       Prompt,\r
+  IN      EFI_STRING_ID       Help,\r
+  IN      UINT8               QuestionFlags,\r
+  IN      UINT8               Flags,\r
+  IN      UINT8               DataType,\r
+  IN      UINT8               MaxContainers,\r
+  IN      IFR_OPTION          *OptionsList,\r
+  IN     UINTN                OptionCount,\r
+  IN OUT EFI_HII_UPDATE_DATA  *Data\r
   )\r
 /*++\r
 \r
 Routine Description:\r
+  Create EFI_IFR_ORDERED_LIST_OP opcode.\r
 \r
-  Create a hyperlink\r
-  \r
 Arguments:\r
+  QuestionId      - Question ID\r
+  VarStoreId      - Storage ID\r
+  VarOffset       - Offset in Storage\r
+  Prompt          - String ID for Prompt\r
+  Help            - String ID for Help\r
+  QuestionFlags   - Flags in Question Header\r
+  Flags           - Flags for ordered list opcode\r
+  DataType        - Type for option value\r
+  MaxContainers   - Maximum count for options in this ordered list\r
+  OptionsList     - List of options\r
+  OptionCount     - Number of options in option list\r
+  Data            - Destination for the created opcode binary\r
 \r
-  FormId        - Form ID of the hyperlink\r
-  \r
-  Prompt        - Prompt of the hyperlink\r
-  \r
-  FormBuffer    - The form where this hyperlink adds to\r
-  \r
-  StringBuffer  - String buffer created for Prompt\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Hyperlink successfully created\r
+Returns:\r
+  EFI_SUCCESS     - Opcode create success\r
 \r
 --*/\r
 ;\r
 \r
 EFI_STATUS\r
-CreateOneOf (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               DataWidth,\r
-  IN      CHAR16              *Prompt,\r
-  IN      CHAR16              *Help,\r
-  IN      IFR_OPTION          *OptionsList,\r
-  IN      UINTN               OptionCount,\r
-  IN OUT  VOID                *FormBuffer,\r
-  IN OUT  VOID                *StringBuffer\r
+CreateCheckBoxOpCode (\r
+  IN      EFI_QUESTION_ID     QuestionId,\r
+  IN      EFI_VARSTORE_ID     VarStoreId,\r
+  IN      UINT16              VarOffset,\r
+  IN      EFI_STRING_ID       Prompt,\r
+  IN      EFI_STRING_ID       Help,\r
+  IN      UINT8               QuestionFlags,\r
+  IN      UINT8               CheckBoxFlags,\r
+  IN OUT EFI_HII_UPDATE_DATA  *Data\r
   )\r
 /*++\r
 \r
 Routine Description:\r
+  Create EFI_IFR_CHECKBOX_OP opcode.\r
 \r
-  Create a one-of question with a set of options to choose from.  The\r
-  OptionsList is a pointer to a null-terminated list of option descriptions.\r
-  \r
 Arguments:\r
+  QuestionId      - Question ID\r
+  VarStoreId      - Storage ID\r
+  VarOffset       - Offset in Storage\r
+  Prompt          - String ID for Prompt\r
+  Help            - String ID for Help\r
+  QuestionFlags   - Flags in Question Header\r
+  CheckBoxFlags   - Flags for checkbox opcode\r
+  Data            - Destination for the created opcode binary\r
 \r
-  QuestionId      - Question ID of the one-of box\r
-  \r
-  DataWidth       - DataWidth of the one-of box\r
-  \r
-  Prompt          - Prompt of the one-of box\r
-  \r
-  Help            - Help of the one-of box\r
-  \r
-  OptionsList     - Each string in it is an option of the one-of box\r
-  \r
-  OptionCount     - Option string count\r
-  \r
-  FormBuffer      - The form where this one-of box adds to\r
-  \r
-  StringBuffer    - String buffer created for Prompt, Help and Option strings\r
-  \r
-Returns: \r
-\r
-  EFI_DEVICE_ERROR    - DataWidth > 2\r
-\r
-  EFI_SUCCESS         - One-Of box successfully created.\r
+Returns:\r
+  EFI_SUCCESS     - Opcode create success\r
 \r
 --*/\r
 ;\r
 \r
 EFI_STATUS\r
-CreateOrderedList (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               MaxEntries,\r
-  IN      CHAR16              *Prompt,\r
-  IN      CHAR16              *Help,\r
-  IN      IFR_OPTION          *OptionsList,\r
-  IN      UINTN               OptionCount,\r
-  IN OUT  VOID                *FormBuffer,\r
-  IN OUT  VOID                *StringBuffer\r
+CreateNumericOpCode (\r
+  IN     EFI_QUESTION_ID     QuestionId,\r
+  IN     EFI_VARSTORE_ID     VarStoreId,\r
+  IN     UINT16              VarOffset,\r
+  IN     EFI_STRING_ID       Prompt,\r
+  IN     EFI_STRING_ID       Help,\r
+  IN     UINT8               QuestionFlags,\r
+  IN     UINT8               NumericFlags,\r
+  IN     UINT64              Minimum,\r
+  IN     UINT64              Maximum,\r
+  IN     UINT64              Step,\r
+  IN     UINT64              Default,\r
+  IN OUT EFI_HII_UPDATE_DATA *Data\r
   )\r
 /*++\r
 \r
 Routine Description:\r
+  Create EFI_IFR_NUMERIC_OP opcode.\r
 \r
-  Create a one-of question with a set of options to choose from.  The\r
-  OptionsList is a pointer to a null-terminated list of option descriptions.\r
-  \r
 Arguments:\r
+  QuestionId      - Question ID\r
+  VarStoreId      - Storage ID\r
+  VarOffset       - Offset in Storage\r
+  Prompt          - String ID for Prompt\r
+  Help            - String ID for Help\r
+  QuestionFlags   - Flags in Question Header\r
+  NumericFlags    - Flags for numeric opcode\r
+  Minimum         - Numeric minimum value\r
+  Maximum         - Numeric maximum value\r
+  Step            - Numeric step for edit\r
+  Default         - Numeric default value\r
+  Data            - Destination for the created opcode binary\r
 \r
-  QuestionId      - Question ID of the ordered list\r
-  \r
-  MaxEntries      - MaxEntries of the ordered list\r
-  \r
-  Prompt          - Prompt of the ordered list\r
-  \r
-  Help            - Help of the ordered list\r
-  \r
-  OptionsList     - Each string in it is an option of the ordered list\r
-  \r
-  OptionCount     - Option string count\r
-  \r
-  FormBuffer      - The form where this ordered list adds to\r
-  \r
-  StringBuffer    - String buffer created for Prompt, Help and Option strings\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Ordered list successfully created.\r
+Returns:\r
+  EFI_SUCCESS     - Opcode create success\r
 \r
 --*/\r
 ;\r
 \r
 EFI_STATUS\r
-CreateCheckBox (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               DataWidth,\r
-  IN      CHAR16              *Prompt,\r
-  IN      CHAR16              *Help,\r
-  IN      UINT8               Flags,\r
-  IN OUT  VOID                *FormBuffer,\r
-  IN OUT  VOID                *StringBuffer\r
+CreateStringOpCode (\r
+  IN      EFI_QUESTION_ID     QuestionId,\r
+  IN      EFI_VARSTORE_ID     VarStoreId,\r
+  IN      UINT16              VarOffset,\r
+  IN      EFI_STRING_ID       Prompt,\r
+  IN      EFI_STRING_ID       Help,\r
+  IN      UINT8               QuestionFlags,\r
+  IN      UINT8               StringFlags,\r
+  IN      UINT8               MinSize,\r
+  IN      UINT8               MaxSize,\r
+  IN OUT EFI_HII_UPDATE_DATA  *Data\r
   )\r
 /*++\r
 \r
 Routine Description:\r
+  Create EFI_IFR_STRING_OP opcode.\r
 \r
-  Create a checkbox\r
-  \r
 Arguments:\r
+  QuestionId      - Question ID\r
+  VarStoreId      - Storage ID\r
+  VarOffset       - Offset in Storage\r
+  Prompt          - String ID for Prompt\r
+  Help            - String ID for Help\r
+  QuestionFlags   - Flags in Question Header\r
+  StringFlags     - Flags for string opcode\r
+  MinSize         - String minimum length\r
+  MaxSize         - String maximum length\r
+  Data            - Destination for the created opcode binary\r
 \r
-  QuestionId      - Question ID of the check box\r
-  \r
-  DataWidth       - DataWidth of the check box\r
-  \r
-  Prompt          - Prompt of the check box\r
-  \r
-  Help            - Help of the check box\r
-  \r
-  Flags           - Flags of the check box\r
-  \r
-  FormBuffer      - The form where this check box adds to\r
-  \r
-  StringBuffer    - String buffer created for Prompt and Help.\r
-  \r
-Returns: \r
-\r
-  EFI_DEVICE_ERROR    - DataWidth > 1\r
-\r
-  EFI_SUCCESS         - Check box successfully created\r
+Returns:\r
+  EFI_SUCCESS     - Opcode create success\r
 \r
 --*/\r
 ;\r
 \r
 EFI_STATUS\r
-CreateNumeric (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               DataWidth,\r
-  IN      CHAR16              *Prompt,\r
-  IN      CHAR16              *Help,\r
-  IN      UINT16              Minimum,\r
-  IN      UINT16              Maximum,\r
-  IN      UINT16              Step,\r
-  IN      UINT16              Default,\r
-  IN      UINT8               Flags,\r
-  IN      UINT16              Key,\r
-  IN OUT  VOID                *FormBuffer,\r
-  IN OUT  VOID                *StringBuffer\r
+CreateBannerOpCode (\r
+  IN      EFI_STRING_ID       Title,\r
+  IN      UINT16              LineNumber,\r
+  IN      UINT8               Alignment,\r
+  IN OUT  EFI_HII_UPDATE_DATA *Data\r
   )\r
 /*++\r
 \r
 Routine Description:\r
+  Create GUIDed opcode for banner.\r
 \r
-  Create a numeric\r
-  \r
 Arguments:\r
+  Title           - String ID for title\r
+  LineNumber      - Line number for this banner\r
+  Alignment       - Alignment for this banner, left, center or right\r
+  Data            - Destination for the created opcode binary\r
 \r
-  QuestionId      - Question ID of the numeric\r
-  \r
-  DataWidth       - DataWidth of the numeric\r
-  \r
-  Prompt          - Prompt of the numeric\r
-  \r
-  Help            - Help of the numeric\r
-  \r
-  Minimum         - Minumun boundary of the numeric\r
-  \r
-  Maximum         - Maximum boundary of the numeric\r
-  \r
-  Step            - Step of the numeric\r
-   \r
-  Default         - Default value\r
-  \r
-  Flags           - Flags of the numeric\r
-  \r
-  Key             - Key of the numeric\r
-  \r
-  FormBuffer      - The form where this numeric adds to\r
-  \r
-  StringBuffer    - String buffer created for Prompt and Help.\r
-  \r
-Returns: \r
-\r
-  EFI_DEVICE_ERROR      - DataWidth > 2\r
-  \r
-  EFI_SUCCESS           - Numeric is successfully created\r
+Returns:\r
+  EFI_SUCCESS     - Opcode create success\r
 \r
 --*/\r
 ;\r
 \r
-EFI_STATUS\r
-CreateString (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               DataWidth,\r
-  IN      CHAR16              *Prompt,\r
-  IN      CHAR16              *Help,\r
-  IN      UINT8               MinSize,\r
-  IN      UINT8               MaxSize,\r
-  IN      UINT8               Flags,\r
-  IN      UINT16              Key,\r
-  IN OUT  VOID                *FormBuffer,\r
-  IN OUT  VOID                *StringBuffer\r
+EFI_HII_PACKAGE_LIST_HEADER *\r
+PreparePackageList (\r
+  IN UINTN                    NumberOfPackages,\r
+  IN EFI_GUID                 *GuidId,\r
+  ...\r
   )\r
 /*++\r
 \r
 Routine Description:\r
+  Assemble EFI_HII_PACKAGE_LIST according to the passed in packages.\r
 \r
-  Create a string\r
-  \r
 Arguments:\r
+  NumberOfPackages  -  Number of packages.\r
+  GuidId            -  Package GUID.\r
 \r
-  QuestionId      - Question ID of the string\r
-  \r
-  DataWidth       - DataWidth of the string\r
-  \r
-  Prompt          - Prompt of the string\r
-  \r
-  Help            - Help of the string\r
-  \r
-  MinSize         - Min size boundary of the string\r
-  \r
-  MaxSize         - Max size boundary of the string\r
-    \r
-  Flags           - Flags of the string\r
-  \r
-  Key             - Key of the string\r
-  \r
-  FormBuffer      - The form where this string adds to\r
-  \r
-  StringBuffer    - String buffer created for Prompt and Help.\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - String successfully created.\r
+Returns:\r
+  Pointer of EFI_HII_PACKAGE_LIST_HEADER.\r
 \r
 --*/\r
 ;\r
 \r
-EFI_STATUS\r
-ExtractDataFromHiiHandle (\r
-  IN      EFI_HII_HANDLE      HiiHandle,\r
-  IN OUT  UINT16              *ImageLength,\r
-  OUT     UINT8               *DefaultImage,\r
-  OUT     EFI_GUID            *Guid\r
+EFI_HII_HANDLE\r
+DevicePathToHiiHandle (\r
+  IN EFI_HII_DATABASE_PROTOCOL  *HiiDatabase,\r
+  IN EFI_DEVICE_PATH_PROTOCOL   *DevicePath\r
   )\r
 /*++\r
 \r
 Routine Description:\r
+  Find HII Handle associated with given Device Path.\r
 \r
-  Extract information pertaining to the HiiHandle\r
-  \r
 Arguments:\r
+  HiiDatabase - Point to EFI_HII_DATABASE_PROTOCOL instance.\r
+  DevicePath  - Device Path associated with the HII package list handle.\r
+\r
+Returns:\r
+  Handle - HII package list Handle associated with the Device Path.\r
+  NULL   - Hii Package list handle is not found.\r
 \r
-  HiiHandle       - Hii handle\r
-  \r
-  ImageLength     - For input, length of DefaultImage;\r
-                    For output, length of actually required\r
-                    \r
-  DefaultImage    - Image buffer prepared by caller\r
-  \r
-  Guid            - Guid information about the form\r
-  \r
-Returns: \r
-\r
-  EFI_OUT_OF_RESOURCES    - No enough buffer to allocate\r
-  \r
-  EFI_BUFFER_TOO_SMALL    - DefualtImage has no enough ImageLength\r
-  \r
-  EFI_SUCCESS             - Successfully extract data from Hii database.\r
-  \r
-  \r
 --*/\r
 ;\r
 \r
-EFI_HII_HANDLE\r
-FindHiiHandle (\r
-  IN OUT EFI_HII_PROTOCOL    **HiiProtocol, OPTIONAL\r
-  IN     EFI_GUID            *Guid\r
+EFI_STATUS\r
+ExtractDefault(\r
+  IN VOID                         *Buffer,\r
+  IN UINTN                        *BufferSize,\r
+  UINTN                           Number,\r
+  ...\r
   )\r
 /*++\r
 \r
-Routine Description:\r
-  Finds HII handle for given pack GUID previously registered with the HII.\r
+  Routine Description:\r
+    Configure the buffer accrording to ConfigBody strings.\r
 \r
-Arguments:\r
-  HiiProtocol - pointer to pointer to HII protocol interface. \r
-                If NULL, the interface will be found but not returned.\r
-                If it points to NULL, the interface will be found and \r
-                written back to the pointer that is pointed to.\r
-  Guid        - The GUID of the pack that registered with the HII.\r
+  Arguments:\r
+    DefaultId             - the ID of default.\r
+    Buffer                - the start address of buffer.\r
+    BufferSize            - the size of buffer.\r
+    Number                - the number of the strings.\r
 \r
-Returns:\r
-  Handle to the HII pack previously registered by the memory driver.\r
+  Returns:\r
+    EFI_BUFFER_TOO_SMALL  - the BufferSize is too small to operate.\r
+    EFI_INVALID_PARAMETER - Buffer is NULL or BufferSize is 0.\r
+    EFI_SUCCESS           - Operation successful.\r
 \r
 --*/\r
 ;\r
 \r
 EFI_STATUS\r
-CreateSubTitleOpCode (\r
-  IN      STRING_REF          StringToken,\r
-  IN OUT  VOID                *FormBuffer\r
+ExtractGuidFromHiiHandle (\r
+  IN      EFI_HII_HANDLE      Handle,\r
+  OUT     EFI_GUID            *Guid\r
   )\r
 /*++\r
 \r
 Routine Description:\r
+  Extract Hii package list GUID for given HII handle.\r
 \r
-  Create a SubTitle opcode independent of string creation\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-  \r
 Arguments:\r
+  HiiHandle     - Hii handle\r
+  Guid          - Package list GUID\r
 \r
-  StringToken     - StringToken of the subtitle\r
-  \r
-  FormBuffer      - Output of subtitle as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Subtitle created to be a form\r
+Returns:\r
+  EFI_SUCCESS   - Successfully extract GUID from Hii database.\r
 \r
 --*/\r
 ;\r
 \r
 EFI_STATUS\r
-CreateTextOpCode (\r
-  IN      STRING_REF          StringToken,\r
-  IN      STRING_REF          StringTokenTwo,\r
-  IN      STRING_REF          StringTokenThree,\r
-  IN      UINT8               Flags,\r
-  IN      UINT16              Key,\r
-  IN OUT  VOID                *FormBuffer\r
+BufferToHexString (\r
+  IN OUT CHAR16    *Str,\r
+  IN UINT8         *Buffer,\r
+  IN UINTN         BufferSize\r
   )\r
 /*++\r
 \r
 Routine Description:\r
+  Converts binary buffer to Unicode string in reversed byte order to BufToHexString().\r
 \r
-  Create a Text opcode independent of string creation\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-  \r
 Arguments:\r
+  Str        -  String for output\r
+  Buffer     -  Binary buffer.\r
+  BufferSize -  Size of the buffer in bytes.\r
 \r
-  StringToken               - First string token of the text\r
-  \r
-  StringTokenTwo            - Second string token of the text\r
-  \r
-  StringTokenThree          - Help string token of the text\r
-  \r
-  Flags                     - Flag of the text\r
-  \r
-  Key                       - Key of the text\r
-  \r
-  FormBuffer                - Output of text as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS       - Text created to be a form\r
+Returns:\r
+  EFI_SUCCESS    -  The function completed successfully.\r
 \r
 --*/\r
 ;\r
 \r
 EFI_STATUS\r
-CreateGotoOpCode (\r
-  IN      UINT16              FormId,\r
-  IN      STRING_REF          StringToken,\r
-  IN      STRING_REF          StringTokenTwo,\r
-  IN      UINT8               Flags,\r
-  IN      UINT16              Key,\r
-  IN OUT  VOID                *FormBuffer\r
+HexStringToBuffer (\r
+  IN OUT UINT8         *Buffer,\r
+  IN OUT UINTN         *BufferSize,\r
+  IN CHAR16            *Str\r
   )\r
 /*++\r
 \r
 Routine Description:\r
+  Converts Hex String to binary buffer in reversed byte order to HexStringToBuf().\r
 \r
-  Create a hyperlink opcode independent of string creation\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-  \r
 Arguments:\r
+    Buffer     - Pointer to buffer that receives the data.\r
+    BufferSize - Length in bytes of the buffer to hold converted data.\r
+                 If routine return with EFI_SUCCESS, containing length of converted data.\r
+                 If routine return with EFI_BUFFER_TOO_SMALL, containg length of buffer desired.\r
+    Str        - String to be converted from.\r
 \r
-  FormId          - Form ID of the hyperlink\r
-  \r
-  StringToken     - Prompt string token of the hyperlink\r
-  \r
-  StringTokenTwo  - Help string token of the hyperlink\r
-  \r
-  Flags           - Flags of the hyperlink\r
-  \r
-  Key             - Key of the hyperlink\r
-  \r
-  FormBuffer      - Output of hyperlink as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS   - Hyperlink created to be a form\r
+Returns:\r
+  EFI_SUCCESS    -  The function completed successfully.\r
 \r
 --*/\r
 ;\r
 \r
 EFI_STATUS\r
-CreateOneOfOpCode (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               DataWidth,\r
-  IN      STRING_REF          PromptToken,\r
-  IN      STRING_REF          HelpToken,\r
-  IN      IFR_OPTION          *OptionsList,\r
-  IN      UINTN               OptionCount,\r
-  IN OUT  VOID                *FormBuffer\r
+ConstructConfigHdr (\r
+  IN OUT CHAR16                *ConfigHdr,\r
+  IN OUT UINTN                 *StrBufferLen,\r
+  IN EFI_GUID                  *Guid,\r
+  IN CHAR16                    *Name, OPTIONAL\r
+  IN EFI_HANDLE                *DriverHandle\r
   )\r
 /*++\r
 \r
 Routine Description:\r
+  Construct <ConfigHdr> using routing information GUID/NAME/PATH.\r
 \r
-  Create a one-of opcode with a set of option op-codes to choose from independent of string creation.\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-\r
-  OptionsList is a pointer to a null-terminated list of option descriptions.  Ensure that OptionsList[x].StringToken\r
-  has been filled in since this routine will not generate StringToken values.\r
-  \r
 Arguments:\r
+  ConfigHdr    - Pointer to the ConfigHdr string.\r
+  StrBufferLen - On input: Length in bytes of buffer to hold the ConfigHdr string. Includes tailing '\0' character.\r
+                 On output:\r
+                    If return EFI_SUCCESS, containing length of ConfigHdr string buffer.\r
+                    If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired.\r
+  Guid         - Routing information: GUID.\r
+  Name         - Routing information: NAME.\r
+  DriverHandle  - Driver handle which contains the routing information: PATH.\r
 \r
-  QuestionId      - Question ID of the one-of box\r
-  \r
-  DataWidth       - DataWidth of the one-of box\r
-  \r
-  PromptToken     - Prompt string token of the one-of box\r
-  \r
-  HelpToken       - Help string token of the one-of box\r
-  \r
-  OptionsList     - Each string in it is an option of the one-of box\r
-  \r
-  OptionCount     - Option string count\r
-  \r
-  FormBuffer      - Output of One-Of box as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS         - One-Of box created to be a form\r
-  \r
-  EFI_DEVICE_ERROR    - DataWidth > 2\r
+Returns:\r
+  EFI_SUCCESS          - Routine success.\r
+  EFI_BUFFER_TOO_SMALL - The ConfigHdr string buffer is too small.\r
 \r
 --*/\r
 ;\r
 \r
-EFI_STATUS\r
-CreateOrderedListOpCode (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               MaxEntries,\r
-  IN      STRING_REF          PromptToken,\r
-  IN      STRING_REF          HelpToken,\r
-  IN      IFR_OPTION          *OptionsList,\r
-  IN      UINTN               OptionCount,\r
-  IN OUT  VOID                *FormBuffer\r
+BOOLEAN\r
+FindBlockName (\r
+  IN OUT CHAR16                *String,\r
+  UINTN                        Offset,\r
+  UINTN                        Width\r
   )\r
 /*++\r
 \r
 Routine Description:\r
+  Search BlockName "&OFFSET=Offset&WIDTH=Width" in a string.\r
 \r
-  Create a ordered list opcode with a set of option op-codes to choose from independent of string creation.\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-\r
-  OptionsList is a pointer to a null-terminated list of option descriptions.  Ensure that OptionsList[x].StringToken\r
-  has been filled in since this routine will not generate StringToken values.\r
-  \r
 Arguments:\r
+  String       - The string to be searched in.\r
+  Offset       - Offset in BlockName.\r
+  Width        - Width in BlockName.\r
 \r
-  QuestionId      - Question ID of the ordered list\r
-  \r
-  MaxEntries      - MaxEntries of the ordered list\r
-  \r
-  PromptToken     - Prompt string token of the ordered list\r
-  \r
-  HelpToken       - Help string token of the ordered list\r
-  \r
-  OptionsList     - Each string in it is an option of the ordered list\r
-  \r
-  OptionCount     - Option string count\r
-  \r
-  FormBuffer      - Output of ordered list as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Ordered list created to be a form\r
+Returns:\r
+  TRUE         - Block name found.\r
+  FALSE        - Block name not found.\r
 \r
 --*/\r
 ;\r
 \r
 EFI_STATUS\r
-CreateCheckBoxOpCode (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               DataWidth,\r
-  IN      STRING_REF          PromptToken,\r
-  IN      STRING_REF          HelpToken,\r
-  IN      UINT8               Flags,\r
-  IN      UINT16              Key,\r
-  IN OUT  VOID                *FormBuffer\r
+GetBrowserData (\r
+  EFI_GUID                   *VariableGuid, OPTIONAL\r
+  CHAR16                     *VariableName, OPTIONAL\r
+  UINTN                      *BufferSize,\r
+  UINT8                      *Buffer\r
   )\r
 /*++\r
 \r
 Routine Description:\r
+  This routine is invoked by ConfigAccess.Callback() to retrived uncommitted data from Form Browser.\r
 \r
-  Create a checkbox opcode independent of string creation\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-  \r
 Arguments:\r
+  VariableGuid  - An optional field to indicate the target variable GUID name to use.\r
+  VariableName  - An optional field to indicate the target human-readable variable name.\r
+  BufferSize    - On input: Length in bytes of buffer to hold retrived data.\r
+                  On output:\r
+                    If return EFI_BUFFER_TOO_SMALL, containg length of buffer desired.\r
+  Buffer        - Buffer to hold retrived data.\r
 \r
-  QuestionId      - Question ID of the check box\r
-  \r
-  DataWidth       - DataWidth of the check box\r
-  \r
-  PromptToken     - Prompt string token of the check box\r
-  \r
-  HelpToken       - Help string token of the check box\r
-  \r
-  Flags           - Flags of the check box\r
-  \r
-  Key             - Key of the check box\r
-  \r
-  FormBuffer      - Output of the check box as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS       - Checkbox created to be a form\r
-  \r
-  EFI_DEVICE_ERROR  - DataWidth > 1\r
+Returns:\r
+  EFI_SUCCESS          - Routine success.\r
+  EFI_BUFFER_TOO_SMALL - The intput buffer is too small.\r
 \r
 --*/\r
 ;\r
 \r
 EFI_STATUS\r
-CreateNumericOpCode (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               DataWidth,\r
-  IN      STRING_REF          PromptToken,\r
-  IN      STRING_REF          HelpToken,\r
-  IN      UINT16              Minimum,\r
-  IN      UINT16              Maximum,\r
-  IN      UINT16              Step,\r
-  IN      UINT16              Default,\r
-  IN      UINT8               Flags,\r
-  IN      UINT16              Key,\r
-  IN OUT  VOID                *FormBuffer\r
+GetHiiHandles (\r
+  IN OUT UINTN                     *HandleBufferLength,\r
+  OUT    EFI_HII_HANDLE            **HiiHandleBuffer\r
   )\r
 /*++\r
 \r
 Routine Description:\r
+  Determines the handles that are currently active in the database.\r
+  It's the caller's responsibility to free handle buffer.\r
 \r
-  Create a numeric opcode independent of string creation\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-  \r
 Arguments:\r
+  HiiDatabase           - A pointer to the EFI_HII_DATABASE_PROTOCOL instance.\r
+  HandleBufferLength    - On input, a pointer to the length of the handle buffer. On output,\r
+                          the length of the handle buffer that is required for the handles found.\r
+  HiiHandleBuffer       - Pointer to an array of Hii Handles returned.\r
 \r
-  QuestionId      - Question ID of the numeric\r
-  \r
-  DataWidth       - DataWidth of the numeric\r
-  \r
-  PromptToken     - Prompt string token of the numeric\r
-  \r
-  HelpToken       - Help string token of the numeric\r
-  \r
-  Minimum         - Minumun boundary of the numeric\r
-  \r
-  Maximum         - Maximum boundary of the numeric\r
-  \r
-  Step            - Step of the numeric\r
-  \r
-  Default         - Default value of the numeric\r
-  \r
-  Flags           - Flags of the numeric\r
-  \r
-  Key             - Key of the numeric\r
-  \r
-  FormBuffer      - Output of the numeric as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS       - The numeric created to be a form.\r
-  \r
-  EFI_DEVICE_ERROR  - DataWidth > 2\r
+Returns:\r
+  EFI_SUCCESS           - Get an array of Hii Handles successfully.\r
+  EFI_INVALID_PARAMETER - Hii is NULL.\r
+  EFI_NOT_FOUND         - Database not found.\r
 \r
 --*/\r
 ;\r
 \r
 EFI_STATUS\r
-CreateStringOpCode (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               DataWidth,\r
-  IN      STRING_REF          PromptToken,\r
-  IN      STRING_REF          HelpToken,\r
-  IN      UINT8               MinSize,\r
-  IN      UINT8               MaxSize,\r
-  IN      UINT8               Flags,\r
-  IN      UINT16              Key,\r
-  IN OUT  VOID                *FormBuffer\r
+SetBrowserData (\r
+  EFI_GUID                   *VariableGuid, OPTIONAL\r
+  CHAR16                     *VariableName, OPTIONAL\r
+  UINTN                      BufferSize,\r
+  UINT8                      *Buffer,\r
+  CHAR16                     *RequestElement  OPTIONAL\r
   )\r
 /*++\r
 \r
 Routine Description:\r
+  This routine is invoked by ConfigAccess.Callback() to update uncommitted data of Form Browser.\r
 \r
-  Create a numeric opcode independent of string creation\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-  \r
 Arguments:\r
+  VariableGuid   - An optional field to indicate the target variable GUID name to use.\r
+  VariableName   - An optional field to indicate the target human-readable variable name.\r
+  BufferSize     - Length in bytes of buffer to hold retrived data.\r
+  Buffer         - Buffer to hold retrived data.\r
+  RequestElement - An optional field to specify which part of the buffer data\r
+                   will be send back to Browser. If NULL, the whole buffer of\r
+                   data will be committed to Browser.\r
+                   <RequestElement> ::= &OFFSET=<Number>&WIDTH=<Number>*\r
 \r
-  QuestionId      - Question ID of the string\r
-  \r
-  DataWidth       - DataWidth of the string\r
-  \r
-  PromptToken     - Prompt token of the string\r
-  \r
-  HelpToken       - Help token of the string\r
-  \r
-  MinSize         - Min size boundary of the string\r
-  \r
-  MaxSize         - Max size boundary of the string\r
-    \r
-  Flags           - Flags of the string\r
-  \r
-  Key             - Key of the string\r
-  \r
-  FormBuffer      - Output of the string as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS       - String created to be a form.\r
+Returns:\r
+  EFI_SUCCESS  - Routine success.\r
+  Other        - Updating Browser uncommitted data failed.\r
 \r
 --*/\r
 ;\r
 \r
 EFI_STATUS\r
-ValidateDataFromHiiHandle (\r
-  IN      EFI_HII_HANDLE      HiiHandle,\r
-  OUT     BOOLEAN             *Results\r
+ConvertRfc3066LanguageToIso639Language (\r
+  CHAR8   *LanguageRfc3066,\r
+  CHAR8   *LanguageIso639\r
   )\r
 /*++\r
 \r
 Routine Description:\r
+  Convert language code from RFC3066 to ISO639-2.\r
 \r
-  Validate that the data associated with the HiiHandle in NVRAM is within\r
-  the reasonable parameters for that FormSet.  Values for strings and passwords\r
-  are not verified due to their not having the equivalent of valid range settings.\r
-  \r
 Arguments:\r
+  LanguageRfc3066 - RFC3066 language code.\r
+  LanguageIso639  - ISO639-2 language code.\r
 \r
-  HiiHandle -   Handle of the HII database entry to query\r
-\r
-  Results -     If return Status is EFI_SUCCESS, Results provides valid data\r
-                TRUE  = NVRAM Data is within parameters\r
-                FALSE = NVRAM Data is NOT within parameters\r
-  \r
-Returns: \r
+Returns:\r
+  EFI_SUCCESS   - Language code converted.\r
+  EFI_NOT_FOUND - Language code not found.\r
 \r
-  EFI_OUT_OF_RESOURCES      - No enough buffer to allocate\r
-  \r
-  EFI_SUCCESS               - Data successfully validated\r
 --*/\r
 ;\r
 \r
-EFI_STATUS\r
-CreateBannerOpCode (\r
-  IN      UINT16              Title,\r
-  IN      UINT16              LineNumber,\r
-  IN      UINT8               Alignment,\r
-  IN OUT  VOID                *FormBuffer\r
+CHAR8 *\r
+Rfc3066ToIso639 (\r
+  CHAR8  *SupportedLanguages\r
   )\r
 /*++\r
 \r
 Routine Description:\r
+  Convert language code list from RFC3066 to ISO639-2, e.g. "en-US;fr-FR" will\r
+  be converted to "engfra".\r
 \r
-  Create a banner opcode.  This is primarily used by the FrontPage implementation from BDS.\r
-  \r
 Arguments:\r
+  SupportedLanguages - The RFC3066 language list.\r
 \r
-  Title       - Title of the banner\r
-  \r
-  LineNumber  - LineNumber of the banner\r
-  \r
-  Alignment   - Alignment of the banner\r
-  \r
-  FormBuffer  - Output of banner as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Banner created to be a form.\r
+Returns:\r
+  The ISO639-2 language list.\r
 \r
 --*/\r
 ;\r
 \r
-VOID\r
-EfiLibHiiVariablePackGetMap (\r
-  IN    EFI_HII_VARIABLE_PACK        *Pack,  \r
-  OUT   CHAR16                       **Name,  OPTIONAL\r
-  OUT   EFI_GUID                     **Guid,  OPTIONAL\r
-  OUT   UINT16                       *Id,     OPTIONAL\r
-  OUT   VOID                         **Var,   OPTIONAL\r
-  OUT   UINTN                        *Size    OPTIONAL\r
-  ) \r
+EFI_STATUS\r
+GetCurrentLanguage (\r
+  OUT     CHAR8               *Lang\r
+  )\r
 /*++\r
 \r
 Routine Description:\r
-\r
-  Extracts a variable form a Pack.\r
+  Determine what is the current language setting\r
 \r
 Arguments:\r
+  Lang      - Pointer of system language\r
 \r
-  Pack - List of variables\r
-  Name - Name of the variable/map\r
-  Guid - GUID of the variable/map\r
-  Var  - Pointer to the variable/map\r
-  Size - Size of the variable/map in bytes\r
-\r
-Returns: \r
-\r
-  VOID.\r
+Returns:\r
+  Status code\r
 \r
 --*/\r
 ;\r
 \r
-UINTN\r
-EfiLibHiiVariablePackListGetMapCnt (\r
-  IN    EFI_HII_VARIABLE_PACK_LIST   *List\r
+VOID\r
+GetNextLanguage (\r
+  IN OUT CHAR8      **LangCode,\r
+  OUT CHAR8         *Lang\r
   )\r
 /*++\r
 \r
 Routine Description:\r
-\r
-  Finds a count of the variables/maps in the List.\r
+  Get next language from language code list.\r
 \r
 Arguments:\r
+  LangCode - The language code.\r
+  Lang     - Returned language.\r
 \r
-  List - List of variables\r
-\r
-Returns: \r
-\r
-  Number of Map in the variable pack list.\r
+Returns:\r
+  None.\r
 \r
 --*/\r
 ;\r
 \r
-typedef VOID (EFI_LIB_HII_VARIABLE_PACK_LIST_CALLBACK) (\r
-  IN CHAR16                      *Name,\r
-  IN EFI_GUID                    *Guid,\r
-  IN UINT16                      Id,\r
-  IN VOID                        *Var,\r
-  IN UINTN                       Size\r
-  )  \r
+CHAR8 *\r
+GetSupportedLanguages (\r
+  IN EFI_HII_HANDLE           HiiHandle\r
+  )\r
 /*++\r
 \r
 Routine Description:\r
-\r
-  type definition for the callback to be \r
-  used with EfiLibHiiVariablePackListForEachVar().\r
+  This function returns the list of supported languages, in the format specified\r
+  in UEFI specification Appendix M.\r
 \r
 Arguments:\r
+  HiiHandle  - The HII package list handle.\r
 \r
-  Id   - Variable/Map ID\r
-  Name - Name of the variable/map\r
-  Guid - GUID of the variable/map\r
-  Var  - Pointer to the variable/map\r
-  Size - Size of the variable/map in bytes\r
-\r
-Returns: \r
-\r
-  VOID\r
+Returns:\r
+  The supported languages.\r
 \r
 --*/\r
 ;\r
 \r
-VOID\r
-EfiLibHiiVariablePackListForEachVar (\r
-  IN    EFI_HII_VARIABLE_PACK_LIST               *List,\r
-  IN    EFI_LIB_HII_VARIABLE_PACK_LIST_CALLBACK  *Callback\r
+UINT16\r
+GetSupportedLanguageNumber (\r
+  IN EFI_HII_HANDLE           HiiHandle\r
   )\r
 /*++\r
 \r
 Routine Description:\r
-\r
-  Will iterate all variable/maps as appearing \r
-  in List and for each, it will call the Callback.\r
+  This function returns the number of supported languages\r
 \r
 Arguments:\r
+  HiiHandle  - The HII package list handle.\r
 \r
-  List     - List of variables\r
-  Callback - Routine to be called for each iterated variable.\r
-\r
-Returns: \r
-\r
-  VOID\r
+Returns:\r
+  The  number of supported languages.\r
 \r
 --*/\r
 ;\r
 \r
 EFI_STATUS\r
-EfiLibHiiVariablePackListGetMapByIdx (\r
-  IN    UINTN                         Idx,  \r
-  IN    EFI_HII_VARIABLE_PACK_LIST    *List,  \r
-  OUT   CHAR16                        **Name,  OPTIONAL\r
-  OUT   EFI_GUID                      **Guid,  OPTIONAL\r
-  OUT   UINT16                        *Id,    OPTIONAL\r
-  OUT   VOID                          **Var,\r
-  OUT   UINTN                         *Size\r
-  ) \r
+GetStringFromHandle (\r
+  IN  EFI_HII_HANDLE                  HiiHandle,\r
+  IN  EFI_STRING_ID                   StringId,\r
+  OUT EFI_STRING                      *String\r
+  )\r
 /*++\r
 \r
 Routine Description:\r
-\r
-  Finds a variable form List given \r
-  the order number as appears in the List.\r
+  Get string specified by StringId form the HiiHandle.\r
 \r
 Arguments:\r
-\r
-  Idx  - The index of the variable/map to retrieve\r
-  List - List of variables\r
-  Name - Name of the variable/map\r
-  Guid - GUID of the variable/map\r
-  Var  - Pointer to the variable/map\r
-  Size - Size of the variable/map in bytes\r
+  HiiHandle     - The HII handle of package list.\r
+  StringId      - The String ID.\r
+  String        - The output string.\r
 \r
 Returns:\r
-\r
-  EFI_SUCCESS   - Variable is found, OUT parameters are valid\r
-  EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid\r
+  EFI_NOT_FOUND         - String is not found.\r
+  EFI_SUCCESS           - Operation is successful.\r
+  EFI_OUT_OF_RESOURCES  - There is not enought memory in the system.\r
+  EFI_INVALID_PARAMETER - The String is NULL.\r
 \r
 --*/\r
 ;\r
 \r
 EFI_STATUS\r
-EfiLibHiiVariablePackListGetMapById (\r
-  IN    UINT16                        Id,  \r
-  IN    EFI_HII_VARIABLE_PACK_LIST    *List,\r
-  OUT   CHAR16                        **Name,  OPTIONAL\r
-  OUT   EFI_GUID                      **Guid,  OPTIONAL\r
-  OUT   VOID                          **Var,\r
-  OUT   UINTN                         *Size\r
-  ) \r
+GetStringFromToken (\r
+  IN  EFI_GUID                        *ProducerGuid,\r
+  IN  EFI_STRING_ID                   StringId,\r
+  OUT EFI_STRING                      *String\r
+  )\r
 /*++\r
 \r
 Routine Description:\r
-\r
-  Finds a variable form List given the \r
-  order number as appears in the List.\r
+  Get the string given the StringId and String package Producer's Guid.\r
 \r
 Arguments:\r
-\r
-  Id   - The ID of the variable/map to retrieve\r
-  List - List of variables\r
-  Name - Name of the variable/map\r
-  Guid - GUID of the variable/map\r
-  Var  - Pointer to the variable/map\r
-  Size - Size of the variable/map in bytes\r
+  ProducerGuid  - The Guid of String package list.\r
+  StringId      - The String ID.\r
+  String        - The output string.\r
 \r
 Returns:\r
-\r
-  EFI_SUCCESS   - Variable is found, OUT parameters are valid\r
-  EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid\r
+  EFI_NOT_FOUND         - String is not found.\r
+  EFI_SUCCESS           - Operation is successful.\r
+  EFI_OUT_OF_RESOURCES  - There is not enought memory in the system.\r
 \r
 --*/\r
 ;\r
 \r
 EFI_STATUS\r
-EfiLibHiiVariablePackListGetMap (\r
-  IN    EFI_HII_VARIABLE_PACK_LIST   *List,\r
-  IN    CHAR16                       *Name,\r
-  IN    EFI_GUID                     *Guid,\r
-  OUT   UINT16                       *Id,\r
-  OUT   VOID                         **Var, \r
-  OUT   UINTN                        *Size\r
-  ) \r
+IfrLibNewString (\r
+  IN  EFI_HII_HANDLE                  PackageList,\r
+  OUT EFI_STRING_ID                   *StringId,\r
+  IN  CONST EFI_STRING                String\r
+  )\r
 /*++\r
 \r
-Routine Description:\r
+  Routine Description:\r
+    This function adds the string into String Package of each language.\r
 \r
-  Finds a variable form EFI_HII_VARIABLE_PACK_LIST given name and GUID.\r
+  Arguments:\r
+    PackageList       - Handle of the package list where this string will be added.\r
+    StringId          - On return, contains the new strings id, which is unique within PackageList.\r
+    String            - Points to the new null-terminated string.\r
 \r
-Arguments:\r
+  Returns:\r
+    EFI_SUCCESS            - The new string was added successfully.\r
+    EFI_NOT_FOUND          - The specified PackageList could not be found in database.\r
+    EFI_OUT_OF_RESOURCES   - Could not add the string due to lack of resources.\r
+    EFI_INVALID_PARAMETER  - String is NULL or StringId is NULL is NULL.\r
 \r
-  List - List of variables\r
-  Name - Name of the variable/map to be found\r
-  Guid - GUID of the variable/map to be found\r
-  Var  - Pointer to the variable/map found\r
-  Size - Size of the variable/map in bytes found\r
+--*/\r
+;\r
 \r
-Returns:\r
+EFI_STATUS\r
+IfrLibGetString (\r
+  IN  EFI_HII_HANDLE                  PackageList,\r
+  IN  EFI_STRING_ID                   StringId,\r
+  OUT EFI_STRING                      String,\r
+  IN  OUT UINTN                       *StringSize\r
+  )\r
+/*++\r
+\r
+  Routine Description:\r
+    This function try to retrieve string from String package of current language.\r
+    If fail, it try to retrieve string from String package of first language it support.\r
 \r
-  EFI_SUCCESS   - variable is found, OUT parameters are valid\r
-  EFI_NOT_FOUND - variable is not found, OUT parameters are not valid\r
+  Arguments:\r
+    PackageList       - The package list in the HII database to search for the specified string.\r
+    StringId          - The string's id, which is unique within PackageList.\r
+    String            - Points to the new null-terminated string.\r
+    StringSize        - On entry, points to the size of the buffer pointed to by String, in bytes. On return,\r
+                        points to the length of the string, in bytes.\r
+\r
+  Returns:\r
+    EFI_SUCCESS            - The string was returned successfully.\r
+    EFI_NOT_FOUND          - The string specified by StringId is not available.\r
+    EFI_BUFFER_TOO_SMALL   - The buffer specified by StringLength is too small to hold the string.\r
+    EFI_INVALID_PARAMETER  - The String or StringSize was NULL.\r
 \r
 --*/\r
 ;\r
 \r
 EFI_STATUS\r
-EfiLibHiiVariableRetrieveFromNv (\r
-  IN  CHAR16                     *Name,\r
-  IN  EFI_GUID                   *Guid,\r
-  IN  UINTN                      Size,\r
-  OUT VOID                       **Var\r
+IfrLibSetString (\r
+  IN EFI_HII_HANDLE                   PackageList,\r
+  IN EFI_STRING_ID                    StringId,\r
+  IN CONST EFI_STRING                 String\r
   )\r
 /*++\r
 \r
-Routine Description:\r
-  Finds out if a variable of specific Name/Guid/Size exists in NV. \r
-  If it does, it will retrieve it into the Var. \r
+  Routine Description:\r
+    This function updates the string in String package of current language.\r
 \r
-Arguments:\r
-  Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.\r
-  Var              - Variable will be retrieved into buffer pointed by this pointer.\r
-                     If pointing to NULL, the buffer will be allocated. Caller is responsible for releasing the buffer.\r
-Returns:\r
-  EFI_SUCCESS    - The variable of exact Name/Guid/Size parameters was retrieved and written to Var.\r
-  EFI_NOT_FOUND  - The variable of this Name/Guid was not found in the NV.\r
-  EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.\r
+  Arguments:\r
+    PackageList       - The package list containing the strings.\r
+    StringId          - The string's id, which is unique within PackageList.\r
+    String            - Points to the new null-terminated string.\r
+\r
+  Returns:\r
+    EFI_SUCCESS            - The string was updated successfully.\r
+    EFI_NOT_FOUND          - The string specified by StringId is not in the database.\r
+    EFI_INVALID_PARAMETER  - The String was NULL.\r
+    EFI_OUT_OF_RESOURCES   - The system is out of resources to accomplish the task.\r
 \r
 --*/\r
 ;\r
 \r
-////\r
-//// Variable override support.\r
-////\r
-\r
 EFI_STATUS\r
-EfiLibHiiVariableOverrideIfSuffix (\r
-  IN  CHAR16                 *Suffix,\r
-  IN  CHAR16                 *Name,\r
-  IN  EFI_GUID               *Guid,\r
-  IN  UINTN                   Size,\r
-  OUT VOID                   *Var\r
-  )  \r
+IfrLibCreatePopUp (\r
+  IN  UINTN                       NumberOfLines,\r
+  OUT EFI_INPUT_KEY               *KeyValue,\r
+  IN  CHAR16                      *String,\r
+  ...\r
+  )\r
 /*++\r
 \r
 Routine Description:\r
-  Overrrides the variable with NV data if found.\r
-  But it only does it if the Name ends with specified Suffix.\r
-  For example, if Suffix="MyOverride" and the Name="XyzSetupMyOverride",\r
-  the Suffix matches the end of Name, so the variable will be loaded from NV\r
-  provided the variable exists and the GUID and Size matches.\r
+  Draw a dialog and return the selected key.\r
 \r
 Arguments:\r
-  Suffix           - Suffix the Name should end with.\r
-  Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.\r
-  Var              - Variable will be retrieved into this buffer.\r
-                     Caller is responsible for providing storage of exactly Size size in bytes.\r
+  NumberOfLines     - The number of lines for the dialog box\r
+  KeyValue          - The EFI_KEY value returned if HotKey is TRUE..\r
+  String            - Pointer to the first string in the list\r
+  ...               - A series of (quantity == NumberOfLines) text strings which\r
+                      will be used to construct the dialog box\r
+\r
 Returns:\r
-  EFI_SUCCESS           - The variable was overriden with NV variable of same Name/Guid/Size.\r
-  EFI_INVALID_PARAMETER - The name of the variable does not end with <Suffix>.\r
-  EFI_NOT_FOUND         - The variable of this Name/Guid was not found in the NV.\r
-  EFI_LOAD_ERROR        - The variable in the NV was of different size, or NV API returned error.\r
+  EFI_SUCCESS           - Displayed dialog and received user interaction\r
+  EFI_INVALID_PARAMETER - One of the parameters was invalid.\r
 \r
 --*/\r
 ;\r
 \r
 EFI_STATUS\r
-EfiLibHiiVariableOverrideBySuffix (\r
-  IN  CHAR16                 *Suffix,\r
-  IN  CHAR16                 *Name,\r
-  IN  EFI_GUID               *Guid,\r
-  IN  UINTN                   Size,\r
-  OUT VOID                   *Var\r
-  ) \r
+IfrLibUpdateForm (\r
+  IN EFI_HII_HANDLE            Handle,\r
+  IN EFI_GUID                  *FormSetGuid, OPTIONAL\r
+  IN EFI_FORM_ID               FormId,\r
+  IN UINT16                    Label,\r
+  IN BOOLEAN                   Insert,\r
+  IN EFI_HII_UPDATE_DATA       *Data\r
+  )\r
 /*++\r
 \r
 Routine Description:\r
-  Overrrides the variable with NV data if found.\r
-  But it only does it if the NV contains the same variable with Name is appended with Suffix.  \r
-  For example, if Suffix="MyOverride" and the Name="XyzSetup",\r
-  the Suffix will be appended to the end of Name, and the variable with Name="XyzSetupMyOverride"\r
-  will be loaded from NV provided the variable exists and the GUID and Size matches.\r
+  This function allows the caller to update a form that has\r
+  previously been registered with the EFI HII database.\r
 \r
 Arguments:\r
-  Suffix           - Suffix the variable will be appended with.\r
-  Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.\r
-  Var              - Variable will be retrieved into this buffer.\r
-                     Caller is responsible for providing storage of exactly Size size in bytes.\r
+  Handle       - Hii Handle\r
+  FormSetGuid  - The formset should be updated.\r
+  FormId       - The form should be updated.\r
+  Label        - Update information starting immediately after this label in the IFR\r
+  Insert       - If TRUE and Data is not NULL, insert data after Label.\r
+                 If FALSE, replace opcodes between two labels with Data.\r
+  Data         - The adding data; If NULL, remove opcodes between two Label.\r
 \r
 Returns:\r
-  EFI_SUCCESS    - The variable was overriden with NV variable of same Name/Guid/Size.\r
-  EFI_NOT_FOUND  - The variable of this Name/Guid was not found in the NV.\r
-  EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.\r
+  EFI_SUCCESS  - Update success.\r
+  Other        - Update fail.\r
 \r
 --*/\r
 ;\r
-\r
 #endif\r
index 8606fc5fd7ba5ef3da2c9ff04102ce98ee888c35..8f6d1ec16a2bb4ff9e63c68fcee55fbdd7081d13 100644 (file)
@@ -617,4 +617,10 @@ FreeAlignedPool (
   IN VOID   *Buffer\r
   );\r
 \r
+VOID\r
+EFIAPI\r
+SafeFreePool (\r
+  IN VOID   *Buffer\r
+  );\r
+\r
 #endif\r
index 5957b0ed79836cbc47fb313d97191048ebec560e..cabad21436f0dc3cf286a59abdb128b8fcffc795 100644 (file)
@@ -207,9 +207,9 @@ typedef struct {
 #define MSG_SATA_DP               0x12\r
 typedef struct {\r
   EFI_DEVICE_PATH_PROTOCOL        Header;\r
-  UINT16                          HbaPortNumber;\r
-  UINT16                          PortMultiplierPort;\r
-  UINT16                          LogicalUnitNumber;\r
+  UINT16                          HBAPortNumber;\r
+  UINT16                          PortMultiplierPortNumber;\r
+  UINT16                          Lun;\r
 } SATA_DEVICE_PATH;\r
 \r
 #define MSG_I2O_DP                0x06\r
index 36e47e150cf67c0057f9362bf42fee28fc2e2442..34fd9b71a7b796f4d4177b68a549ccac65c09353 100644 (file)
 #ifndef __EFI_FORM_BROWSER_H__\r
 #define __EFI_FORM_BROWSER_H__\r
 \r
-#error "UEFI 2.1 HII is not fully implemented for now, Please don't include this file now."\r
-\r
-\r
 #define EFI_FORM_BROWSER2_PROTOCOL_GUID \\r
-  { 0xe5a1333e, 0xe1b4, 0x4e55, { 0xce, 0xeb, 0x35, 0xc3, 0xef, 0x13, 0x34, 0x43 } }\r
+  {0xb9d4c360, 0xbcfb, 0x4f9b, {0x92, 0x98, 0x53, 0xc1, 0x36, 0x98, 0x22, 0x58 }}\r
 \r
 \r
 typedef struct _EFI_FORM_BROWSER2_PROTOCOL   EFI_FORM_BROWSER2_PROTOCOL;\r
@@ -54,10 +51,10 @@ typedef struct {
 \r
 typedef UINTN EFI_BROWSER_ACTION_REQUEST;\r
 \r
-#define EFI_BROWSER_ACTION_NONE   0\r
-#define EFI_BROWSER_ACTION_RESET  1\r
-#define EFI_BROWSER_ACTION_SUMBIT 2\r
-#define EFI_BROWSER_ACTION_EXIT   3\r
+#define EFI_BROWSER_ACTION_REQUEST_NONE   0\r
+#define EFI_BROWSER_ACTION_REQUEST_RESET  1\r
+#define EFI_BROWSER_ACTION_REQUEST_SUBMIT 2\r
+#define EFI_BROWSER_ACTION_REQUEST_EXIT   3\r
 \r
 \r
 /**\r
@@ -67,7 +64,7 @@ typedef UINTN EFI_BROWSER_ACTION_REQUEST;
   the browser to use a variety of passed-in information or\r
   primarily use the HII database as the source of information.\r
 \r
-  @param This   A pointer to the EFI_FORM_BROWSER_PROTOCOL\r
+  @param This   A pointer to the EFI_FORM_BROWSER2_PROTOCOL\r
                 instance.\r
 \r
   @param Handle   A pointer to an array of HII handles to\r
@@ -121,12 +118,12 @@ typedef UINTN EFI_BROWSER_ACTION_REQUEST;
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_SEND_FORM2) (\r
-  IN CONST  EFI_FORM_BROWSER_PROTOCOL  *This,\r
-  IN CONST  EFI_HII_HANDLE             *Handle,\r
-  IN CONST  UINTN                      HandleCount,\r
-  IN CONST  BOOLEAN                    SingleUse,\r
+  IN CONST  EFI_FORM_BROWSER2_PROTOCOL  *This,\r
+  IN        EFI_HII_HANDLE              *Handle,\r
+  IN        UINTN                      HandleCount,\r
+  IN        EFI_GUID                   *FormSetGuid, OPTIONAL\r
+  IN        EFI_FORM_ID                FormId, OPTIONAL\r
   IN CONST  EFI_SCREEN_DESCRIPTOR      *ScreenDimensions, OPTIONAL\r
-  OUT       BOOLEAN                    *ResetRequired OPTIONAL\r
   OUT       EFI_BROWSER_ACTION_REQUEST *ActionRequest  OPTIONAL\r
 );\r
 \r
@@ -137,7 +134,7 @@ EFI_STATUS
   browser. This routine called this service in the browser to\r
   retrieve or set certain uncommitted state information.\r
 \r
-  @param This   A pointer to the EFI_FORM_BROWSER_PROTOCOL\r
+  @param This   A pointer to the EFI_FORM_BROWSER2_PROTOCOL\r
                 instance.\r
 \r
   @param ResultsDataSize  A pointer to the size of the buffer\r
@@ -172,7 +169,7 @@ EFI_STATUS
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_BROWSER_CALLBACK2 ) (\r
-  IN CONST  EFI_FORM_BROWSER_PROTOCOL *This,\r
+  IN CONST  EFI_FORM_BROWSER2_PROTOCOL *This,\r
   IN OUT    UINTN                     *ResultsDataSize,\r
   IN OUT    EFI_STRING                ResultsData,\r
   IN CONST  BOOLEAN                   RetrieveData,\r
@@ -213,4 +210,3 @@ extern EFI_GUID gEfiFormBrowser2ProtocolGuid;
 \r
 #endif\r
 \r
-\r
index b253a7b047f39ddd26911b9a05b987183eb8ba33..25dd7f1642d92ac3f0031ad3257d806fc1809c41 100644 (file)
 #ifndef __EFI_HII_CONFIG_ACCESS_H__\r
 #define __EFI_HII_CONFIG_ACCESS_H__\r
 \r
-#error "UEFI 2.1 HII is not fully implemented for now, Please don't include this file now."\r
+#include <Protocol/FormBrowser2.h>\r
 \r
 #define EFI_HII_CONFIG_ACCESS_PROTOCOL_GUID  \\r
   { 0x330d4706, 0xf2a0, 0x4e4f, { 0xa3, 0x69, 0xb6, 0x6f, 0xa8, 0xd5, 0x43, 0x85 } }\r
 \r
 typedef struct _EFI_HII_CONFIG_ACCESS_PROTOCOL  EFI_HII_CONFIG_ACCESS_PROTOCOL;\r
 \r
+typedef UINTN EFI_BROWSER_ACTION;\r
+\r
+#define EFI_BROWSER_ACTION_CHANGING 0\r
+#define EFI_BROWSER_ACTION_CHANGED  1\r
+\r
 /**\r
    \r
   This function allows the caller to request the current\r
@@ -235,3 +240,4 @@ extern EFI_GUID gEfiHiiConfigAccessProtocolGuid;
 \r
 #endif\r
 \r
+\r
index 9c592645d04c979b4a262e6e35b2a92580117785..ad7154d60171e78b01a53a7bdb307af44e9c7f94 100644 (file)
@@ -19,8 +19,6 @@
 #ifndef __HII_CONFIG_ROUTING_H__\r
 #define __HII_CONFIG_ROUTING_H__\r
 \r
-#error "UEFI 2.1 HII is not fully implemented for now, Please don't include this file now."\r
-\r
 #define EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID \\r
   { 0x587e72d7, 0xcc50, 0x4f79, { 0x82, 0x09, 0xca, 0x29, 0x1f, 0xc1, 0xa1, 0x0f } }\r
 \r
@@ -112,7 +110,7 @@ typedef
 EFI_STATUS\r
 (EFIAPI * EFI_HII_ROUTING_EXTRACT_CONFIG ) (\r
   IN CONST  EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r
-  IN CONST  EFI_STRING                      *Request,\r
+  IN CONST  EFI_STRING                      Request,\r
   OUT       EFI_STRING                      *Progress,\r
   OUT       EFI_STRING                      *Results\r
 );\r
@@ -278,7 +276,7 @@ EFI_STATUS
   IN CONST  EFI_STRING                      ConfigRequest,\r
   IN CONST  UINT8                           *Block,\r
   IN CONST  UINTN                           BlockSize,\r
-  OUT       EFI_STRING                      **Config,\r
+  OUT       EFI_STRING                      *Config,\r
   OUT       EFI_STRING                      *Progress\r
 );\r
 \r
@@ -334,12 +332,62 @@ typedef
 EFI_STATUS\r
 (EFIAPI * EFI_HII_ROUTING_CONFIG_TO_BLOCK ) (\r
   IN CONST  EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r
-  IN CONST  EFI_STRING                      *ConfigResp,\r
-  IN CONST  UINT8                           *Block,\r
+  IN CONST  EFI_STRING                      ConfigResp,\r
+  IN OUT    UINT8                           *Block,\r
   IN OUT    UINTN                           *BlockSize,\r
   OUT       EFI_STRING                      *Progress\r
 );\r
 \r
+typedef\r
+EFI_STATUS \r
+(EFIAPI * EFI_HII_GET_ALT_CFG) (\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
+  Routine Description:\r
+    This helper function is to be called by drivers to extract portions of \r
+    a larger configuration string.\r
+    \r
+  Arguments:          \r
+    This                   - A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance.    \r
+    Configuration          - A null-terminated Unicode string in <MultiConfigAltResp> format.\r
+    Guid                   - A pointer to the GUID value to search for in the \r
+                             routing portion of the ConfigResp string when retrieving \r
+                             the requested data. If Guid is NULL, then all GUID \r
+                             values will be searched for.\r
+    Name                   - A pointer to the NAME value to search for in the \r
+                             routing portion of the ConfigResp string when retrieving \r
+                             the requested data. If Name is NULL, then all Name \r
+                             values will be searched for.                         \r
+    DevicePath             - A pointer to the PATH value to search for in the \r
+                             routing portion of the ConfigResp string when retrieving \r
+                             the requested data. If DevicePath is NULL, then all \r
+                             DevicePath values will be searched for.             \r
+    AltCfgId               - A pointer to the ALTCFG value to search for in the \r
+                             routing portion of the ConfigResp string when retrieving \r
+                             the requested data.  If this parameter is NULL, \r
+                             then the current setting will be retrieved.\r
+    AltCfgResp             - A pointer to a buffer which will be allocated by the \r
+                             function which contains the retrieved string as requested.  \r
+                             This buffer is only allocated if the call was successful. \r
+    \r
+  Returns:              \r
+    EFI_SUCCESS            - The request succeeded. The requested data was extracted \r
+                             and placed in the newly allocated AltCfgResp buffer.\r
+    EFI_OUT_OF_RESOURCES   - Not enough memory to allocate AltCfgResp.    \r
+    EFI_INVALID_PARAMETER  - Any parameter is invalid.\r
+    EFI_NOT_FOUND          - Target for the specified routing data was not found.\r
+                             \r
+--*/        \r
+;\r
+\r
 \r
 /**\r
    \r
@@ -354,6 +402,7 @@ struct _EFI_HII_CONFIG_ROUTING_PROTOCOL {
   EFI_HII_ROUTING_ROUTE_CONFIG    RouteConfig;\r
   EFI_HII_ROUTING_BLOCK_TO_CONFIG BlockToConfig;\r
   EFI_HII_ROUTING_CONFIG_TO_BLOCK ConfigToBlock;\r
+  EFI_HII_GET_ALT_CFG             GetAltConfig;\r
 };\r
 \r
 extern EFI_GUID gEfiHiiConfigRoutingProtocolGuid;\r
index a100a6bba8a53d7cdafebf88ff6b802680357088..75245c11cd6560943dd65265cdcf75bd3302de76 100644 (file)
 #ifndef __HII_DATABASE_H__\r
 #define __HII_DATABASE_H__\r
 \r
-#error "UEFI 2.1 HII is not fully implemented for now, Please don't include this file now."\r
-\r
 #define EFI_HII_DATABASE_PROTOCOL_GUID \\r
   { 0xef9fc172, 0xa1b2, 0x4693, { 0xb3, 0x27, 0x6d, 0x32, 0xfc, 0x41, 0x60, 0x42 } }\r
 \r
 \r
 typedef struct _EFI_HII_DATABASE_PROTOCOL EFI_HII_DATABASE_PROTOCOL;\r
 \r
-//\r
-// ConfigurationS of HII.\r
-// \r
-#define GLYPH_WIDTH         8\r
-#define GLYPH_HEIGHT        19\r
-\r
-/**\r
-    \r
-  Each package starts with a header, as defined above, which  \r
-  indicates the size and type of the package. When added to a  \r
-  pointer pointing to the start of the header, Length points at  \r
-  the next package. The package lists form a package list when  \r
-  concatenated together and terminated with an  \r
-  EFI_HII_PACKAGE_HEADER with a Type of EFI_HII_PACKAGE_END. The  \r
-  type EFI_HII_PACKAGE_TYPE_GUID is used for vendor-defined HII  \r
-  packages, whose contents are determined by the Guid. The range  \r
-  of package types starting with EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN  \r
-  through EFI_HII_PACKAGE_TYPE_SYSTEM_END are reserved for system  \r
-  firmware implementers.  \r
-  \r
-  @param Length The size of the package in bytes.\r
-  \r
-  @param Type   The package type. See EFI_HII_PACKAGE_TYPE_x,\r
-                below.\r
-  \r
-  @param Data   The package data, the format of which is\r
-                determined by Type.\r
-  \r
-**/\r
-typedef struct {\r
-  UINT32  Length:24;\r
-  UINT32  Type:8;\r
-  // UINT8  Data[...];\r
-} EFI_HII_PACKAGE_HEADER;\r
-\r
-//\r
-// EFI_HII_PACKAGE_TYPE_x.\r
-// \r
-#define EFI_HII_PACKAGE_TYPE_ALL      0x00\r
-#define EFI_HII_PACKAGE_TYPE_GUID     0x01\r
-#define EFI_HII_PACKAGE_FORM_CONFIG   0x02\r
-#define EFI_HII_PACKAGE_FORM_APP      0x03\r
-#define EFI_HII_PACKAGE_STRINGS       0x04\r
-#define EFI_HII_PACKAGE_FONTS         0x05\r
-#define EFI_HII_PACKAGE_IMAGES        0x06\r
-#define EFI_HII_PACKAGE_SIMPLE_FONTS  0x07\r
-#define EFI_HII_PACKAGE_DEVICE_PATH   0x08\r
-#define EFI_HII_PACKAGE_END           0x09\r
-#define EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN   0xE0\r
-#define EFI_HII_PACKAGE_TYPE_SYSTEM_END     0xFF\r
-\r
-\r
-/**\r
-  \r
-  This header uniquely identifies the package list.and is placed   \r
-  in front of a list of packages. Package lists with the same   \r
-  PackageListGuid value should contain the same data set. Updated   \r
-  versions should have updated GUIDs.   \r
-  \r
-  @param PackageListGuid  The unique identifier applied to the\r
-                          list of packages which follows.\r
-  \r
-  \r
-  @param PackageLength    The size of the package list (in\r
-                         bytes), including the header.\r
-\r
-**/\r
-typedef struct {\r
-  EFI_GUID  PackageListGuid;\r
-  UINT32    PackagLength;\r
-} EFI_HII_PACKAGE_LIST_HEADER;\r
-\r
-/**\r
-\r
-  The fonts must be presented in Unicode sort order. That is,\r
-  the primary sort key is the UnicodeWeight and the secondary\r
-  sort key is the SurrogateWeight. It is up to developers who\r
-  manage fonts to choose efficient mechanisms for accessing\r
-  fonts. The contiguous presentation can easily be used because\r
-  narrow and wide glyphs are not intermixed, so a binary search\r
-  is possible (hence the requirement that the glyphs be sorted\r
-  by weight).\r
-\r
-  @param Header   The header contains a Length and Type field.\r
-                  In the case of a font package, the type will\r
-                  be EFI_HII_PACKAGE_SIMPLE_FONTS and the length\r
-                  will be the total size of the font package\r
-                  including the size of the narrow and wide\r
-                  glyphs. See EFI_HII_PACKAGE_HEADER.\r
-\r
-  @param NumberOfNarrowGlyphs   The number of NarrowGlyphs that\r
-                                are included in the font package.\r
-\r
-  @param NumberOfWideGlyphs   The number of WideGlyphs that are\r
-                              included in the font package.\r
-\r
-  @param NarrowGlyphs   An array of EFI_NARROW_GLYPH entries.\r
-                        The number of entries is specified by\r
-                        NumberOfNarrowGlyphs.\r
-\r
-  @param WideGlyphs   An array of EFI_WIDE_GLYPH entries. The\r
-                      number of entries is specified by\r
-                      NumberOfWideGlyphs. To calculate the\r
-                      offset of WideGlyphs, use the offset of\r
-                      NarrowGlyphs and add the size of\r
-                      EFI_NARROW_GLYPH multiplied by the\r
-                      NumberOfNarrowGlyphs.\r
-\r
-*/\r
-typedef struct _EFI_HII_SIMPLE_FONT_PACKAGE_HDR {\r
-  EFI_HII_PACKAGE_HEADER  Header;\r
-  UINT16                  NumberOfNarrowGlyphs;\r
-  UINT16                  NumberOfWideGlyphs;\r
-  // EFI_NARROW_GLYPH         NarrowGlyphs[];\r
-  // EFI_WIDE_GLYPH           WideGlyphs[];\r
-} EFI_HII_SIMPLE_FONT_PACKAGE_HDR;\r
-\r
-//\r
-// Contents of EFI_NARROW_GLYPH.Attributes\r
-//\r
-#define EFI_GLYPH_NON_SPACING 0x01\r
-#define EFI_GLYPH_WIDE        0x02\r
-\r
-/**\r
-\r
-  Glyphs are represented by two structures, one each for the two\r
-  sizes of glyphs. The narrow glyph (EFI_NARROW_GLYPH) is the\r
-  normal glyph used for text display.\r
-\r
-  @param UnicodeWeight  The Unicode representation of the glyph.\r
-                        The term weight is the technical term\r
-                        for a character value.\r
-\r
-  @param Attributes   The data element containing the glyph\r
-                      definitions; see Related Definitions\r
-                      below.\r
-\r
-  @param GlyphCol1  The column major glyph representation of the\r
-                    character. Bits   with values of one\r
-                    indicate that the corresponding pixel is to\r
-                    be on when normally displayed; those with\r
-                    zero are off.\r
-\r
-**/\r
-typedef struct {\r
-  CHAR16  UnicodeWeight;\r
-  UINT8   Attributes;\r
-  UINT8   GlyphCol1[19];\r
-} EFI_NARROW_GLYPH;\r
-\r
-/**\r
-   \r
-  Glyphs are represented via the two structures, one each for the\r
-  two sizes of glyphs. The wide glyph (EFI_WIDE_GLYPH) is large\r
-  enough to display logographic characters.\r
-\r
-  @param UnicodeWeight  The Unicode representation of the glyph.\r
-                        The term weight is the technical term\r
-                        for a character value.\r
-\r
-  @param Attributes   The data element containing the glyph\r
-                      definitions; see Related Definitions in\r
-                      EFI_NARROW_GLYPH for attribute values.\r
-  \r
-  @param GlyphCol1, GlyphCol2   The column major glyph\r
-                                representation of the character.\r
-                                Bits with values of one indicate\r
-                                that the corresponding pixel is\r
-                                to be on when normally\r
-                                displayed; those with zero are\r
-                                off.\r
-  \r
-  @param Pad  Ensures that sizeof(EFI_WIDE_GLYPH) is twice the\r
-              sizeof(EFI_NARROW_GLYPH). The contents of Pad must\r
-              bezero.\r
-\r
-\r
-**/\r
-typedef struct {\r
-  CHAR16  UnicodeWeight;\r
-  UINT8   Attributes;\r
-  UINT8   GlyphCol1[GLYPH_HEIGHT];\r
-  UINT8   GlyphCol2[GLYPH_HEIGHT];\r
-  UINT8   Pad[3];\r
-} EFI_WIDE_GLYPH;\r
-\r
-\r
-//\r
-// EFI_HII_FONT_STYLE\r
-// \r
-typedef UINT32  EFI_HII_FONT_STYLE;\r
-#define EFI_HII_FONT_STYLE_BOLD       0x00000001\r
-#define EFI_HII_FONT_STYLE_ITALIC     0x00000002\r
-#define EFI_HII_FONT_STYLE_EMBOSS     0x00010000\r
-#define EFI_HII_FONT_STYLE_OUTLINE    0x00020000\r
-#define EFI_HII_FONT_STYLE_SHADOW     0x00040000\r
-#define EFI_HII_FONT_STYLE_UNDERLINE  0x00080000\r
-#define EFI_HII_FONT_STYLE_DBL_UNDER  0x00100000\r
-\r
-//\r
-// EFI_HII_GLYPH_BLOCK.BlockType\r
-// \r
-#define EFI_HII_GIBT_END            0x00\r
-#define EFI_HII_GIBT_GLYPH          0x10\r
-#define EFI_HII_GIBT_GLYPHS         0x11\r
-#define EFI_HII_GIBT_GLYPH_DEFAULT  0x12\r
-#define EFI_HII_GIBT_GLYPHS_DEFAULT 0x13\r
-#define EFI_HII_GIBT_DUPLICATE      0x20\r
-#define EFI_HII_GIBT_SKIP2          0x21 \r
-#define EFI_HII_GIBT_SKIP1          0x22\r
-#define EFI_HII_GIBT_DEFAULTS       0x23\r
-#define EFI_HII_GIBT_EXT1           0x30\r
-#define EFI_HII_GIBT_EXT2           0x31\r
-#define EFI_HII_GIBT_EXT4           0x32\r
-\r
-/**\r
-\r
-  EFI_HII_GIBT_END block is found. When processing the glyph\r
-  blocks, each block refers to the current character value\r
-  (CharValueCurrent), which is initially set to one (1). Glyph\r
-  blocks of an unknown type should be skipped. If they cannot be\r
-  skipped, then processing halts.\r
-\r
-**/\r
-typedef struct _EFI_HII_GLYPH_BLOCK {\r
-  UINT8 BlockType;\r
-  UINT8 BlockBody[1];\r
-} EFI_HII_GLYPH_BLOCK;\r
-\r
-\r
-/**\r
-\r
-  @param Width  Width of the character or character cell, in\r
-                pixels. For fixed-pitch fonts, this is the same\r
-                as the advance.\r
-\r
-  @param Height   Height of the character or character cell, in\r
-                  pixels.\r
-\r
-  @param OffsetX  Offset to the horizontal edge of the character\r
-                  cell.\r
-\r
-  @param OffsetY  Offset to the vertical edge of the character\r
-                  cell.\r
-\r
-  @param AdvanceX   Number of pixels to advance to the right\r
-                    when moving from the origin of the current\r
-                    glyph to the origin of the next glyph.\r
-   \r
-**/\r
-typedef struct _EFI_HII_GLYPH_INFO {\r
-  UINT16  Width;\r
-  UINT16  Height;\r
-  INT16   OffsetX;\r
-  INT16   OffsetY;\r
-  INT16   AdvanceX;\r
-} EFI_HII_GLYPH_INFO;\r
-\r
-\r
-/**\r
-   \r
-  Changes the default cell information used for subsequent\r
-  EFI_HII_GIBT_GLYPH_DEFAULT and EFI_HII_GIBT_GLYPHS_DEFAULT glyph\r
-  blocks. The cell information described by Cell remains in effect\r
-  until the next EFI_HII_GIBT_DEFAULTS is found. Prior to the\r
-  first EFI_HII_GIBT_DEFAULTS block, the cell information in the\r
-  fixed header are used.\r
-\r
-  @param Header   Standard glyph block header, where\r
-                  Header.BlockType = EFI_HII_GIBT_DEFAULTS.\r
-  \r
-  @param Cell   The new default cell information which will be\r
-                applied to all subsequent GLYPH_DEFAULT and\r
-                GLYPHS_DEFAULT blocks.\r
-\r
-**/\r
-typedef struct _EFI_HII_GIBT_DEFAULTS_BLOCK {\r
-  EFI_HII_GLYPH_BLOCK   Header;\r
-  EFI_HII_GLYPH_INFO    Cell;\r
-} EFI_HII_GIBT_DEFAULTS_BLOCK;\r
-\r
-\r
-/**\r
-   \r
-  Indicates that the glyph with character value CharValueCurrent\r
-  has the same glyph as a previously defined character value and\r
-  increments CharValueCurrent by one.\r
-\r
-  @param Header   Standard glyph block header, where\r
-                  Header.BlockType = EFI_HII_GIBT_DUPLICATE.\r
-\r
-  @param CharValue  The previously defined character value with\r
-                    the exact same glyph.\r
-\r
-**/\r
-typedef struct _EFI_HII_GIBT_DUPLICATE_BLOCK {\r
-  EFI_HII_GLYPH_BLOCK   Header;\r
-  CHAR16                CharValue;\r
-} EFI_HII_GIBT_DUPLICATE_BLOCK;\r
-\r
-\r
-/**\r
-   \r
-  Any glyphs with a character value greater than or equal to\r
-  CharValueCurrent are empty.\r
-\r
-  @param Header   Standard glyph block header, where\r
-                  Header.BlockType = EFI_HII_GIBT_END.\r
-\r
-**/\r
-typedef struct _EFI_GLYPH_GIBT_END_BLOCK {\r
-  EFI_HII_GLYPH_BLOCK   Header;\r
-} EFI_GLYPH_GIBT_END_BLOCK;\r
-\r
-/**\r
-  \r
-  These are reserved for future expansion, with length bytes\r
-  included so that they can be easily skipped.\r
-\r
-  @param Header   Standard glyph block header, where\r
-                  Header.BlockType = EFI_HII_GIBT_EXT1,\r
-                  EFI_HII_GIBT_EXT2 or EFI_HII_GIBT_EXT4.\r
-\r
-  @param Length   Size of the glyph block, in bytes.\r
-\r
-**/\r
-typedef struct _EFI_HII_GIBT_EXT1_BLOCK {\r
-  EFI_HII_GLYPH_BLOCK Header;\r
-  UINT8               BlockType2;\r
-  UINT8               Length;\r
-} EFI_HII_GIBT_EXT1_BLOCK;\r
-\r
-\r
-/**\r
-  \r
-  These are reserved for future expansion, with length bytes\r
-  included so that they can be easily skipped.\r
-\r
-  @param Header   Standard glyph block header, where\r
-                  Header.BlockType = EFI_HII_GIBT_EXT1,\r
-                  EFI_HII_GIBT_EXT2 or EFI_HII_GIBT_EXT4.\r
-\r
-  @param Length   Size of the glyph block, in bytes.\r
-\r
-**/\r
-typedef struct _EFI_HII_GIBT_EXT2_BLOCK {\r
-  EFI_HII_GLYPH_BLOCK Header;\r
-  UINT8               BlockType2;\r
-  UINT16              Length;\r
-} EFI_HII_GIBT_EXT2_BLOCK;\r
-\r
-/**\r
-  \r
-  These are reserved for future expansion, with length bytes\r
-  included so that they can be easily skipped.\r
-\r
-  @param Header   Standard glyph block header, where\r
-                  Header.BlockType = EFI_HII_GIBT_EXT1,\r
-                  EFI_HII_GIBT_EXT2 or EFI_HII_GIBT_EXT4.\r
-\r
-  @param Length   Size of the glyph block, in bytes.\r
-\r
-**/\r
-typedef struct _EFI_HII_GIBT_EXT4_BLOCK {\r
-  EFI_HII_GLYPH_BLOCK Header;\r
-  UINT8               BlockType2;\r
-  UINT32              Length;\r
-} EFI_HII_GIBT_EXT4_BLOCK;\r
-\r
-\r
-/**\r
-   \r
-  This block provides the bitmap for the character with the value\r
-  CharValueCurrent and increments CharValueCurrent by one. Each\r
-  glyph contains a glyph width and height, a drawing offset,\r
-  number of pixels to advance after drawing and then the encoded\r
-  bitmap.\r
-\r
-  @param Header   Standard glyph block header, where\r
-                  Header.BlockType = EFI_HII_GIBT_GLYPH.\r
-\r
-  @param Cell   Contains the width and height of the encoded\r
-                bitmap (Cell.Width and Cell.Height), the number\r
-                of pixels (signed) right of the character cell\r
-                origin where the left edge of the bitmap should\r
-                be placed (Cell.OffsetX), the number of pixels\r
-                above the character cell origin where the top\r
-                edge of the bitmap should be placed\r
-                (Cell.OffsetY) and the number of pixels (signed)\r
-                to move right to find the origin for the next\r
-                charactercell (Cell.AdvanceX).\r
-\r
-  @param GlyphCount   The number of glyph bitmaps.\r
-\r
-  @param BitmapData   The bitmap data specifies a series of\r
-                      pixels, one bit per pixel, left-to-right,\r
-                      top-tobottom. Each glyph bitmap only\r
-                      encodes the portion of the bitmap enclosed\r
-                      by its character-bounding box, but the\r
-                      entire glyph is padded out to the nearest\r
-                      byte. The number of bytes per bitmap can\r
-                      be calculated as: ((Cell.Width + 7)/8) *\r
-                      Cell.Height.\r
-\r
-\r
-**/\r
-typedef struct _EFI_HII_GIBT_GLYPH_BLOCK {\r
-  EFI_HII_GLYPH_BLOCK   Header;\r
-  EFI_HII_GLYPH_INFO    Cell;\r
-  UINT16                GlyphCount;\r
-  UINT8                 BitmapData[1];\r
-} EFI_HII_GIBT_GLYPH_BLOCK;\r
-\r
-/**\r
-   \r
-  Provides the bitmaps for the characters with the values\r
-  CharValueCurrent through CharValueCurrent + Count -1 and\r
-  increments CharValueCurrent by Count. These glyphs have\r
-  identical cell information and the encoded bitmaps are exactly\r
-  the same number of byes.\r
-\r
-  @param Header   Standard glyph block header, where\r
-                  Header.BlockType = EFI_HII_GIBT_GLYPHS.\r
-\r
-  @param Cell     Contains the width and height of the encoded\r
-                  bitmap (Cell.Width and Cell.Height), the\r
-                  number of pixels (signed) right of the\r
-                  character cell origin where the left edge of\r
-                  the bitmap should be placed (Cell.OffsetX),\r
-                  the number of pixels above the character cell\r
-                  origin where the top edge of the bitmap should\r
-                  be placed (Cell.OffsetY) and the number of\r
-                  pixels(signed) to move right to find the\r
-                  origin for the next character cell\r
-                  (Cell.AdvanceX).\r
-\r
-  @param BitmapData   The bitmap data specifies a series of\r
-                      pixels, one bit per pixel, left-to-right,\r
-                      top-tobottom, for each glyph. Each glyph\r
-                      bitmap only encodes the portion of the\r
-                      bitmap enclosed by its character-bounding\r
-                      box. The number of bytes per bitmap can be\r
-                      calculated as: ((Cell.Width + 7)/8) *\r
-                      Cell.Height.\r
-\r
-**/\r
-typedef struct _EFI_HII_GIBT_GLYPHS_BLOCK {\r
-  EFI_HII_GLYPH_BLOCK   Header;\r
-  EFI_HII_GLYPH_INFO    Cell;\r
-  UINT8                 BitmapData[1];\r
-} EFI_HII_GIBT_GLYPHS_BLOCK;\r
-\r
-/**\r
-   \r
-  Provides the bitmap for the character with the value\r
-  CharValueCurrent and increments CharValueCurrent by 1. This\r
-  glyph uses the default cell information. The default cell\r
-  information is found in the font header or the most recently\r
-  processed EFI_HII_GIBT_DEFAULTS.\r
-\r
-  @param Header   Standard glyph block header, where\r
-                  Header.BlockType = EFI_HII_GIBT_GLYPH_DEFAULT.\r
-\r
-  @param BitmapData   The bitmap data specifies a series of\r
-                      pixels, one bit per pixel, left-to-right,\r
-                      top-tobottom. Each glyph bitmap only\r
-                      encodes the portion of the bitmap enclosed\r
-                      by its character-bounding box. The number\r
-                      of bytes per bitmap can be calculated as:\r
-                      ((Global.Cell.Width + 7)/8) *\r
-                      Global.Cell.Height.\r
-\r
-**/\r
-typedef struct _EFI_HII_GIBT_GLYPH_DEFAULT_BLOCK {\r
-  EFI_HII_GLYPH_BLOCK Header;\r
-  UINT8               BitmapData[1];\r
-} EFI_HII_GIBT_GLYPH_DEFAULT_BLOCK;\r
-\r
-\r
-\r
-\r
-/**\r
-   \r
-  Provides the bitmaps for the characters with the values\r
-  CharValueCurrent through CharValueCurrent + Count -1 and\r
-  increments CharValueCurrent by Count. These glyphs use the\r
-  default cell information and the encoded bitmaps have exactly\r
-  the same number of byes.\r
-\r
-  @param Header   Standard glyph block header, where\r
-                  Header.BlockType =\r
-                  EFI_HII_GIBT_GLYPHS_DEFAULT.\r
-\r
-  @param Count    Number of glyphs in the glyph block.\r
-\r
-  @param BitmapData   The bitmap data specifies a series of\r
-                      pixels, one bit per pixel, left-to-right,\r
-                      top-tobottom, for each glyph. Each glyph\r
-                      bitmap only encodes the portion of the\r
-                      bitmap enclosed by its character-bounding\r
-                      box. The number of bytes per bitmap can be\r
-                      calculated as: ((Global.Cell.Width + 7)/8)\r
-                      Global.Cell.Height.\r
-\r
-**/\r
-typedef struct _EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK {\r
-  EFI_HII_GLYPH_BLOCK Header;\r
-  UINT16              Count;\r
-  UINT8               BitmapData[1];\r
-} EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK;\r
-\r
-/**\r
-   \r
-  Increments the current character value CharValueCurrent by the\r
-  number specified.\r
-\r
-  @param Header   Standard glyph block header, where BlockType =\r
-                  EFI_HII_GIBT_SKIP1 or EFI_HII_GIBT_SKIP2.\r
-\r
-  @param SkipCount  The unsigned 8- or 16-bit value to add to\r
-                    CharValueCurrent.\r
-\r
-**/\r
-typedef struct _EFI_HII_GIBT_SKIP2_BLOCK {\r
-  EFI_HII_GLYPH_BLOCK Header;\r
-  UINT16              SkipCount;\r
-} EFI_HII_GIBT_SKIP2_BLOCK;\r
-\r
-\r
-/**\r
-   \r
-  Increments the current character value CharValueCurrent by the\r
-  number specified.\r
-\r
-  @param Header   Standard glyph block header, where BlockType =\r
-                  EFI_HII_GIBT_SKIP1 or EFI_HII_GIBT_SKIP2.\r
-\r
-  @param SkipCount  The unsigned 8- or 16-bit value to add to\r
-                    CharValueCurrent.\r
-\r
-**/\r
-typedef struct _EFI_HII_GIBT_SKIP1_BLOCK {\r
-  EFI_HII_GLYPH_BLOCK Header;\r
-  UINT8               SkipCount;\r
-} EFI_HII_GIBT_SKIP1_BLOCK;\r
-\r
-\r
-/**\r
-   \r
-  This package is created by NewPackageList() when the package\r
-  list is first added to the HII database by locating the\r
-  EFI_DEVICE_PATH_PROTOCOL attached to the driver handle passed in\r
-  to that function.\r
-  \r
-**/\r
-typedef EFI_DEVICE_PATH_PROTOCOL  EFI_HII_DEVICE_PATH_PACKAGE_HDR;\r
-\r
-\r
-/**\r
-   \r
-  This is a free-form package type designed to allow extensibility\r
-  by allowing the format to be specified using Guid.\r
-\r
-  @param Guid   Identifier which describes the remaining data\r
-                within the package.\r
-\r
-**/\r
-typedef struct _EFI_HII_GUID_PACKAGE_HDR {\r
-  EFI_GUID Guid;\r
-} EFI_HII_GUID_PACKAGE_HDR;\r
-\r
-\r
-/**\r
-   \r
-  The Strings package record describes the mapping between string\r
-  identifiers and the actual text of the strings themselves. The\r
-  package consists of three parts: a fixed header, the string\r
-  information and the font information.\r
-\r
-  @param Header   The standard package header, where Header.Type\r
-                  = EFI_HII_PACKAGE_STRINGS.\r
-\r
-  @param HdrSize  Size of this header.\r
-\r
-  @param StringInfoOffset   Offset, relative to the start of\r
-                            this header, of the string information.\r
-\r
-  @param LanguageWindow   Specifies the default values placed in\r
-                          the static and dynamic windows before\r
-                          processing each SCSU-encoded strings.\r
-\r
-\r
-  @param LanguageName   String identifier within the current\r
-                        string package of the full name of the\r
-                        language specified by Language. Language\r
-                        Language of the strings, as specified by\r
-                        RFC 3066.\r
-\r
-**/\r
-typedef struct _EFI_HII_STRING_PACKAGE_HDR {\r
-  EFI_HII_PACKAGE_HEADER  Header;\r
-  UINT32                  HdrSize;\r
-  UINT32                  StringInfoOffset;\r
-  CHAR16                  LanguageWindow[16];\r
-  EFI_STRING_ID           LanguageName;\r
-  CHAR8 Language[1];\r
-} EFI_HII_STRING_PACKAGE_HDR;\r
-\r
-\r
-\r
-/**\r
-\r
-  The fixed header consists of a standard record header and then\r
-  the character values in this section, the flags (including the\r
-  encoding method) and the offsets of the glyph information, the\r
-  glyph bitmaps and the character map.\r
-\r
-  @param Header   The standard package header, where Header.Size\r
-                  EFI_HII_PACKAGE_FONTS.\r
-\r
-  @param HdrSize  Size of this header.\r
-\r
-  @param GlyphInfoOffset  The offset, relative to the start of\r
-                          this header, of a series of\r
-                          variable-length glyph blocks, each\r
-                          describing information about the\r
-                          bitmap associated with a glyph.\r
-\r
-  @param Cell   This contains the measurement of the widest and\r
-                tallest characters in the font (Cell.Width and\r
-                Cell.Height). It also contains the offset to the\r
-                horizontal and vertical origin point of the\r
-                character cell (Cell.OffsetX and Cell.OffsetY).\r
-                Finally, it contains the default AdvanceX. The\r
-                individual glyph's OffsetX and OffsetY value is\r
-                added to this position to determine where to\r
-                draw the top-left pixel of the character's\r
-                glyph. The character glyph's AdvanceX is added\r
-                to this position to determine the origin point\r
-                for the next character.\r
-\r
-  @param FontStyle  The design style of the font, 1 bit per\r
-                    style. See EFI_HII_FONT_STYLE.\r
-\r
-  @param FontFamily   The null-terminated string with the name\r
-                      of the font family to which the font\r
-                      belongs.\r
-\r
-**/\r
-typedef struct _EFI_HII_FONT_PACKAGE_HDR {\r
-  EFI_HII_PACKAGE_HEADER  Header;\r
-  UINT32                  HdrSize;\r
-  UINT32                  GlyphBlockOffset;\r
-  EFI_HII_GLYPH_INFO      Cell;\r
-  EFI_HII_FONT_STYLE      FontStyle;\r
-  CHAR16                  FontFamily[1];\r
-} EFI_HII_FONT_PACKAGE_HDR;\r
-\r
-\r
-//\r
-// EFI_HII_STRING_BLOCK.BlockType\r
-// \r
-#define FI_HII_SIBT_END                 0x00\r
-#define EFI_HII_SIBT_STRING_SCSU        0x10\r
-#define EFI_HII_SIBT_STRING_SCSU_FONT   0x11\r
-#define EFI_HII_SIBT_STRINGS_SCSU       0x12\r
-#define EFI_HII_SIBT_STRINGS_SCSU_FONT  0x13\r
-#define EFI_HII_SIBT_STRING_UCS2        0x14\r
-#define EFI_HII_SIBT_STRING_UCS2_FONT   0x15\r
-#define EFI_HII_SIBT_STRINGS_UCS2       0x16\r
-#define EFI_HII_SIBT_STRINGS_UCS2_FONT  0x17\r
-#define EFI_HII_SIBT_DUPLICATE          0x20\r
-#define EFI_HII_SIBT_SKIP2              0x21\r
-#define EFI_HII_SIBT_SKIP1              0x22\r
-#define EFI_HII_SIBT_EXT1               0x30\r
-#define EFI_HII_SIBT_EXT2               0x31\r
-#define EFI_HII_SIBT_EXT4               0x32\r
-#define EFI_HII_SIBT_FONT               0x40\r
-\r
-/**\r
-   \r
-  String blocks specify the text and font for the current string\r
-  identifier and increment to the next string identifier.\r
-**/\r
-typedef struct {\r
-  UINT8   BlockType;\r
-  UINT8   BlockBody[1];\r
-} EFI_HII_STRING_BLOCK;\r
-\r
-\r
-/**\r
-   \r
-  Indicates that the string with string identifier\r
-  StringIdCurrent is the same as a previously defined string and\r
-  increments StringIdCurrent by one.\r
-  \r
-  @param Header   Standard string block header, where\r
-                  Header.BlockType = EFI_HII_SIBT_DUPLICATE.\r
-  \r
-  @param StringId   The string identifier of a previously\r
-                    defined string with the exact same string\r
-                    text. Description\r
-\r
-\r
-**/\r
-typedef struct _EFI_HII_SIBT_DUPLICATE_BLOCK {\r
-  EFI_HII_STRING_BLOCK  Header;\r
-  EFI_STRING_ID         StringId;\r
-} EFI_HII_SIBT_DUPLICATE_BLOCK;\r
-\r
-/**\r
-   \r
-  Any strings with a string identifier greater than or equal to\r
-  StringIdCurrent are empty.\r
-\r
-  @param Header   Standard string block header, where\r
-                  Header.BlockType = EFI_HII_SIBT_END.\r
-\r
-**/\r
-typedef struct _EFI_HII_SIBT_END_BLOCK {\r
-  EFI_HII_STRING_BLOCK  Header;\r
-} EFI_HII_SIBT_END_BLOCK;\r
-\r
-\r
-/**\r
-   \r
-  These are reserved for future expansion, with length bytes\r
-  included so that they can be easily skip\r
-\r
-  @param Header   Standard string block header, where\r
-                  Header.BlockType = EFI_HII_SIBT_EXT1,\r
-                  EFI_HII_SIBT_EXT2 or EFI_HII_SIBT_EXT4.\r
-  \r
-  @param Length   Size of the string block, in bytes.\r
-\r
-**/\r
-typedef struct _EFI_HII_SIBT_EXT1_BLOCK {\r
-  EFI_HII_STRING_BLOCK  Header;\r
-  UINT8                 BlockType2;\r
-  UINT8                 Length;\r
-} EFI_HII_SIBT_EXT1_BLOCK;\r
-\r
-/**\r
-   \r
-  These are reserved for future expansion, with length bytes\r
-  included so that they can be easily skip\r
-\r
-  @param Header   Standard string block header, where\r
-                  Header.BlockType = EFI_HII_SIBT_EXT1,\r
-                  EFI_HII_SIBT_EXT2 or EFI_HII_SIBT_EXT4.\r
-  \r
-  @param Length   Size of the string block, in bytes.\r
-\r
-**/\r
-typedef struct _EFI_HII_SIBT_EXT2_BLOCK {\r
-  EFI_HII_STRING_BLOCK  Header;\r
-  UINT8                 BlockType2;\r
-  UINT16                Length;\r
-} EFI_HII_SIBT_EXT2_BLOCK;\r
-\r
-/**\r
-   \r
-  These are reserved for future expansion, with length bytes\r
-  included so that they can be easily skip\r
-\r
-  @param Header   Standard string block header, where\r
-                  Header.BlockType = EFI_HII_SIBT_EXT1,\r
-                  EFI_HII_SIBT_EXT2 or EFI_HII_SIBT_EXT4.\r
-  \r
-  @param Length   Size of the string block, in bytes.\r
-\r
-**/\r
-typedef struct _EFI_HII_SIBT_EXT4_BLOCK {\r
-  EFI_HII_STRING_BLOCK  Header;\r
-  UINT8                 BlockType2;\r
-  UINT32                Length;\r
-} EFI_HII_SIBT_EXT4_BLOCK;\r
-\r
-/**\r
-   \r
-  Associates a font identifier FontId with a font name FontName,\r
-  size FontSize and style FontStyle. This font identifier may be\r
-  used with the string blocks. The font identifier 0 is the\r
-  default font for those string blocks which do not specify a font\r
-  identifier.\r
-\r
-  @param Header   Standard extended header, where\r
-                  Header.BlockType = EFI_HII_SIBT_FONT.\r
-\r
-  @param FontId   Font identifier, which must be unique within\r
-                  the font package.\r
-\r
-  @param FontSize   Character cell size, in pixels, of the font.\r
-\r
-  @param FontStyle  Font style.\r
-\r
-  @param FontName   Null-terminated font family name.\r
-\r
-**/\r
-typedef struct _EFI_HII_SIBT_FONT_BLOCK {\r
-  EFI_HII_SIBT_EXT2_BLOCK   Header;\r
-  UINT8                     FontId;\r
-  UINT16                    FontSize;\r
-  EFI_HII_FONT_STYLE        FontStyle;\r
-  CHAR16                    FontName[1];\r
-} EFI_HII_SIBT_FONT_BLOCK;\r
-\r
-/**\r
-   \r
-  Increments the current string identifier StringIdCurrent by the\r
-  number specified.\r
-\r
-  @param Header   Standard string block header, where\r
-                  Header.BlockType = EFI_HII_SIBT_SKIP1.\r
-  \r
-  @param SkipCount  The unsigned 8-bit value to add to\r
-                    StringIdCurrent.\r
-\r
-**/\r
-typedef struct _EFI_HII_SIBT_SKIP1_BLOCK {\r
-  EFI_HII_STRING_BLOCK  Header;\r
-  UINT8                 SkipCount;\r
-} EFI_HII_SIBT_SKIP1_BLOCK;\r
-\r
-/**\r
-\r
-  Increments the current string identifier StringIdCurrent by\r
-  the number specified.\r
-\r
-  @param Header   Standard string block header, where\r
-                  Header.BlockType = EFI_HII_SIBT_SKIP2.\r
-\r
-  @param SkipCount  The unsigned 16-bit value to add to\r
-                    StringIdCurrent.\r
-\r
-**/\r
-typedef struct _EFI_HII_SIBT_SKIP2_BLOCK {\r
-  EFI_HII_STRING_BLOCK  Header;\r
-  UINT16                SkipCount;\r
-} EFI_HII_SIBT_SKIP2_BLOCK;\r
-\r
-/**\r
-   \r
-  This string block provides the SCSU-encoded text for the string\r
-  in the default font with string identifier StringIdCurrent and\r
-  increments StringIdCurrent by one.\r
-\r
-  @param Header   Standard header where Header.BlockType =\r
-                  EFI_HII_SIBT_STRING_SCSU.\r
-\r
-  @param StringText   The string text is a null-terminated\r
-                      string, which is assigned to the string\r
-                      identifier StringIdCurrent.\r
-\r
-**/\r
-typedef struct _EFI_HII_SIBT_STRING_SCSU_BLOCK {\r
-  EFI_HII_STRING_BLOCK Header;\r
-  UINT8 StringText[1];\r
-} EFI_HII_SIBT_STRING_SCSU_BLOCK;\r
-\r
-\r
-/**\r
-\r
-  This string block provides the SCSU-encoded text for the string\r
-  in the font specified by FontIdentifier with string identifier\r
-  StringIdCurrent and increments StringIdCurrent by one.\r
-\r
-  @param Header   Standard string block header, where\r
-                  Header.BlockType = EFI_HII_SIBT_STRING_SCSU_FONT.\r
-\r
-  @param FontIdentifier   The identifier of the font to be used\r
-                          as the starting font for the entire\r
-                          string. The identifier must either be\r
-                          0 for the default font or an\r
-                          identifier previously specified by an\r
-                          EFI_HII_SIBT_FONT block. Any string\r
-                          characters that deviates from this\r
-                          font family, size or style must\r
-                          provide an explicit control character.\r
-\r
-  @param StringText   The string text is a null-terminated\r
-                      encoded string, which is assigned to the\r
-                      string identifier StringIdCurrent.\r
-\r
-\r
-**/\r
-typedef struct _EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK {\r
-  EFI_HII_STRING_BLOCK  Header;\r
-  UINT8                 FontIdentifier;\r
-  UINT8                 StringText[1];\r
-} EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK;\r
-\r
-\r
-/**\r
-   \r
-  This string block provides the SCSU-encoded text for StringCount\r
-  strings which have the default font and which have sequential\r
-  string identifiers. The strings are assigned the identifiers,\r
-  starting with StringIdCurrent and continuing through\r
-  StringIdCurrent + StringCount ??C 1. StringIdCurrent is\r
-  incremented by StringCount.\r
-\r
-  @param Header   Standard header where Header.BlockType =\r
-                  EFI_HII_SIBT_STRINGS_SCSU.\r
-\r
-  @param StringCount  Number of strings in StringText.\r
-\r
-  @param StringText   The strings, where each string is a\r
-                      null-terminated encoded string.\r
-\r
-**/\r
-typedef struct _EFI_HII_SIBT_STRINGS_SCSU_BLOCK {\r
-  EFI_HII_STRING_BLOCK  Header;\r
-  UINT16                StringCount;\r
-  UINT8                 StringText[1];\r
-} EFI_HII_SIBT_STRINGS_SCSU_BLOCK;\r
-\r
-\r
-/**\r
-   \r
-  This string block provides the SCSU-encoded text for StringCount\r
-  strings which have the font specified by FontIdentifier and\r
-  which have sequential string identifiers. The strings are\r
-  assigned the identifiers, starting with StringIdCurrent and\r
-  continuing through StringIdCurrent + StringCount ??C 1.\r
-  StringIdCurrent is incremented by StringCount.\r
-\r
-  @param Header   Standard header where Header.BlockType =\r
-                  EFI_HII_SIBT_STRINGS_SCSU_FONT.\r
-\r
-  @param StringCount  Number of strings in StringText.\r
-\r
-  @param FontIdentifier   The identifier of the font to be used\r
-                          as the starting font for the entire\r
-                          string. The identifier must either be\r
-                          0 for the default font or an\r
-                          identifier previously specified by an\r
-                          EFI_HII_SIBT_FONT block. Any string\r
-                          characters that deviates from this\r
-                          font family, size or style must\r
-                          provide an explicit control character.\r
-\r
-  @param StringText   The strings, where each string is a\r
-                      null-terminated encoded string.\r
-\r
-**/\r
-typedef struct _EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK {\r
-  EFI_HII_STRING_BLOCK  Header;\r
-  UINT16                StringCount;\r
-  UINT8                 FontIdentifier;\r
-  UINT8                 StringText[1];\r
-} EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK;\r
-\r
-\r
-/**\r
-   \r
-  This string block provides the UCS-2 encoded text for the string\r
-  in the default font with string identifier StringIdCurrent and\r
-  increments StringIdCurrent by one.\r
-\r
-  @param Header   Standard header where Header.BlockType =\r
-                  EFI_HII_SIBT_STRING_UCS2.\r
-\r
-  @param StringText   The string text is a null-terminated UCS-2\r
-                      string, which is assigned to the string\r
-                      identifier StringIdCurrent.\r
-\r
-**/\r
-typedef struct _EFI_HII_SIBT_STRING_UCS2_BLOCK {\r
-  EFI_HII_STRING_BLOCK  Header;\r
-  CHAR16                StringText[1];\r
-} EFI_HII_SIBT_STRING_UCS2_BLOCK;\r
-\r
-\r
-/**\r
-   \r
-  This string block provides the UCS-2 encoded text for the string\r
-  in the font specified by FontIdentifier with string identifier\r
-  StringIdCurrent and increments StringIdCurrent by one\r
-\r
-  @param Header   Standard header where Header.BlockType =\r
-                  EFI_HII_SIBT_STRING_UCS2_FONT.\r
-\r
-  @param FontIdentifier   The identifier of the font to be used\r
-                          as the starting font for the entire\r
-                          string. The identifier must either be\r
-                          0 for the default font or an\r
-                          identifier previously specified by an\r
-                          EFI_HII_SIBT_FONT block. Any string\r
-                          characters that deviates from this\r
-                          font family, size or style must\r
-                          provide an explicit control character.\r
-\r
-  @param StringText   The string text is a null-terminated UCS-2\r
-                      string, which is assigned to the string\r
-                      identifier StringIdCurrent.\r
-\r
-**/\r
-typedef struct _EFI_HII_SIBT_STRING_UCS2_FONT_BLOCK {\r
-  EFI_HII_STRING_BLOCK  Header;\r
-  UINT8                 FontIdentifier;\r
-  CHAR16                StringText[1];\r
-} EFI_HII_SIBT_STRING_UCS2_FONT_BLOCK;\r
-\r
-\r
-/**\r
-   \r
-  This string block provides the UCS-2 encoded text for the\r
-  strings in the default font with string identifiers\r
-  StringIdCurrent to StringIdCurrent + StringCount - 1 and\r
-  increments StringIdCurrent by StringCount.\r
-\r
-  @param Header   Standard header where Header.BlockType =\r
-                  EFI_HII_SIBT_STRINGS_UCS2.\r
-\r
-  @param StringCount  Number of strings in StringText.\r
-\r
-  @param StringText   The string text is a series of\r
-                      null-terminated UCS-2 strings, which are\r
-                      assigned to the string identifiers\r
-                      StringIdCurrent.to StringIdCurrent +\r
-                      StringCount - 1.\r
-  \r
-**/\r
-typedef struct _EFI_HII_SIBT_STRINGS_UCS2_BLOCK {\r
-  EFI_HII_STRING_BLOCK  Header;\r
-  UINT16                StringCount;\r
-  CHAR16                StringText[1];\r
-} EFI_HII_SIBT_STRINGS_UCS2_BLOCK;\r
-\r
-\r
-/**\r
-   \r
-  The fixed header consists of a standard record header and the\r
-  offsets of the image and palette information.\r
-\r
-  @param Header   Standard package header, where Header.Type =\r
-                  EFI_HII_PACKAGE_IMAGES. ImageInfoOffset\r
-                  Offset, relative to this header, of the image\r
-                  information. If this is zero, then there are\r
-                  no images in the package.\r
-\r
-  @param PaletteInfoOffset  Offset, relative to this header, of\r
-                            the palette information. If this is\r
-                            zero, then there are no palettes in\r
-                            the image package.\r
-\r
-**/\r
-typedef struct _EFI_HII_IMAGE_PACKAGE_HDR {\r
-  EFI_HII_PACKAGE_HEADER  Header;\r
-  UINT32                  ImageInfoOffset;\r
-  UINT32                  PaletteInfoOffset;\r
-} EFI_HII_IMAGE_PACKAGE_HDR;\r
-\r
-\r
-//\r
-// EFI_HII_IMAGE_BLOCK\r
-// \r
-typedef struct _EFI_HII_IMAGE_BLOCK {\r
-  UINT8   BlockType;\r
-  UINT8   BlockBody[1];\r
-} EFI_HII_IMAGE_BLOCK;\r
-\r
-//\r
-// EFI_HII_IMAGE_BLOCK.BlockType.\r
-// \r
-#define EFI_HII_IIBT_END                0x00\r
-#define EFI_HII_IIBT_IMAGE_1BIT         0x10\r
-#define EFI_HII_IIBT_IMAGE_1BIT_TRANS   0x11\r
-#define EFI_HII_IIBT_IMAGE_4BIT         0x12\r
-#define EFI_HII_IIBT_IMAGE_4BIT_TRANS   0x13\r
-#define EFI_HII_IIBT_IMAGE_8BIT         0x14\r
-#define EFI_HII_IIBT_IMAGE_8BIT_TRANS   0x15\r
-#define EFI_HII_IIBT_IMAGE_24BIT        0x16\r
-#define EFI_HII_IIBT_IMAGE_24BIT_TRANS  0x17\r
-#define EFI_HII_IIBT_IMAGE_JPEG         0x18\r
-#define EFI_HII_IIBT_DUPLICATE          0x20\r
-#define EFI_HII_IIBT_SKIP2              0x21\r
-#define EFI_HII_IIBT_SKIP1              0x22\r
-#define EFI_HII_IIBT_EXT1               0x30\r
-#define EFI_HII_IIBT_EXT2               0x31\r
-#define EFI_HII_IIBT_EXT4               0x32\r
-\r
-\r
-/**\r
-   \r
-  Any images with an image identifier greater than or equal to\r
-  ImageIdCurrent are empty.\r
-\r
-  @param Header   Standard image block header, where\r
-                  Header.BlockType = EFI_HII_IIBT_END.\r
-\r
-**/\r
-typedef struct _EFI_HII_IIBT_END_BLOCK {\r
-  EFI_HII_IMAGE_BLOCK   Header;\r
-} EFI_HII_IIBT_END_BLOCK;\r
-\r
-\r
-/**\r
-   \r
-  Future extensions for image records which need a length-byte\r
-  length use this prefix.\r
-\r
-  @param Header   Standard image block header, where\r
-                  Header.BlockType = EFI_HII_IIBT_EXT1,\r
-                  EFI_HII_IIBT_EXT2 or EFI_HII_IIBT_EXT4.\r
-  \r
-  @param Length   Size of the image block, in bytes, including\r
-                  the image block header.\r
-\r
-**/\r
-typedef struct _EFI_HII_IIBT_EXT1_BLOCK {\r
-  EFI_HII_IMAGE_BLOCK Header;\r
-  UINT8               BlockType2;\r
-  UINT8               Length;\r
-} EFI_HII_IIBT_EXT1_BLOCK;\r
-\r
-/**\r
-   \r
-  Future extensions for image records which need a length-byte\r
-  length use this prefix.\r
-\r
-  @param Header   Standard image block header, where\r
-                  Header.BlockType = EFI_HII_IIBT_EXT1,\r
-                  EFI_HII_IIBT_EXT2 or EFI_HII_IIBT_EXT4.\r
-  \r
-  @param Length   Size of the image block, in bytes, including\r
-                  the image block header.\r
-\r
-**/\r
-typedef struct _EFI_HII_IIBT_EXT2_BLOCK {\r
-  EFI_HII_IMAGE_BLOCK Header;\r
-  UINT8               BlockType2;\r
-  UINT16              Length;\r
-} EFI_HII_IIBT_EXT2_BLOCK;\r
-\r
-/**\r
-   \r
-  Future extensions for image records which need a length-byte\r
-  length use this prefix.\r
-\r
-  @param Header   Standard image block header, where\r
-                  Header.BlockType = EFI_HII_IIBT_EXT1,\r
-                  EFI_HII_IIBT_EXT2 or EFI_HII_IIBT_EXT4.\r
-  \r
-  @param Length   Size of the image block, in bytes, including\r
-                  the image block header.\r
-\r
-**/\r
-typedef struct _EFI_HII_IIBT_EXT4_BLOCK {\r
-  EFI_HII_IMAGE_BLOCK Header;\r
-  UINT8               BlockType2;\r
-  UINT32              Length;\r
-} EFI_HII_IIBT_EXT4_BL0CK;\r
-\r
-//\r
-// EFI_HII_IIBT_IMAGE_1BIT_BASE\r
-// \r
-typedef struct _EFI_HII_IIBT_IMAGE_1BIT_BASE {\r
-  UINT16 Width;\r
-  UINT16 Height;\r
-  // UINT8 Data[...];\r
-} EFI_HII_IIBT_IMAGE_1BIT_BASE;\r
-\r
-/**\r
-\r
-  This record assigns the 1-bit-per-pixel bitmap data to the\r
-  ImageIdCurrent identifier and increment ImageIdCurrent by one.\r
-  The data in the EFI_HII_IMAGE_1BIT_TRANS structure is exactly\r
-  the same as the EFI_HII_IMAGE_1BIT structure, the difference is\r
-  how the data is treated. The bitmap pixel value 0 is the\r
-  transparency value and will not be written to the\r
-  screen. The bitmap pixel value 1 will be translated to the color\r
-  specified by Palette.\r
-\r
-  @param Header   Standard image header, where Header.BlockType\r
-                  = EFI_HII_IIBT_IMAGE_1BIT_TRANS.\r
-\r
-  @param PaletteIndex   Index of the palette in the palette\r
-                        information.\r
-\r
-  @param Bitmap   The bitmap specifies a series of pixels, one\r
-                  bit per pixel, left-to-right, top-to-bottom,\r
-                  and is padded out to the nearest byte. The\r
-                  number of bytes per bitmap can be calculated\r
-                  as: ((Width + 7)/8) * Height.\r
-\r
-**/\r
-typedef struct _EFI_HII_IBIT_IMAGE_1BIT_BLOCK {\r
-  EFI_HII_IMAGE_BLOCK           Header;\r
-  UINT8                         PaletteIndex;\r
-  EFI_HII_IIBT_IMAGE_1BIT_BASE  Bitmap;\r
-} EFI_HII_IIBT_IMAGE_1BIT_BLOCK;\r
-\r
-typedef EFI_HII_IIBT_IMAGE_1BIT_BLOCK   EFI_HII_IIBT_IMAGE_1BIT_TRANS_BLOCK;\r
-\r
-\r
-//\r
-// EFI_HII_RGB_PIXEL\r
-// \r
-typedef struct _EFI_HII_RGB_PIXEL {\r
-  UINT8 b;\r
-  UINT8 g;\r
-  UINT8 r;\r
-} EFI_HII_RGB_PIXEL;\r
-\r
-//\r
-// FI_HII_IIBT_IMAGE_24BIT_BASE\r
-// \r
-typedef struct _EFI_HII_IIBT_IMAGE_24BIT_BASE {\r
-  UINT16 Width;\r
-  UINT16 Height;\r
-  // EFI_HII_RGB_PIXEL Bitmap[...];\r
-} EFI_HII_IIBT_IMAGE_24BIT_BASE;\r
-\r
-/**\r
-\r
-  This record assigns the 24-bit-per-pixel bitmap data to the   \r
-  ImageIdCurrent identifier and increment ImageIdCurrent by one.   \r
-  The image's upper left hand corner pixel is composed of the\r
-  first three bitmap bytes. The first byte is the pixel????s blue   \r
-  component value, the next byte is the pixel????s green component   \r
-  value, and the third byte is the pixel's red component value\r
-  (B,G,R). Each color component value can vary from 0x00 (color   \r
-  off) to 0xFF (color full on), allowing 16.8 millions colors that   \r
-  can be specified.\r
-\r
-  @param Header   Standard image header, where Header.BlockType\r
-                  = EFI_HII_IIBT_IMAGE_24BIT. Bitmap The bitmap\r
-                  specifies a series of pixels, 24 bits per\r
-                  pixel, left-to-right, top-to-bottom. The\r
-                  number of bytes per bitmap can be calculated\r
-                  as: (Width * 3) * Height.\r
-\r
-  @param Type     See EFI_HII_RGB_PIXEL definition.\r
-\r
-**/\r
-typedef struct {\r
-  EFI_HII_IMAGE_BLOCK           Header;\r
-  EFI_HII_IIBT_IMAGE_24BIT_BASE Bitmap;\r
-} EFI_HII_IIBT_IMAGE_24BIT_BLOCK;\r
-\r
-typedef EFI_HII_IIBT_IMAGE_24BIT_BLOCK EFI_HII_IIBT_IMAGE_24BIT_TRANS_BLOCK;\r
-\r
-\r
-\r
-//\r
-// EFI_HII_IIBT_IMAGE_4BIT_BASE\r
-// \r
-typedef struct _EFI_HII_IIBT_IMAGE_4BIT_BASE {\r
-  UINT16 Width;\r
-  UINT16 Height;\r
-  // UINT8 Data[...];\r
-} EFI_HII_IIBT_IMAGE_4BIT_BASE;\r
-\r
-/**\r
-   \r
-  This record assigns the 4-bit-per-pixel bitmap data to the\r
-  ImageIdCurrent identifier using the specified palette and\r
-  increment ImageIdCurrent by one. The image????s upper left hand\r
-  corner pixel is the most significant nibble of the first bitmap\r
-  byte.\r
-\r
-  @param Header   Standard image header, where Header.BlockType\r
-                  = EFI_HII_IIBT_IMAGE_4BIT.\r
-\r
-  @param PaletteIndex   Index of the palette in the palette\r
-                        information.\r
-\r
-  @param Bitmap   The bitmap specifies a series of pixels, four\r
-                  bits per pixel, left-to-right, top-to-bottom,\r
-                  and is padded out to the nearest byte. The\r
-                  number of bytes per bitmap can be calculated\r
-                  as: ((Width + 1)/2) Height.\r
-\r
-**/\r
-typedef struct _EFI_HII_IIBT_IMAGE_4BIT_BLOCK {\r
-  EFI_HII_IMAGE_BLOCK           Header;\r
-  UINT8                         PaletteIndex;\r
-  EFI_HII_IIBT_IMAGE_4BIT_BASE  Bitmap;\r
-} EFI_HII_IIBT_IMAGE_4BIT_BLOCK;\r
-\r
-typedef EFI_HII_IIBT_IMAGE_4BIT_BLOCK EFI_HII_IIBT_IMAGE_4BIT_TRANS_BLOCK;\r
-\r
-\r
-\r
-//\r
-// EFI_HII_IIBT_IMAGE_8BIT_BASE \r
-// \r
-typedef struct _EFI_HII_IIBT_IMAGE_8BIT_BASE {\r
-  UINT16  Width;\r
-  UINT16  Height;\r
-  // UINT8 Data[...];\r
-} EFI_HII_IIBT_IMAGE_8BIT_BASE;\r
-\r
-/**\r
-   \r
-  This record assigns the 8-bit-per-pixel bitmap data to the\r
-  ImageIdCurrent identifier using the specified palette and\r
-  increment ImageIdCurrent by one. The image????s upper left hand\r
-  corner pixel is the first bitmap byte.\r
-\r
-  @param Header   Standard image header, where Header.BlockType\r
-                  = EFI_HII_IIBT_IMAGE_8BIT.\r
-\r
-  @param PaletteIndex   Index of the palette in the palette\r
-                        information.\r
-\r
-  @param Bitmap   The bitmap specifies a series of pixels, eight\r
-                  bits per pixel, left-to-right, top-to-bottom.\r
-                  The number of bytes per bitmap can be\r
-                  calculated as: Width * Height.\r
-\r
-**/\r
-typedef struct _EFI_HII_IIBT_IMAGE_8BIT_PALETTE {\r
-  EFI_HII_IMAGE_BLOCK           Header;\r
-  UINT8                         PaletteIndex;\r
-  EFI_HII_IIBT_IMAGE_8BIT_BASE  Bitmap;\r
-} EFI_HII_IIBT_IMAGE_8BIT_PALETTE;\r
-\r
-typedef EFI_HII_IIBT_IMAGE_8BIT_PALETTE   EFI_HII_IIBT_IMAGE_8BIT_TRANS_BLOCK;\r
-\r
-\r
-/**\r
-   \r
-  Indicates that the image with image ID ImageValueCurrent has the\r
-  same image as a previously defined image ID and increments\r
-  ImageValueCurrent by one\r
-\r
-  @param Header   Standard image header, where Header.BlockType\r
-                  = EFI_HII_IIBT_DUPLICATE.\r
-\r
-  @param ImageId  The previously defined image ID with the exact\r
-                  same image.\r
-\r
-\r
-**/\r
-typedef struct _EFI_HII_IIBT_DUPLICATE_BLOCK {\r
-  EFI_HII_IMAGE_BLOCK   Header;\r
-  EFI_IMAGE_ID          ImageId;\r
-} EFI_HII_IIBT_DUPLICATE_BLOCK;\r
-\r
-\r
-/**\r
-   \r
-  This record assigns the JPEG image data to the ImageIdCurrent\r
-  identifier and increment ImageIdCurrent by one. The JPEG decoder\r
-  is only required to cover the basic JPEG encoding types, which\r
-  are produced by standard available paint packages (for example:\r
-  MSPaint under Windows from Microsoft). This would include JPEG\r
-  encoding of high (1:1:1) and medium (4:1:1) quality with only\r
-  three components (R,G,B) ??C no support for the special gray\r
-  component encoding.\r
-\r
-  @param Header   Standard image header, where Header.BlockType\r
-                  = EFI_HII_IIBT_IMAGE_JPEG.\r
-  \r
-  @param Size   Specifies the size of the JPEG encoded data.\r
-  \r
-  @param Data   JPEG encoded data with ????JFIF???? signature at\r
-                offset 6 in the data block. The JPEG encoded\r
-                data, specifies type of encoding and final size\r
-                of true-color image.\r
-\r
-**/\r
-typedef struct _EFI_HII_IIBT_JPEG {\r
-  EFI_HII_IMAGE_BLOCK Header;\r
-  UINT32              Size;\r
-  //UINT8 Data[ Â¡Â­ ];\r
-} EFI_HII_IIBT_JPEG;\r
-\r
-\r
-/**\r
-   \r
-  Increments the current image ID ImageIdCurrent by the number\r
-  specified.\r
-  \r
-  @param Header   Standard image header, where Header.BlockType\r
-                  = EFI_HII_IIBT_SKIP1.\r
-  \r
-  @param SkipCount  The unsigned 8-bit value to add  to\r
-                    ImageIdCurrent.\r
-\r
-**/\r
-typedef struct _EFI_HII_IIBT_SKIP1_BLOCK {\r
-  EFI_HII_IMAGE_BLOCK Header;\r
-  UINT8               SkipCount;\r
-} EFI_HII_IIBT_SKIP1_BLOCK;\r
-\r
-/**\r
-  \r
-  Increments the current image ID ImageIdCurrent by the number\r
-  specified.\r
-  \r
-  @param Header   Standard image header, where Header.BlockType\r
-                  = EFI_HII_IIBT_SKIP2.\r
-  \r
-  @param SkipCount  The unsigned 16-bit value to add to\r
-                    ImageIdCurrent.\r
-\r
-**/\r
-typedef struct _EFI_HII_IIBT_SKIP2_BLOCK {\r
-  EFI_HII_IMAGE_BLOCK   Header;\r
-  UINT16                SkipCount;\r
-} EFI_HII_IIBT_SKIP2_BLOCK;\r
-\r
-\r
-/**\r
-   \r
-  This fixed header is followed by zero or more variable-length\r
-  palette information records. The structures are assigned a\r
-  number 1 to n.\r
-\r
-  @param PaletteCount   Number of palettes.\r
-\r
-**/\r
-typedef struct _EFI_HII_IMAGE_PALETTE_INFO_HEADER {\r
-  UINT16  PaletteCount;\r
-} EFI_HII_IMAGE_PALETTE_INFO_HEADER;\r
-\r
-/**\r
-   \r
-  Each palette information record is an array of 24-bit color\r
-  structures. The first entry (PaletteValue[0]) corresponds to\r
-  color 0 in the source image; the second entry (PaletteValue[1])\r
-  corresponds to color 1, etc. Each palette entry is a three byte\r
-  entry, with the first byte equal to the blue component of the\r
-  color, followed by green, and finally red (B,G,R). Each color\r
-  component value can vary from 0x00 (color off) to 0xFF (color\r
-  full on), allowing 16.8 millions colors that can be specified.\r
-\r
-  @param PaletteSize  Size of the palette information.\r
-  \r
-  @param PaletteValue   Array of color values.\r
-  \r
-**/\r
-typedef struct _EFI_HII_IMAGE_PALETTE_INFO {\r
-  UINT16 PaletteSize;\r
-  // EFI_HII_RGB_PIXEL PaletteValue[...];\r
-} EFI_HII_IMAGE_PALETTE_INFO;\r
-\r
-\r
 \r
 //\r
 // EFI_HII_DATABASE_NOTIFY_TYPE\r
@@ -1503,11 +59,11 @@ typedef UINTN   EFI_HII_DATABASE_NOTIFY_TYPE;
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_HII_DATABASE_NOTIFY) (\r
-  IN CONST  UINT8                         PackageType,\r
+  IN        UINT8                         PackageType,\r
   IN CONST  EFI_GUID                      *PackageGuid,\r
   IN CONST  EFI_HII_PACKAGE_HEADER        *Package,\r
-  IN CONST  EFI_HII_HANDLE                Handle,\r
-  IN CONST  EFI_HII_DATABASE_NOTIFY_TYPE  NotifyType\r
+  IN        EFI_HII_HANDLE                 Handle,\r
+  IN        EFI_HII_DATABASE_NOTIFY_TYPE  NotifyType\r
 );\r
 \r
 /**\r
@@ -1531,7 +87,7 @@ EFI_STATUS
 \r
   @param DriverHandle   Associate the package list with this EFI\r
                         handle Handle A pointer to the\r
-                        EFI_HII_HANDLE instance.\r
+                        EFI_HII_HANDLE  instance.\r
 \r
   @retval EFI_SUCCESS   The package list associated with the\r
                         Handle was added to the HII database.\r
@@ -1546,11 +102,11 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_HII_NEW_PACK) (\r
+(EFIAPI *EFI_HII_DATABASE_NEW_PACK) (\r
   IN CONST  EFI_HII_DATABASE_PROTOCOL   *This,\r
   IN CONST  EFI_HII_PACKAGE_LIST_HEADER *PackageList,\r
-  IN CONST  EFI_HANDLE                  DriverHandle,\r
-  OUT       EFI_HII_HANDLE              *Handle\r
+  IN        EFI_HANDLE                  DriverHandle,\r
+  OUT       EFI_HII_HANDLE               *Handle\r
 );\r
 \r
 \r
@@ -1577,9 +133,9 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_HII_REMOVE_PACK) (\r
+(EFIAPI *EFI_HII_DATABASE_REMOVE_PACK) (\r
   IN CONST  EFI_HII_DATABASE_PROTOCOL *This,\r
-  IN CONST  EFI_HII_HANDLE            Handle\r
+  IN        EFI_HII_HANDLE             Handle\r
 );\r
 \r
 \r
@@ -1626,9 +182,9 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_HII_UPDATE_PACK) (\r
+(EFIAPI *EFI_HII_DATABASE_UPDATE_PACK) (\r
   IN CONST  EFI_HII_DATABASE_PROTOCOL   *This,\r
-  IN CONST  EFI_HII_HANDLE              Handle,\r
+  IN        EFI_HII_HANDLE               Handle,\r
   IN CONST  EFI_HII_PACKAGE_LIST_HEADER *PackageList\r
 );\r
 \r
@@ -1660,7 +216,7 @@ EFI_STATUS
                               that is required for the handles\r
                               found.\r
 \r
-  @param Handle   An array of EFI_HII_HANDLE instances returned.\r
+  @param Handle   An array of EFI_HII_HANDLE  instances returned.\r
 \r
 \r
   @retval EFI_SUCCESS   Handle was updated successfully.\r
@@ -1676,12 +232,12 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_HII_LIST_PACKS) (\r
+(EFIAPI *EFI_HII_DATABASE_LIST_PACKS) (\r
   IN CONST  EFI_HII_DATABASE_PROTOCOL *This,\r
-  IN CONST  UINT8                     PackageType,\r
+  IN        UINT8                     PackageType,\r
   IN CONST  EFI_GUID                  *PackageGuid,\r
   IN OUT    UINTN                     *HandleBufferLength,\r
-  OUT       EFI_HII_HANDLE            *Handle\r
+  OUT       EFI_HII_HANDLE             *Handle\r
 );\r
 \r
 \r
@@ -1704,7 +260,7 @@ EFI_STATUS
   @param This   A pointer to the EFI_HII_DATABASE_PROTOCOL\r
                 instance.\r
 \r
-  @param Handle   An EFI_HII_HANDLE that corresponds to the\r
+  @param Handle   An EFI_HII_HANDLE  that corresponds to the\r
                   desired package list in the HII database to\r
                   export or NULL to indicate all package lists\r
                   should be exported. \r
@@ -1726,11 +282,11 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_HII_EXPORT_PACKS) (\r
-  IN CONST  EFI_HII_DATABASE_PROTOCOL *This,\r
-  IN CONST  EFI_HII_HANDLE            Handle,\r
-  IN OUT    UINTN                     *BufferSize,\r
-  OUT       EFI_HII_PACKAGE_HEADER    *Buffer\r
+(EFIAPI *EFI_HII_DATABASE_EXPORT_PACKS) (\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
@@ -1789,12 +345,12 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_HII_REGISTER_NOTIFY) (\r
+(EFIAPI *EFI_HII_DATABASE_REGISTER_NOTIFY) (\r
   IN CONST  EFI_HII_DATABASE_PROTOCOL     *This,\r
-  IN CONST  UINT8                         PackageType,\r
+  IN        UINT8                         PackageType,\r
   IN CONST  EFI_GUID                      *PackageGuid,\r
-  IN CONST  EFI_HII_DATABASE_NOTIFY       PackageNotifyFn,\r
-  IN CONST  EFI_HII_DATABASE_NOTIFY_TYPE  NotifyType,\r
+  IN        EFI_HII_DATABASE_NOTIFY       PackageNotifyFn,\r
+  IN        EFI_HII_DATABASE_NOTIFY_TYPE  NotifyType,\r
   OUT       EFI_HANDLE                    *NotifyHandle\r
 );\r
 \r
@@ -1817,215 +373,12 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_HII_UNREGISTER_NOTIFY) (\r
+(EFIAPI *EFI_HII_DATABASE_UNREGISTER_NOTIFY) (\r
   IN CONST  EFI_HII_DATABASE_PROTOCOL *This,\r
-  IN CONST  EFI_HANDLE                NotificationHandle\r
+  IN        EFI_HANDLE                NotificationHandle\r
 );\r
 \r
 \r
-/**\r
-   \r
-  @param Header   The general pack header which defines both the\r
-                  type of pack and the length of the entire\r
-                  pack.\r
-\r
-  @param LayoutCount  The number of keyboard layouts contained\r
-                      in the entire keyboard pack.\r
-\r
-  @param Layout   An array of LayoutCount number of keyboard\r
-                  layouts.\r
-\r
-**/\r
-typedef struct {\r
-  EFI_HII_PACKAGE_HEADER  Header;\r
-  UINT16                  LayoutCount;\r
-  // EFI_HII_KEYBOARD_LAYOUT Layout[...];\r
-} EFI_HII_KEYBOARD_PACK;\r
-\r
-/**\r
-   \r
-  @param LayoutLength   The length of the current keyboard\r
-                        layout.\r
-\r
-  @param Guid   The unique ID associated with this keyboard\r
-                layout.\r
-\r
-  @param LayoutDescriptorString   An offset location (0 is the\r
-                                  beginning of the\r
-                                  EFI_KEYBOARD_LAYOUT instance)\r
-                                  of the string which describes\r
-                                  this keyboard layout. The data\r
-                                  that is being referenced is in\r
-                                  EFI_DESCRIPTION_STRING_BUNDLE\r
-                                  format.\r
-\r
-  @param DescriptorCount  The number of Descriptor entries in\r
-                          this layout.\r
-\r
-  @param Descriptors  An array of key descriptors.\r
-\r
-**/\r
-typedef struct {\r
-  UINT16              LayoutLength;\r
-  EFI_GUID            Guid;\r
-  RELOFST             LayoutDescriptorString;\r
-  UINT8               DescriptorCount;\r
-  // EFI_KEY_DESCRIPTOR   Descriptors[...];\r
-} EFI_HII_KEYBOARD_LAYOUT;\r
-\r
-\r
-/**\r
-   \r
-  @param Language   The language to associate with\r
-                    DescriptionString.\r
-\r
-  @param Space  A space (U-0x0020) character to force as a\r
-                separator between the Language field and the\r
-                formal description string.\r
-\r
-  @param DescriptionString  A null-terminated description\r
-                            string.\r
-\r
-**/\r
-typedef struct {\r
-  CHAR16  Language[3];\r
-  CHAR16  Space;\r
-  CHAR16  DescriptionString[1];\r
-} EFI_DESCRIPTION_STRING;\r
-\r
-/**\r
-   \r
-  @param DescriptionCount   The number of description strings.\r
-\r
-  @param DescriptionString  An array of language-specific\r
-                            description strings.\r
-\r
-**/\r
-typedef struct {\r
-  UINT16                  DescriptionCount;\r
-  // EFI_DESCRIPTION_STRING   DescriptionString[];\r
-} EFI_DESCRIPTION_STRING_BUNDLE;\r
-\r
-/**\r
-\r
-  See the figure below for which key corresponds to the values in\r
-  the enumeration above. For example, EfiKeyLCtrl corresponds to\r
-  the left control key in the lower-left corner of the keyboard,\r
-  EfiKeyFour corresponds to the 4 key on the numeric keypad, and\r
-  EfiKeySLck corresponds to the Scroll Lock key in the upper-right\r
-  corner of the keyboard.\r
-\r
-**/\r
-typedef enum {\r
-  EfiKeyLCtrl, EfiKeyA0, EfiKeyLAlt, EfiKeySpaceBar,\r
-  EfiKeyA2, EfiKeyA3, EfiKeyA4, EfiKeyRCtrl, EfiKeyLeftArrow,\r
-  EfiKeyDownArrow, EfiKeyRightArrow, EfiKeyZero,\r
-  EfiKeyPeriod, EfiKeyEnter, EfiKeyLShift, EfiKeyB0,\r
-  EfiKeyB1, EfiKeyB2, EfiKeyB3, EfiKeyB4, EfiKeyB5, EfiKeyB6,\r
-  EfiKeyB7, EfiKeyB8, EfiKeyB9, EfiKeyB10, EfiKeyRshift,\r
-  EfiKeyUpArrow, EfiKeyOne, EfiKeyTwo, EfiKeyThree,\r
-  EfiKeyCapsLock, EfiKeyC1, EfiKeyC2, EfiKeyC3, EfiKeyC4,\r
-  EfiKeyC5, EfiKeyC6, EfiKeyC7, EfiKeyC8, EfiKeyC9,\r
-  EfiKeyC10, EfiKeyC11, EfiKeyC12, EfiKeyFour, EfiKeyFive,\r
-  EfiKeySix, EfiKeyPlus, EfiKeyTab, EfiKeyD1, EfiKeyD2,\r
-  EfiKeyD3, EfiKeyD4, EfiKeyD5, EfiKeyD6, EfiKeyD7, EfiKeyD8,\r
-  EfiKeyD9, EfiKeyD10, EfiKeyD11, EfiKeyD12, EfiKeyD13,\r
-  EfiKeyDel, EfiKeyEnd, EfiKeyPgDn, EfiKeySeven, EfiKeyEight,\r
-  EfiKeyNine, EfiKeyE0, EfiKeyE1, EfiKeyE2, EfiKeyE3,\r
-  EfiKeyE4, EfiKeyE5, EfiKeyE6, EfiKeyE7, EfiKeyE8, EfiKeyE9,\r
-  EfiKeyE10, EfiKeyE11, EfiKeyE12, EfiKeyBackSpace,\r
-  EfiKeyIns, EfiKeyHome, EfiKeyPgUp, EfiKeyNLck, EfiKeySlash,\r
-  EfiKeyAsterisk, EfiKeyMinus, EfiKeyEsc, EfiKeyF1, EfiKeyF2,\r
-  EfiKeyF3, EfiKeyF4, EfiKeyF5, EfiKeyF6, EfiKeyF7, EfiKeyF8,\r
-  EfiKeyF9, EfiKeyF10, EfiKeyF11, EfiKeyF12, EfiKeyPrint,\r
-  EfiKeySLck, EfiKeyPause\r
-} EFI_KEY;\r
-\r
-/**\r
-   \r
-  @param Key Used to describe a physical key on a keyboard.\r
-\r
-  @param Unicode  Unicode value for the Key.\r
-\r
-  @param ShiftedUnicode   Unicode value for the key with the\r
-                          shift key being held down. \r
-\r
-  @param AltGrUnicode   Unicode value for the key with the\r
-                        Alt-GR being held down.\r
-\r
-  @param ShiftedAltGrUnicode  Unicode value for the key with the\r
-                              Alt-GR and shift keys being held down.\r
-\r
-  @param Modifier   Modifier keys are defined to allow for\r
-                    special functionality that is not\r
-                    necessarily accomplished by a printable\r
-                    character. Many of these modifier keys are\r
-                    flags to toggle certain state bits on and\r
-                    off inside of a keyboard driver.\r
-  \r
-**/\r
-typedef struct {\r
-  EFI_KEY Key;\r
-  CHAR16  Unicode;\r
-  CHAR16  ShiftedUnicode;\r
-  CHAR16  AltGrUnicode;\r
-  CHAR16  ShiftedAltGrUnicode;\r
-  UINT16  Modifier;\r
-} EFI_KEY_DESCRIPTOR;\r
-\r
-\r
-//\r
-// Modifier values\r
-//\r
-#define EFI_NULL_MODIFIER                 0x0000\r
-#define EFI_LEFT_CONTROL_MODIFIER         0x0001\r
-#define EFI_RIGHT_CONTROL_MODIFIER        0x0002\r
-#define EFI_LEFT_ALT_MODIFIER             0x0003\r
-#define EFI_RIGHT_ALT_MODIFIER            0x0004\r
-#define EFI_ALT_GR_MODIFIER               0x0005\r
-#define EFI_INSERT_MODIFIER               0x0006\r
-#define EFI_DELETE_MODIFIER               0x0007\r
-#define EFI_PAGE_DOWN_MODIFIER            0x0008\r
-#define EFI_PAGE_UP_MODIFIER              0x0009\r
-#define EFI_HOME_MODIFIER                 0x000A\r
-#define EFI_END_MODIFIER                  0x000B\r
-#define EFI_LEFT_SHIFT_MODIFIER           0x000C\r
-#define EFI_RIGHT_SHIFT_MODIFIER          0x000D\r
-#define EFI_CAPS_LOCK_MODIFIER            0x000E\r
-#define EFI_NUM_LOCK _MODIFIER            0x000F\r
-#define EFI_LEFT_ARROW_MODIFIER           0x0010\r
-#define EFI_RIGHT_ARROW_MODIFIER          0x0011\r
-#define EFI_DOWN_ARROW_MODIFIER           0x0012\r
-#define EFI_UP_ARROW_MODIFIER             0X0013\r
-#define EFI_NS_KEY_MODIFIER               0x0014\r
-#define EFI_NS_KEY_DEPENDENCY_MODIFIER    0x0015\r
-#define EFI_FUNCTION_KEY_ONE_MODIFIER     0x0016\r
-#define EFI_FUNCTION_KEY_TWO_MODIFIER     0x0017\r
-#define EFI_FUNCTION_KEY_THREE_MODIFIER   0x0018\r
-#define EFI_FUNCTION_KEY_FOUR_MODIFIER    0x0019\r
-#define EFI_FUNCTION_KEY_FIVE_MODIFIER    0x001A\r
-#define EFI_FUNCTION_KEY_SIX_MODIFIER     0x001B\r
-#define EFI_FUNCTION_KEY_SEVEN_MODIFIER   0x001C\r
-#define EFI_FUNCTION_KEY_EIGHT_MODIFIER   0x001D\r
-#define EFI_FUNCTION_KEY_NINE_MODIFIER    0x001E\r
-#define EFI_FUNCTION_KEY_TEN_MODIFIER     0x001F\r
-#define EFI_FUNCTION_KEY_ELEVEN_MODIFIER  0x0020\r
-#define EFI_FUNCTION_KEY_TWELVE_MODIFIER  0x0021\r
-//\r
-// Keys that have multiple control functions based on modifier\r
-// settings are handled in the keyboard driver implementation.\r
-// For instance PRINT_KEY might have a modifier held down and\r
-// is still a nonprinting character, but might have an alternate\r
-// control function like SYSREQUEST\r
-//\r
-#define EFI_PRINT_MODIFIER                0x0022\r
-#define EFI_SYS_REQUEST_MODIFIER          0x0023\r
-#define EFI_SCROLL_LOCK_MODIFIER          0x0024\r
-#define EFI_PAUSE_MODIFIER                0x0025\r
-#define EFI_BREAK_MODIFIER                0x0026\r
-\r
-\r
-\r
 /**\r
    \r
   This routine retrieves an array of GUID values for each keyboard\r
@@ -2089,6 +442,7 @@ EFI_STATUS
 (EFIAPI *EFI_HII_GET_KEYBOARD_LAYOUT) (\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
@@ -2129,7 +483,7 @@ EFI_STATUS
   @param This   A pointer to the EFI_HII_DATABASE_PROTOCOL\r
                 instance.\r
   \r
-  @param PackageListHandle  An EFI_HII_HANDLE that corresponds\r
+  @param PackageListHandle  An EFI_HII_HANDLE  that corresponds\r
                             to the desired package list in the\r
                             HIIdatabase.\r
   \r
@@ -2146,9 +500,9 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_HII_GET_PACK_HANDLE) (\r
+(EFIAPI *EFI_HII_DATABASE_GET_PACK_HANDLE) (\r
   IN CONST  EFI_HII_DATABASE_PROTOCOL *This,\r
-  IN CONST  EFI_HII_HANDLE            PackageListHandle,\r
+  IN        EFI_HII_HANDLE             PackageListHandle,\r
   OUT       EFI_HANDLE                *DriverHandle\r
 );\r
 \r
@@ -2190,20 +544,21 @@ EFI_STATUS
 \r
 **/\r
 struct _EFI_HII_DATABASE_PROTOCOL {\r
-  EFI_HII_NEW_PACK                NewPackageList;\r
-  EFI_HII_REMOVE_PACK             RemovePackageList;\r
-  EFI_HII_UPDATE_PACK             UpdatePackageList;\r
-  EFI_HII_LIST_PACKS              ListPackageLists;\r
-  EFI_HII_EXPORT_PACKS            ExportPackageLists;\r
-  EFI_HII_REGISTER_NOTIFY         RegisterPackageNotify;\r
-  EFI_HII_UNREGISTER_NOTIFY       UnregisterPackageNotify;\r
-  EFI_HII_FIND_KEYBOARD_LAYOUTS   FindKeyboardLayouts;\r
-  EFI_HII_GET_KEYBOARD_LAYOUT     GetKeyboardLayout;\r
-  EFI_HII_SET_KEYBOARD_LAYOUT     SetKeyboardLayout;\r
-  EFI_HII_GET_PACK_HANDLE         GetPackageHandle;\r
+  EFI_HII_DATABASE_NEW_PACK                    NewPackageList;\r
+  EFI_HII_DATABASE_REMOVE_PACK                 RemovePackageList;\r
+  EFI_HII_DATABASE_UPDATE_PACK        UpdatePackageList;\r
+  EFI_HII_DATABASE_LIST_PACKS         ListPackageLists;\r
+  EFI_HII_DATABASE_EXPORT_PACKS       ExportPackageLists;\r
+  EFI_HII_DATABASE_REGISTER_NOTIFY    RegisterPackageNotify;\r
+  EFI_HII_DATABASE_UNREGISTER_NOTIFY  UnregisterPackageNotify;\r
+  EFI_HII_FIND_KEYBOARD_LAYOUTS       FindKeyboardLayouts;\r
+  EFI_HII_GET_KEYBOARD_LAYOUT         GetKeyboardLayout;\r
+  EFI_HII_SET_KEYBOARD_LAYOUT         SetKeyboardLayout;\r
+  EFI_HII_DATABASE_GET_PACK_HANDLE    GetPackageListHandle;\r
 };\r
 \r
 extern EFI_GUID gEfiHiiDatabaseProtocolGuid;\r
 \r
 #endif\r
 \r
+\r
index c9568aac5a6f001f01715e62bc302e8341bda6b1..644416f6e5df4bbc5c3e11c3971591f145871473 100644 (file)
@@ -18,8 +18,6 @@
 #include <Protocol/GraphicsOutput.h>\r
 #include <Protocol/HiiImage.h>\r
 \r
-#error "UEFI 2.1 HII is not fully implemented for now, Please don't include this file now."\r
-\r
 #define EFI_HII_FONT_PROTOCOL_GUID \\r
 { 0xe9ca4775, 0x8657, 0x47fc, { 0x97, 0xe7, 0x7e, 0xd6, 0x5a, 0x8, 0x43, 0x24 } }\r
 \r
@@ -264,12 +262,12 @@ typedef
 EFI_STATUS\r
 (EFIAPI *EFI_HII_STRING_TO_IMAGE) (\r
   IN CONST  EFI_HII_FONT_PROTOCOL *This,\r
-  IN CONST  EFI_HII_OUT_FLAGS     Flags,\r
+  IN        EFI_HII_OUT_FLAGS     Flags,\r
   IN CONST  EFI_STRING            String,\r
   IN CONST  EFI_FONT_DISPLAY_INFO *StringInfo,\r
   IN OUT    EFI_IMAGE_OUTPUT      **Blt,\r
-  IN CONST  UINTN                 BltX,\r
-  IN CONST  UINTN                 BltY,\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
@@ -396,14 +394,14 @@ typedef
 EFI_STATUS\r
 (EFIAPI *EFI_HII_STRING_ID_TO_IMAGE) (\r
   IN CONST  EFI_HII_FONT_PROTOCOL *This,\r
-  IN CONST  EFI_HII_OUT_FLAGS     Flags,\r
-  IN CONST  EFI_HII_HANDLE        PackageList,\r
-  IN CONST  EFI_STRING_ID         StringId,\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 CONST  UINTN                 BltX,\r
-  IN CONST  UINTN                 BltY,\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
index 4958687e8369a793ff98a47733eb03b3b4a8e6e0..5bd84905c2298df093f8b6262a80d28f861e6fff 100644 (file)
@@ -15,8 +15,6 @@
 #ifndef __HII_IMAGE_H__\r
 #define __HII_IMAGE_H__\r
 \r
-#error "UEFI 2.1 HII is not fully implemented for now, Please don't include this file now."\r
-\r
 #define EFI_HII_IMAGE_PROTOCOL_GUID \\r
   { 0x31a6406a, 0x6bdf, 0x4e46, { 0xb2, 0xa2, 0xeb, 0xaa, 0x89, 0xc4, 0x9, 0x20 } }\r
 \r
@@ -47,10 +45,10 @@ typedef struct _EFI_HII_IMAGE_PROTOCOL EFI_HII_IMAGE_PROTOCOL;
    \r
 **/\r
 typedef struct _EFI_IMAGE_INPUT {\r
-  UINT32  Flags;\r
-  UINT16  Width;\r
-  UINT16  Height;\r
-  EFI_GRAPHICS_OUTPUT_BLT_PIXEL   *Bitmap;\r
+  UINT32                          Flags;\r
+  UINT16                          Width;\r
+  UINT16                          Height;\r
+  EFI_GRAPHICS_OUTPUT_BLT_PIXEL   Bitmap[1];\r
 } EFI_IMAGE_INPUT;\r
 \r
 \r
@@ -83,7 +81,7 @@ typedef
 EFI_STATUS\r
 (EFIAPI *EFI_HII_NEW_IMAGE) (\r
   IN CONST  EFI_HII_IMAGE_PROTOCOL  *This,\r
-  IN CONST  EFI_HII_HANDLE          PackageList,\r
+  IN        EFI_HII_HANDLE          PackageList,\r
   OUT       EFI_IMAGE_ID            *ImageId,\r
   IN CONST  EFI_IMAGE_INPUT         *Image\r
 );\r
@@ -133,8 +131,8 @@ typedef
 EFI_STATUS\r
 (EFIAPI *EFI_HII_GET_IMAGE) (\r
   IN CONST  EFI_HII_IMAGE_PROTOCOL  *This,\r
-  IN CONST  EFI_HII_HANDLE          PackageList,\r
-  IN CONST  EFI_IMAGE_ID            ImageId,\r
+  IN        EFI_HII_HANDLE          PackageList,\r
+  IN        EFI_IMAGE_ID            ImageId,\r
   OUT       EFI_IMAGE_INPUT         *Image,\r
   OUT       UINTN                   *ImageSize\r
 );\r
@@ -168,9 +166,9 @@ typedef
 EFI_STATUS\r
 (EFIAPI *EFI_HII_SET_IMAGE) (\r
   IN CONST  EFI_HII_IMAGE_PROTOCOL  *This,\r
-  IN CONST  EFI_HII_HANDLE          PackageList,\r
-  IN CONST  EFI_IMAGE_ID            ImageId,\r
-  IN CONST  EFI_IMAGE_INPUT         Image\r
+  IN        EFI_HII_HANDLE          PackageList,\r
+  IN        EFI_IMAGE_ID            ImageId,\r
+  IN CONST  EFI_IMAGE_INPUT         *Image\r
 );\r
 \r
 \r
@@ -264,11 +262,11 @@ typedef
 EFI_STATUS\r
 (EFIAPI *EFI_HII_DRAW_IMAGE) (\r
   IN CONST  EFI_HII_IMAGE_PROTOCOL  *This,\r
-  IN CONST  EFI_HII_DRAW_FLAGS      Flags,\r
-  IN CONST  EFI_IMAGE_INPUT         Image,\r
+  IN        EFI_HII_DRAW_FLAGS      Flags,\r
+  IN CONST  EFI_IMAGE_INPUT         *Image,\r
   IN OUT    EFI_IMAGE_OUTPUT        **Blt,\r
-  IN CONST  UINTN                   BltX,\r
-  IN CONST  UINTN                   BltY\r
+  IN        UINTN                   BltX,\r
+  IN        UINTN                   BltY\r
 );\r
 \r
 /**\r
@@ -342,12 +340,12 @@ typedef
 EFI_STATUS\r
 (EFIAPI *EFI_HII_DRAW_IMAGE_ID) (\r
 IN CONST  EFI_HII_IMAGE_PROTOCOL  *This,\r
-IN CONST  EFI_HII_DRAW_FLAGS      Flags,\r
-IN CONST  EFI_HII_HANDLE          PackageList,\r
-IN CONST  EFI_IMAGE_ID            ImageId,\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 CONST  UINTN                   BltX,\r
-IN CONST  UINTN                   BltY\r
+IN        UINTN                   BltX,\r
+IN        UINTN                   BltY\r
 );\r
 \r
 \r
@@ -379,3 +377,4 @@ extern EFI_GUID gEfiHiiImageProtocolGuid;
 \r
 #endif\r
 \r
+\r
index eafe5de6fe83f8bdcb058664ee686b64a2a4fa43..e120e9e470e0fc43c813d63d35d8d0621249fd78 100644 (file)
 #ifndef __HII_STRING_H__\r
 #define __HII_STRING_H__\r
 \r
-#error "UEFI 2.1 HII is not fully implemented for now, Please don't include this file now."\r
-\r
 #define EFI_HII_STRING_PROTOCOL_GUID \\r
   { 0xfd96974, 0x23aa, 0x4cdc, { 0xb9, 0xcb, 0x98, 0xd1, 0x77, 0x50, 0x32, 0x2a } }\r
 \r
+#include <Protocol/HiiDatabase.h>\r
+#include <Protocol/HiiFont.h>\r
+\r
 \r
 typedef struct _EFI_HII_STRING_PROTOCOL EFI_HII_STRING_PROTOCOL;\r
 \r
@@ -59,11 +60,12 @@ typedef
 EFI_STATUS\r
 (EFIAPI *EFI_HII_NEW_STRING) (\r
   IN CONST  EFI_HII_STRING_PROTOCOL   *This,\r
-  IN CONST  EFI_HII_HANDLE            PackageList,\r
-  OUT       EFI_STRING_ID             *StringId\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_FONT_INFO             *StringFontInfo OPTIONAL\r
 );\r
 \r
 \r
@@ -124,11 +126,11 @@ EFI_STATUS
 (EFIAPI *EFI_HII_GET_STRING) (\r
   IN CONST  EFI_HII_STRING_PROTOCOL *This,\r
   IN CONST  CHAR8                   *Language,\r
-  IN CONST  EFI_HII_HANDLE          PackageList,\r
-  IN CONST  EFI_STRING_ID           StringId,\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 OUT    UINTN                   *StringSize,\r
+  OUT       EFI_FONT_INFO           **StringFontInfo OPTIONAL\r
 );\r
 \r
 /**\r
@@ -168,10 +170,10 @@ typedef
 EFI_STATUS\r
 (EFIAPI *EFI_HII_SET_STRING) (\r
   IN CONST  EFI_HII_STRING_PROTOCOL *This,\r
-  IN CONST  EFI_HII_HANDLE          PackageList,\r
-  IN CONST  EFI_STRING_ID           StringId,\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        EFI_STRING              String,\r
   IN CONST  EFI_FONT_INFO           *StringFontInfo OPTIONAL\r
 );\r
 \r
@@ -208,10 +210,10 @@ EFI_STATUS
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_HII_GET_LANGUAGES) (\r
-  IN CONST  EFI_HII_DATABASE_PROTOCOL *This,\r
-  IN CONST  EFI_HII_HANDLE            PackageList,\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 OUT    UINTN                     *LanguagesSize\r
 );\r
 \r
 \r
@@ -263,12 +265,12 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_GET_2ND_LANGUAGES) (\r
-  IN CONST  EFI_HII_DATABASE_PROTOCOL *This,\r
-  IN CONST  EFI_HII_HANDLE            PackageList,\r
-  IN CONST  CHAR8                     *FirstLanguage;\r
+(EFIAPI *EFI_HII_GET_2ND_LANGUAGES) (\r
+  IN CONST  EFI_HII_STRING_PROTOCOL   *This,\r
+  IN        EFI_HII_HANDLE            PackageList,\r
+  IN CONST  CHAR8                     *FirstLanguage,\r
   IN OUT    CHAR8                     *SecondLanguages,\r
-  IN OUT    UINTN                     SecondLanguagesSize\r
+  IN OUT    UINTN                     *SecondLanguagesSize\r
 );\r
 \r
 \r
@@ -301,3 +303,4 @@ extern EFI_GUID gEfiHiiStringProtocolGuid;
 \r
 #endif\r
 \r
+\r
index a31a40b23448fad69caf918a3d1d5e78f2ca015d..f4119c1c7e577235730087fef388f4e60c5558a3 100644 (file)
@@ -34,7 +34,6 @@ typedef UINTN                     EFI_TPL;
 typedef UINT64                    EFI_LBA;\r
 \r
 \r
-typedef UINT16                    EFI_HII_HANDLE;\r
 typedef UINT16                    STRING_REF;\r
 \r
 typedef UINT64                    EFI_PHYSICAL_ADDRESS;\r
index 8c08dfa35b6556ae00264797d91d0758c8afebb0..d13421d0db6445efa1a19863d78e62c6138cb05f 100644 (file)
 //\r
 typedef UINT32  RELOFST;\r
 \r
-typedef CHAR16  *EFI_STRING;\r
+typedef VOID*   EFI_HII_HANDLE;\r
+typedef CHAR16* EFI_STRING;\r
 typedef UINT16  EFI_IMAGE_ID;\r
 typedef UINT16  EFI_QUESTION_ID;\r
 typedef UINT16  EFI_STRING_ID;\r
 typedef UINT16  EFI_FORM_ID;\r
 typedef UINT16  EFI_VARSTORE_ID;\r
+typedef UINT16  EFI_DEFAULT_ID;\r
+typedef UINT32  EFI_HII_FONT_STYLE;\r
 \r
 \r
-//\r
-// IFR Op codes\r
-//\r
-#define EFI_IFR_FORM_OP                 0x01\r
-#define EFI_IFR_SUBTITLE_OP             0x02\r
-#define EFI_IFR_TEXT_OP                 0x03\r
-#define EFI_IFR_GRAPHIC_OP              0x04\r
-#define EFI_IFR_ONE_OF_OP               0x05\r
-#define EFI_IFR_CHECKBOX_OP             0x06\r
-#define EFI_IFR_NUMERIC_OP              0x07\r
-#define EFI_IFR_PASSWORD_OP             0x08\r
-#define EFI_IFR_ONE_OF_OPTION_OP        0x09  // ONEOF OPTION field\r
-#define EFI_IFR_SUPPRESS_IF_OP          0x0A\r
-#define EFI_IFR_END_FORM_OP             0x0B\r
-#define EFI_IFR_HIDDEN_OP               0x0C\r
-#define EFI_IFR_END_FORM_SET_OP         0x0D\r
-#define EFI_IFR_FORM_SET_OP             0x0E\r
-#define EFI_IFR_REF_OP                  0x0F\r
-#define EFI_IFR_END_ONE_OF_OP           0x10\r
-#define EFI_IFR_END_OP                  EFI_IFR_END_ONE_OF_OP\r
-#define EFI_IFR_INCONSISTENT_IF_OP      0x11\r
-#define EFI_IFR_EQ_ID_VAL_OP            0x12\r
-#define EFI_IFR_EQ_ID_ID_OP             0x13\r
-#define EFI_IFR_EQ_ID_LIST_OP           0x14\r
-#define EFI_IFR_AND_OP                  0x15\r
-#define EFI_IFR_OR_OP                   0x16\r
-#define EFI_IFR_NOT_OP                  0x17\r
-#define EFI_IFR_END_IF_OP               0x18  // for endif of inconsistentif, suppressif, grayoutif\r
-#define EFI_IFR_GRAYOUT_IF_OP           0x19\r
-#define EFI_IFR_DATE_OP                 0x1A\r
-#define EFI_IFR_TIME_OP                 0x1B\r
-#define EFI_IFR_STRING_OP               0x1C\r
-#define EFI_IFR_LABEL_OP                0x1D\r
-#define EFI_IFR_SAVE_DEFAULTS_OP        0x1E\r
-#define EFI_IFR_RESTORE_DEFAULTS_OP     0x1F\r
-#define EFI_IFR_BANNER_OP               0x20\r
-#define EFI_IFR_INVENTORY_OP            0x21\r
-#define EFI_IFR_EQ_VAR_VAL_OP           0x22\r
-#define EFI_IFR_ORDERED_LIST_OP         0x23\r
-#define EFI_IFR_VARSTORE_OP             0x24\r
-#define EFI_IFR_VARSTORE_SELECT_OP      0x25\r
-#define EFI_IFR_VARSTORE_SELECT_PAIR_OP 0x26\r
-#define EFI_IFR_TRUE_OP                 0x27\r
-#define EFI_IFR_FALSE_OP                0x28\r
-#define EFI_IFR_GT_OP                   0x29\r
-#define EFI_IFR_GE_OP                   0x2A\r
-#define EFI_IFR_OEM_DEFINED_OP          0x2B\r
-#define EFI_IFR_LAST_OPCODE             EFI_IFR_OEM_DEFINED_OP\r
-#define EFI_IFR_OEM_OP                  0xFE\r
-#define EFI_IFR_NV_ACCESS_COMMAND       0xFF\r
-\r
-//\r
-// Define values for the flags fields in some VFR opcodes. These are\r
-// bitmasks.\r
-//\r
-#define EFI_IFR_FLAG_DEFAULT              0x01\r
-#define EFI_IFR_FLAG_MANUFACTURING        0x02\r
-#define EFI_IFR_FLAG_INTERACTIVE          0x04\r
-#define EFI_IFR_FLAG_NV_ACCESS            0x08\r
-#define EFI_IFR_FLAG_RESET_REQUIRED       0x10\r
-#define EFI_IFR_FLAG_LATE_CHECK           0x20\r
-\r
-#define EFI_NON_DEVICE_CLASS              0x00  // Useful when you do not want something in the Device Manager\r
-#define EFI_DISK_DEVICE_CLASS             0x01\r
-#define EFI_VIDEO_DEVICE_CLASS            0x02\r
-#define EFI_NETWORK_DEVICE_CLASS          0x04\r
-#define EFI_INPUT_DEVICE_CLASS            0x08\r
-#define EFI_ON_BOARD_DEVICE_CLASS         0x10\r
-#define EFI_OTHER_DEVICE_CLASS            0x20\r
-\r
-#define EFI_SETUP_APPLICATION_SUBCLASS    0x00\r
-#define EFI_GENERAL_APPLICATION_SUBCLASS  0x01\r
-#define EFI_FRONT_PAGE_SUBCLASS           0x02\r
-#define EFI_SINGLE_USE_SUBCLASS           0x03  // Used to display a single entity and then exit\r
-\r
-//\r
-// Used to flag dynamically created op-codes. This is meaningful to the IFR Library set\r
-// and the browser since we need to distinguish between compiled NV map data and created data.\r
-// We do not allow new entries to be created in the NV map dynamically however we still need\r
-// to display this information correctly.  To dynamically create op-codes and assume that their\r
-// data will be saved, ensure that the NV starting location they refer to is pre-defined in the\r
-// NV map.\r
-//\r
-#define EFI_IFR_FLAG_CREATED  128\r
 \r
 #pragma pack(1)\r
+\r
+\r
 //\r
-// IFR Structure definitions\r
+// HII package list\r
 //\r
 typedef struct {\r
-  UINT8 OpCode;\r
-  UINTLength;\r
-} EFI_IFR_OP_HEADER;\r
+  EFI_GUID               PackageListGuid;\r
+  UINT32                 PackageLength;\r
+} EFI_HII_PACKAGE_LIST_HEADER;\r
 \r
+/**\r
+    \r
+  Each package starts with a header, as defined above, which  \r
+  indicates the size and type of the package. When added to a  \r
+  pointer pointing to the start of the header, Length points at  \r
+  the next package. The package lists form a package list when  \r
+  concatenated together and terminated with an  \r
+  EFI_HII_PACKAGE_HEADER with a Type of EFI_HII_PACKAGE_END. The  \r
+  type EFI_HII_PACKAGE_TYPE_GUID is used for vendor-defined HII  \r
+  packages, whose contents are determined by the Guid. The range  \r
+  of package types starting with EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN  \r
+  through EFI_HII_PACKAGE_TYPE_SYSTEM_END are reserved for system  \r
+  firmware implementers.  \r
+  \r
+  @param Length The size of the package in bytes.\r
+  \r
+  @param Type   The package type. See EFI_HII_PACKAGE_TYPE_x,\r
+                below.\r
+  \r
+  @param Data   The package data, the format of which is\r
+                determined by Type.\r
+  \r
+**/\r
 typedef struct {\r
-  EFI_IFR_OP_HEADER     Header;\r
-  EFI_GUID              Guid;\r
-  STRING_REF            FormSetTitle;\r
-  STRING_REF            Help;\r
-  EFI_PHYSICAL_ADDRESS  CallbackHandle;\r
-  UINT16                Class;\r
-  UINT16                SubClass;\r
-  UINT16                NvDataSize; // set once, size of the NV data as defined in the script\r
-} EFI_IFR_FORM_SET;\r
+  UINT32  Length:24;\r
+  UINT32  Type:8;\r
+  // UINT8  Data[...];\r
+} EFI_HII_PACKAGE_HEADER;\r
 \r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-  UINT16            FormId;\r
-  STRING_REF        FormTitle;\r
-} EFI_IFR_FORM;\r
+//\r
+// EFI_HII_PACKAGE_TYPE_x.\r
+// \r
+#define EFI_HII_PACKAGE_TYPE_ALL             0x00\r
+#define EFI_HII_PACKAGE_TYPE_GUID            0x01\r
+#define EFI_HII_PACKAGE_FORM                 0x02\r
+#define EFI_HII_PACKAGE_KEYBOARD_LAYOUT      0x03\r
+#define EFI_HII_PACKAGE_STRINGS              0x04\r
+#define EFI_HII_PACKAGE_FONTS                0x05\r
+#define EFI_HII_PACKAGE_IMAGES               0x06\r
+#define EFI_HII_PACKAGE_SIMPLE_FONTS         0x07\r
+#define EFI_HII_PACKAGE_DEVICE_PATH          0x08\r
+#define EFI_HII_PACKAGE_END                  0xDF\r
+#define EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN    0xE0\r
+#define EFI_HII_PACKAGE_TYPE_SYSTEM_END      0xFF\r
 \r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-  UINT16            LabelId;\r
-} EFI_IFR_LABEL;\r
+//\r
+// Simplified Font Package\r
+//\r
+\r
+#define EFI_GLYPH_HEIGHT                     19\r
+#define EFI_GLYPH_WIDTH                      8\r
+//\r
+// Contents of EFI_NARROW_GLYPH.Attributes\r
+//\r
+#define EFI_GLYPH_NON_SPACING                0x01\r
+#define EFI_GLYPH_WIDE                       0x02\r
 \r
 typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-  STRING_REF        SubTitle;\r
-} EFI_IFR_SUBTITLE;\r
+  CHAR16                 UnicodeWeight;\r
+  UINT8                  Attributes;\r
+  UINT8                  GlyphCol1[EFI_GLYPH_HEIGHT];\r
+} EFI_NARROW_GLYPH;\r
 \r
 typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-  STRING_REF        Help;\r
-  STRING_REF        Text;\r
-  STRING_REF        TextTwo;\r
-  UINT8             Flags;          // This is included solely for purposes of interactive/dynamic support.\r
-  UINT16            Key;            // Value to be passed to caller to identify this particular op-code\r
-} EFI_IFR_TEXT;\r
+  CHAR16                 UnicodeWeight;\r
+  UINT8                  Attributes;\r
+  UINT8                  GlyphCol1[EFI_GLYPH_HEIGHT];\r
+  UINT8                  GlyphCol2[EFI_GLYPH_HEIGHT];\r
+  UINT8                  Pad[3];\r
+} EFI_WIDE_GLYPH;\r
+\r
+\r
+typedef struct _EFI_HII_SIMPLE_FONT_PACKAGE_HDR {\r
+  EFI_HII_PACKAGE_HEADER Header;\r
+  UINT16                 NumberOfNarrowGlyphs;\r
+  UINT16                 NumberOfWideGlyphs;\r
+  // EFI_NARROW_GLYPH       NarrowGlyphs[];\r
+  // EFI_WIDE_GLYPH         WideGlyphs[];\r
+} EFI_HII_SIMPLE_FONT_PACKAGE_HDR;\r
 \r
 //\r
-// goto\r
+// Font Package\r
 //\r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-  UINT16            FormId;\r
-  STRING_REF        Prompt;\r
-  STRING_REF        Help;   // The string Token for the context-help\r
-  UINT8             Flags;  // This is included solely for purposes of interactive/dynamic support.\r
-  UINT16            Key;    // Value to be passed to caller to identify this particular op-code\r
-} EFI_IFR_REF;\r
 \r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-} EFI_IFR_END_FORM;\r
+#define EFI_HII_FONT_STYLE_BOLD              0x00000001\r
+#define EFI_HII_FONT_STYLE_ITALIC            0x00000002\r
+#define EFI_HII_FONT_STYLE_EMBOSS            0x00010000\r
+#define EFI_HII_FONT_STYLE_OUTLINE           0x00020000\r
+#define EFI_HII_FONT_STYLE_SHADOW            0x00040000\r
+#define EFI_HII_FONT_STYLE_UNDERLINE         0x00080000\r
+#define EFI_HII_FONT_STYLE_DBL_UNDER         0x00100000\r
 \r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-} EFI_IFR_END_FORM_SET;\r
+typedef struct _EFI_HII_GLYPH_INFO {\r
+  UINT16                 Width;\r
+  UINT16                 Height;\r
+  INT16                  OffsetX;\r
+  INT16                  OffsetY;\r
+  INT16                  AdvanceX;\r
+} EFI_HII_GLYPH_INFO;\r
+\r
+typedef struct _EFI_HII_FONT_PACKAGE_HDR {\r
+  EFI_HII_PACKAGE_HEADER Header;\r
+  UINT32                 HdrSize;\r
+  UINT32                 GlyphBlockOffset;\r
+  EFI_HII_GLYPH_INFO     Cell;\r
+  EFI_HII_FONT_STYLE     FontStyle;\r
+  CHAR16                 FontFamily[1];\r
+} EFI_HII_FONT_PACKAGE_HDR;\r
+\r
+#define EFI_HII_GIBT_END                  0x00\r
+#define EFI_HII_GIBT_GLYPH                0x10\r
+#define EFI_HII_GIBT_GLYPHS               0x11\r
+#define EFI_HII_GIBT_GLYPH_DEFAULT        0x12\r
+#define EFI_HII_GIBT_GLYPHS_DEFAULT       0x13\r
+#define EFI_HII_GIBT_DUPLICATE            0x20\r
+#define EFI_HII_GIBT_SKIP2                0x21\r
+#define EFI_HII_GIBT_SKIP1                0x22\r
+#define EFI_HII_GIBT_DEFAULTS             0x23\r
+#define EFI_HII_GIBT_EXT1                 0x30\r
+#define EFI_HII_GIBT_EXT2                 0x31\r
+#define EFI_HII_GIBT_EXT4                 0x32\r
+\r
+typedef struct _EFI_HII_GLYPH_BLOCK {\r
+  UINT8                  BlockType;\r
+} EFI_HII_GLYPH_BLOCK;\r
+\r
+typedef struct _EFI_HII_GIBT_DEFAULTS_BLOCK {\r
+  EFI_HII_GLYPH_BLOCK    Header;\r
+  EFI_HII_GLYPH_INFO     Cell;\r
+} EFI_HII_GIBT_DEFAULTS_BLOCK;\r
+\r
+typedef struct _EFI_HII_GIBT_DUPLICATE_BLOCK {\r
+  EFI_HII_GLYPH_BLOCK    Header;\r
+  CHAR16                 CharValue;\r
+} EFI_HII_GIBT_DUPLICATE_BLOCK;\r
+\r
+typedef struct _EFI_GLYPH_GIBT_END_BLOCK {\r
+  EFI_HII_GLYPH_BLOCK    Header;\r
+} EFI_GLYPH_GIBT_END_BLOCK;\r
+\r
+typedef struct _EFI_HII_GIBT_EXT1_BLOCK {\r
+  EFI_HII_GLYPH_BLOCK    Header;\r
+  UINT8                  BlockType2;\r
+  UINT8                  Length;\r
+} EFI_HII_GIBT_EXT1_BLOCK;\r
+\r
+typedef struct _EFI_HII_GIBT_EXT2_BLOCK {\r
+  EFI_HII_GLYPH_BLOCK    Header;\r
+  UINT8                  BlockType2;\r
+  UINT16                 Length;\r
+} EFI_HII_GIBT_EXT2_BLOCK;\r
+\r
+typedef struct _EFI_HII_GIBT_EXT4_BLOCK {\r
+  EFI_HII_GLYPH_BLOCK    Header;\r
+  UINT8                  BlockType2;\r
+  UINT32                 Length;\r
+} EFI_HII_GIBT_EXT4_BLOCK;\r
+\r
+typedef struct _EFI_HII_GIBT_GLYPH_BLOCK {\r
+  EFI_HII_GLYPH_BLOCK    Header;\r
+  EFI_HII_GLYPH_INFO     Cell;\r
+  UINT8                  BitmapData[1]; // the number of bytes per bitmap can be calculated by ((Cell.Width+7)/8)*Cell.Height\r
+} EFI_HII_GIBT_GLYPH_BLOCK;\r
+\r
+typedef struct _EFI_HII_GIBT_GLYPHS_BLOCK {\r
+  EFI_HII_GLYPH_BLOCK    Header;\r
+  EFI_HII_GLYPH_INFO     Cell;\r
+  UINT16                 Count;  \r
+  UINT8                  BitmapData[1]; // the number of bytes per bitmap can be calculated by ((Cell.Width+7)/8)*Cell.Height\r
+} EFI_HII_GIBT_GLYPHS_BLOCK;\r
+\r
+typedef struct _EFI_HII_GIBT_GLYPH_DEFAULT_BLOCK {\r
+  EFI_HII_GLYPH_BLOCK    Header;\r
+  UINT8                  BitmapData[1]; // the number of bytes per bitmap can be calculated by ((Global.Cell.Width+7)/8)*Global.Cell.Height\r
+} EFI_HII_GIBT_GLYPH_DEFAULT_BLOCK;\r
+\r
+typedef struct _EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK {\r
+  EFI_HII_GLYPH_BLOCK    Header;\r
+  UINT16                 Count;\r
+  UINT8                  BitmapData[1]; // the number of bytes per bitmap can be calculated by ((Global.Cell.Width+7)/8)*Global.Cell.Height\r
+} EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK;\r
+\r
+typedef struct _EFI_HII_GIBT_SKIP1_BLOCK {\r
+  EFI_HII_GLYPH_BLOCK    Header;\r
+  UINT8                  SkipCount;\r
+} EFI_HII_GIBT_SKIP1_BLOCK;\r
+\r
+typedef struct _EFI_HII_GIBT_SKIP2_BLOCK {\r
+  EFI_HII_GLYPH_BLOCK    Header;\r
+  UINT16                 SkipCount;\r
+} EFI_HII_GIBT_SKIP2_BLOCK;\r
 \r
 //\r
-// Also notice that the IFR_ONE_OF and IFR_CHECK_BOX are identical in structure......code assumes this to be true, if this ever\r
-// changes we need to revisit the InitializeTagStructures code\r
+// Device Path Package\r
 //\r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-  UINT16            QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name\r
-  UINT8             Width;      // The Size of the Data being saved\r
-  STRING_REF        Prompt;     // The String Token for the Prompt\r
-  STRING_REF        Help;       // The string Token for the context-help\r
-} EFI_IFR_ONE_OF;\r
+typedef struct _EFI_HII_DEVICE_PATH_PACKAGE {\r
+  EFI_HII_PACKAGE_HEADER   Header;\r
+  // EFI_DEVICE_PATH_PROTOCOL DevicePath[];\r
+} EFI_HII_DEVICE_PATH_PACKAGE;\r
 \r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-  UINT16            QuestionId; // The offset in NV for storage of the data\r
-  UINT8             MaxEntries; // The maximum number of options in the ordered list (=size of NVStore)\r
-  STRING_REF        Prompt;     // The string token for the prompt\r
-  STRING_REF        Help;       // The string token for the context-help\r
-} EFI_IFR_ORDERED_LIST;\r
+//\r
+// GUID Package\r
+//\r
+typedef struct _EFI_HII_GUID_PACKAGE_HDR {\r
+  EFI_HII_PACKAGE_HEADER  Header;\r
+  EFI_GUID                Guid;\r
+  // Data per GUID definition may follow\r
+} EFI_HII_GUID_PACKAGE_HDR;\r
 \r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-  UINT16            QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name\r
-  UINT8             Width;      // The Size of the Data being saved\r
-  STRING_REF        Prompt;     // The String Token for the Prompt\r
-  STRING_REF        Help;       // The string Token for the context-help\r
-  UINT8             Flags;      // For now, if non-zero, means that it is the default option, - further definition likely\r
-  UINT16            Key;        // Value to be passed to caller to identify this particular op-code\r
-} EFI_IFR_CHECKBOX, EFI_IFR_CHECK_BOX;\r
+//\r
+// String Package\r
+//\r
 \r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-  STRING_REF        Option;     // The string token describing the option\r
-  UINT16            Value;      // The value associated with this option that is stored in the NVRAM if chosen\r
-  UINT8             Flags;      // For now, if non-zero, means that it is the default option, - further definition likely above\r
-  UINT16            Key;        // Value to be passed to caller to identify this particular op-code\r
-} EFI_IFR_ONE_OF_OPTION;\r
+#define UEFI_CONFIG_LANG  L"x-UEFI"\r
+#define UEFI_CONFIG_LANG2 L"x-i-UEFI"     // BUGBUG, spec need to be updated.\r
+\r
+typedef struct _EFI_HII_STRING_PACKAGE_HDR {\r
+  EFI_HII_PACKAGE_HEADER  Header;\r
+  UINT32                  HdrSize;\r
+  UINT32                  StringInfoOffset;\r
+  CHAR16                  LanguageWindow[16];\r
+  EFI_STRING_ID           LanguageName;\r
+  CHAR8                   Language[1];\r
+} EFI_HII_STRING_PACKAGE_HDR;\r
 \r
 typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-  UINT16            QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name\r
-  UINT8             Width;      // The Size of the Data being saved\r
-  STRING_REF        Prompt;     // The String Token for the Prompt\r
-  STRING_REF        Help;       // The string Token for the context-help\r
-  UINT8             Flags;      // This is included solely for purposes of interactive/dynamic support.\r
-  UINT16            Key;        // Value to be passed to caller to identify this particular op-code\r
-  UINT16            Minimum;\r
-  UINT16            Maximum;\r
-  UINT16            Step;       // If step is 0, then manual input is specified, otherwise, left/right arrow selection is called for\r
-  UINT16            Default;\r
-} EFI_IFR_NUMERIC;\r
+  UINT8                   BlockType;\r
+} EFI_HII_STRING_BLOCK;\r
+\r
+#define EFI_HII_SIBT_END                     0x00\r
+#define EFI_HII_SIBT_STRING_SCSU             0x10\r
+#define EFI_HII_SIBT_STRING_SCSU_FONT        0x11\r
+#define EFI_HII_SIBT_STRINGS_SCSU            0x12\r
+#define EFI_HII_SIBT_STRINGS_SCSU_FONT       0x13\r
+#define EFI_HII_SIBT_STRING_UCS2             0x14\r
+#define EFI_HII_SIBT_STRING_UCS2_FONT        0x15\r
+#define EFI_HII_SIBT_STRINGS_UCS2            0x16\r
+#define EFI_HII_SIBT_STRINGS_UCS2_FONT       0x17\r
+#define EFI_HII_SIBT_DUPLICATE               0x20\r
+#define EFI_HII_SIBT_SKIP2                   0x21\r
+#define EFI_HII_SIBT_SKIP1                   0x22\r
+#define EFI_HII_SIBT_EXT1                    0x30\r
+#define EFI_HII_SIBT_EXT2                    0x31\r
+#define EFI_HII_SIBT_EXT4                    0x32\r
+#define EFI_HII_SIBT_FONT                    0x40\r
+\r
+typedef struct _EFI_HII_SIBT_DUPLICATE_BLOCK {\r
+  EFI_HII_STRING_BLOCK    Header;\r
+  EFI_STRING_ID           StringId;\r
+} EFI_HII_SIBT_DUPLICATE_BLOCK;\r
+\r
+typedef struct _EFI_HII_SIBT_END_BLOCK {\r
+  EFI_HII_STRING_BLOCK    Header;\r
+} EFI_HII_SIBT_END_BLOCK;\r
+\r
+typedef struct _EFI_HII_SIBT_EXT1_BLOCK {\r
+  EFI_HII_STRING_BLOCK    Header;\r
+  UINT8                   BlockType2;\r
+  UINT8                   Length;\r
+} EFI_HII_SIBT_EXT1_BLOCK;\r
+\r
+typedef struct _EFI_HII_SIBT_EXT2_BLOCK {\r
+  EFI_HII_STRING_BLOCK    Header;\r
+  UINT8                   BlockType2;\r
+  UINT16                  Length;\r
+} EFI_HII_SIBT_EXT2_BLOCK;\r
+\r
+typedef struct _EFI_HII_SIBT_EXT4_BLOCK {\r
+  EFI_HII_STRING_BLOCK    Header;\r
+  UINT8                   BlockType2;\r
+  UINT32                  Length;\r
+} EFI_HII_SIBT_EXT4_BLOCK;\r
+\r
+typedef struct _EFI_HII_SIBT_FONT_BLOCK {\r
+  EFI_HII_SIBT_EXT2_BLOCK Header;\r
+  UINT8                   FontId;\r
+  UINT16                  FontSize;\r
+  EFI_HII_FONT_STYLE      FontStyle;\r
+  CHAR16                  FontName[1];\r
+} EFI_HII_SIBT_FONT_BLOCK;\r
+\r
+typedef struct _EFI_HII_SIBT_SKIP1_BLOCK {\r
+  EFI_HII_STRING_BLOCK    Header;\r
+  UINT8                   SkipCount;\r
+} EFI_HII_SIBT_SKIP1_BLOCK;\r
+\r
+typedef struct _EFI_HII_SIBT_SKIP2_BLOCK {\r
+  EFI_HII_STRING_BLOCK    Header;\r
+  UINT16                  SkipCount;\r
+} EFI_HII_SIBT_SKIP2_BLOCK;\r
+\r
+typedef struct _EFI_HII_SIBT_STRING_SCSU_BLOCK {\r
+  EFI_HII_STRING_BLOCK    Header;\r
+  UINT8                   StringText[1];\r
+} EFI_HII_SIBT_STRING_SCSU_BLOCK;\r
+\r
+typedef struct _EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK {\r
+  EFI_HII_STRING_BLOCK    Header;\r
+  UINT8                   FontIdentifier;\r
+  UINT8                   StringText[1];\r
+} EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK;\r
+\r
+typedef struct _EFI_HII_SIBT_STRINGS_SCSU_BLOCK {\r
+  EFI_HII_STRING_BLOCK    Header;\r
+  UINT16                  StringCount;\r
+  UINT8                   StringText[1];\r
+} EFI_HII_SIBT_STRINGS_SCSU_BLOCK;\r
+\r
+typedef struct _EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK {\r
+  EFI_HII_STRING_BLOCK    Header;\r
+  UINT8                   FontIdentifier;\r
+  UINT16                  StringCount;\r
+  UINT8                   StringText[1];\r
+} EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK;\r
+\r
+typedef struct _EFI_HII_SIBT_STRING_UCS2_BLOCK {\r
+  EFI_HII_STRING_BLOCK    Header;\r
+  CHAR16                  StringText[1];\r
+} EFI_HII_SIBT_STRING_UCS2_BLOCK;\r
+\r
+typedef struct _EFI_HII_SIBT_STRING_UCS2_FONT_BLOCK {\r
+  EFI_HII_STRING_BLOCK    Header;\r
+  UINT8                   FontIdentifier;\r
+  CHAR16                  StringText[1];\r
+} EFI_HII_SIBT_STRING_UCS2_FONT_BLOCK;\r
+\r
+typedef struct _EFI_HII_SIBT_STRINGS_UCS2_BLOCK {\r
+  EFI_HII_STRING_BLOCK    Header;\r
+  UINT16                  StringCount;\r
+  CHAR16                  StringText[1];\r
+} EFI_HII_SIBT_STRINGS_UCS2_BLOCK;\r
+\r
+typedef struct _EFI_HII_SIBT_STRINGS_UCS2_FONT_BLOCK {\r
+  EFI_HII_STRING_BLOCK    Header;\r
+  UINT8                   FontIdentifier;\r
+  UINT16                  StringCount;\r
+  CHAR16                  StringText[1];\r
+} EFI_HII_SIBT_STRINGS_UCS2_FONT_BLOCK;\r
 \r
 //\r
-// There is an interesting twist with regards to Time and Date.  This is one of the few items which can accept input from\r
-// a user, however may or may not need to use storage in the NVRAM space.  The decided method for determining if NVRAM space\r
-// will be used (only for a TimeOp or DateOp) is:  If .QuestionId == 0 && .Width == 0 (normally an impossibility) then use system\r
-// resources to store the data away and not NV resources.  In other words, the setup engine will call gRT->SetTime, and gRT->SetDate\r
-// for the saving of data, and the values displayed will be from the gRT->GetXXXX series of calls.\r
+// Image Packages\r
+//\r
+\r
+typedef struct _EFI_HII_IMAGE_PACKAGE_HDR {\r
+  EFI_HII_PACKAGE_HEADER  Header;\r
+  UINT32                  ImageInfoOffset;\r
+  UINT32                  PaletteInfoOffset;\r
+} EFI_HII_IMAGE_PACKAGE_HDR;\r
+\r
+typedef struct _EFI_HII_IMAGE_BLOCK {\r
+  UINT8                   BlockType;\r
+} EFI_HII_IMAGE_BLOCK;\r
+\r
+#define EFI_HII_IIBT_END               0x00\r
+#define EFI_HII_IIBT_IMAGE_1BIT        0x10\r
+#define EFI_HII_IIBT_IMAGE_1BIT_TRANS  0x11\r
+#define EFI_HII_IIBT_IMAGE_4BIT        0x12\r
+#define EFI_HII_IIBT_IMAGE_4BIT_TRANS  0x13\r
+#define EFI_HII_IIBT_IMAGE_8BIT        0x14\r
+#define EFI_HII_IIBT_IMAGE_8BIT_TRANS  0x15\r
+#define EFI_HII_IIBT_IMAGE_24BIT       0x16\r
+#define EFI_HII_IIBT_IMAGE_24BIT_TRANS 0x17\r
+#define EFI_HII_IIBT_IMAGE_JPEG        0x18\r
+#define EFI_HII_IIBT_DUPLICATE         0x20\r
+#define EFI_HII_IIBT_SKIP2             0x21\r
+#define EFI_HII_IIBT_SKIP1             0x22\r
+#define EFI_HII_IIBT_EXT1              0x30\r
+#define EFI_HII_IIBT_EXT2              0x31\r
+#define EFI_HII_IIBT_EXT4              0x32\r
+\r
+typedef struct _EFI_HII_IIBT_END_BLOCK {\r
+  EFI_HII_IMAGE_BLOCK          Header;\r
+} EFI_HII_IIBT_END_BLOCK;\r
+\r
+typedef struct _EFI_HII_IIBT_EXT1_BLOCK {\r
+  EFI_HII_IMAGE_BLOCK          Header;\r
+  UINT8                        BlockType2;\r
+  UINT8                        Length;\r
+} EFI_HII_IIBT_EXT1_BLOCK;\r
+\r
+typedef struct _EFI_HII_IIBT_EXT2_BLOCK {\r
+  EFI_HII_IMAGE_BLOCK          Header;\r
+  UINT8                        BlockType2;\r
+  UINT16                       Length;\r
+} EFI_HII_IIBT_EXT2_BLOCK;\r
+\r
+typedef struct _EFI_HII_IIBT_EXT4_BLOCK {\r
+  EFI_HII_IMAGE_BLOCK          Header;\r
+  UINT8                        BlockType2;\r
+  UINT32                       Length;\r
+} EFI_HII_IIBT_EXT4_BLOCK;\r
+\r
+typedef struct _EFI_HII_IIBT_IMAGE_1BIT_BASE {\r
+  UINT16                       Width;\r
+  UINT16                       Height;\r
+  UINT8                        Data[1];\r
+} EFI_HII_IIBT_IMAGE_1BIT_BASE;\r
+\r
+typedef struct _EFI_HII_IIBT_IMAGE_1BIT_BLOCK {\r
+  EFI_HII_IMAGE_BLOCK          Header;\r
+  UINT8                        PaletteIndex;\r
+  EFI_HII_IIBT_IMAGE_1BIT_BASE Bitmap;\r
+} EFI_HII_IIBT_IMAGE_1BIT_BLOCK;\r
+\r
+typedef struct _EFI_HII_IIBT_IMAGE_1BIT_TRANS_BLOCK {\r
+  EFI_HII_IMAGE_BLOCK          Header;\r
+  UINT8                        PaletteIndex;\r
+  EFI_HII_IIBT_IMAGE_1BIT_BASE Bitmap;\r
+} EFI_HII_IIBT_IMAGE_1BIT_TRANS_BLOCK;\r
+\r
+typedef struct _EFI_HII_RGB_PIXEL {\r
+  UINT8                        b;\r
+  UINT8                        g;\r
+  UINT8                        r;\r
+} EFI_HII_RGB_PIXEL;\r
+\r
+typedef struct _EFI_HII_IIBT_IMAGE_24BIT_BASE {\r
+  UINT16                       Width;\r
+  UINT16                       Height;\r
+  EFI_HII_RGB_PIXEL            Bitmap[1];\r
+} EFI_HII_IIBT_IMAGE_24BIT_BASE;\r
+\r
+typedef struct _EFI_HII_IIBT_IMAGE_24BIT_BLOCK {\r
+  EFI_HII_IMAGE_BLOCK           Header;\r
+  EFI_HII_IIBT_IMAGE_24BIT_BASE Bitmap;\r
+} EFI_HII_IIBT_IMAGE_24BIT_BLOCK;\r
+\r
+typedef struct _EFI_HII_IIBT_IMAGE_24BIT_TRANS_BLOCK {\r
+  EFI_HII_IMAGE_BLOCK           Header;\r
+  EFI_HII_IIBT_IMAGE_24BIT_BASE Bitmap;\r
+} EFI_HII_IIBT_IMAGE_24BIT_TRANS_BLOCK;\r
+\r
+typedef struct _EFI_HII_IIBT_IMAGE_4BIT_BASE {\r
+  UINT16                       Width;\r
+  UINT16                       Height;\r
+  UINT8                        Data[1];\r
+} EFI_HII_IIBT_IMAGE_4BIT_BASE;\r
+\r
+typedef struct _EFI_HII_IIBT_IMAGE_4BIT_BLOCK {\r
+  EFI_HII_IMAGE_BLOCK          Header;\r
+  UINT8                        PaletteIndex;\r
+  EFI_HII_IIBT_IMAGE_4BIT_BASE Bitmap;\r
+} EFI_HII_IIBT_IMAGE_4BIT_BLOCK;\r
+\r
+typedef struct _EFI_HII_IIBT_IMAGE_4BIT_TRANS_BLOCK {\r
+  EFI_HII_IMAGE_BLOCK          Header;\r
+  UINT8                        PaletteIndex;\r
+  EFI_HII_IIBT_IMAGE_4BIT_BASE Bitmap;\r
+} EFI_HII_IIBT_IMAGE_4BIT_TRANS_BLOCK;\r
+\r
+typedef struct _EFI_HII_IIBT_IMAGE_8BIT_BASE {\r
+  UINT16                       Width;\r
+  UINT16                       Height;\r
+  UINT8                        Data[1];\r
+} EFI_HII_IIBT_IMAGE_8BIT_BASE;\r
+\r
+typedef struct _EFI_HII_IIBT_IMAGE_8BIT_PALETTE_BLOCK {\r
+  EFI_HII_IMAGE_BLOCK          Header;\r
+  UINT8                        PaletteIndex;\r
+  EFI_HII_IIBT_IMAGE_8BIT_BASE Bitmap;\r
+} EFI_HII_IIBT_IMAGE_8BIT_BLOCK;\r
+\r
+typedef struct _EFI_HII_IIBT_IMAGE_8BIT_TRANS_BLOCK {\r
+  EFI_HII_IMAGE_BLOCK          Header;\r
+  UINT8                        PaletteIndex;\r
+  EFI_HII_IIBT_IMAGE_8BIT_BASE Bitmap;\r
+} EFI_HII_IIBT_IMAGE_8BIT_TRAN_BLOCK;\r
+\r
+typedef struct _EFI_HII_IIBT_DUPLICATE_BLOCK {\r
+  EFI_HII_IMAGE_BLOCK          Header;\r
+  EFI_IMAGE_ID                 ImageId;\r
+} EFI_HII_IIBT_DUPLICATE_BLOCK;\r
+\r
+typedef struct _EFI_HII_IIBT_JPEG_BLOCK {\r
+  EFI_HII_IMAGE_BLOCK          Header;\r
+  UINT32                       Size;\r
+  UINT8                        Data[1];\r
+} EFI_HII_IIBT_JPEG_BLOCK;\r
+\r
+typedef struct _EFI_HII_IIBT_SKIP1_BLOCK {\r
+  EFI_HII_IMAGE_BLOCK          Header;\r
+  UINT8                        SkipCount;\r
+} EFI_HII_IIBT_SKIP1_BLOCK;\r
+\r
+typedef struct _EFI_HII_IIBT_SKIP2_BLOCK {\r
+  EFI_HII_IMAGE_BLOCK          Header;\r
+  UINT16                       SkipCount;\r
+} EFI_HII_IIBT_SKIP2_BLOCK;\r
+\r
+typedef struct _EFI_HII_IMAGE_PALETTE_INFO_HEADER {\r
+  UINT16                       PaletteCount;\r
+} EFI_HII_IMAGE_PALETTE_INFO_HEADER;\r
+\r
+typedef struct _EFI_HII_IMAGE_PALETTE_INFO {\r
+  UINT16                       PaletteSize;\r
+  EFI_HII_RGB_PIXEL            PaletteValue[1];\r
+} EFI_HII_IMAGE_PALETTE_INFO;\r
+\r
 //\r
+// Forms Package\r
+//\r
+\r
+typedef struct _EFI_HII_FORM_PACKAGE {\r
+  EFI_HII_PACKAGE_HEADER       Header;\r
+  // EFI_IFR_OP_HEADER         OpCodeHeader;\r
+  // More op-codes follow\r
+} EFI_HII_FORM_PACKAGE;\r
+\r
 typedef struct {\r
-  EFI_IFR_NUMERIC Hour;\r
-  EFI_IFR_NUMERIC Minute;\r
-  EFI_IFR_NUMERIC Second;\r
-} EFI_IFR_TIME;\r
+  UINT8 Hour;\r
+  UINT8 Minute;\r
+  UINT8 Second;\r
+} EFI_HII_TIME;\r
 \r
 typedef struct {\r
-  EFI_IFR_NUMERIC Year;\r
-  EFI_IFR_NUMERIC Month;\r
-  EFI_IFR_NUMERIC Day;\r
+  UINT16 Year;\r
+  UINT8  Month;\r
+  UINT8  Day;\r
+} EFI_HII_DATE;\r
+\r
+typedef union {\r
+  UINT8           u8;\r
+  UINT16          u16;\r
+  UINT32          u32;\r
+  UINT64          u64;\r
+  BOOLEAN         b;\r
+  EFI_HII_TIME    time;\r
+  EFI_HII_DATE    date;\r
+  EFI_STRING_ID   string;\r
+} EFI_IFR_TYPE_VALUE;\r
+\r
+#define EFI_IFR_FORM_OP                0x01\r
+#define EFI_IFR_SUBTITLE_OP            0x02\r
+#define EFI_IFR_TEXT_OP                0x03\r
+#define EFI_IFR_IMAGE_OP               0x04\r
+#define EFI_IFR_ONE_OF_OP              0x05\r
+#define EFI_IFR_CHECKBOX_OP            0x06\r
+#define EFI_IFR_NUMERIC_OP             0x07\r
+#define EFI_IFR_PASSWORD_OP            0x08\r
+#define EFI_IFR_ONE_OF_OPTION_OP       0x09\r
+#define EFI_IFR_SUPPRESS_IF_OP         0x0A\r
+#define EFI_IFR_LOCKED_OP              0x0B\r
+#define EFI_IFR_ACTION_OP              0x0C\r
+#define EFI_IFR_RESET_BUTTON_OP        0x0D\r
+#define EFI_IFR_FORM_SET_OP            0x0E\r
+#define EFI_IFR_REF_OP                 0x0F\r
+#define EFI_IFR_NO_SUBMIT_IF_OP        0x10\r
+#define EFI_IFR_INCONSISTENT_IF_OP     0x11\r
+#define EFI_IFR_EQ_ID_VAL_OP           0x12\r
+#define EFI_IFR_EQ_ID_ID_OP            0x13\r
+#define EFI_IFR_EQ_ID_LIST_OP          0x14\r
+#define EFI_IFR_AND_OP                 0x15\r
+#define EFI_IFR_OR_OP                  0x16\r
+#define EFI_IFR_NOT_OP                 0x17\r
+#define EFI_IFR_RULE_OP                0x18\r
+#define EFI_IFR_GRAY_OUT_IF_OP         0x19\r
+#define EFI_IFR_DATE_OP                0x1A\r
+#define EFI_IFR_TIME_OP                0x1B\r
+#define EFI_IFR_STRING_OP              0x1C\r
+#define EFI_IFR_REFRESH_OP             0x1D\r
+#define EFI_IFR_DISABLE_IF_OP          0x1E\r
+#define EFI_IFR_TO_LOWER_OP            0x20\r
+#define EFI_IFR_TO_UPPER_OP            0x21\r
+#define EFI_IFR_ORDERED_LIST_OP        0x23\r
+#define EFI_IFR_VARSTORE_OP            0x24\r
+#define EFI_IFR_VARSTORE_NAME_VALUE_OP 0x25\r
+#define EFI_IFR_VARSTORE_EFI_OP        0x26\r
+#define EFI_IFR_VARSTORE_DEVICE_OP     0x27\r
+#define EFI_IFR_VERSION_OP             0x28\r
+#define EFI_IFR_END_OP                 0x29\r
+#define EFI_IFR_MATCH_OP               0x2A\r
+#define EFI_IFR_EQUAL_OP               0x2F\r
+#define EFI_IFR_NOT_EQUAL_OP           0x30\r
+#define EFI_IFR_GREATER_THAN_OP        0x31\r
+#define EFI_IFR_GREATER_EQUAL_OP       0x32\r
+#define EFI_IFR_LESS_THAN_OP           0x33\r
+#define EFI_IFR_LESS_EQUAL_OP          0x34\r
+#define EFI_IFR_BITWISE_AND_OP         0x35\r
+#define EFI_IFR_BITWISE_OR_OP          0x36\r
+#define EFI_IFR_BITWISE_NOT_OP         0x37\r
+#define EFI_IFR_SHIFT_LEFT_OP          0x38\r
+#define EFI_IFR_SHIFT_RIGHT_OP         0x39\r
+#define EFI_IFR_ADD_OP                 0x3A\r
+#define EFI_IFR_SUBTRACT_OP            0x3B\r
+#define EFI_IFR_MULTIPLY_OP            0x3C\r
+#define EFI_IFR_DIVIDE_OP              0x3D\r
+#define EFI_IFR_MODULO_OP              0x3E\r
+#define EFI_IFR_RULE_REF_OP            0x3F\r
+#define EFI_IFR_QUESTION_REF1_OP       0x40\r
+#define EFI_IFR_QUESTION_REF2_OP       0x41\r
+#define EFI_IFR_UINT8_OP               0x42\r
+#define EFI_IFR_UINT16_OP              0x43\r
+#define EFI_IFR_UINT32_OP              0x44\r
+#define EFI_IFR_UINT64_OP              0x45\r
+#define EFI_IFR_TRUE_OP                0x46\r
+#define EFI_IFR_FALSE_OP               0x47\r
+#define EFI_IFR_TO_UINT_OP             0x48\r
+#define EFI_IFR_TO_STRING_OP           0x49\r
+#define EFI_IFR_TO_BOOLEAN_OP          0x4A\r
+#define EFI_IFR_MID_OP                 0x4B\r
+#define EFI_IFR_FIND_OP                0x4C\r
+#define EFI_IFR_TOKEN_OP               0x4D\r
+#define EFI_IFR_STRING_REF1_OP         0x4E\r
+#define EFI_IFR_STRING_REF2_OP         0x4F\r
+#define EFI_IFR_CONDITIONAL_OP         0x50\r
+#define EFI_IFR_QUESTION_REF3_OP       0x51\r
+#define EFI_IFR_ZERO_OP                0x52\r
+#define EFI_IFR_ONE_OP                 0x53\r
+#define EFI_IFR_ONES_OP                0x54\r
+#define EFI_IFR_UNDEFINED_OP           0x55\r
+#define EFI_IFR_LENGTH_OP              0x56\r
+#define EFI_IFR_DUP_OP                 0x57\r
+#define EFI_IFR_THIS_OP                0x58\r
+#define EFI_IFR_SPAN_OP                0x59\r
+#define EFI_IFR_VALUE_OP               0x5A\r
+#define EFI_IFR_DEFAULT_OP             0x5B\r
+#define EFI_IFR_DEFAULTSTORE_OP        0x5C\r
+#define EFI_IFR_CATENATE_OP            0x5E\r
+#define EFI_IFR_GUID_OP                0x5F\r
+\r
+\r
+typedef struct _EFI_IFR_OP_HEADER {\r
+  UINT8                    OpCode;\r
+  UINT8                    Length:7;\r
+  UINT8                    Scope:1;\r
+} EFI_IFR_OP_HEADER;\r
+\r
+typedef struct _EFI_IFR_STATEMENT_HEADER {\r
+  EFI_STRING_ID            Prompt;\r
+  EFI_STRING_ID            Help;\r
+} EFI_IFR_STATEMENT_HEADER;\r
+\r
+typedef struct _EFI_IFR_QUESTION_HEADER {\r
+  EFI_IFR_STATEMENT_HEADER Header;\r
+  EFI_QUESTION_ID          QuestionId;\r
+  EFI_VARSTORE_ID          VarStoreId;\r
+  union {\r
+    EFI_STRING_ID          VarName;\r
+    UINT16                 VarOffset;\r
+  }                        VarStoreInfo;\r
+  UINT8                    Flags;\r
+} EFI_IFR_QUESTION_HEADER;\r
+\r
+#define EFI_IFR_FLAG_READ_ONLY         0x01\r
+#define EFI_IFR_FLAG_CALLBACK          0x04\r
+#define EFI_IFR_FLAG_RESET_REQUIRED    0x10\r
+#define EFI_IFR_FLAG_OPTIONS_ONLY      0x80\r
+\r
+typedef struct _EFI_IFR_DEFAULTSTORE {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_STRING_ID            DefaultName;\r
+  UINT16                   DefaultId;\r
+} EFI_IFR_DEFAULTSTORE;\r
+\r
+#define EFI_HII_DEFAULT_CLASS_STANDARD       0x0000\r
+#define EFI_HII_DEFAULT_CLASS_MANUFACTURING  0x0001\r
+#define EFI_HII_DEFAULT_CLASS_SAFE           0x0002\r
+#define EFI_HII_DEFAULT_CLASS_PLATFORM_BEGIN 0x4000\r
+#define EFI_HII_DEFAULT_CLASS_PLATFORM_END   0x7fff\r
+#define EFI_HII_DEFAULT_CLASS_HARDWARE_BEGIN 0x8000\r
+#define EFI_HII_DEFAULT_CLASS_HARDWARE_END   0xbfff\r
+#define EFI_HII_DEFAULT_CLASS_FIRMWARE_BEGIN 0xc000\r
+#define EFI_HII_DEFAULT_CLASS_FIRMWARE_END   0xffff\r
+\r
+typedef struct _EFI_IFR_VARSTORE {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_GUID                 Guid;\r
+  EFI_VARSTORE_ID          VarStoreId;\r
+  UINT16                   Size;\r
+  UINT8                    Name[1];\r
+} EFI_IFR_VARSTORE;\r
+\r
+typedef struct _EFI_IFR_VARSTORE_EFI {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  UINT16                   VarStoreId;\r
+  EFI_GUID                 Guid;\r
+  UINT32                   Attributes;\r
+} EFI_IFR_VARSTORE_EFI;\r
+\r
+typedef struct _EFI_IFR_VARSTORE_NAME_VALUE {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  UINT16                   VarStoreId;\r
+  EFI_GUID                 Guid;\r
+} EFI_IFR_VARSTORE_NAME_VALUE;\r
+\r
+typedef struct _EFI_IFR_FORM_SET {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_GUID                 Guid;\r
+  EFI_STRING_ID            FormSetTitle;\r
+  EFI_STRING_ID            Help;\r
+} EFI_IFR_FORM_SET;\r
+\r
+typedef struct _EFI_IFR_END {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_END;\r
+\r
+typedef struct _EFI_IFR_FORM {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  UINT16                   FormId;\r
+  EFI_STRING_ID            FormTitle;\r
+} EFI_IFR_FORM;\r
+\r
+typedef struct _EFI_IFR_IMAGE {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_IMAGE_ID             Id;\r
+} EFI_IFR_IMAGE;\r
+\r
+typedef struct _EFI_IFR_LOCKED {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_LOCKED;\r
+\r
+typedef struct _EFI_IFR_RULE {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  UINT8                    RuleId;\r
+} EFI_IFR_RULE;\r
+\r
+typedef struct _EFI_IFR_DEFAULT {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  UINT16                   DefaultId;\r
+  UINT8                    Type;\r
+  EFI_IFR_TYPE_VALUE       Value;\r
+} EFI_IFR_DEFAULT;\r
+\r
+typedef struct _EFI_IFR_VALUE {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_VALUE;\r
+\r
+typedef struct _EFI_IFR_SUBTITLE {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_IFR_STATEMENT_HEADER Statement;\r
+  UINT8                    Flags;\r
+} EFI_IFR_SUBTITLE;\r
+\r
+#define EFI_IFR_FLAGS_HORIZONTAL       0x01\r
+\r
+typedef struct _EFI_IFR_CHECKBOX {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_IFR_QUESTION_HEADER  Question;\r
+  UINT8                    Flags;\r
+} EFI_IFR_CHECKBOX;\r
+\r
+#define EFI_IFR_CHECKBOX_DEFAULT       0x01\r
+#define EFI_IFR_CHECKBOX_DEFAULT_MFG   0x02\r
+\r
+typedef struct _EFI_IFR_TEXT {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_IFR_STATEMENT_HEADER Statement;\r
+  EFI_STRING_ID            TextTwo;\r
+} EFI_IFR_TEXT;\r
+\r
+typedef struct _EFI_IFR_REF {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_IFR_QUESTION_HEADER  Question;\r
+  EFI_FORM_ID              FormId;\r
+} EFI_IFR_REF;\r
+\r
+typedef struct _EFI_IFR_REF2 {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_IFR_QUESTION_HEADER  Question;\r
+  EFI_FORM_ID              FormId;\r
+  EFI_QUESTION_ID          QuestionId;\r
+} EFI_IFR_REF2;\r
+\r
+typedef struct _EFI_IFR_REF3 {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_IFR_QUESTION_HEADER  Question;\r
+  EFI_FORM_ID              FormId;\r
+  EFI_QUESTION_ID          QuestionId;\r
+  EFI_GUID                 FormSetId;\r
+} EFI_IFR_REF3;\r
+\r
+typedef struct _EFI_IFR_REF4 {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_IFR_QUESTION_HEADER  Question;\r
+  EFI_FORM_ID              FormId;\r
+  EFI_QUESTION_ID          QuestionId;\r
+  EFI_GUID                 FormSetId;\r
+  EFI_STRING_ID            DevicePath;\r
+} EFI_IFR_REF4;\r
+\r
+typedef struct _EFI_IFR_RESET_BUTTON {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_IFR_QUESTION_HEADER  Question;\r
+  EFI_DEFAULT_ID           DefaultId;\r
+} EFI_IFR_RESET_BUTTON;\r
+\r
+typedef struct _EFI_IFR_ACTION {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_IFR_QUESTION_HEADER  Question;\r
+  EFI_STRING_ID            QuestionConfig;\r
+} EFI_IFR_ACTION;\r
+\r
+typedef struct _EFI_IFR_ACTION_1 {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_IFR_QUESTION_HEADER  Question;\r
+} EFI_IFR_ACTION_1;\r
+\r
+typedef struct _EFI_IFR_DATE {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_IFR_QUESTION_HEADER  Question;\r
+  UINT8                    Flags;\r
 } EFI_IFR_DATE;\r
 \r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-  UINT16            QuestionId;   // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name\r
-  UINT8             Width;        // The Size of the Data being saved -- BUGBUG -- remove someday\r
-  STRING_REF        Prompt;       // The String Token for the Prompt\r
-  STRING_REF        Help;         // The string Token for the context-help\r
-  UINT8             Flags;        // This is included solely for purposes of interactive/dynamic support.\r
-  UINT16            Key;          // Value to be passed to caller to identify this particular op-code\r
-  UINT8             MinSize;      // Minimum allowable sized password\r
-  UINT8             MaxSize;      // Maximum allowable sized password\r
-  UINT16            Encoding;\r
-} EFI_IFR_PASSWORD;\r
+#define EFI_QF_DATE_YEAR_SUPPRESS      0x01\r
+#define EFI_QF_DATE_MONTH_SUPPRESS     0x02\r
+#define EFI_QF_DATE_DAY_SUPPRESS       0x04\r
 \r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-  UINT16            QuestionId;   // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name\r
-  UINT8             Width;        // The Size of the Data being saved -- BUGBUG -- remove someday\r
-  STRING_REF        Prompt;       // The String Token for the Prompt\r
-  STRING_REF        Help;         // The string Token for the context-help\r
-  UINT8             Flags;        // This is included solely for purposes of interactive/dynamic support.\r
-  UINT16            Key;          // Value to be passed to caller to identify this particular op-code\r
-  UINT8             MinSize;      // Minimum allowable sized password\r
-  UINT8             MaxSize;      // Maximum allowable sized password\r
+#define EFI_QF_DATE_STORAGE            0x30\r
+#define     QF_DATE_STORAGE_NORMAL     0x00\r
+#define     QF_DATE_STORAGE_TIME       0x10\r
+#define     QF_DATE_STORAGE_WAKEUP     0x20\r
+\r
+typedef union {\r
+  struct {\r
+    UINT8 MinValue;\r
+    UINT8 MaxValue;\r
+    UINT8 Step;\r
+  } u8;\r
+  struct {\r
+    UINT16 MinValue;\r
+    UINT16 MaxValue;\r
+    UINT16 Step;\r
+  } u16;\r
+  struct {\r
+    UINT32 MinValue;\r
+    UINT32 MaxValue;\r
+    UINT32 Step;\r
+  } u32;\r
+  struct {\r
+    UINT64 MinValue;\r
+    UINT64 MaxValue;\r
+    UINT64 Step;\r
+  } u64;\r
+} MINMAXSTEP_DATA;\r
+\r
+typedef struct _EFI_IFR_NUMERIC {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_IFR_QUESTION_HEADER  Question;\r
+  UINT8                    Flags;\r
+  MINMAXSTEP_DATA          data;\r
+} EFI_IFR_NUMERIC;\r
+\r
+#define EFI_IFR_NUMERIC_SIZE           0x03\r
+#define EFI_IFR_NUMERIC_SIZE_1         0x00\r
+#define EFI_IFR_NUMERIC_SIZE_2         0x01\r
+#define EFI_IFR_NUMERIC_SIZE_4         0x02\r
+#define EFI_IFR_NUMERIC_SIZE_8         0x03\r
+\r
+#define EFI_IFR_DISPLAY                0x30\r
+#define EFI_IFR_DISPLAY_INT_DEC        0x00\r
+#define EFI_IFR_DISPLAY_UINT_DEC       0x10\r
+#define EFI_IFR_DISPLAY_UINT_HEX       0x20\r
+\r
+typedef struct _EFI_IFR_ONE_OF {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_IFR_QUESTION_HEADER  Question;\r
+  UINT8                    Flags;\r
+  MINMAXSTEP_DATA          data;\r
+} EFI_IFR_ONE_OF;\r
+\r
+typedef struct _EFI_IFR_STRING {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_IFR_QUESTION_HEADER  Question;\r
+  UINT8                    MinSize;\r
+  UINT8                    MaxSize;\r
+  UINT8                    Flags;\r
 } EFI_IFR_STRING;\r
 \r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-} EFI_IFR_END_ONE_OF;\r
+#define EFI_IFR_STRING_MULTI_LINE      0x01\r
 \r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-  UINT16            Value;\r
-  UINT16            Key;\r
-} EFI_IFR_HIDDEN;\r
+typedef struct _EFI_IFR_PASSWORD {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_IFR_QUESTION_HEADER  Question;\r
+  UINT16                   MinSize;\r
+  UINT16                   MaxSize;\r
+} EFI_IFR_PASSWORD;\r
 \r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-  UINT8             Flags;\r
-} EFI_IFR_SUPPRESS;\r
+typedef struct _EFI_IFR_ORDERED_LIST {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_IFR_QUESTION_HEADER  Question;\r
+  UINT8                    MaxContainers;\r
+  UINT8                    Flags;\r
+} EFI_IFR_ORDERED_LIST;\r
 \r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-  UINT8             Flags;\r
-} EFI_IFR_GRAY_OUT;\r
+#define EFI_IFR_UNIQUE_SET             0x01\r
+#define EFI_IFR_NO_EMPTY_SET           0x02\r
 \r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-  STRING_REF        Popup;\r
-  UINT8             Flags;\r
-} EFI_IFR_INCONSISTENT;\r
+typedef struct _EFI_IFR_TIME {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_IFR_QUESTION_HEADER  Question;\r
+  UINT8                    Flags;\r
+} EFI_IFR_TIME;\r
 \r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-  UINT16            QuestionId;   // offset into variable storage\r
-  UINT8             Width;        // size of variable storage\r
-  UINT16            Value;        // value to compare against\r
+#define QF_TIME_HOUR_SUPPRESS          0x01\r
+#define QF_TIME_MINUTE_SUPPRESS        0x02\r
+#define QF_TIME_SECOND_SUPPRESS        0x04\r
+\r
+#define QF_TIME_STORAGE                0x30\r
+#define QF_TIME_STORAGE_NORMAL         0x00\r
+#define QF_TIME_STORAGE_TIME           0x10\r
+#define QF_TIME_STORAGE_WAKEUP         0x20\r
+\r
+typedef struct _EFI_IFR_DISABLE_IF {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_DISABLE_IF;\r
+\r
+typedef struct _EFI_IFR_SUPPRESS_IF {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_SUPPRESS_IF;\r
+\r
+typedef struct _EFI_IFR_GRAY_OUT_IF {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_GRAY_OUT_IF;\r
+\r
+typedef struct _EFI_IFR_INCONSISTENT_IF {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_STRING_ID            Error;\r
+} EFI_IFR_INCONSISTENT_IF;\r
+\r
+typedef struct _EFI_IFR_NO_SUBMIT_IF {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_STRING_ID            Error;\r
+} EFI_IFR_NO_SUBMIT_IF;\r
+\r
+typedef struct _EFI_IFR_REFRESH {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  UINT8                    RefreshInterval;\r
+} EFI_IFR_REFRESH;\r
+\r
+typedef struct _EFI_IFR_VARSTORE_DEVICE {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_STRING_ID            DevicePath;\r
+} EFI_IFR_VARSTORE_DEVICE;\r
+\r
+typedef struct _EFI_IFR_ONE_OF_OPTION {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_STRING_ID            Option;\r
+  UINT8                    Flags;\r
+  UINT8                    Type;\r
+  EFI_IFR_TYPE_VALUE       Value;\r
+} EFI_IFR_ONE_OF_OPTION;\r
+\r
+#define EFI_IFR_TYPE_NUM_SIZE_8        0x00\r
+#define EFI_IFR_TYPE_NUM_SIZE_16       0x01\r
+#define EFI_IFR_TYPE_NUM_SIZE_32       0x02\r
+#define EFI_IFR_TYPE_NUM_SIZE_64       0x03\r
+#define EFI_IFR_TYPE_BOOLEAN           0x04\r
+#define EFI_IFR_TYPE_TIME              0x05\r
+#define EFI_IFR_TYPE_DATE              0x06\r
+#define EFI_IFR_TYPE_STRING            0x07\r
+#define EFI_IFR_TYPE_OTHER             0x08\r
+\r
+#define EFI_IFR_OPTION_DEFAULT         0x10\r
+#define EFI_IFR_OPTION_DEFAULT_MFG     0x20\r
+\r
+typedef struct _EFI_IFR_GUID {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_GUID                 Guid;\r
+  //Optional Data Follows\r
+} EFI_IFR_GUID;\r
+\r
+typedef struct _EFI_IFR_DUP {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_DUP;\r
+\r
+typedef struct _EFI_IFR_EQ_ID_ID {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_QUESTION_ID          QuestionId1;\r
+  EFI_QUESTION_ID          QuestionId2;\r
+} EFI_IFR_EQ_ID_ID;\r
+\r
+typedef struct _EFI_IFR_EQ_ID_VAL {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_QUESTION_ID          QuestionId;\r
+  UINT16                   Value;\r
 } EFI_IFR_EQ_ID_VAL;\r
 \r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-  UINT16            QuestionId;   // offset into variable storage\r
-  UINT8             Width;        // size of variable storage\r
-  UINT16            ListLength;\r
-  UINT16            ValueList[1];\r
+typedef struct _EFI_IFR_EQ_ID_LIST {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_QUESTION_ID          QuestionId;\r
+  UINT16                   ListLength;\r
+  UINT16                   ValueList[1];\r
 } EFI_IFR_EQ_ID_LIST;\r
 \r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-  UINT16            QuestionId1;  // offset into variable storage for first value to compare\r
-  UINT8             Width;        // size of variable storage (must be same for both)\r
-  UINT16            QuestionId2;  // offset into variable storage for second value to compare\r
-} EFI_IFR_EQ_ID_ID;\r
+typedef struct _EFI_IFR_QUESTION_REF1 {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_QUESTION_ID          QuestionId;\r
+} EFI_IFR_QUESTION_REF1;\r
 \r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-  UINT16            VariableId;   // offset into variable storage\r
-  UINT16            Value;        // value to compare against\r
-} EFI_IFR_EQ_VAR_VAL;\r
+typedef struct _EFI_IFR_UINT8 {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  UINT8 Value;\r
+} EFI_IFR_UINT8;\r
 \r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
+typedef struct _EFI_IFR_UINT16 {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  UINT16                   Value;\r
+} EFI_IFR_UINT16;\r
+\r
+typedef struct _EFI_IFR_QUESTION_REF2 {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_QUESTION_REF2;\r
+\r
+typedef struct _EFI_IFR_UINT32 {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  UINT32                   Value;\r
+} EFI_IFR_UINT32;\r
+\r
+typedef struct _EFI_IFR_UINT64 {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  UINT64 Value;\r
+} EFI_IFR_UINT64;\r
+\r
+typedef struct _EFI_IFR_QUESTION_REF3 {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_QUESTION_REF3;\r
+\r
+typedef struct _EFI_IFR_QUESTION_REF3_2 {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_STRING_ID            DevicePath;\r
+} EFI_IFR_QUESTION_REF3_2;\r
+\r
+typedef struct _EFI_IFR_QUESTION_REF3_3 {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_STRING_ID            DevicePath;\r
+  EFI_GUID                 Guid;\r
+} EFI_IFR_QUESTION_REF3_3;\r
+\r
+typedef struct _EFI_IFR_RULE_REF {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  UINT8                    RuleId;\r
+} EFI_IFR_RULE_REF;\r
+\r
+typedef struct _EFI_IFR_STRING_REF1 {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  EFI_STRING_ID            StringId;\r
+} EFI_IFR_STRING_REF1;\r
+\r
+typedef struct _EFI_IFR_STRING_REF2 {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_STRING_REF2;\r
+\r
+typedef struct _EFI_IFR_THIS {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_THIS;\r
+\r
+typedef struct _EFI_IFR_TRUE {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_TRUE;\r
+\r
+typedef struct _EFI_IFR_FALSE {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_FALSE;\r
+\r
+typedef struct _EFI_IFR_ONE {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_ONE;\r
+\r
+typedef struct _EFI_IFR_ONES {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_ONES;\r
+\r
+typedef struct _EFI_IFR_ZERO {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_ZERO;\r
+\r
+typedef struct _EFI_IFR_UNDEFINED {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_UNDEFINED;\r
+\r
+typedef struct _EFI_IFR_VERSION {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_VERSION;\r
+\r
+typedef struct _EFI_IFR_LENGTH {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_LENGTH;\r
+\r
+typedef struct _EFI_IFR_NOT {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_NOT;\r
+\r
+typedef struct _EFI_IFR_BITWISE_NOT {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_BITWISE_NOT;\r
+\r
+typedef struct _EFI_IFR_TO_BOOLEAN {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_TO_BOOLEAN;\r
+\r
+#define EFI_IFR_STRING_UNSIGNED_DEC      0\r
+#define EFI_IFR_STRING_SIGNED_DEC        1\r
+#define EFI_IFR_STRING_LOWERCASE_HEX     2\r
+#define EFI_IFR_STRING_UPPERCASE_HEX     3\r
+\r
+#define EFI_IFR_STRING_ASCII             0\r
+#define EFI_IFR_STRING_UNICODE           8\r
+\r
+typedef struct _EFI_IFR_TO_STRING {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  UINT8                    Format;\r
+} EFI_IFR_TO_STRING;\r
+\r
+typedef struct _EFI_IFR_TO_UINT {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_TO_UINT;\r
+\r
+typedef struct _EFI_IFR_TO_UPPER {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_TO_UPPER;\r
+\r
+typedef struct _EFI_IFR_TO_LOWER {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_TO_LOWER;\r
+\r
+typedef struct _EFI_IFR_ADD {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_ADD;\r
+\r
+typedef struct _EFI_IFR_AND {\r
+  EFI_IFR_OP_HEADER        Header;\r
 } EFI_IFR_AND;\r
 \r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
+typedef struct _EFI_IFR_BITWISE_AND {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_BITWISE_AND;\r
+\r
+typedef struct _EFI_IFR_BITWISE_OR {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_BITWISE_OR;\r
+\r
+typedef struct _EFI_IFR_CATENATE {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_CATENATE;\r
+\r
+typedef struct _EFI_IFR_DIVIDE {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_DIVIDE;\r
+\r
+typedef struct _EFI_IFR_EQUAL {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_EQUAL;\r
+\r
+typedef struct _EFI_IFR_GREATER_EQUAL {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_GREATER_EQUAL;\r
+\r
+typedef struct _EFI_IFR_GREATER_THAN {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_GREATER_THAN;\r
+\r
+typedef struct _EFI_IFR_LESS_EQUAL {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_LESS_EQUAL;\r
+\r
+typedef struct _EFI_IFR_LESS_THAN {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_LESS_THAN;\r
+\r
+typedef struct _EFI_IFR_MATCH {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_MATCH;\r
+\r
+typedef struct _EFI_IFR_MULTIPLY {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_MULTIPLY;\r
+\r
+typedef struct _EFI_IFR_MODULO {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_MODULO;\r
+\r
+typedef struct _EFI_IFR_NOT_EQUAL {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_NOT_EQUAL;\r
+\r
+typedef struct _EFI_IFR_OR {\r
+  EFI_IFR_OP_HEADER        Header;\r
 } EFI_IFR_OR;\r
 \r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-} EFI_IFR_NOT;\r
+typedef struct _EFI_IFR_SHIFT_LEFT {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_SHIFT_LEFT;\r
 \r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-} EFI_IFR_END_EXPR, EFI_IFR_END_IF;\r
+typedef struct _EFI_IFR_SHIFT_RIGHT {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_SHIFT_RIGHT;\r
 \r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-  UINT16            FormId;\r
-  STRING_REF        Prompt;\r
-  STRING_REF        Help;\r
-  UINT8             Flags;\r
-  UINT16            Key;\r
-} EFI_IFR_SAVE_DEFAULTS;\r
+typedef struct _EFI_IFR_SUBTRACT {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_SUBTRACT;\r
 \r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-  STRING_REF        Help;\r
-  STRING_REF        Text;\r
-  STRING_REF        TextTwo;      // optional text\r
-} EFI_IFR_INVENTORY;\r
+typedef struct _EFI_IFR_CONDITIONAL {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_CONDITIONAL;\r
 \r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-  EFI_GUID          Guid;         // GUID for the variable\r
-  UINT16            VarId;        // variable store ID, as referenced elsewhere in the form\r
-  UINT16            Size;         // size of the variable storage\r
-} EFI_IFR_VARSTORE;\r
+#define EFI_IFR_FF_CASE_SENSITIVE    0x00\r
+#define EFI_IFR_FF_CASE_INSENSITIVE  0x01\r
 \r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-  UINT16            VarId;        // variable store ID, as referenced elsewhere in the form\r
-} EFI_IFR_VARSTORE_SELECT;\r
+typedef struct _EFI_IFR_FIND {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  UINT8                    Format;\r
+} EFI_IFR_FIND;\r
+\r
+typedef struct _EFI_IFR_MID {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_MID;\r
+\r
+typedef struct _EFI_IFR_TOKEN {\r
+  EFI_IFR_OP_HEADER        Header;\r
+} EFI_IFR_TOKEN;\r
+\r
+#define EFI_IFR_FLAGS_FIRST_MATCHING     0x00\r
+#define EFI_IFR_FLAGS_FIRST_NON_MATCHING 0x01\r
+\r
+typedef struct _EFI_IFR_SPAN {\r
+  EFI_IFR_OP_HEADER        Header;\r
+  UINT8                    Flags;\r
+} EFI_IFR_SPAN;\r
 \r
 //\r
-// Used for the ideqid VFR statement where two variable stores may be referenced in the\r
-// same VFR statement.\r
-// A browser should treat this as an EFI_IFR_VARSTORE_SELECT statement and assume that all following\r
-// IFR opcodes use the VarId as defined here.\r
+// Keyboard Package\r
 //\r
+\r
+typedef enum {    \r
+  EfiKeyLCtrl,\r
+  EfiKeyA0, \r
+  EfiKeyLAlt,\r
+  EfiKeySpaceBar,\r
+  EfiKeyA2,\r
+  EfiKeyA3,\r
+  EfiKeyA4,\r
+  EfiKeyRCtrl,\r
+  EfiKeyLeftArrow,\r
+  EfiKeyDownArrow,\r
+  EfiKeyRightArrow,\r
+  EfiKeyZero,\r
+  EfiKeyPeriod,\r
+  EfiKeyEnter,\r
+  EfiKeyLShift,\r
+  EfiKeyB0,\r
+  EfiKeyB1,\r
+  EfiKeyB2,\r
+  EfiKeyB3,\r
+  EfiKeyB4,\r
+  EfiKeyB5,\r
+  EfiKeyB6,\r
+  EfiKeyB7,\r
+  EfiKeyB8,\r
+  EfiKeyB9,\r
+  EfiKeyB10,\r
+  EfiKeyRshift,\r
+  EfiKeyUpArrow,\r
+  EfiKeyOne,\r
+  EfiKeyTwo,\r
+  EfiKeyThree,\r
+  EfiKeyCapsLock,\r
+  EfiKeyC1,\r
+  EfiKeyC2,\r
+  EfiKeyC3,\r
+  EfiKeyC4,\r
+  EfiKeyC5,\r
+  EfiKeyC6,\r
+  EfiKeyC7,\r
+  EfiKeyC8,\r
+  EfiKeyC9,\r
+  EfiKeyC10,\r
+  EfiKeyC11,\r
+  EfiKeyC12,\r
+  EfiKeyFour,\r
+  EfiKeyFive,\r
+  EfiKeySix,\r
+  EfiKeyPlus,\r
+  EfiKeyTab,\r
+  EfiKeyD1,\r
+  EfiKeyD2,\r
+  EfiKeyD3,\r
+  EfiKeyD4,\r
+  EfiKeyD5,\r
+  EfiKeyD6,\r
+  EfiKeyD7,\r
+  EfiKeyD8,\r
+  EfiKeyD9,\r
+  EfiKeyD10,\r
+  EfiKeyD11,\r
+  EfiKeyD12,\r
+  EfiKeyD13,\r
+  EfiKeyDel,\r
+  EfiKeyEnd,\r
+  EfiKeyPgDn,\r
+  EfiKeySeven,\r
+  EfiKeyEight,\r
+  EfiKeyNine,\r
+  EfiKeyE0,\r
+  EfiKeyE1,\r
+  EfiKeyE2,\r
+  EfiKeyE3,\r
+  EfiKeyE4,\r
+  EfiKeyE5,\r
+  EfiKeyE6,\r
+  EfiKeyE7,\r
+  EfiKeyE8,\r
+  EfiKeyE9,\r
+  EfiKeyE10,\r
+  EfiKeyE11,\r
+  EfiKeyE12,\r
+  EfiKeyBackSpace,\r
+  EfiKeyIns,\r
+  EfiKeyHome,\r
+  EfiKeyPgUp,\r
+  EfiKeyNLck,\r
+  EfiKeySlash,\r
+  EfiKeyAsterisk,\r
+  EfiKeyMinus,\r
+  EfiKeyEsc,\r
+  EfiKeyF1,\r
+  EfiKeyF2,\r
+  EfiKeyF3,\r
+  EfiKeyF4,\r
+  EfiKeyF5,\r
+  EfiKeyF6,\r
+  EfiKeyF7,\r
+  EfiKeyF8,\r
+  EfiKeyF9,\r
+  EfiKeyF10,\r
+  EfiKeyF11,\r
+  EfiKeyF12,\r
+  EfiKeyPrint,\r
+  EfiKeySLck,\r
+  EfiKeyPause\r
+} EFI_KEY;\r
+\r
 typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-  UINT16            VarId;          // variable store ID, as referenced elsewhere in the form\r
-  UINT16            SecondaryVarId; // variable store ID, as referenced elsewhere in the form\r
-} EFI_IFR_VARSTORE_SELECT_PAIR;\r
+  EFI_KEY                 Key;\r
+  CHAR16                  Unicode;\r
+  CHAR16                  ShiftedUnicode;\r
+  CHAR16                  AltGrUnicode;\r
+  CHAR16                  ShiftedAltGrUnicode;\r
+  UINT16                  Modifier;\r
+  UINT16                  AffectedAttribute;\r
+} EFI_KEY_DESCRIPTOR;\r
+\r
+//\r
+// A key which is affected by all the standard shift modifiers.  \r
+// Most keys would be expected to have this bit active.\r
+//\r
+#define EFI_AFFECTED_BY_STANDARD_SHIFT       0x0001\r
+//\r
+// This key is affected by the caps lock so that if a keyboard driver\r
+// would need to disambiguate between a key which had a Â¡Â°1¡± defined\r
+// versus a Â¡Â°a¡± character.  Having this bit turned on would tell\r
+// the keyboard driver to use the appropriate shifted state or not.\r
+//\r
+#define EFI_AFFECTED_BY_CAPS_LOCK            0x0002\r
+//\r
+// Similar to the case of CAPS lock, if this bit is active, the key\r
+// is affected by the num lock being turned on.\r
+//\r
+#define EFI_AFFECTED_BY_NUM_LOCK             0x0004\r
 \r
 typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-} EFI_IFR_TRUE;\r
+  UINT16                  LayoutLength;\r
+  EFI_GUID                Guid;\r
+  UINT32                  LayoutDescriptorStringOffset;\r
+  UINT8                   DescriptorCount;\r
+  // EFI_KEY_DESCRIPTOR    Descriptors[];\r
+} EFI_HII_KEYBOARD_LAYOUT;\r
 \r
 typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-} EFI_IFR_FALSE;\r
+  EFI_HII_PACKAGE_HEADER  Header;\r
+  UINT16                  LayoutCount;\r
+  // EFI_HII_KEYBOARD_LAYOUT Layout[];\r
+} EFI_HII_KEYBOARD_PACKAGE_HDR;\r
 \r
 typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-} EFI_IFR_GT;\r
+  CHAR16                  Language[3];\r
+  CHAR16                  Space;\r
+  CHAR16                  DescriptionString[1];\r
+} EFI_DESCRIPTION_STRING;\r
 \r
 typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-} EFI_IFR_GE;\r
+  UINT16                  DescriptionCount;\r
+  EFI_DESCRIPTION_STRING  DescriptionString[1];\r
+} EFI_DESCRIPTION_STRING_BUNDLE;\r
 \r
 //\r
-// Save defaults and restore defaults have same structure\r
+// Modifier values\r
 //\r
-#define EFI_IFR_RESTORE_DEFAULTS  EFI_IFR_SAVE_DEFAULTS\r
+#define EFI_NULL_MODIFIER                0x0000\r
+#define EFI_LEFT_CONTROL_MODIFIER        0x0001\r
+#define EFI_RIGHT_CONTROL_MODIFIER       0x0002\r
+#define EFI_LEFT_ALT_MODIFIER            0x0003\r
+#define EFI_RIGHT_ALT_MODIFIER           0x0004\r
+#define EFI_ALT_GR_MODIFIER              0x0005\r
+#define EFI_INSERT_MODIFIER              0x0006\r
+#define EFI_DELETE_MODIFIER              0x0007\r
+#define EFI_PAGE_DOWN_MODIFIER           0x0008\r
+#define EFI_PAGE_UP_MODIFIER             0x0009\r
+#define EFI_HOME_MODIFIER                0x000A\r
+#define EFI_END_MODIFIER                 0x000B\r
+#define EFI_LEFT_SHIFT_MODIFIER          0x000C\r
+#define EFI_RIGHT_SHIFT_MODIFIER         0x000D\r
+#define EFI_CAPS_LOCK_MODIFIER           0x000E\r
+#define EFI_NUM_LOCK _MODIFIER           0x000F\r
+#define EFI_LEFT_ARROW_MODIFIER          0x0010\r
+#define EFI_RIGHT_ARROW_MODIFIER         0x0011\r
+#define EFI_DOWN_ARROW_MODIFIER          0x0012\r
+#define EFI_UP_ARROW_MODIFIER            0x0013\r
+#define EFI_NS_KEY_MODIFIER              0x0014\r
+#define EFI_NS_KEY_DEPENDENCY_MODIFIER   0x0015\r
+#define EFI_FUNCTION_KEY_ONE_MODIFIER    0x0016\r
+#define EFI_FUNCTION_KEY_TWO_MODIFIER    0x0017\r
+#define EFI_FUNCTION_KEY_THREE_MODIFIER  0x0018\r
+#define EFI_FUNCTION_KEY_FOUR_MODIFIER   0x0019\r
+#define EFI_FUNCTION_KEY_FIVE_MODIFIER   0x001A\r
+#define EFI_FUNCTION_KEY_SIX_MODIFIER    0x001B\r
+#define EFI_FUNCTION_KEY_SEVEN_MODIFIER  0x001C\r
+#define EFI_FUNCTION_KEY_EIGHT_MODIFIER  0x001D\r
+#define EFI_FUNCTION_KEY_NINE_MODIFIER   0x001E\r
+#define EFI_FUNCTION_KEY_TEN_MODIFIER    0x001F\r
+#define EFI_FUNCTION_KEY_ELEVEN_MODIFIER 0x0020\r
+#define EFI_FUNCTION_KEY_TWELVE_MODIFIER 0x0021\r
 \r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-  STRING_REF        Title;        // The string token for the banner title\r
-  UINT16            LineNumber;   // 1-based line number\r
-  UINT8             Alignment;    // left, center, or right-aligned\r
-} EFI_IFR_BANNER;\r
-\r
-#define EFI_IFR_BANNER_ALIGN_LEFT   0\r
-#define EFI_IFR_BANNER_ALIGN_CENTER 1\r
-#define EFI_IFR_BANNER_ALIGN_RIGHT  2\r
-#define EFI_IFR_BANNER_TIMEOUT      0xFF\r
+//\r
+// Keys that have multiple control functions based on modifier\r
+// settings are handled in the keyboard driver implementation.\r
+// For instance PRINT_KEY might have a modifier held down and\r
+// is still a nonprinting character, but might have an alternate\r
+// control function like SYSREQUEST\r
+//\r
+#define EFI_PRINT_MODIFIER               0x0022\r
+#define EFI_SYS_REQUEST_MODIFIER         0x0023\r
+#define EFI_SCROLL_LOCK_MODIFIER         0x0024\r
+#define EFI_PAUSE_MODIFIER               0x0025\r
+#define EFI_BREAK_MODIFIER               0x0026\r
 \r
 #pragma pack()\r
 \r
index 3e04bb1cba1efc20e6f746e3594e5ec700e4f72a..773797a291151f032cdb49a7e488525d72ad735d 100644 (file)
@@ -1077,3 +1077,17 @@ FreeAlignedPool (
   Status = gBS->FreePool (RawAddress);\r
   ASSERT_EFI_ERROR (Status);\r
 }\r
+\r
+\r
+VOID\r
+EFIAPI\r
+SafeFreePool (\r
+  IN VOID   *Buffer\r
+  )\r
+{\r
+  if (Buffer != NULL) {\r
+    FreePool (Buffer);\r
+    Buffer = NULL;\r
+  }\r
+}\r
+\r
index 6cc5e764e9ec33259da7e9125c9b32577a29a5c5..ef86f5da24832fa54cd3be11a359cd255f0d232a 100644 (file)
 \r
 #include <PiDxe.h>\r
 \r
+#include <Protocol/HiiDatabase.h>\r
+#include <Protocol/HiiString.h>\r
+#include <Protocol/DevicePath.h>\r
+\r
+#include <Guid/GlobalVariable.h>\r
+\r
+#include <Library/BaseLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
 #include <Library/HiiLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/UefiRuntimeServicesTableLib.h>\r
+#include <Library/PcdLib.h>\r
+\r
+#include <MdeModuleHii.h>\r
+\r
+#include "InternalHiiLib.h"\r
+\r
+\r
+EFI_HII_DATABASE_PROTOCOL   *mHiiDatabaseProt;\r
+EFI_HII_STRING_PROTOCOL     *mHiiStringProt;\r
+\r
+//\r
+// Hii vendor device path template\r
+//\r
+HII_VENDOR_DEVICE_PATH  mHiiVendorDevicePathTemplate = {\r
+  {\r
+    {\r
+      {\r
+        HARDWARE_DEVICE_PATH,\r
+        HW_VENDOR_DP,\r
+        {\r
+          (UINT8) (sizeof (HII_VENDOR_DEVICE_PATH_NODE)),\r
+          (UINT8) ((sizeof (HII_VENDOR_DEVICE_PATH_NODE)) >> 8)\r
+        }\r
+      },\r
+      EFI_IFR_TIANO_GUID\r
+    },\r
+    0\r
+  },\r
+  {\r
+    END_DEVICE_PATH_TYPE,\r
+    END_ENTIRE_DEVICE_PATH_SUBTYPE,\r
+    { \r
+      END_DEVICE_PATH_LENGTH\r
+    }\r
+  }\r
+};\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+UefiHiiLibConstructor (\r
+  IN EFI_HANDLE           ImageHandle,\r
+  IN EFI_SYSTEM_TABLE     *SystemTable\r
+  )\r
+{\r
+  EFI_STATUS Status;\r
+  \r
+  Status = gBS->LocateProtocol (\r
+      &gEfiHiiDatabaseProtocolGuid,\r
+      NULL,\r
+      (VOID **) &mHiiDatabaseProt\r
+    );\r
+  ASSERT_EFI_ERROR (Status);\r
+  ASSERT (mHiiDatabaseProt != NULL);\r
+\r
+  Status = gBS->LocateProtocol (\r
+      &gEfiHiiStringProtocolGuid,\r
+      NULL,\r
+      (VOID **) &mHiiStringProt\r
+    );\r
+  ASSERT_EFI_ERROR (Status);\r
+  ASSERT (mHiiStringProt != NULL);\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+EFI_STATUS\r
+HiiLibGetCurrentLanguage (\r
+  OUT     CHAR8               *Lang\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+  Determine what is the current language setting\r
+\r
+Arguments:\r
+  Lang      - Pointer of system language\r
+\r
+Returns:\r
+  Status code\r
+\r
+--*/\r
+{\r
+  EFI_STATUS  Status;\r
+  UINTN       Size;\r
+\r
+  //\r
+  // Get current language setting\r
+  //\r
+  Size = RFC_3066_ENTRY_SIZE;\r
+  Status = gRT->GetVariable (\r
+                  L"PlatformLang",\r
+                  &gEfiGlobalVariableGuid,\r
+                  NULL,\r
+                  &Size,\r
+                  Lang\r
+                  );\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    AsciiStrCpy (Lang, (CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLang));\r
+  }\r
+\r
+  return Status;\r
+}\r
+\r
+VOID\r
+HiiLibGetNextLanguage (\r
+  IN OUT CHAR8      **LangCode,\r
+  OUT CHAR8         *Lang\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+  Get next language from language code list (with separator ';').\r
+\r
+Arguments:\r
+  LangCode - On input: point to first language in the list. On output: point to\r
+             next language in the list, or NULL if no more language in the list.\r
+  Lang     - The first language in the list.\r
+\r
+Returns:\r
+  None.\r
+\r
+--*/\r
+{\r
+  UINTN  Index;\r
+  CHAR8  *StringPtr;\r
+\r
+  if (LangCode == NULL || *LangCode == NULL) {\r
+    *Lang = 0;\r
+    return;\r
+  }\r
+\r
+  Index = 0;\r
+  StringPtr = *LangCode;\r
+  while (StringPtr[Index] != 0 && StringPtr[Index] != ';') {\r
+    Index++;\r
+  }\r
+\r
+  CopyMem (Lang, StringPtr, Index);\r
+  Lang[Index] = 0;\r
+\r
+  if (StringPtr[Index] == ';') {\r
+    Index++;\r
+  }\r
+  *LangCode = StringPtr + Index;\r
+}\r
+\r
+CHAR8 *\r
+HiiLibGetSupportedLanguages (\r
+  IN EFI_HII_HANDLE           HiiHandle\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+  This function returns the list of supported languages, in the format specified\r
+  in UEFI specification Appendix M.\r
+\r
+Arguments:\r
+  HiiHandle  - The HII package list handle.\r
+\r
+Returns:\r
+  The supported languages.\r
+\r
+--*/\r
+{\r
+  EFI_STATUS  Status;\r
+  UINTN       BufferSize;\r
+  CHAR8       *LanguageString;\r
+\r
+  //\r
+  // Collect current supported Languages for given HII handle\r
+  //\r
+  BufferSize = 0x1000;\r
+  LanguageString = AllocatePool (BufferSize);\r
+  Status = mHiiStringProt->GetLanguages (mHiiStringProt, HiiHandle, LanguageString, &BufferSize);\r
+  if (Status == EFI_BUFFER_TOO_SMALL) {\r
+    gBS->FreePool (LanguageString);\r
+    LanguageString = AllocatePool (BufferSize);\r
+    Status = mHiiStringProt->GetLanguages (mHiiStringProt, HiiHandle, LanguageString, &BufferSize);\r
+  }\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    LanguageString = NULL;\r
+  }\r
+\r
+  return LanguageString;\r
+}\r
+\r
+UINT16\r
+HiiLibGetSupportedLanguageNumber (\r
+  IN EFI_HII_HANDLE           HiiHandle\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+  This function returns the number of supported languages\r
+\r
+Arguments:\r
+  HiiHandle  - The HII package list handle.\r
+\r
+Returns:\r
+  The  number of supported languages.\r
+\r
+--*/\r
+{\r
+  CHAR8   *Languages;\r
+  CHAR8   *LanguageString;\r
+  UINT16  LangNumber;\r
+  CHAR8   Lang[RFC_3066_ENTRY_SIZE];\r
+\r
+  Languages = HiiLibGetSupportedLanguages (HiiHandle);\r
+  if (Languages == NULL) {\r
+    return 0;\r
+  }\r
+\r
+  LangNumber = 0;\r
+  LanguageString = Languages;\r
+  while (*LanguageString != 0) {\r
+    HiiLibGetNextLanguage (&LanguageString, Lang);\r
+    LangNumber++;\r
+  }\r
+  gBS->FreePool (Languages);\r
+\r
+  return LangNumber;\r
+}\r
+\r
+\r
+EFI_HII_PACKAGE_LIST_HEADER *\r
+InternalHiiLibPreparePackages (\r
+  IN UINTN           NumberOfPackages,\r
+  IN CONST EFI_GUID  *GuidId, OPTIONAL\r
+  VA_LIST            Marker\r
+  )\r
+{\r
+  EFI_HII_PACKAGE_LIST_HEADER *PackageListHeader;\r
+  UINT8                       *PackageListData;\r
+  UINT32                      PackageListLength;\r
+  UINT32                      PackageLength;\r
+  EFI_HII_PACKAGE_HEADER      PackageHeader;\r
+  UINT8                       *PackageArray;\r
+  UINTN                       Index;\r
+  VA_LIST                     MarkerBackup;\r
+\r
+  PackageListLength = sizeof (EFI_HII_PACKAGE_LIST_HEADER);\r
+\r
+  MarkerBackup = Marker;\r
+  \r
+  for (Index = 0; Index < NumberOfPackages; Index++) {\r
+    CopyMem (&PackageLength, VA_ARG (Marker, VOID *), sizeof (UINT32));\r
+    PackageListLength += (PackageLength - sizeof (UINT32));\r
+  }\r
+\r
+  //\r
+  // Include the lenght of EFI_HII_PACKAGE_END\r
+  //\r
+  PackageListLength += sizeof (EFI_HII_PACKAGE_HEADER);\r
+  PackageListHeader = AllocateZeroPool (PackageListLength);\r
+  ASSERT (PackageListHeader != NULL);\r
+  CopyMem (&PackageListHeader->PackageListGuid, GuidId, sizeof (EFI_GUID));\r
+  PackageListHeader->PackageLength = PackageListLength;\r
+\r
+  PackageListData = ((UINT8 *) PackageListHeader) + sizeof (EFI_HII_PACKAGE_LIST_HEADER);\r
+\r
+  Marker = MarkerBackup;\r
+  for (Index = 0; Index < NumberOfPackages; Index++) {\r
+    PackageArray = (UINT8 *) VA_ARG (Marker, VOID *);\r
+    CopyMem (&PackageLength, PackageArray, sizeof (UINT32));\r
+    PackageLength  -= sizeof (UINT32);\r
+    PackageArray += sizeof (UINT32);\r
+    CopyMem (PackageListData, PackageArray, PackageLength);\r
+    PackageListData += PackageLength;\r
+  }\r
+\r
+  //\r
+  // Append EFI_HII_PACKAGE_END\r
+  //\r
+  PackageHeader.Type = EFI_HII_PACKAGE_END;\r
+  PackageHeader.Length = sizeof (EFI_HII_PACKAGE_HEADER);\r
+  CopyMem (PackageListData, &PackageHeader, PackageHeader.Length);\r
+\r
+  return PackageListHeader;\r
+}\r
+\r
+EFI_HII_PACKAGE_LIST_HEADER *\r
+EFIAPI\r
+HiiLibPreparePackageList (\r
+  IN UINTN                    NumberOfPackages,\r
+  IN CONST EFI_GUID           *GuidId,\r
+  ...\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+  Assemble EFI_HII_PACKAGE_LIST according to the passed in packages.\r
+\r
+Arguments:\r
+  NumberOfPackages  -  Number of packages.\r
+  GuidId            -  Package GUID.\r
+\r
+Returns:\r
+  Pointer of EFI_HII_PACKAGE_LIST_HEADER.\r
+\r
+--*/\r
+{\r
+  EFI_HII_PACKAGE_LIST_HEADER *PackageListHeader;\r
+  VA_LIST                     Marker;\r
+\r
+  VA_START (Marker, GuidId);\r
+  PackageListHeader = InternalHiiLibPreparePackages (NumberOfPackages, GuidId, Marker);\r
+  VA_END (Marker);\r
+\r
+  return PackageListHeader;\r
+}\r
+\r
 \r
 /**\r
-  This function allocates pool for an EFI_HII_PACKAGES structure\r
-  with enough space for the variable argument list of package pointers.\r
-  The allocated structure is initialized using NumberOfPackages, Guid,\r
-  and the variable length argument list of package pointers.\r
+  This function allocates pool for an EFI_HII_PACKAGE_LIST structure\r
+  with additional space that is big enough to host all packages described by the variable \r
+  argument list of package pointers.  The allocated structure is initialized using NumberOfPackages, \r
+  GuidId,  and the variable length argument list of package pointers.\r
 \r
-  @param  NumberOfPackages The number of HII packages to prepare.\r
-  @param  Guid Package GUID.\r
+  Then, EFI_HII_PACKAGE_LIST will be register to the default System HII Database. The\r
+  Handle to the newly registered Package List is returned throught HiiHandle.\r
 \r
-  @return The allocated and initialized packages.\r
+  @param  NumberOfPackages  The number of HII packages to register.\r
+  @param  GuidId                    Package List GUID ID.\r
+  @param  HiiHandle                The ID used to retrieve the Package List later.\r
+  @param  ...                          The variable argument list describing all HII Package.\r
+\r
+  @return\r
+  The allocated and initialized packages.\r
 \r
 **/\r
-EFI_HII_PACKAGE_LIST_HEADER *\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+HiiLibAddPackagesToHiiDatabase (\r
+  IN       UINTN               NumberOfPackages,\r
+  IN CONST EFI_GUID            *GuidId,\r
+  IN       EFI_HANDLE          DriverHandle, OPTIONAL\r
+  OUT      EFI_HII_HANDLE      *HiiHandle, OPTIONAL\r
+  ...\r
+  )\r
+{\r
+  VA_LIST                   Args;\r
+  EFI_HII_PACKAGE_LIST_HEADER *PackageListHeader;\r
+  EFI_STATUS                Status;\r
+\r
+\r
+  VA_START (Args, HiiHandle);\r
+  PackageListHeader = InternalHiiLibPreparePackages (NumberOfPackages, GuidId, Args);\r
+\r
+  Status      = mHiiDatabaseProt->NewPackageList (mHiiDatabaseProt, PackageListHeader, DriverHandle, HiiHandle);\r
+  if (HiiHandle != NULL) {\r
+    if (EFI_ERROR (Status)) {\r
+      *HiiHandle = NULL;\r
+    }\r
+  }\r
+\r
+  FreePool (PackageListHeader);\r
+  VA_END (Args);\r
+  \r
+  return Status;\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+HiiLibAddFontPackageToHiiDatabase (\r
+  IN       UINTN               FontSize,\r
+  IN CONST UINT8               *FontBinary,\r
+  IN CONST EFI_GUID            *GuidId,\r
+  OUT      EFI_HII_HANDLE      *HiiHandle OPTIONAL\r
+  )\r
+{\r
+  EFI_STATUS                           Status;\r
+  UINT8                                *Location;\r
+  EFI_HII_SIMPLE_FONT_PACKAGE_HDR      *SimplifiedFont;\r
+  UINTN                                PackageLength;\r
+  EFI_HII_PACKAGE_LIST_HEADER          *PackageList;\r
+  UINT8                                *Package;\r
+\r
+  //\r
+  // Add 4 bytes to the header for entire length for PreparePackageList use only.\r
+  // Looks ugly. Might be updated when font tool is ready.\r
+  //\r
+  PackageLength   = sizeof (EFI_HII_SIMPLE_FONT_PACKAGE_HDR) + FontSize + 4;\r
+  Package = AllocateZeroPool (PackageLength);\r
+  if (Package == NULL) {\r
+    return EFI_OUT_OF_RESOURCES;\r
+  }\r
+  CopyMem (Package, &PackageLength, 4);\r
+  SimplifiedFont = (EFI_HII_SIMPLE_FONT_PACKAGE_HDR*) (Package + 4);\r
+  SimplifiedFont->Header.Length        = (UINT32) (PackageLength - 4);\r
+  SimplifiedFont->Header.Type          = EFI_HII_PACKAGE_SIMPLE_FONTS;\r
+  SimplifiedFont->NumberOfNarrowGlyphs = (UINT16) (FontSize / sizeof (EFI_NARROW_GLYPH));\r
+  \r
+  Location = (UINT8 *) (&SimplifiedFont->NumberOfWideGlyphs + 1);\r
+  CopyMem (Location, FontBinary, FontSize);\r
+  \r
+  //\r
+  // Add this simplified font package to a package list then install it.\r
+  //\r
+  PackageList = HiiLibPreparePackageList (1, GuidId, Package);\r
+  Status = mHiiDatabaseProt->NewPackageList (mHiiDatabaseProt, PackageList, NULL, HiiHandle);\r
+  ASSERT_EFI_ERROR (Status);\r
+  SafeFreePool (PackageList);\r
+  SafeFreePool (Package);    \r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+HiiLibRemovePackagesFromHiiDatabase (\r
+  IN      EFI_HII_HANDLE      HiiHandle\r
+  )\r
+{\r
+  return mHiiDatabaseProt->RemovePackageList (mHiiDatabaseProt, HiiHandle);\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+HiiLibCreateString (\r
+  IN  EFI_HII_HANDLE                  PackageList,\r
+  OUT EFI_STRING_ID                   *StringId,\r
+  IN  CONST EFI_STRING                String\r
+  )\r
+{\r
+  EFI_STATUS  Status;\r
+  CHAR8       *Languages;\r
+  CHAR8       *LangStrings;\r
+  CHAR8       Lang[RFC_3066_ENTRY_SIZE];\r
+\r
+  Status = EFI_SUCCESS;\r
+\r
+  Languages = HiiLibGetSupportedLanguages (PackageList);\r
+\r
+  LangStrings = Languages;\r
+  while (*LangStrings != 0) {\r
+    HiiLibGetNextLanguage (&LangStrings, Lang);\r
+\r
+    Status = mHiiStringProt->NewString (\r
+                                 mHiiStringProt,\r
+                                 PackageList,\r
+                                 StringId,\r
+                                 Lang,\r
+                                 NULL,\r
+                                 String,\r
+                                 NULL\r
+                                 );\r
+    if (EFI_ERROR (Status)) {\r
+      break;\r
+    }\r
+  }\r
+\r
+  FreePool (Languages);\r
+\r
+  return Status;\r
+  \r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+HiiLibUpdateString (\r
+  IN  EFI_HII_HANDLE                  PackageList,\r
+  IN  EFI_STRING_ID                   StringId,\r
+  IN  CONST EFI_STRING                String\r
+  )\r
+{\r
+  EFI_STATUS  Status;\r
+  CHAR8       *Languages;\r
+  CHAR8       *LangStrings;\r
+  CHAR8       Lang[RFC_3066_ENTRY_SIZE];\r
+\r
+  Status = EFI_SUCCESS;\r
+\r
+  Languages = HiiLibGetSupportedLanguages (PackageList);\r
+\r
+  LangStrings = Languages;\r
+  while (*LangStrings != 0) {\r
+    HiiLibGetNextLanguage (&LangStrings, Lang);\r
+\r
+    Status = mHiiStringProt->SetString (\r
+                                 mHiiStringProt,\r
+                                 PackageList,\r
+                                 StringId,\r
+                                 Lang,\r
+                                 String,\r
+                                 NULL\r
+                                 );\r
+    if (EFI_ERROR (Status)) {\r
+      break;\r
+    }\r
+  }\r
+\r
+  FreePool (Languages);\r
+\r
+  return Status;\r
+}\r
+\r
+//                                                                                      //\r
+// //////////////////////////////////////////////////\r
+//                                                                                    //\r
+\r
+//\r
+// This function is Implementation Specifc. HII_VENDOR_DEVICE_PATH\r
+// This should be moved to MdeModulepkg.\r
+//\r
+EFI_STATUS\r
 EFIAPI\r
-PreparePackages (\r
-  IN CONST  UINTN     NumberOfPackages,\r
-  IN CONST  EFI_GUID  *Guid OPTIONAL,\r
+HiiLibCreateHiiDriverHandle (\r
+  OUT EFI_HANDLE               *DriverHandle\r
+  )\r
+{\r
+  EFI_STATUS                   Status;\r
+  HII_VENDOR_DEVICE_PATH_NODE  *VendorDevicePath;\r
+  UINT64                       MonotonicCount;\r
+\r
+  VendorDevicePath = AllocateCopyPool (sizeof (HII_VENDOR_DEVICE_PATH), &mHiiVendorDevicePathTemplate);\r
+  if (VendorDevicePath == NULL) {\r
+    return EFI_OUT_OF_RESOURCES;\r
+  }\r
+\r
+  gBS->GetNextMonotonicCount (&MonotonicCount);\r
+  VendorDevicePath->MonotonicCount = (UINT32) MonotonicCount;\r
+\r
+  *DriverHandle = NULL;\r
+  Status = gBS->InstallProtocolInterface (\r
+                  DriverHandle,\r
+                  &gEfiDevicePathProtocolGuid,\r
+                  EFI_NATIVE_INTERFACE,\r
+                  VendorDevicePath\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+HiiLibDestroyHiiDriverHandle (\r
+  IN EFI_HANDLE               DriverHandle\r
+  )\r
+{\r
+  EFI_STATUS                   Status;\r
+  EFI_DEVICE_PATH_PROTOCOL     *DevicePath;\r
+\r
+  Status = gBS->HandleProtocol (\r
+                  DriverHandle,\r
+                  &gEfiDevicePathProtocolGuid,\r
+                  (VOID **) &DevicePath\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  Status = gBS->UninstallProtocolInterface (\r
+                  DriverHandle,\r
+                  &gEfiDevicePathProtocolGuid,\r
+                  DevicePath\r
+                  );\r
+\r
+  return Status;\r
+}\r
+\r
+EFI_STATUS\r
+HiiLibExtractDefault(\r
+  IN VOID                         *Buffer,\r
+  IN UINTN                        *BufferSize,\r
+  UINTN                           Number,\r
   ...\r
   )\r
+/*++\r
+\r
+  Routine Description:\r
+\r
+    Configure the buffer accrording to ConfigBody strings.\r
+\r
+  Arguments:\r
+    DefaultId             - the ID of default.\r
+    Buffer                - the start address of buffer.\r
+    BufferSize            - the size of buffer.\r
+    Number                - the number of the strings.\r
+\r
+  Returns:\r
+    EFI_BUFFER_TOO_SMALL  - the BufferSize is too small to operate.\r
+    EFI_INVALID_PARAMETER - Buffer is NULL or BufferSize is 0.\r
+    EFI_SUCCESS           - Operation successful.\r
+\r
+--*/\r
 {\r
+  VA_LIST                         Args;\r
+  UINTN                           Index;\r
+  UINT32                          TotalLen;\r
+  UINT8                           *BufCfgArray;\r
+  UINT8                           *BufferPos;\r
+  UINT16                          Offset;\r
+  UINT16                          Width;\r
+  UINT8                           *Value;\r
+\r
+  if ((Buffer == NULL) || (BufferSize == NULL)) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
+  Offset = 0;\r
+  Width  = 0;\r
+  Value  = NULL;\r
+\r
+  VA_START (Args, Number);\r
+  for (Index = 0; Index < Number; Index++) {\r
+    BufCfgArray = (UINT8 *) VA_ARG (Args, VOID *);\r
+    CopyMem (&TotalLen, BufCfgArray, sizeof (UINT32));\r
+    BufferPos = BufCfgArray + sizeof (UINT32);\r
+\r
+    while ((UINT32)(BufferPos - BufCfgArray) < TotalLen) {\r
+      CopyMem (&Offset, BufferPos, sizeof (UINT16));\r
+      BufferPos += sizeof (UINT16);\r
+      CopyMem (&Width, BufferPos, sizeof (UINT16));\r
+      BufferPos += sizeof (UINT16);\r
+      Value = BufferPos;\r
+      BufferPos += Width;\r
+\r
+      if ((UINTN)(Offset + Width) > *BufferSize) {\r
+        return EFI_BUFFER_TOO_SMALL;\r
+      }\r
+\r
+      CopyMem ((UINT8 *)Buffer + Offset, Value, Width);\r
+    }\r
+  }\r
+  VA_END (Args);\r
+\r
+  *BufferSize = (UINTN)Offset;\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+\r
+STATIC EFI_GUID mIfrVendorGuid = EFI_IFR_TIANO_GUID;\r
+\r
+EFI_STATUS\r
+HiiLibExtractClassFromHiiHandle (\r
+  IN      EFI_HII_HANDLE      Handle,\r
+  OUT     UINT16              *Class,\r
+  OUT     EFI_STRING_ID       *FormSetTitle,\r
+  OUT     EFI_STRING_ID       *FormSetHelp\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+  Extract formset class for given HII handle.\r
+\r
+Arguments:\r
+  HiiHandle       - Hii handle\r
+  Class           - Class of the formset\r
+  FormSetTitle    - Formset title string\r
+  FormSetHelp     - Formset help string\r
+\r
+Returns:\r
+  EFI_SUCCESS     - Successfully extract Class for specified Hii handle.\r
+\r
+--*/\r
+{\r
+  EFI_STATUS                   Status;\r
+  UINTN                        BufferSize;\r
+  EFI_HII_DATABASE_PROTOCOL    *HiiDatabase;\r
+  EFI_HII_PACKAGE_LIST_HEADER  *HiiPackageList;\r
+  UINT8                        *Package;\r
+  UINT8                        *OpCodeData;\r
+  UINT32                       Offset;\r
+  UINT32                       Offset2;\r
+  UINT32                       PackageListLength;\r
+  EFI_HII_PACKAGE_HEADER       PackageHeader;\r
+\r
+  *Class = EFI_NON_DEVICE_CLASS;\r
+  *FormSetTitle = 0;\r
+  *FormSetHelp = 0;\r
+\r
   //\r
-  // BugBug: Need more detail on UEFI spec.\r
+  // Locate HII Database protocol\r
+  //\r
+  Status = gBS->LocateProtocol (\r
+                  &gEfiHiiDatabaseProtocolGuid,\r
+                  NULL,\r
+                  (VOID **) &HiiDatabase\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  //\r
+  // Get HII PackageList\r
+  //\r
+  BufferSize = 0;\r
+  HiiPackageList = NULL;\r
+  Status = HiiDatabase->ExportPackageLists (HiiDatabase, Handle, &BufferSize, HiiPackageList);\r
+  if (Status == EFI_BUFFER_TOO_SMALL) {\r
+    HiiPackageList = AllocatePool (BufferSize);\r
+    ASSERT (HiiPackageList != NULL);\r
+\r
+    Status = HiiDatabase->ExportPackageLists (HiiDatabase, Handle, &BufferSize, HiiPackageList);\r
+  }\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
   //\r
-  ASSERT (FALSE);\r
-  return NULL;\r
+  // Get Form package from this HII package List\r
+  //\r
+  Offset = sizeof (EFI_HII_PACKAGE_LIST_HEADER);\r
+  Offset2 = 0;\r
+  CopyMem (&PackageListLength, &HiiPackageList->PackageLength, sizeof (UINT32));\r
+\r
+  while (Offset < PackageListLength) {\r
+    Package = ((UINT8 *) HiiPackageList) + Offset;\r
+    CopyMem (&PackageHeader, Package, sizeof (EFI_HII_PACKAGE_HEADER));\r
+\r
+    if (PackageHeader.Type == EFI_HII_PACKAGE_FORM) {\r
+      //\r
+      // Search Class Opcode in this Form Package\r
+      //\r
+      Offset2 = sizeof (EFI_HII_PACKAGE_HEADER);\r
+      while (Offset2 < PackageHeader.Length) {\r
+        OpCodeData = Package + Offset2;\r
+\r
+        if (((EFI_IFR_OP_HEADER *) OpCodeData)->OpCode == EFI_IFR_FORM_SET_OP) {\r
+          //\r
+          // Find FormSet OpCode\r
+          //\r
+          CopyMem (FormSetTitle, &((EFI_IFR_FORM_SET *) OpCodeData)->FormSetTitle, sizeof (EFI_STRING_ID));\r
+          CopyMem (FormSetHelp, &((EFI_IFR_FORM_SET *) OpCodeData)->Help, sizeof (EFI_STRING_ID));\r
+        }\r
+\r
+        if ((((EFI_IFR_OP_HEADER *) OpCodeData)->OpCode == EFI_IFR_GUID_OP) &&\r
+             CompareGuid (&mIfrVendorGuid, (EFI_GUID *)(OpCodeData + sizeof (EFI_IFR_OP_HEADER))) &&\r
+            (((EFI_IFR_GUID_CLASS *) OpCodeData)->ExtendOpCode == EFI_IFR_EXTEND_OP_CLASS)\r
+           ) {\r
+          //\r
+          // Find GUIDed Class OpCode\r
+          //\r
+          CopyMem (Class, &((EFI_IFR_GUID_CLASS *) OpCodeData)->Class, sizeof (UINT16));\r
+\r
+          //\r
+          // Till now, we ought to have found the formset Opcode\r
+          //\r
+          break;\r
+        }\r
+\r
+        Offset2 += ((EFI_IFR_OP_HEADER *) OpCodeData)->Length;\r
+      }\r
+\r
+      if (Offset2 < PackageHeader.Length) {\r
+        //\r
+        // Target formset found\r
+        //\r
+        break;\r
+      }\r
+    }\r
+\r
+    Offset += PackageHeader.Length;\r
+  }\r
+\r
+  gBS->FreePool (HiiPackageList);\r
+\r
+  return EFI_SUCCESS;\r
 }\r
+\r
index feaa95649a9c21138a08ee8062b0ef40e0748c37..ddff1c8004cf8359399ec7a404f2e0e45d9df49c 100644 (file)
@@ -22,8 +22,9 @@
   VERSION_STRING                 = 1.0\r
   LIBRARY_CLASS                  = HiiLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER\r
   EDK_RELEASE_VERSION            = 0x00020000\r
-  EFI_SPECIFICATION_VERSION      = 0x00020000\r
+  EFI_SPECIFICATION_VERSION      = 0x0002000A\r
 \r
+  CONSTRUCTOR                    = UefiHiiLibConstructor\r
 \r
 #\r
 #  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
 \r
 [Packages]\r
   MdePkg/MdePkg.dec\r
-\r
+  #BugBug: This package dependency will be re-evaluated when the code become functional and stable.\r
+  #      : HiiLibCreateHiiDriverHandle depends on HII_VENDOR_DEVICE_PATH which is defined by this\r
+  #      : specification only. \r
+  MdeModulePkg/MdeModulePkg.dec\r
 \r
 [LibraryClasses]\r
   MemoryAllocationLib\r
   DebugLib\r
-\r
+  PcdLib\r
+  UefiRuntimeServicesTableLib\r
+\r
+[Protocols]\r
+  gEfiHiiDatabaseProtocolGuid  # ALWAYS_CONSUMED\r
+  gEfiHiiStringProtocolGuid    # ALWAYS_CONSUMED\r
+  gEfiDevicePathProtocolGuid  \r
+  \r
+[Guids]  \r
+  gEfiGlobalVariableGuid \r
+\r
+[Depex]\r
+  gEfiHiiDatabaseProtocolGuid AND gEfiHiiStringProtocolGuid\r
+\r
+[Pcd]\r
+  gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang
\ No newline at end of file
diff --git a/MdePkg/Library/HiiLib/InternalHiiLib.h b/MdePkg/Library/HiiLib/InternalHiiLib.h
new file mode 100644 (file)
index 0000000..78540a4
--- /dev/null
@@ -0,0 +1,20 @@
+/** @file\r
+  Internal include file for the HII Library instance.\r
+\r
+  Copyright (c) 2007, 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
+\r
+**/\r
+\r
+#ifndef __INTERNAL_HII_LIB_H__\r
+#define __INTERNAL_HII_LIB_H__\r
+\r
+\r
+\r
+#endif\r
index b1f6157bf56416212e4a7f82081a595a6dc1a3ff..80a01aac7b830cabb981161b121c6ad9a5aa53b8 100644 (file)
@@ -1075,3 +1075,16 @@ FreeAlignedPool (
   // PEI phase does not support to free pool, so leave it as NOP.\r
   //\r
 }\r
+\r
+\r
+VOID\r
+EFIAPI\r
+SafeFreePool (\r
+  IN VOID   *Buffer\r
+  )\r
+{\r
+  //\r
+  // PEI phase does not support to free pool, so leave it as NOP.\r
+  //\r
+}\r
+\r
index e5d34a87d0b4bff2eb5a78ceceeea8263c95e2d0..02d1c943f69264623ecbda8489a4c1e28dff66ed 100644 (file)
@@ -83,7 +83,8 @@
   BasePeCoffLib|Include/Library/PeCoffLib.h\r
   GraphicsLib|Include/Library/GraphicsLib.h\r
   ExtractGuidedSectionLib|Include/Library/ExtractGuidedSectionLib.h\r
-\r
+  IfrSupportLib|Include/Library/IfrSupportLib.h\r
+  \r
 [LibraryClasses.IPF]\r
   SalLib|Include/Library/SalLib.h\r
   PalCallLib|Include/Library/PalCallLib.h\r
   gPcdProtocolGuid               = { 0x11B34006, 0xD85B, 0x4D0A, { 0xA2, 0x90, 0xD5, 0xA5, 0x71, 0x31, 0x0E, 0xF7 }}\r
   gEfiTcgProtocolGuid            = { 0xf541796d, 0xa62e, 0x4954, { 0xa7, 0x75, 0x95, 0x84, 0xf6, 0x1b, 0x9c, 0xdd }}\r
 \r
-## BugBug: HII related protocols should be defined.\r
-  gEfiFormBrowser2ProtocolGuid    = { 0xE5A1333E, 0xE1B4, 0x4D55, { 0xCE, 0xEB, 0x35, 0xC3, 0xEF, 0x13, 0x34, 0x43 }}\r
-  \r
+  gEfiFormBrowserProtocolGuid    =   {0xE5A1333E, 0xE1B4, 0x4D55, {0xCE, 0xEB, 0x35, 0xC3, 0xEF, 0x13, 0x34, 0x43}}\r
+  gEfiFormBrowser2ProtocolGuid   =   {0xb9d4c360, 0xbcfb, 0x4f9b, {0x92, 0x98, 0x53, 0xc1, 0x36, 0x98, 0x22, 0x58}}\r
+  gEfiHiiStringProtocolGuid      =   {0x0fd96974, 0x23aa, 0x4cdc, {0xb9, 0xcb, 0x98, 0xd1, 0x77, 0x50, 0x32, 0x2a}}\r
+  gEfiHiiImageProtocolGuid       =   {0x31a6406a, 0x6bdf, 0x4e46, {0xb2, 0xa2, 0xeb, 0xaa, 0x89, 0xc4, 0x09, 0x20}}\r
+  gEfiHiiConfigRoutingProtocolGuid = {0x587e72d7, 0xcc50, 0x4f79, {0x82, 0x09, 0xca, 0x29, 0x1f, 0xc1, 0xa1, 0x0f}}\r
+  gEfiHiiDatabaseProtocolGuid    =   {0xef9fc172, 0xa1b2, 0x4693, {0xb3, 0x27, 0x6d, 0x32, 0xfc, 0x41, 0x60, 0x42}}\r
+  gEfiHiiFontProtocolGuid        =   {0xe9ca4775, 0x8657, 0x47fc, {0x97, 0xe7, 0x7e, 0xd6, 0x5a, 0x08, 0x43, 0x24}}\r
+  gEfiHiiConfigAccessProtocolGuid =  {0x330d4706, 0xf2a0, 0x4e4f, {0xa3, 0x69, 0xb6, 0x6f, 0xa8, 0xd5, 0x43, 0x85}}\r
 \r
 [PcdsFeatureFlag.common]\r
   gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable|FALSE|BOOLEAN|0x0000000d\r
   gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultTimeout|0x0008|UINT16|0x0000001b\r
   gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangCodes|"engfra"|VOID*|0x0000001c\r
   gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang|"eng"|VOID*|0x0000001d\r
-  gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLangCodes|"en;fr"|VOID*|0x0000001e\r
-  gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang|"en"|VOID*|0x0000001f\r
+  gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLangCodes|"en-US;fr-FR"|VOID*|0x0000001e\r
+  gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang|"en-US"|VOID*|0x0000001f\r
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|115200|UINT64|0x00000020\r
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits|8|UINT8|0x00000021\r
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|1|UINT8|0x00000022\r
   gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultTimeout|0x0008|UINT16|0x0000001b\r
   gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangCodes|"engfra"|VOID*|0x0000001c\r
   gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang|"eng"|VOID*|0x0000001d\r
-  gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLangCodes|"en;fr"|VOID*|0x0000001e\r
-  gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang|"en"|VOID*|0x0000001f\r
+  gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLangCodes|"en-US;fr-FR"|VOID*|0x0000001e\r
+  gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang|"en-US"|VOID*|0x0000001f\r
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|115200|UINT64|0x00000020\r
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits|8|UINT8|0x00000021\r
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|1|UINT8|0x00000022\r
   gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultTimeout|0x0008|UINT16|0x0000001b\r
   gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangCodes|"engfra"|VOID*|0x0000001c\r
   gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang|"eng"|VOID*|0x0000001d\r
-  gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLangCodes|"en;fr"|VOID*|0x0000001e\r
-  gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang|"en"|VOID*|0x0000001f\r
+  gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLangCodes|"en-US;fr-FR"|VOID*|0x0000001e\r
+  gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang|"en-US"|VOID*|0x0000001f\r
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|115200|UINT64|0x00000020\r
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits|8|UINT8|0x00000021\r
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|1|UINT8|0x00000022\r
index e232efb7f9e3e13a0088680b589a5dffbd49c98a..1a6f16270af36b2364bfa3e9ac72e065aed07f1e 100644 (file)
@@ -23,7 +23,6 @@
   BUILD_TARGETS                  = DEBUG|RELEASE\r
   SKUID_IDENTIFIER               = DEFAULT\r
 \r
-\r
 [PcdsFeatureFlag.common]\r
   gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable|FALSE\r
   gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnosticsDisable|FALSE\r
@@ -77,6 +76,7 @@
   MdePkg/Library/DxePiLib/DxePiLib.inf\r
   MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf\r
   MdePkg/Library/DxeSmbusLib/DxeSmbusLib.inf\r
+  MdePkg/Library/HiiLib/HiiLib.inf\r
   MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf\r
   MdePkg/Library/PeiDxePostCodeLibReportStatusCode/PeiDxePostCodeLibReportStatusCode.inf\r
   MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf\r
   MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
   MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf\r
   MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf\r
+  \r
 \r
 [Components.IA32]\r
   MdePkg/Library/BaseMemoryLibOptPei/BaseMemoryLibOptPei.inf\r