Made VfrCompile buildable in BaseTools source tree
authorjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Wed, 20 Feb 2008 09:09:42 +0000 (09:09 +0000)
committerjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Wed, 20 Feb 2008 09:09:42 +0000 (09:09 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1010 7335b38e-4728-0410-8992-fb3ffe349368

Source/C/Include/Common/MdeModuleHii.h [new file with mode: 0644]
Source/C/Include/Common/UefiBaseTypes.h
Source/C/Include/Common/UefiInternalFormRepresentation.h
Source/C/Include/Guid/PcAnsi.h [new file with mode: 0644]
Source/C/Include/Protocol/DevicePath.h [new file with mode: 0644]
Source/C/VfrCompile/EfiVfr.h
Source/C/VfrCompile/Makefile
Source/C/VfrCompile/VfrCompiler.h
Source/C/VfrCompile/VfrError.h
Source/C/VfrCompile/VfrSyntax.g
Source/C/VfrCompile/VfrUtilityLib.h

diff --git a/Source/C/Include/Common/MdeModuleHii.h b/Source/C/Include/Common/MdeModuleHii.h
new file mode 100644 (file)
index 0000000..7296f0d
--- /dev/null
@@ -0,0 +1,119 @@
+/* @file\r
+\r
+  EDK II specific HII relative definition.\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
+\r
+#ifndef _MDEMODULE_HII_H\r
+#define _MDEMODULE_HII_H\r
+\r
+#define NARROW_CHAR         0xFFF0\r
+#define WIDE_CHAR           0xFFF1\r
+#define NON_BREAKING_CHAR   0xFFF2\r
+\r
+#define GLYPH_WIDTH         EFI_GLYPH_WIDTH\r
+#define GLYPH_HEIGHT        EFI_GLYPH_HEIGHT\r
+\r
+//\r
+// State defined for password statemachine \r
+//\r
+#define BROWSER_STATE_VALIDATE_PASSWORD  0\r
+#define BROWSER_STATE_SET_PASSWORD       1\r
+\r
+\r
+//\r
+// Tiano Implementation specific Device Path definition.\r
+//\r
+typedef struct {\r
+  VENDOR_DEVICE_PATH             VendorDevicePath;\r
+  UINT32                         MonotonicCount;\r
+} HII_VENDOR_DEVICE_PATH_NODE;\r
+\r
+typedef struct {\r
+  HII_VENDOR_DEVICE_PATH_NODE    Node;\r
+  EFI_DEVICE_PATH_PROTOCOL       End;\r
+} HII_VENDOR_DEVICE_PATH;\r
+\r
+\r
+//\r
+// GUIDed opcodes defined for Tiano\r
+//\r
+#define EFI_IFR_TIANO_GUID \\r
+  { 0xf0b1735, 0x87a0, 0x4193, {0xb2, 0x66, 0x53, 0x8c, 0x38, 0xaf, 0x48, 0xce} }\r
+\r
+\r
+#pragma pack(1)\r
+\r
+#define EFI_IFR_EXTEND_OP_LABEL       0x0\r
+#define EFI_IFR_EXTEND_OP_BANNER      0x1\r
+#define EFI_IFR_EXTEND_OP_TIMEOUT     0x2\r
+#define EFI_IFR_EXTEND_OP_CLASS       0x3\r
+#define EFI_IFR_EXTEND_OP_SUBCLASS    0x4\r
+\r
+typedef struct _EFI_IFR_GUID_LABEL {\r
+  EFI_IFR_OP_HEADER   Header;\r
+  EFI_GUID            Guid;\r
+  UINT8               ExtendOpCode;\r
+  UINT16              Number;\r
+} EFI_IFR_GUID_LABEL;\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
+\r
+typedef struct _EFI_IFR_GUID_BANNER {\r
+  EFI_IFR_OP_HEADER   Header;\r
+  EFI_GUID            Guid;\r
+  UINT8               ExtendOpCode; // Extended opcode is EFI_IFR_EXTEND_OP_BANNER\r
+  EFI_STRING_ID       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_GUID_BANNER;\r
+\r
+typedef struct _EFI_IFR_GUID_TIMEOUT {\r
+  EFI_IFR_OP_HEADER   Header;\r
+  EFI_GUID            Guid;\r
+  UINT8               ExtendOpCode;\r
+  UINT16              TimeOut;\r
+} EFI_IFR_GUID_TIMEOUT;\r
+\r
+#define EFI_NON_DEVICE_CLASS              0x00\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
+typedef struct _EFI_IFR_GUID_CLASS {\r
+  EFI_IFR_OP_HEADER   Header;\r
+  EFI_GUID            Guid;\r
+  UINT8               ExtendOpCode;\r
+  UINT16              Class;\r
+} EFI_IFR_GUID_CLASS;\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\r
+\r
+typedef struct _EFI_IFR_GUID_SUBCLASS {\r
+  EFI_IFR_OP_HEADER   Header;\r
+  EFI_GUID            Guid;\r
+  UINT8               ExtendOpCode;\r
+  UINT16              SubClass;\r
+} EFI_IFR_GUID_SUBCLASS;\r
+\r
+#pragma pack()\r
+\r
+#endif\r
+\r
index 20f3bee..4809400 100644 (file)
@@ -1,23 +1,21 @@
-/** @file\r
-  This file makes the BaseTypes.h backward compatible with the ones used in the \r
-  past for EFI and Tiano development. It's mostly just prepending an EFI_ on the \r
-  definitions.\r
 \r
-  Copyright (c) 2006, 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
+/* @file\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
+  Defines data types and constants introduced in UEFI.\r
 \r
-  Module Name:  UefiBaseTypes.h\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
 \r
-#ifndef __UEFI_BASE_TYPES_H__\r
-#define __UEFI_BASE_TYPES_H__\r
+#ifndef __UEFI_BASETYPE_H__\r
+#define __UEFI_BASETYPE_H__\r
 \r
 #include <Common/BaseTypes.h>\r
 \r
@@ -36,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 4524c57..dd7247f 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
-// BugBug in UEFI2.1 \r
-// \r
-typedef VOID    *EFI_FONT_HANDLE;\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
+// 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
-// 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
+// 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
-\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
+#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
-#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
 \r
 \r
+//\r
+// References to string tokens must use this macro to enable scanning for\r
+// token usages.\r
+//\r
+//\r
+// STRING_TOKEN is not defined in UEFI specification. But it is placed \r
+// here for the easy access by C files and VFR source files.\r
+//\r
+#define STRING_TOKEN(t) t\r
+\r
 #endif\r
diff --git a/Source/C/Include/Guid/PcAnsi.h b/Source/C/Include/Guid/PcAnsi.h
new file mode 100644 (file)
index 0000000..0140201
--- /dev/null
@@ -0,0 +1,58 @@
+/** @file\r
+  Terminal Device Path Vendor Guid.\r
+\r
+  Copyright (c) 2006, 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
+  @par Revision Reference:\r
+  GUIDs defined in UEFI 2.0 spec.\r
+\r
+**/\r
+\r
+#ifndef __PC_ANSI_H__\r
+#define __PC_ANSI_H__\r
+\r
+#define EFI_PC_ANSI_GUID \\r
+  { \\r
+    0xe0c14753, 0xf9be, 0x11d2, {0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r
+  }\r
+\r
+#define EFI_VT_100_GUID \\r
+  { \\r
+    0xdfa66065, 0xb419, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r
+  }\r
+\r
+#define EFI_VT_100_PLUS_GUID \\r
+  { \\r
+    0x7baec70b, 0x57e0, 0x4c76, {0x8e, 0x87, 0x2f, 0x9e, 0x28, 0x08, 0x83, 0x43 } \\r
+  }\r
+\r
+#define EFI_VT_UTF8_GUID \\r
+  { \\r
+    0xad15a0d6, 0x8bec, 0x4acf, {0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88 } \\r
+  }\r
+\r
+#define EFI_UART_DEVICE_PATH_GUID \\r
+  { \\r
+    0x37499a9d, 0x542f, 0x4c89, {0xa0, 0x26, 0x35, 0xda, 0x14, 0x20, 0x94, 0xe4 } \\r
+  }\r
+  \r
+#define EFI_SAS_DEVICE_PATH_GUID \\r
+  { \\r
+    0xd487ddb4, 0x008b, 0x11d9, {0xaf, 0xdc, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d } \\r
+  }\r
+\r
+extern EFI_GUID gEfiPcAnsiGuid;\r
+extern EFI_GUID gEfiVT100Guid;\r
+extern EFI_GUID gEfiVT100PlusGuid;\r
+extern EFI_GUID gEfiVTUTF8Guid;\r
+extern EFI_GUID gEfiUartDevicePathGuid;\r
+extern EFI_GUID gEfiSasDevicePathGuid;\r
+\r
+#endif\r
diff --git a/Source/C/Include/Protocol/DevicePath.h b/Source/C/Include/Protocol/DevicePath.h
new file mode 100644 (file)
index 0000000..47948d6
--- /dev/null
@@ -0,0 +1,545 @@
+/** @file\r
+  The device path protocol as defined in UEFI 2.0.\r
+\r
+  The device path represents a programatic path to a device. It's the view\r
+  from a software point of view. It also must persist from boot to boot, so \r
+  it can not contain things like PCI bus numbers that change from boot to boot.\r
+\r
+  Copyright (c) 2006, 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 __EFI_DEVICE_PATH_PROTOCOL_H__\r
+#define __EFI_DEVICE_PATH_PROTOCOL_H__\r
+\r
+#include <Guid/PcAnsi.h>\r
+\r
+//\r
+// Device Path protocol\r
+//\r
+#define EFI_DEVICE_PATH_PROTOCOL_GUID \\r
+  { \\r
+    0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \\r
+  }\r
+\r
+//\r
+// Protocol GUID defined in EFI1.1.\r
+// \r
+\r
+//\r
+// Device Path information\r
+//\r
+#define DEVICE_PATH_PROTOCOL  EFI_DEVICE_PATH_PROTOCOL_GUID\r
+\r
+#pragma pack(1)\r
+\r
+typedef struct {\r
+  UINT8 Type;\r
+  UINT8 SubType;\r
+  UINT8 Length[2];\r
+} EFI_DEVICE_PATH_PROTOCOL;\r
+\r
+//\r
+// For backward-compatible with EFI1.1.\r
+// \r
+typedef EFI_DEVICE_PATH_PROTOCOL  EFI_DEVICE_PATH;\r
+\r
+//\r
+// Hardware Device Paths\r
+//\r
+#define HARDWARE_DEVICE_PATH      0x01\r
+\r
+#define HW_PCI_DP                 0x01\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT8                           Function;\r
+  UINT8                           Device;\r
+} PCI_DEVICE_PATH;\r
+\r
+#define HW_PCCARD_DP              0x02\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT8                           FunctionNumber;\r
+} PCCARD_DEVICE_PATH;\r
+\r
+#define HW_MEMMAP_DP              0x03\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          MemoryType;\r
+  EFI_PHYSICAL_ADDRESS            StartingAddress;\r
+  EFI_PHYSICAL_ADDRESS            EndingAddress;\r
+} MEMMAP_DEVICE_PATH;\r
+\r
+#define HW_VENDOR_DP              0x04\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  EFI_GUID                        Guid;\r
+} VENDOR_DEVICE_PATH;\r
+\r
+#define HW_CONTROLLER_DP          0x05\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          ControllerNumber;\r
+} CONTROLLER_DEVICE_PATH;\r
+\r
+//\r
+// ACPI Device Paths\r
+//\r
+#define ACPI_DEVICE_PATH          0x02\r
+\r
+#define ACPI_DP                   0x01\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          HID;\r
+  UINT32                          UID;\r
+} ACPI_HID_DEVICE_PATH;\r
+\r
+#define ACPI_EXTENDED_DP          0x02\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          HID;\r
+  UINT32                          UID;\r
+  UINT32                          CID;\r
+  //\r
+  // Optional variable length _HIDSTR\r
+  // Optional variable length _UIDSTR\r
+  //\r
+} ACPI_EXTENDED_HID_DEVICE_PATH;\r
+\r
+//\r
+//  EISA ID Macro\r
+//  EISA ID Definition 32-bits\r
+//   bits[15:0] - three character compressed ASCII EISA ID.\r
+//   bits[31:16] - binary number\r
+//    Compressed ASCII is 5 bits per character 0b00001 = 'A' 0b11010 = 'Z'\r
+//\r
+#define PNP_EISA_ID_CONST         0x41d0\r
+#define EISA_ID(_Name, _Num)      ((UINT32) ((_Name) | (_Num) << 16))\r
+#define EISA_PNP_ID(_PNPId)       (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))\r
+#define EFI_PNP_ID(_PNPId)        (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))\r
+\r
+#define PNP_EISA_ID_MASK          0xffff\r
+#define EISA_ID_TO_NUM(_Id)       ((_Id) >> 16)\r
+\r
+\r
+#define ACPI_ADR_DP               0x03\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          ADR;\r
+} ACPI_ADR_DEVICE_PATH;\r
+\r
+\r
+//\r
+// Messaging Device Paths\r
+//\r
+#define MESSAGING_DEVICE_PATH     0x03\r
+\r
+#define MSG_ATAPI_DP              0x01\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT8                           PrimarySecondary;\r
+  UINT8                           SlaveMaster;\r
+  UINT16                          Lun;\r
+} ATAPI_DEVICE_PATH;\r
+\r
+#define MSG_SCSI_DP               0x02\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT16                          Pun;\r
+  UINT16                          Lun;\r
+} SCSI_DEVICE_PATH;\r
+\r
+#define MSG_FIBRECHANNEL_DP       0x03\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          Reserved;\r
+  UINT64                          WWN;\r
+  UINT64                          Lun;\r
+} FIBRECHANNEL_DEVICE_PATH;\r
+\r
+#define MSG_1394_DP               0x04\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          Reserved;\r
+  UINT64                          Guid;\r
+} F1394_DEVICE_PATH;\r
+\r
+#define MSG_USB_DP                0x05\r
+typedef struct {\r
+    EFI_DEVICE_PATH_PROTOCOL      Header;\r
+    UINT8                         ParentPortNumber;\r
+    UINT8                         InterfaceNumber;\r
+} USB_DEVICE_PATH;\r
+\r
+#define MSG_USB_CLASS_DP          0x0f\r
+typedef struct {\r
+    EFI_DEVICE_PATH_PROTOCOL      Header;\r
+    UINT16                        VendorId;\r
+    UINT16                        ProductId;\r
+    UINT8                         DeviceClass;\r
+    UINT8                         DeviceSubClass;\r
+    UINT8                         DeviceProtocol;\r
+} USB_CLASS_DEVICE_PATH;\r
+\r
+#define MSG_USB_WWID_DP           0x10\r
+typedef struct {\r
+    EFI_DEVICE_PATH_PROTOCOL      Header;\r
+    UINT16                        InterfaceNumber;\r
+    UINT16                        VendorId;\r
+    UINT16                        ProductId;\r
+    // CHAR16                     SerialNumber[...];\r
+} USB_WWID_DEVICE_PATH;\r
+\r
+\r
+#define MSG_DEVICE_LOGICAL_UNIT_DP  0x11\r
+typedef struct {\r
+    EFI_DEVICE_PATH_PROTOCOL      Header;\r
+    UINT8                         Lun;\r
+} DEVICE_LOGICAL_UNIT_DEVICE_PATH;\r
+\r
+#define MSG_SATA_DP               0x12\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT16                          HBAPortNumber;\r
+  UINT16                          PortMultiplierPortNumber;\r
+  UINT16                          Lun;\r
+} SATA_DEVICE_PATH;\r
+\r
+#define MSG_I2O_DP                0x06\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          Tid;\r
+} I2O_DEVICE_PATH;\r
+\r
+#define MSG_MAC_ADDR_DP           0x0b\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  EFI_MAC_ADDRESS                 MacAddress;\r
+  UINT8                           IfType;\r
+} MAC_ADDR_DEVICE_PATH;\r
+\r
+#define MSG_IPv4_DP               0x0c\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  EFI_IPv4_ADDRESS                LocalIpAddress;\r
+  EFI_IPv4_ADDRESS                RemoteIpAddress;\r
+  UINT16                          LocalPort;\r
+  UINT16                          RemotePort;\r
+  UINT16                          Protocol;\r
+  BOOLEAN                         StaticIpAddress;\r
+} IPv4_DEVICE_PATH;\r
+\r
+#define MSG_IPv6_DP               0x0d\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  EFI_IPv6_ADDRESS                LocalIpAddress;\r
+  EFI_IPv6_ADDRESS                RemoteIpAddress;\r
+  UINT16                          LocalPort;\r
+  UINT16                          RemotePort;\r
+  UINT16                          Protocol;\r
+  BOOLEAN                         StaticIpAddress;\r
+} IPv6_DEVICE_PATH;\r
+\r
+#define MSG_INFINIBAND_DP         0x09\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          ResourceFlags;\r
+  UINT8                           PortGid[16];\r
+  UINT64                          ServiceId;\r
+  UINT64                          TargetPortId;\r
+  UINT64                          DeviceId;\r
+} INFINIBAND_DEVICE_PATH;\r
+\r
+#define INFINIBAND_RESOURCE_FLAG_IOC_SERVICE                0x01\r
+#define INFINIBAND_RESOURCE_FLAG_EXTENDED_BOOT_ENVIRONMENT  0x02\r
+#define INFINIBAND_RESOURCE_FLAG_CONSOLE_PROTOCOL           0x04\r
+#define INFINIBAND_RESOURCE_FLAG_STORAGE_PROTOCOL           0x08\r
+#define INFINIBAND_RESOURCE_FLAG_NETWORK_PROTOCOL           0x10\r
+\r
+#define MSG_UART_DP               0x0e\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          Reserved;\r
+  UINT64                          BaudRate;\r
+  UINT8                           DataBits;\r
+  UINT8                           Parity;\r
+  UINT8                           StopBits;\r
+} UART_DEVICE_PATH;\r
+\r
+//\r
+// Use VENDOR_DEVICE_PATH struct\r
+//\r
+#define MSG_VENDOR_DP             0x0a\r
+typedef VENDOR_DEVICE_PATH        VENDOR_DEFINED_DEVICE_PATH;\r
+\r
+#define DEVICE_PATH_MESSAGING_PC_ANSI     EFI_PC_ANSI_GUID\r
+#define DEVICE_PATH_MESSAGING_VT_100      EFI_VT_100_GUID\r
+#define DEVICE_PATH_MESSAGING_VT_100_PLUS EFI_VT_100_PLUS_GUID\r
+#define DEVICE_PATH_MESSAGING_VT_UTF8     EFI_VT_UTF8_GUID\r
+\r
+#define DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL   EFI_UART_DEVICE_PATH_GUID\r
+\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  EFI_GUID                        Guid;\r
+  UINT32                          FlowControlMap;\r
+} UART_FLOW_CONTROL_DEVICE_PATH;\r
+\r
+#define DEVICE_PATH_MESSAGING_SAS                 EFI_SAS_DEVICE_PATH_GUID\r
+\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  EFI_GUID                        Guid;\r
+  UINT32                          Reserved;\r
+  UINT64                          SasAddress;\r
+  UINT64                          Lun;\r
+  UINT16                          DeviceTopology;\r
+  UINT16                          RelativeTargetPort;\r
+} SAS_DEVICE_PATH;\r
+\r
+#define MSG_ISCSI_DP              0x13\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT16                          NetworkProtocol;\r
+  UINT16                          LoginOption;\r
+  UINT64                          Lun;\r
+  UINT16                          TargetPortalGroupTag;\r
+  // CHAR8                        iSCSI Target Name\r
+} ISCSI_DEVICE_PATH;\r
+\r
+#define ISCSI_LOGIN_OPTION_NO_HEADER_DIGEST             0x0000\r
+#define ISCSI_LOGIN_OPTION_HEADER_DIGEST_USING_CRC32C   0x0002\r
+#define ISCSI_LOGIN_OPTION_NO_DATA_DIGEST               0x0000\r
+#define ISCSI_LOGIN_OPTION_DATA_DIGEST_USING_CRC32C     0x0008\r
+#define ISCSI_LOGIN_OPTION_AUTHMETHOD_CHAP              0x0000\r
+#define ISCSI_LOGIN_OPTION_AUTHMETHOD_NON               0x1000\r
+#define ISCSI_LOGIN_OPTION_CHAP_BI                      0x0000\r
+#define ISCSI_LOGIN_OPTION_CHAP_UNI                     0x2000\r
+\r
+//\r
+// Media Device Path\r
+//\r
+#define MEDIA_DEVICE_PATH         0x04\r
+\r
+#define MEDIA_HARDDRIVE_DP        0x01\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          PartitionNumber;\r
+  UINT64                          PartitionStart;\r
+  UINT64                          PartitionSize;\r
+  UINT8                           Signature[16];\r
+  UINT8                           MBRType;\r
+  UINT8                           SignatureType;\r
+} HARDDRIVE_DEVICE_PATH;\r
+\r
+#define MBR_TYPE_PCAT             0x01\r
+#define MBR_TYPE_EFI_PARTITION_TABLE_HEADER 0x02\r
+\r
+#define SIGNATURE_TYPE_MBR        0x01\r
+#define SIGNATURE_TYPE_GUID       0x02\r
+\r
+#define MEDIA_CDROM_DP            0x02\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          BootEntry;\r
+  UINT64                          PartitionStart;\r
+  UINT64                          PartitionSize;\r
+} CDROM_DEVICE_PATH;\r
+\r
+//\r
+// Use VENDOR_DEVICE_PATH struct\r
+//\r
+#define MEDIA_VENDOR_DP           0x03\r
+\r
+#define MEDIA_FILEPATH_DP         0x04\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  CHAR16                          PathName[1];\r
+} FILEPATH_DEVICE_PATH;\r
+\r
+#define SIZE_OF_FILEPATH_DEVICE_PATH  EFI_FIELD_OFFSET(FILEPATH_DEVICE_PATH,PathName)\r
+\r
+#define MEDIA_PROTOCOL_DP         0x05\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  EFI_GUID                        Protocol;\r
+} MEDIA_PROTOCOL_DEVICE_PATH;\r
+\r
+\r
+#define MEDIA_PIWG_FW_VOL_DP      0x7\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  EFI_GUID                        FvName;\r
+} MEDIA_FW_VOL_DEVICE_PATH;\r
+\r
+\r
+#define MEDIA_PIWG_FW_FILE_DP     0x6\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  EFI_GUID                        FvFileName;\r
+} MEDIA_FW_VOL_FILEPATH_DEVICE_PATH;\r
+\r
+//\r
+// BBS Device Path\r
+//\r
+#define BBS_DEVICE_PATH           0x05\r
+#define BBS_BBS_DP                0x01\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT16                          DeviceType;\r
+  UINT16                          StatusFlag;\r
+  CHAR8                           String[1];\r
+} BBS_BBS_DEVICE_PATH;\r
+\r
+//\r
+// DeviceType definitions - from BBS specification\r
+//\r
+#define BBS_TYPE_FLOPPY           0x01\r
+#define BBS_TYPE_HARDDRIVE        0x02\r
+#define BBS_TYPE_CDROM            0x03\r
+#define BBS_TYPE_PCMCIA           0x04\r
+#define BBS_TYPE_USB              0x05\r
+#define BBS_TYPE_EMBEDDED_NETWORK 0x06\r
+#define BBS_TYPE_BEV              0x80\r
+#define BBS_TYPE_UNKNOWN          0xFF\r
+\r
+\r
+//\r
+// Union of all possible Device Paths and pointers to Device Paths\r
+//\r
+\r
+typedef union {\r
+  EFI_DEVICE_PATH_PROTOCOL             DevPath;\r
+  PCI_DEVICE_PATH                      Pci;\r
+  PCCARD_DEVICE_PATH                   PcCard;\r
+  MEMMAP_DEVICE_PATH                   MemMap;\r
+  VENDOR_DEVICE_PATH                   Vendor;\r
+\r
+  CONTROLLER_DEVICE_PATH               Controller;\r
+  ACPI_HID_DEVICE_PATH                 Acpi;\r
+\r
+  ATAPI_DEVICE_PATH                    Atapi;\r
+  SCSI_DEVICE_PATH                     Scsi;\r
+  ISCSI_DEVICE_PATH                    Iscsi;\r
+  FIBRECHANNEL_DEVICE_PATH             FibreChannel;\r
+\r
+  F1394_DEVICE_PATH                    F1394;\r
+  USB_DEVICE_PATH                      Usb;\r
+  SATA_DEVICE_PATH                     Sata;\r
+  USB_CLASS_DEVICE_PATH                UsbClass;\r
+  I2O_DEVICE_PATH                      I2O;\r
+  MAC_ADDR_DEVICE_PATH                 MacAddr;\r
+  IPv4_DEVICE_PATH                     Ipv4;\r
+  IPv6_DEVICE_PATH                     Ipv6;\r
+  INFINIBAND_DEVICE_PATH               InfiniBand;\r
+  UART_DEVICE_PATH                     Uart;\r
+\r
+  HARDDRIVE_DEVICE_PATH                HardDrive;\r
+  CDROM_DEVICE_PATH                    CD;\r
+\r
+  FILEPATH_DEVICE_PATH                 FilePath;\r
+  MEDIA_PROTOCOL_DEVICE_PATH           MediaProtocol;\r
+\r
+  BBS_BBS_DEVICE_PATH                  Bbs;\r
+} EFI_DEV_PATH;\r
+\r
+\r
+\r
+typedef union {\r
+  EFI_DEVICE_PATH_PROTOCOL             *DevPath;\r
+  PCI_DEVICE_PATH                      *Pci;\r
+  PCCARD_DEVICE_PATH                   *PcCard;\r
+  MEMMAP_DEVICE_PATH                   *MemMap;\r
+  VENDOR_DEVICE_PATH                   *Vendor;\r
+\r
+  CONTROLLER_DEVICE_PATH               *Controller;\r
+  ACPI_HID_DEVICE_PATH                 *Acpi;\r
+  ACPI_EXTENDED_HID_DEVICE_PATH        *ExtendedAcpi;\r
+\r
+  ATAPI_DEVICE_PATH                    *Atapi;\r
+  SCSI_DEVICE_PATH                     *Scsi;\r
+  FIBRECHANNEL_DEVICE_PATH             *FibreChannel;\r
+\r
+  F1394_DEVICE_PATH                    *F1394;\r
+  USB_DEVICE_PATH                      *Usb;\r
+  SATA_DEVICE_PATH                     *Sata;\r
+  USB_CLASS_DEVICE_PATH                *UsbClass;\r
+  I2O_DEVICE_PATH                      *I2O;\r
+  MAC_ADDR_DEVICE_PATH                 *MacAddr;\r
+  IPv4_DEVICE_PATH                     *Ipv4;\r
+  IPv6_DEVICE_PATH                     *Ipv6;\r
+  INFINIBAND_DEVICE_PATH               *InfiniBand;\r
+  UART_DEVICE_PATH                     *Uart;\r
+\r
+  HARDDRIVE_DEVICE_PATH                *HardDrive;\r
+  CDROM_DEVICE_PATH                    *CD;\r
+\r
+  FILEPATH_DEVICE_PATH                 *FilePath;\r
+  MEDIA_PROTOCOL_DEVICE_PATH           *MediaProtocol;\r
+\r
+  BBS_BBS_DEVICE_PATH                  *Bbs;\r
+  UINT8                                *Raw;\r
+} EFI_DEV_PATH_PTR;\r
+\r
+#pragma pack()\r
+                                             \r
+#define EFI_DP_TYPE_MASK                     0x7F\r
+#define EFI_DP_TYPE_UNPACKED                 0x80\r
+#define END_DEVICE_PATH_TYPE                 0x7f\r
+                                             \r
+#define EFI_END_ENTIRE_DEVICE_PATH           0xff\r
+#define EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE   0xff\r
+#define EFI_END_INSTANCE_DEVICE_PATH         0x01\r
+#define END_ENTIRE_DEVICE_PATH_SUBTYPE       EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE\r
+#define END_INSTANCE_DEVICE_PATH_SUBTYPE     EFI_END_INSTANCE_DEVICE_PATH\r
+                                             \r
+#define EFI_END_DEVICE_PATH_LENGTH           (sizeof (EFI_DEVICE_PATH_PROTOCOL))\r
+#define END_DEVICE_PATH_LENGTH               EFI_END_DEVICE_PATH_LENGTH\r
+                                             \r
+#define DP_IS_END_TYPE(a)                    \r
+#define DP_IS_END_SUBTYPE(a)                 (((a)->SubType == END_ENTIRE_DEVICE_PATH_SUBTYPE)\r
+#define DevicePathSubType(a)                 ((a)->SubType)\r
+#define IsDevicePathUnpacked(a)              ((a)->Type & EFI_DP_TYPE_UNPACKED)\r
+                                             \r
+#define EfiDevicePathNodeLength(a)           (((a)->Length[0]) | ((a)->Length[1] << 8))\r
+#define DevicePathNodeLength(a)              (EfiDevicePathNodeLength(a))\r
+#define EfiNextDevicePathNode(a)             ((EFI_DEVICE_PATH_PROTOCOL *) (((UINT8 *) (a)) + EfiDevicePathNodeLength (a)))\r
+#define NextDevicePathNode(a)                (EfiNextDevicePathNode(a)) \r
+                                             \r
+#define EfiDevicePathType(a)                 (((a)->Type) & EFI_DP_TYPE_MASK)\r
+#define DevicePathType(a)                    (EfiDevicePathType(a))\r
+#define EfiIsDevicePathEndType(a)            (EfiDevicePathType (a) == END_DEVICE_PATH_TYPE)\r
+#define IsDevicePathEndType(a)               (EfiIsDevicePathEndType(a)) \r
+                                             \r
+                                             \r
+#define EfiIsDevicePathEndSubType(a)         ((a)->SubType == EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE)\r
+#define IsDevicePathEndSubType(a)            (EfiIsDevicePathEndSubType(a))\r
+#define EfiIsDevicePathEndInstanceSubType(a) ((a)->SubType == EFI_END_INSTANCE_DEVICE_PATH)\r
+                                             \r
+#define EfiIsDevicePathEnd(a)                (EfiIsDevicePathEndType (a) && EfiIsDevicePathEndSubType (a))\r
+#define IsDevicePathEnd(a)                   (EfiIsDevicePathEnd(a))\r
+#define EfiIsDevicePathEndInstance(a)        (EfiIsDevicePathEndType (a) && EfiIsDevicePathEndInstanceSubType (a))\r
+\r
+\r
+#define SetDevicePathNodeLength(a,l) {                           \\r
+          (a)->Length[0] = (UINT8) (l);                          \\r
+          (a)->Length[1] = (UINT8) ((l) >> 8);                   \\r
+          }\r
+\r
+#define SetDevicePathEndNode(a)  {                               \\r
+          (a)->Type = END_DEVICE_PATH_TYPE;                      \\r
+          (a)->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE;         \\r
+          (a)->Length[0] = sizeof(EFI_DEVICE_PATH_PROTOCOL);     \\r
+          (a)->Length[1] = 0;                                    \\r
+          }\r
+\r
+extern EFI_GUID gEfiDevicePathProtocolGuid;\r
+\r
+#endif\r
index 43e40ab..d5fc9d3 100644 (file)
@@ -22,8 +22,10 @@ Abstract:
 #ifndef _EFIVFR_H_\r
 #define _EFIVFR_H_\r
 \r
-#include "Tiano.h"\r
-#include "TianoHii.h"\r
+#include "Common/UefiBaseTypes.h"\r
+#include "Protocol/DevicePath.h"\r
+#include "Common/UefiInternalFormRepresentation.h"\r
+#include "Common/MdeModuleHii.h"\r
 \r
 #define MAX_PATH                 255\r
 #define MAX_LINE_LEN             4096\r
index 1d2ae1d..8803674 100644 (file)
@@ -1,20 +1,24 @@
 !INCLUDE ..\Makefiles\ms.common
 
+CPPFLAGS = $(CPPFLAGS) /WX /D PCCTS_USE_NAMESPACE_STD
 APPNAME = VfrCompile
 
 LIBS = $(LIB_PATH)\Common.lib
 
-OBJECTS = VfrCompile.obj VfrServices.obj DLGLexer.obj EfiVfrParser.obj ATokenBuffer.obj DLexerBase.obj AParser.obj
+OBJECTS = AParser.obj DLexerBase.obj ATokenBuffer.obj EfiVfrParser.obj VfrSyntax.obj VfrLexer.obj \
+          VfrFormPkg.obj VfrError.obj VfrUtilityLib.obj VfrCompiler.obj
 
 INC = $(INC) -I $(BASE_TOOLS_PATH)\Source\C\VfrCompile\Pccts\h
 
 !INCLUDE ..\Makefiles\ms.app
 
-VfrCompile.cpp DLGLexer.cpp EfiVfrParser.cpp: VfrCompile.g
+VfrSyntax.cpp EfiVfrParser.cpp EfiVfrParser.h VfrParser.dlg VfrTokens.h: VfrSyntax.g
        pushd . & cd Pccts & $(MAKE) & popd
-       antlr -CC -e3 -ck 3 -o . VfrCompile.g
-       dlg -C2 -i -CC -o . parser.dlg
-       pushd . & cd Pccts & $(MAKE) clean
+       antlr -CC -e3 -ck 3 -k 2 -fl VfrParser.dlg -ft VfrTokens.h -o . VfrSyntax.g
+#      pushd . & cd Pccts & $(MAKE) clean
+
+VfrLexer.cpp VfrLexer.h: VfrParser.dlg
+       dlg -C2 -i -CC -cl VfrLexer -o . VfrParser.dlg
 
 ATokenBuffer.obj: Pccts\h\ATokenBuffer.cpp
        $(CXX) -c $(CPPFLAGS) $(INC) $? -Fo$@
index 0c710c2..392e92e 100644 (file)
@@ -1,8 +1,7 @@
 #ifndef _VFRCOMPILER_H_\r
 #define _VFRCOMPILER_H_\r
 \r
-#include "Tiano.h"\r
-#include "EfiTypes.h"\r
+#include "Common/UefiBaseTypes.h"\r
 #include "EfiVfr.h"\r
 #include "VfrFormPkg.h"\r
 #include "VfrUtilityLib.h"\r
index a9d7278..6b5d3e7 100644 (file)
@@ -1,8 +1,7 @@
 #ifndef _VFRERROR_H_\r
 #define _VFRERROR_H_\r
 \r
-#include "Tiano.h"\r
-#include "EfiTypes.h"\r
+#include "Common/UefiBaseTypes.h"\r
 \r
 typedef enum {\r
   VFR_RETURN_SUCCESS = 0,\r
index e7ae206..10ea664 100644 (file)
@@ -146,7 +146,7 @@ VfrParserStart (
 #token Uint16("UINT16")                         "UINT16"\r
 #token Char16("CHAR16")                         "CHAR16"\r
 #token Uint8("UINT8")                           "UINT8"\r
-#token GUID("guid")                             "guid"\r
+#token Uuid("guid")                             "guid"\r
 #token CheckBox("checkbox")                     "checkbox"\r
 #token EndCheckBox("endcheckbox")               "endcheckbox"\r
 #token Numeric("numeric")                       "numeric"\r
@@ -423,7 +423,7 @@ vfrFromSetDefinition :
      UINT16      C, SC;\r
   >>\r
   L:FormSet                                         << SET_LINE_INFO (FSObj, L); >>\r
-  GUID "=" guidDefinition[Guid] ","                 << FSObj.SetGuid (&Guid); >>\r
+  Uuid "=" guidDefinition[Guid] ","                 << FSObj.SetGuid (&Guid); >>\r
   Title "=" "STRING_TOKEN" "\(" S1:Number "\)" ","  << FSObj.SetFormSetTitle (_STOSID(S1->getText())); >>\r
   Help  "=" "STRING_TOKEN" "\(" S2:Number "\)" ","  << FSObj.SetHelp (_STOSID(S2->getText())); >>\r
   {\r
@@ -498,7 +498,7 @@ vfrStatementVarStoreLinear :
     VarId "=" ID:Number ","                         << VarStoreId = _STOU16(ID->getText()); >>\r
   }\r
   Name "=" SN:StringIdentifier ","\r
-  GUID "=" guidDefinition[Guid]\r
+  Uuid "=" guidDefinition[Guid]\r
                                                     <<\r
                                                        _PCATCH(mCVfrDataStorage.DeclareBufferVarStore (\r
                                                                                   SN->getText(), \r
@@ -532,7 +532,7 @@ vfrStatementVarStoreEfi :
                                                     << VSEObj.SetAttributes (Attr); >>\r
   Name "=" "STRING_TOKEN" "\(" VN:Number "\)" ","\r
   VarSize "=" N:Number ","\r
-  GUID "=" guidDefinition[Guid]                     << mCVfrDataStorage.DeclareEfiVarStore (SN->getText(), &Guid, _STOSID(VN->getText()), _STOU32(N->getText())); >>\r
+  Uuid "=" guidDefinition[Guid]                     << mCVfrDataStorage.DeclareEfiVarStore (SN->getText(), &Guid, _STOSID(VN->getText()), _STOU32(N->getText())); >>\r
                                                     << \r
                                                        VSEObj.SetGuid (&Guid);\r
                                                        _PCATCH(mCVfrDataStorage.GetVarStoreId(SN->getText(), &VarStoreId), SN);\r
@@ -556,7 +556,7 @@ vfrStatementVarStoreNameValue :
   (\r
     Name "=" "STRING_TOKEN" "\(" N:Number "\)" ","  << _PCATCH(mCVfrDataStorage.NameTableAddItem (_STOSID(N->getText())), SN); >>\r
   )+\r
-  GUID "=" guidDefinition[Guid]                     << _PCATCH(mCVfrDataStorage.DeclareNameVarStoreEnd (&Guid), SN); >>\r
+  Uuid "=" guidDefinition[Guid]                     << _PCATCH(mCVfrDataStorage.DeclareNameVarStoreEnd (&Guid), SN); >>\r
                                                     << \r
                                                        VSNVObj.SetGuid (&Guid);\r
                                                        _PCATCH(mCVfrDataStorage.GetVarStoreId(SN->getText(), &VarStoreId), SN);\r
@@ -2228,7 +2228,7 @@ questionref13Exp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
         Path "=" "STRING_TOKEN" "\(" S:Number "\)"     << Type = 0x4; DevPath = _STOSID(S->getText()); >>\r
       }\r
       {\r
-        GUID "=" guidDefinition[Guid]                  << Type = 0x5; >>\r
+        Uuid "=" guidDefinition[Guid]                  << Type = 0x5; >>\r
       }\r
     )\r
     |\r
index cb045c5..8c99fba 100644 (file)
@@ -1,9 +1,8 @@
 #ifndef _VFRUTILITYLIB_H_\r
 #define _VFRUTILITYLIB_H_\r
 \r
-#include "Tiano.h"\r
 #include "string.h"\r
-#include "EfiTypes.h"\r
+#include "Common/UefiBaseTypes.h"\r
 #include "EfiVfr.h"\r
 #include "VfrError.h"\r
 \r