iPXE
UefiInternalFormRepresentation.h
Go to the documentation of this file.
00001 /** @file
00002   This file defines the encoding for the VFR (Visual Form Representation) language.
00003   IFR is primarily consumed by the EFI presentation engine, and produced by EFI
00004   internal application and drivers as well as all add-in card option-ROM drivers
00005 
00006 Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
00007 (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
00008 This program and the accompanying materials are licensed and made available under
00009 the terms and conditions of the BSD License that accompanies this distribution.
00010 The full text of the license may be found at
00011 http://opensource.org/licenses/bsd-license.php.
00012 
00013 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
00014 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
00015 
00016   @par Revision Reference:
00017   These definitions are from UEFI 2.1 and 2.2.
00018 
00019 **/
00020 
00021 #ifndef __UEFI_INTERNAL_FORMREPRESENTATION_H__
00022 #define __UEFI_INTERNAL_FORMREPRESENTATION_H__
00023 
00024 FILE_LICENCE ( BSD3 );
00025 
00026 #include <ipxe/efi/Guid/HiiFormMapMethodGuid.h>
00027 
00028 ///
00029 /// The following types are currently defined:
00030 ///
00031 typedef VOID*   EFI_HII_HANDLE;
00032 typedef CHAR16* EFI_STRING;
00033 typedef UINT16  EFI_IMAGE_ID;
00034 typedef UINT16  EFI_QUESTION_ID;
00035 typedef UINT16  EFI_STRING_ID;
00036 typedef UINT16  EFI_FORM_ID;
00037 typedef UINT16  EFI_VARSTORE_ID;
00038 typedef UINT16  EFI_ANIMATION_ID;
00039 
00040 typedef UINT16  EFI_DEFAULT_ID;
00041 
00042 typedef UINT32  EFI_HII_FONT_STYLE;
00043 
00044 
00045 
00046 #pragma pack(1)
00047 
00048 //
00049 // Definitions for Package Lists and Package Headers
00050 // Section 27.3.1
00051 //
00052 
00053 ///
00054 /// The header found at the start of each package list.
00055 ///
00056 typedef struct {
00057   EFI_GUID               PackageListGuid;
00058   UINT32                 PackageLength;
00059 } EFI_HII_PACKAGE_LIST_HEADER;
00060 
00061 ///
00062 /// The header found at the start of each package.
00063 ///
00064 typedef struct {
00065   UINT32  Length:24;
00066   UINT32  Type:8;
00067   // UINT8  Data[...];
00068 } EFI_HII_PACKAGE_HEADER;
00069 
00070 //
00071 // Value of HII package type
00072 //
00073 #define EFI_HII_PACKAGE_TYPE_ALL             0x00
00074 #define EFI_HII_PACKAGE_TYPE_GUID            0x01
00075 #define EFI_HII_PACKAGE_FORMS                0x02
00076 #define EFI_HII_PACKAGE_STRINGS              0x04
00077 #define EFI_HII_PACKAGE_FONTS                0x05
00078 #define EFI_HII_PACKAGE_IMAGES               0x06
00079 #define EFI_HII_PACKAGE_SIMPLE_FONTS         0x07
00080 #define EFI_HII_PACKAGE_DEVICE_PATH          0x08
00081 #define EFI_HII_PACKAGE_KEYBOARD_LAYOUT      0x09
00082 #define EFI_HII_PACKAGE_ANIMATIONS           0x0A
00083 #define EFI_HII_PACKAGE_END                  0xDF
00084 #define EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN    0xE0
00085 #define EFI_HII_PACKAGE_TYPE_SYSTEM_END      0xFF
00086 
00087 //
00088 // Definitions for Simplified Font Package
00089 //
00090 
00091 ///
00092 /// Contents of EFI_NARROW_GLYPH.Attributes.
00093 ///@{
00094 #define EFI_GLYPH_NON_SPACING                0x01
00095 #define EFI_GLYPH_WIDE                       0x02
00096 #define EFI_GLYPH_HEIGHT                     19
00097 #define EFI_GLYPH_WIDTH                      8
00098 ///@}
00099 
00100 ///
00101 /// The EFI_NARROW_GLYPH has a preferred dimension (w x h) of 8 x 19 pixels.
00102 ///
00103 typedef struct {
00104   ///
00105   /// The Unicode representation of the glyph. The term weight is the
00106   /// technical term for a character code.
00107   ///
00108   CHAR16                 UnicodeWeight;
00109   ///
00110   /// The data element containing the glyph definitions.
00111   ///
00112   UINT8                  Attributes;
00113   ///
00114   /// The column major glyph representation of the character. Bits
00115   /// with values of one indicate that the corresponding pixel is to be
00116   /// on when normally displayed; those with zero are off.
00117   ///
00118   UINT8                  GlyphCol1[EFI_GLYPH_HEIGHT];
00119 } EFI_NARROW_GLYPH;
00120 
00121 ///
00122 /// The EFI_WIDE_GLYPH has a preferred dimension (w x h) of 16 x 19 pixels, which is large enough
00123 /// to accommodate logographic characters.
00124 ///
00125 typedef struct {
00126   ///
00127   /// The Unicode representation of the glyph. The term weight is the
00128   /// technical term for a character code.
00129   ///
00130   CHAR16                 UnicodeWeight;
00131   ///
00132   /// The data element containing the glyph definitions.
00133   ///
00134   UINT8                  Attributes;
00135   ///
00136   /// The column major glyph representation of the character. Bits
00137   /// with values of one indicate that the corresponding pixel is to be
00138   /// on when normally displayed; those with zero are off.
00139   ///
00140   UINT8                  GlyphCol1[EFI_GLYPH_HEIGHT];
00141   ///
00142   /// The column major glyph representation of the character. Bits
00143   /// with values of one indicate that the corresponding pixel is to be
00144   /// on when normally displayed; those with zero are off.
00145   ///
00146   UINT8                  GlyphCol2[EFI_GLYPH_HEIGHT];
00147   ///
00148   /// Ensures that sizeof (EFI_WIDE_GLYPH) is twice the
00149   /// sizeof (EFI_NARROW_GLYPH). The contents of Pad must
00150   /// be zero.
00151   ///
00152   UINT8                  Pad[3];
00153 } EFI_WIDE_GLYPH;
00154 
00155 ///
00156 /// A simplified font package consists of a font header
00157 /// followed by a series of glyph structures.
00158 ///
00159 typedef struct _EFI_HII_SIMPLE_FONT_PACKAGE_HDR {
00160   EFI_HII_PACKAGE_HEADER Header;
00161   UINT16                 NumberOfNarrowGlyphs;
00162   UINT16                 NumberOfWideGlyphs;
00163   // EFI_NARROW_GLYPH       NarrowGlyphs[];
00164   // EFI_WIDE_GLYPH         WideGlyphs[];
00165 } EFI_HII_SIMPLE_FONT_PACKAGE_HDR;
00166 
00167 //
00168 // Definitions for Font Package
00169 // Section 27.3.3
00170 //
00171 
00172 //
00173 // Value for font style
00174 //
00175 #define EFI_HII_FONT_STYLE_NORMAL            0x00000000
00176 #define EFI_HII_FONT_STYLE_BOLD              0x00000001
00177 #define EFI_HII_FONT_STYLE_ITALIC            0x00000002
00178 #define EFI_HII_FONT_STYLE_EMBOSS            0x00010000
00179 #define EFI_HII_FONT_STYLE_OUTLINE           0x00020000
00180 #define EFI_HII_FONT_STYLE_SHADOW            0x00040000
00181 #define EFI_HII_FONT_STYLE_UNDERLINE         0x00080000
00182 #define EFI_HII_FONT_STYLE_DBL_UNDER         0x00100000
00183 
00184 typedef struct _EFI_HII_GLYPH_INFO {
00185   UINT16                 Width;
00186   UINT16                 Height;
00187   INT16                  OffsetX;
00188   INT16                  OffsetY;
00189   INT16                  AdvanceX;
00190 } EFI_HII_GLYPH_INFO;
00191 
00192 ///
00193 /// The fixed header consists of a standard record header,
00194 /// then the character values in this section, the flags
00195 /// (including the encoding method) and the offsets of the glyph
00196 /// information, the glyph bitmaps and the character map.
00197 ///
00198 typedef struct _EFI_HII_FONT_PACKAGE_HDR {
00199   EFI_HII_PACKAGE_HEADER Header;
00200   UINT32                 HdrSize;
00201   UINT32                 GlyphBlockOffset;
00202   EFI_HII_GLYPH_INFO     Cell;
00203   EFI_HII_FONT_STYLE     FontStyle;
00204   CHAR16                 FontFamily[1];
00205 } EFI_HII_FONT_PACKAGE_HDR;
00206 
00207 //
00208 // Value of different glyph info block types
00209 //
00210 #define EFI_HII_GIBT_END                  0x00
00211 #define EFI_HII_GIBT_GLYPH                0x10
00212 #define EFI_HII_GIBT_GLYPHS               0x11
00213 #define EFI_HII_GIBT_GLYPH_DEFAULT        0x12
00214 #define EFI_HII_GIBT_GLYPHS_DEFAULT       0x13
00215 #define EFI_HII_GIBT_GLYPH_VARIABILITY    0x14
00216 #define EFI_HII_GIBT_DUPLICATE            0x20
00217 #define EFI_HII_GIBT_SKIP2                0x21
00218 #define EFI_HII_GIBT_SKIP1                0x22
00219 #define EFI_HII_GIBT_DEFAULTS             0x23
00220 #define EFI_HII_GIBT_EXT1                 0x30
00221 #define EFI_HII_GIBT_EXT2                 0x31
00222 #define EFI_HII_GIBT_EXT4                 0x32
00223 
00224 typedef struct _EFI_HII_GLYPH_BLOCK {
00225   UINT8                  BlockType;
00226 } EFI_HII_GLYPH_BLOCK;
00227 
00228 //
00229 // Definition of different glyph info block types
00230 //
00231 
00232 typedef struct _EFI_HII_GIBT_DEFAULTS_BLOCK {
00233   EFI_HII_GLYPH_BLOCK    Header;
00234   EFI_HII_GLYPH_INFO     Cell;
00235 } EFI_HII_GIBT_DEFAULTS_BLOCK;
00236 
00237 typedef struct _EFI_HII_GIBT_DUPLICATE_BLOCK {
00238   EFI_HII_GLYPH_BLOCK    Header;
00239   CHAR16                 CharValue;
00240 } EFI_HII_GIBT_DUPLICATE_BLOCK;
00241 
00242 typedef struct _EFI_GLYPH_GIBT_END_BLOCK {
00243   EFI_HII_GLYPH_BLOCK    Header;
00244 } EFI_GLYPH_GIBT_END_BLOCK;
00245 
00246 typedef struct _EFI_HII_GIBT_EXT1_BLOCK {
00247   EFI_HII_GLYPH_BLOCK    Header;
00248   UINT8                  BlockType2;
00249   UINT8                  Length;
00250 } EFI_HII_GIBT_EXT1_BLOCK;
00251 
00252 typedef struct _EFI_HII_GIBT_EXT2_BLOCK {
00253   EFI_HII_GLYPH_BLOCK    Header;
00254   UINT8                  BlockType2;
00255   UINT16                 Length;
00256 } EFI_HII_GIBT_EXT2_BLOCK;
00257 
00258 typedef struct _EFI_HII_GIBT_EXT4_BLOCK {
00259   EFI_HII_GLYPH_BLOCK    Header;
00260   UINT8                  BlockType2;
00261   UINT32                 Length;
00262 } EFI_HII_GIBT_EXT4_BLOCK;
00263 
00264 typedef struct _EFI_HII_GIBT_GLYPH_BLOCK {
00265   EFI_HII_GLYPH_BLOCK    Header;
00266   EFI_HII_GLYPH_INFO     Cell;
00267   UINT8                  BitmapData[1];
00268 } EFI_HII_GIBT_GLYPH_BLOCK;
00269 
00270 typedef struct _EFI_HII_GIBT_GLYPHS_BLOCK {
00271   EFI_HII_GLYPH_BLOCK    Header;
00272   EFI_HII_GLYPH_INFO     Cell;
00273   UINT16                 Count;
00274   UINT8                  BitmapData[1];
00275 } EFI_HII_GIBT_GLYPHS_BLOCK;
00276 
00277 typedef struct _EFI_HII_GIBT_GLYPH_DEFAULT_BLOCK {
00278   EFI_HII_GLYPH_BLOCK    Header;
00279   UINT8                  BitmapData[1];
00280 } EFI_HII_GIBT_GLYPH_DEFAULT_BLOCK;
00281 
00282 typedef struct _EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK {
00283   EFI_HII_GLYPH_BLOCK    Header;
00284   UINT16                 Count;
00285   UINT8                  BitmapData[1];
00286 } EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK;
00287 
00288 typedef struct _EFI_HII_GIBT_VARIABILITY_BLOCK {
00289   EFI_HII_GLYPH_BLOCK    Header;
00290   EFI_HII_GLYPH_INFO     Cell;
00291   UINT8                  GlyphPackInBits;
00292   UINT8                  BitmapData [1];
00293 } EFI_HII_GIBT_VARIABILITY_BLOCK;
00294 
00295 typedef struct _EFI_HII_GIBT_SKIP1_BLOCK {
00296   EFI_HII_GLYPH_BLOCK    Header;
00297   UINT8                  SkipCount;
00298 } EFI_HII_GIBT_SKIP1_BLOCK;
00299 
00300 typedef struct _EFI_HII_GIBT_SKIP2_BLOCK {
00301   EFI_HII_GLYPH_BLOCK    Header;
00302   UINT16                 SkipCount;
00303 } EFI_HII_GIBT_SKIP2_BLOCK;
00304 
00305 //
00306 // Definitions for Device Path Package
00307 // Section 27.3.4
00308 //
00309 
00310 ///
00311 /// The device path package is used to carry a device path
00312 /// associated with the package list.
00313 ///
00314 typedef struct _EFI_HII_DEVICE_PATH_PACKAGE_HDR {
00315   EFI_HII_PACKAGE_HEADER   Header;
00316   // EFI_DEVICE_PATH_PROTOCOL DevicePath[];
00317 } EFI_HII_DEVICE_PATH_PACKAGE_HDR;
00318 
00319 //
00320 // Definitions for GUID Package
00321 // Section 27.3.5
00322 //
00323 
00324 ///
00325 /// The GUID package is used to carry data where the format is defined by a GUID.
00326 ///
00327 typedef struct _EFI_HII_GUID_PACKAGE_HDR {
00328   EFI_HII_PACKAGE_HEADER  Header;
00329   EFI_GUID                Guid;
00330   // Data per GUID definition may follow
00331 } EFI_HII_GUID_PACKAGE_HDR;
00332 
00333 //
00334 // Definitions for String Package
00335 // Section 27.3.6
00336 //
00337 
00338 #define UEFI_CONFIG_LANG   "x-UEFI"
00339 #define UEFI_CONFIG_LANG_2 "x-i-UEFI"
00340 
00341 ///
00342 /// The fixed header consists of a standard record header and then the string identifiers
00343 /// contained in this section and the offsets of the string and language information.
00344 ///
00345 typedef struct _EFI_HII_STRING_PACKAGE_HDR {
00346   EFI_HII_PACKAGE_HEADER  Header;
00347   UINT32                  HdrSize;
00348   UINT32                  StringInfoOffset;
00349   CHAR16                  LanguageWindow[16];
00350   EFI_STRING_ID           LanguageName;
00351   CHAR8                   Language[1];
00352 } EFI_HII_STRING_PACKAGE_HDR;
00353 
00354 typedef struct {
00355   UINT8                   BlockType;
00356 } EFI_HII_STRING_BLOCK;
00357 
00358 //
00359 // Value of different string information block types
00360 //
00361 #define EFI_HII_SIBT_END                     0x00
00362 #define EFI_HII_SIBT_STRING_SCSU             0x10
00363 #define EFI_HII_SIBT_STRING_SCSU_FONT        0x11
00364 #define EFI_HII_SIBT_STRINGS_SCSU            0x12
00365 #define EFI_HII_SIBT_STRINGS_SCSU_FONT       0x13
00366 #define EFI_HII_SIBT_STRING_UCS2             0x14
00367 #define EFI_HII_SIBT_STRING_UCS2_FONT        0x15
00368 #define EFI_HII_SIBT_STRINGS_UCS2            0x16
00369 #define EFI_HII_SIBT_STRINGS_UCS2_FONT       0x17
00370 #define EFI_HII_SIBT_DUPLICATE               0x20
00371 #define EFI_HII_SIBT_SKIP2                   0x21
00372 #define EFI_HII_SIBT_SKIP1                   0x22
00373 #define EFI_HII_SIBT_EXT1                    0x30
00374 #define EFI_HII_SIBT_EXT2                    0x31
00375 #define EFI_HII_SIBT_EXT4                    0x32
00376 #define EFI_HII_SIBT_FONT                    0x40
00377 
00378 //
00379 // Definition of different string information block types
00380 //
00381 
00382 typedef struct _EFI_HII_SIBT_DUPLICATE_BLOCK {
00383   EFI_HII_STRING_BLOCK    Header;
00384   EFI_STRING_ID           StringId;
00385 } EFI_HII_SIBT_DUPLICATE_BLOCK;
00386 
00387 typedef struct _EFI_HII_SIBT_END_BLOCK {
00388   EFI_HII_STRING_BLOCK    Header;
00389 } EFI_HII_SIBT_END_BLOCK;
00390 
00391 typedef struct _EFI_HII_SIBT_EXT1_BLOCK {
00392   EFI_HII_STRING_BLOCK    Header;
00393   UINT8                   BlockType2;
00394   UINT8                   Length;
00395 } EFI_HII_SIBT_EXT1_BLOCK;
00396 
00397 typedef struct _EFI_HII_SIBT_EXT2_BLOCK {
00398   EFI_HII_STRING_BLOCK    Header;
00399   UINT8                   BlockType2;
00400   UINT16                  Length;
00401 } EFI_HII_SIBT_EXT2_BLOCK;
00402 
00403 typedef struct _EFI_HII_SIBT_EXT4_BLOCK {
00404   EFI_HII_STRING_BLOCK    Header;
00405   UINT8                   BlockType2;
00406   UINT32                  Length;
00407 } EFI_HII_SIBT_EXT4_BLOCK;
00408 
00409 typedef struct _EFI_HII_SIBT_FONT_BLOCK {
00410   EFI_HII_SIBT_EXT2_BLOCK Header;
00411   UINT8                   FontId;
00412   UINT16                  FontSize;
00413   EFI_HII_FONT_STYLE      FontStyle;
00414   CHAR16                  FontName[1];
00415 } EFI_HII_SIBT_FONT_BLOCK;
00416 
00417 typedef struct _EFI_HII_SIBT_SKIP1_BLOCK {
00418   EFI_HII_STRING_BLOCK    Header;
00419   UINT8                   SkipCount;
00420 } EFI_HII_SIBT_SKIP1_BLOCK;
00421 
00422 typedef struct _EFI_HII_SIBT_SKIP2_BLOCK {
00423   EFI_HII_STRING_BLOCK    Header;
00424   UINT16                  SkipCount;
00425 } EFI_HII_SIBT_SKIP2_BLOCK;
00426 
00427 typedef struct _EFI_HII_SIBT_STRING_SCSU_BLOCK {
00428   EFI_HII_STRING_BLOCK    Header;
00429   UINT8                   StringText[1];
00430 } EFI_HII_SIBT_STRING_SCSU_BLOCK;
00431 
00432 typedef struct _EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK {
00433   EFI_HII_STRING_BLOCK    Header;
00434   UINT8                   FontIdentifier;
00435   UINT8                   StringText[1];
00436 } EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK;
00437 
00438 typedef struct _EFI_HII_SIBT_STRINGS_SCSU_BLOCK {
00439   EFI_HII_STRING_BLOCK    Header;
00440   UINT16                  StringCount;
00441   UINT8                   StringText[1];
00442 } EFI_HII_SIBT_STRINGS_SCSU_BLOCK;
00443 
00444 typedef struct _EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK {
00445   EFI_HII_STRING_BLOCK    Header;
00446   UINT8                   FontIdentifier;
00447   UINT16                  StringCount;
00448   UINT8                   StringText[1];
00449 } EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK;
00450 
00451 typedef struct _EFI_HII_SIBT_STRING_UCS2_BLOCK {
00452   EFI_HII_STRING_BLOCK    Header;
00453   CHAR16                  StringText[1];
00454 } EFI_HII_SIBT_STRING_UCS2_BLOCK;
00455 
00456 typedef struct _EFI_HII_SIBT_STRING_UCS2_FONT_BLOCK {
00457   EFI_HII_STRING_BLOCK    Header;
00458   UINT8                   FontIdentifier;
00459   CHAR16                  StringText[1];
00460 } EFI_HII_SIBT_STRING_UCS2_FONT_BLOCK;
00461 
00462 typedef struct _EFI_HII_SIBT_STRINGS_UCS2_BLOCK {
00463   EFI_HII_STRING_BLOCK    Header;
00464   UINT16                  StringCount;
00465   CHAR16                  StringText[1];
00466 } EFI_HII_SIBT_STRINGS_UCS2_BLOCK;
00467 
00468 typedef struct _EFI_HII_SIBT_STRINGS_UCS2_FONT_BLOCK {
00469   EFI_HII_STRING_BLOCK    Header;
00470   UINT8                   FontIdentifier;
00471   UINT16                  StringCount;
00472   CHAR16                  StringText[1];
00473 } EFI_HII_SIBT_STRINGS_UCS2_FONT_BLOCK;
00474 
00475 //
00476 // Definitions for Image Package
00477 // Section 27.3.7
00478 //
00479 
00480 typedef struct _EFI_HII_IMAGE_PACKAGE_HDR {
00481   EFI_HII_PACKAGE_HEADER  Header;
00482   UINT32                  ImageInfoOffset;
00483   UINT32                  PaletteInfoOffset;
00484 } EFI_HII_IMAGE_PACKAGE_HDR;
00485 
00486 typedef struct _EFI_HII_IMAGE_BLOCK {
00487   UINT8                   BlockType;
00488 } EFI_HII_IMAGE_BLOCK;
00489 
00490 //
00491 // Value of different image information block types
00492 //
00493 #define EFI_HII_IIBT_END               0x00
00494 #define EFI_HII_IIBT_IMAGE_1BIT        0x10
00495 #define EFI_HII_IIBT_IMAGE_1BIT_TRANS  0x11
00496 #define EFI_HII_IIBT_IMAGE_4BIT        0x12
00497 #define EFI_HII_IIBT_IMAGE_4BIT_TRANS  0x13
00498 #define EFI_HII_IIBT_IMAGE_8BIT        0x14
00499 #define EFI_HII_IIBT_IMAGE_8BIT_TRANS  0x15
00500 #define EFI_HII_IIBT_IMAGE_24BIT       0x16
00501 #define EFI_HII_IIBT_IMAGE_24BIT_TRANS 0x17
00502 #define EFI_HII_IIBT_IMAGE_JPEG        0x18
00503 #define EFI_HII_IIBT_IMAGE_PNG         0x19
00504 #define EFI_HII_IIBT_DUPLICATE         0x20
00505 #define EFI_HII_IIBT_SKIP2             0x21
00506 #define EFI_HII_IIBT_SKIP1             0x22
00507 #define EFI_HII_IIBT_EXT1              0x30
00508 #define EFI_HII_IIBT_EXT2              0x31
00509 #define EFI_HII_IIBT_EXT4              0x32
00510 
00511 //
00512 // Definition of different image information block types
00513 //
00514 
00515 typedef struct _EFI_HII_IIBT_END_BLOCK {
00516   EFI_HII_IMAGE_BLOCK          Header;
00517 } EFI_HII_IIBT_END_BLOCK;
00518 
00519 typedef struct _EFI_HII_IIBT_EXT1_BLOCK {
00520   EFI_HII_IMAGE_BLOCK          Header;
00521   UINT8                        BlockType2;
00522   UINT8                        Length;
00523 } EFI_HII_IIBT_EXT1_BLOCK;
00524 
00525 typedef struct _EFI_HII_IIBT_EXT2_BLOCK {
00526   EFI_HII_IMAGE_BLOCK          Header;
00527   UINT8                        BlockType2;
00528   UINT16                       Length;
00529 } EFI_HII_IIBT_EXT2_BLOCK;
00530 
00531 typedef struct _EFI_HII_IIBT_EXT4_BLOCK {
00532   EFI_HII_IMAGE_BLOCK          Header;
00533   UINT8                        BlockType2;
00534   UINT32                       Length;
00535 } EFI_HII_IIBT_EXT4_BLOCK;
00536 
00537 typedef struct _EFI_HII_IIBT_IMAGE_1BIT_BASE {
00538   UINT16                       Width;
00539   UINT16                       Height;
00540   UINT8                        Data[1];
00541 } EFI_HII_IIBT_IMAGE_1BIT_BASE;
00542 
00543 typedef struct _EFI_HII_IIBT_IMAGE_1BIT_BLOCK {
00544   EFI_HII_IMAGE_BLOCK          Header;
00545   UINT8                        PaletteIndex;
00546   EFI_HII_IIBT_IMAGE_1BIT_BASE Bitmap;
00547 } EFI_HII_IIBT_IMAGE_1BIT_BLOCK;
00548 
00549 typedef struct _EFI_HII_IIBT_IMAGE_1BIT_TRANS_BLOCK {
00550   EFI_HII_IMAGE_BLOCK          Header;
00551   UINT8                        PaletteIndex;
00552   EFI_HII_IIBT_IMAGE_1BIT_BASE Bitmap;
00553 } EFI_HII_IIBT_IMAGE_1BIT_TRANS_BLOCK;
00554 
00555 typedef struct _EFI_HII_RGB_PIXEL {
00556   UINT8                        b;
00557   UINT8                        g;
00558   UINT8                        r;
00559 } EFI_HII_RGB_PIXEL;
00560 
00561 typedef struct _EFI_HII_IIBT_IMAGE_24BIT_BASE {
00562   UINT16                       Width;
00563   UINT16                       Height;
00564   EFI_HII_RGB_PIXEL            Bitmap[1];
00565 } EFI_HII_IIBT_IMAGE_24BIT_BASE;
00566 
00567 typedef struct _EFI_HII_IIBT_IMAGE_24BIT_BLOCK {
00568   EFI_HII_IMAGE_BLOCK           Header;
00569   EFI_HII_IIBT_IMAGE_24BIT_BASE Bitmap;
00570 } EFI_HII_IIBT_IMAGE_24BIT_BLOCK;
00571 
00572 typedef struct _EFI_HII_IIBT_IMAGE_24BIT_TRANS_BLOCK {
00573   EFI_HII_IMAGE_BLOCK           Header;
00574   EFI_HII_IIBT_IMAGE_24BIT_BASE Bitmap;
00575 } EFI_HII_IIBT_IMAGE_24BIT_TRANS_BLOCK;
00576 
00577 typedef struct _EFI_HII_IIBT_IMAGE_4BIT_BASE {
00578   UINT16                       Width;
00579   UINT16                       Height;
00580   UINT8                        Data[1];
00581 } EFI_HII_IIBT_IMAGE_4BIT_BASE;
00582 
00583 typedef struct _EFI_HII_IIBT_IMAGE_4BIT_BLOCK {
00584   EFI_HII_IMAGE_BLOCK          Header;
00585   UINT8                        PaletteIndex;
00586   EFI_HII_IIBT_IMAGE_4BIT_BASE Bitmap;
00587 } EFI_HII_IIBT_IMAGE_4BIT_BLOCK;
00588 
00589 typedef struct _EFI_HII_IIBT_IMAGE_4BIT_TRANS_BLOCK {
00590   EFI_HII_IMAGE_BLOCK          Header;
00591   UINT8                        PaletteIndex;
00592   EFI_HII_IIBT_IMAGE_4BIT_BASE Bitmap;
00593 } EFI_HII_IIBT_IMAGE_4BIT_TRANS_BLOCK;
00594 
00595 typedef struct _EFI_HII_IIBT_IMAGE_8BIT_BASE {
00596   UINT16                       Width;
00597   UINT16                       Height;
00598   UINT8                        Data[1];
00599 } EFI_HII_IIBT_IMAGE_8BIT_BASE;
00600 
00601 typedef struct _EFI_HII_IIBT_IMAGE_8BIT_PALETTE_BLOCK {
00602   EFI_HII_IMAGE_BLOCK          Header;
00603   UINT8                        PaletteIndex;
00604   EFI_HII_IIBT_IMAGE_8BIT_BASE Bitmap;
00605 } EFI_HII_IIBT_IMAGE_8BIT_BLOCK;
00606 
00607 typedef struct _EFI_HII_IIBT_IMAGE_8BIT_TRANS_BLOCK {
00608   EFI_HII_IMAGE_BLOCK          Header;
00609   UINT8                        PaletteIndex;
00610   EFI_HII_IIBT_IMAGE_8BIT_BASE Bitmap;
00611 } EFI_HII_IIBT_IMAGE_8BIT_TRAN_BLOCK;
00612 
00613 typedef struct _EFI_HII_IIBT_DUPLICATE_BLOCK {
00614   EFI_HII_IMAGE_BLOCK          Header;
00615   EFI_IMAGE_ID                 ImageId;
00616 } EFI_HII_IIBT_DUPLICATE_BLOCK;
00617 
00618 typedef struct _EFI_HII_IIBT_JPEG_BLOCK {
00619   EFI_HII_IMAGE_BLOCK          Header;
00620   UINT32                       Size;
00621   UINT8                        Data[1];
00622 } EFI_HII_IIBT_JPEG_BLOCK;
00623 
00624 typedef struct _EFI_HII_IIBT_PNG_BLOCK {
00625   EFI_HII_IMAGE_BLOCK          Header;
00626   UINT32                       Size;
00627   UINT8                        Data[1];
00628 } EFI_HII_IIBT_PNG_BLOCK;
00629 
00630 typedef struct _EFI_HII_IIBT_SKIP1_BLOCK {
00631   EFI_HII_IMAGE_BLOCK          Header;
00632   UINT8                        SkipCount;
00633 } EFI_HII_IIBT_SKIP1_BLOCK;
00634 
00635 typedef struct _EFI_HII_IIBT_SKIP2_BLOCK {
00636   EFI_HII_IMAGE_BLOCK          Header;
00637   UINT16                       SkipCount;
00638 } EFI_HII_IIBT_SKIP2_BLOCK;
00639 
00640 //
00641 // Definitions for Palette Information
00642 //
00643 
00644 typedef struct _EFI_HII_IMAGE_PALETTE_INFO_HEADER {
00645   UINT16                       PaletteCount;
00646 } EFI_HII_IMAGE_PALETTE_INFO_HEADER;
00647 
00648 typedef struct _EFI_HII_IMAGE_PALETTE_INFO {
00649   UINT16                       PaletteSize;
00650   EFI_HII_RGB_PIXEL            PaletteValue[1];
00651 } EFI_HII_IMAGE_PALETTE_INFO;
00652 
00653 //
00654 // Definitions for Forms Package
00655 // Section 27.3.8
00656 //
00657 
00658 ///
00659 /// The Form package is used to carry form-based encoding data.
00660 ///
00661 typedef struct _EFI_HII_FORM_PACKAGE_HDR {
00662   EFI_HII_PACKAGE_HEADER       Header;
00663   // EFI_IFR_OP_HEADER         OpCodeHeader;
00664   // More op-codes follow
00665 } EFI_HII_FORM_PACKAGE_HDR;
00666 
00667 typedef struct {
00668   UINT8 Hour;
00669   UINT8 Minute;
00670   UINT8 Second;
00671 } EFI_HII_TIME;
00672 
00673 typedef struct {
00674   UINT16 Year;
00675   UINT8  Month;
00676   UINT8  Day;
00677 } EFI_HII_DATE;
00678 
00679 typedef struct {
00680   EFI_QUESTION_ID QuestionId;
00681   EFI_FORM_ID     FormId;
00682   EFI_GUID        FormSetGuid;
00683   EFI_STRING_ID   DevicePath;
00684 } EFI_HII_REF;
00685 
00686 typedef union {
00687   UINT8           u8;
00688   UINT16          u16;
00689   UINT32          u32;
00690   UINT64          u64;
00691   BOOLEAN         b;
00692   EFI_HII_TIME    time;
00693   EFI_HII_DATE    date;
00694   EFI_STRING_ID   string; ///< EFI_IFR_TYPE_STRING, EFI_IFR_TYPE_ACTION
00695   EFI_HII_REF     ref;    ///< EFI_IFR_TYPE_REF
00696   // UINT8 buffer[];      ///< EFI_IFR_TYPE_BUFFER
00697 } EFI_IFR_TYPE_VALUE;
00698 
00699 //
00700 // IFR Opcodes
00701 //
00702 #define EFI_IFR_FORM_OP                0x01
00703 #define EFI_IFR_SUBTITLE_OP            0x02
00704 #define EFI_IFR_TEXT_OP                0x03
00705 #define EFI_IFR_IMAGE_OP               0x04
00706 #define EFI_IFR_ONE_OF_OP              0x05
00707 #define EFI_IFR_CHECKBOX_OP            0x06
00708 #define EFI_IFR_NUMERIC_OP             0x07
00709 #define EFI_IFR_PASSWORD_OP            0x08
00710 #define EFI_IFR_ONE_OF_OPTION_OP       0x09
00711 #define EFI_IFR_SUPPRESS_IF_OP         0x0A
00712 #define EFI_IFR_LOCKED_OP              0x0B
00713 #define EFI_IFR_ACTION_OP              0x0C
00714 #define EFI_IFR_RESET_BUTTON_OP        0x0D
00715 #define EFI_IFR_FORM_SET_OP            0x0E
00716 #define EFI_IFR_REF_OP                 0x0F
00717 #define EFI_IFR_NO_SUBMIT_IF_OP        0x10
00718 #define EFI_IFR_INCONSISTENT_IF_OP     0x11
00719 #define EFI_IFR_EQ_ID_VAL_OP           0x12
00720 #define EFI_IFR_EQ_ID_ID_OP            0x13
00721 #define EFI_IFR_EQ_ID_VAL_LIST_OP      0x14
00722 #define EFI_IFR_AND_OP                 0x15
00723 #define EFI_IFR_OR_OP                  0x16
00724 #define EFI_IFR_NOT_OP                 0x17
00725 #define EFI_IFR_RULE_OP                0x18
00726 #define EFI_IFR_GRAY_OUT_IF_OP         0x19
00727 #define EFI_IFR_DATE_OP                0x1A
00728 #define EFI_IFR_TIME_OP                0x1B
00729 #define EFI_IFR_STRING_OP              0x1C
00730 #define EFI_IFR_REFRESH_OP             0x1D
00731 #define EFI_IFR_DISABLE_IF_OP          0x1E
00732 #define EFI_IFR_ANIMATION_OP           0x1F
00733 #define EFI_IFR_TO_LOWER_OP            0x20
00734 #define EFI_IFR_TO_UPPER_OP            0x21
00735 #define EFI_IFR_MAP_OP                 0x22
00736 #define EFI_IFR_ORDERED_LIST_OP        0x23
00737 #define EFI_IFR_VARSTORE_OP            0x24
00738 #define EFI_IFR_VARSTORE_NAME_VALUE_OP 0x25
00739 #define EFI_IFR_VARSTORE_EFI_OP        0x26
00740 #define EFI_IFR_VARSTORE_DEVICE_OP     0x27
00741 #define EFI_IFR_VERSION_OP             0x28
00742 #define EFI_IFR_END_OP                 0x29
00743 #define EFI_IFR_MATCH_OP               0x2A
00744 #define EFI_IFR_GET_OP                 0x2B
00745 #define EFI_IFR_SET_OP                 0x2C
00746 #define EFI_IFR_READ_OP                0x2D
00747 #define EFI_IFR_WRITE_OP               0x2E
00748 #define EFI_IFR_EQUAL_OP               0x2F
00749 #define EFI_IFR_NOT_EQUAL_OP           0x30
00750 #define EFI_IFR_GREATER_THAN_OP        0x31
00751 #define EFI_IFR_GREATER_EQUAL_OP       0x32
00752 #define EFI_IFR_LESS_THAN_OP           0x33
00753 #define EFI_IFR_LESS_EQUAL_OP          0x34
00754 #define EFI_IFR_BITWISE_AND_OP         0x35
00755 #define EFI_IFR_BITWISE_OR_OP          0x36
00756 #define EFI_IFR_BITWISE_NOT_OP         0x37
00757 #define EFI_IFR_SHIFT_LEFT_OP          0x38
00758 #define EFI_IFR_SHIFT_RIGHT_OP         0x39
00759 #define EFI_IFR_ADD_OP                 0x3A
00760 #define EFI_IFR_SUBTRACT_OP            0x3B
00761 #define EFI_IFR_MULTIPLY_OP            0x3C
00762 #define EFI_IFR_DIVIDE_OP              0x3D
00763 #define EFI_IFR_MODULO_OP              0x3E
00764 #define EFI_IFR_RULE_REF_OP            0x3F
00765 #define EFI_IFR_QUESTION_REF1_OP       0x40
00766 #define EFI_IFR_QUESTION_REF2_OP       0x41
00767 #define EFI_IFR_UINT8_OP               0x42
00768 #define EFI_IFR_UINT16_OP              0x43
00769 #define EFI_IFR_UINT32_OP              0x44
00770 #define EFI_IFR_UINT64_OP              0x45
00771 #define EFI_IFR_TRUE_OP                0x46
00772 #define EFI_IFR_FALSE_OP               0x47
00773 #define EFI_IFR_TO_UINT_OP             0x48
00774 #define EFI_IFR_TO_STRING_OP           0x49
00775 #define EFI_IFR_TO_BOOLEAN_OP          0x4A
00776 #define EFI_IFR_MID_OP                 0x4B
00777 #define EFI_IFR_FIND_OP                0x4C
00778 #define EFI_IFR_TOKEN_OP               0x4D
00779 #define EFI_IFR_STRING_REF1_OP         0x4E
00780 #define EFI_IFR_STRING_REF2_OP         0x4F
00781 #define EFI_IFR_CONDITIONAL_OP         0x50
00782 #define EFI_IFR_QUESTION_REF3_OP       0x51
00783 #define EFI_IFR_ZERO_OP                0x52
00784 #define EFI_IFR_ONE_OP                 0x53
00785 #define EFI_IFR_ONES_OP                0x54
00786 #define EFI_IFR_UNDEFINED_OP           0x55
00787 #define EFI_IFR_LENGTH_OP              0x56
00788 #define EFI_IFR_DUP_OP                 0x57
00789 #define EFI_IFR_THIS_OP                0x58
00790 #define EFI_IFR_SPAN_OP                0x59
00791 #define EFI_IFR_VALUE_OP               0x5A
00792 #define EFI_IFR_DEFAULT_OP             0x5B
00793 #define EFI_IFR_DEFAULTSTORE_OP        0x5C
00794 #define EFI_IFR_FORM_MAP_OP            0x5D
00795 #define EFI_IFR_CATENATE_OP            0x5E
00796 #define EFI_IFR_GUID_OP                0x5F
00797 #define EFI_IFR_SECURITY_OP            0x60
00798 #define EFI_IFR_MODAL_TAG_OP           0x61
00799 #define EFI_IFR_REFRESH_ID_OP          0x62
00800 #define EFI_IFR_WARNING_IF_OP          0x63
00801 #define EFI_IFR_MATCH2_OP              0x64
00802 
00803 //
00804 // Definitions of IFR Standard Headers
00805 // Section 27.3.8.2
00806 //
00807 
00808 typedef struct _EFI_IFR_OP_HEADER {
00809   UINT8                    OpCode;
00810   UINT8                    Length:7;
00811   UINT8                    Scope:1;
00812 } EFI_IFR_OP_HEADER;
00813 
00814 typedef struct _EFI_IFR_STATEMENT_HEADER {
00815   EFI_STRING_ID            Prompt;
00816   EFI_STRING_ID            Help;
00817 } EFI_IFR_STATEMENT_HEADER;
00818 
00819 typedef struct _EFI_IFR_QUESTION_HEADER {
00820   EFI_IFR_STATEMENT_HEADER Header;
00821   EFI_QUESTION_ID          QuestionId;
00822   EFI_VARSTORE_ID          VarStoreId;
00823   union {
00824     EFI_STRING_ID          VarName;
00825     UINT16                 VarOffset;
00826   }                        VarStoreInfo;
00827   UINT8                    Flags;
00828 } EFI_IFR_QUESTION_HEADER;
00829 
00830 //
00831 // Flag values of EFI_IFR_QUESTION_HEADER
00832 //
00833 #define EFI_IFR_FLAG_READ_ONLY          0x01
00834 #define EFI_IFR_FLAG_CALLBACK           0x04
00835 #define EFI_IFR_FLAG_RESET_REQUIRED     0x10
00836 #define EFI_IFR_FLAG_RECONNECT_REQUIRED 0x40
00837 #define EFI_IFR_FLAG_OPTIONS_ONLY       0x80
00838 
00839 //
00840 // Definition for Opcode Reference
00841 // Section 27.3.8.3
00842 //
00843 typedef struct _EFI_IFR_DEFAULTSTORE {
00844   EFI_IFR_OP_HEADER        Header;
00845   EFI_STRING_ID            DefaultName;
00846   UINT16                   DefaultId;
00847 } EFI_IFR_DEFAULTSTORE;
00848 
00849 //
00850 // Default Identifier of default store
00851 //
00852 #define EFI_HII_DEFAULT_CLASS_STANDARD       0x0000
00853 #define EFI_HII_DEFAULT_CLASS_MANUFACTURING  0x0001
00854 #define EFI_HII_DEFAULT_CLASS_SAFE           0x0002
00855 #define EFI_HII_DEFAULT_CLASS_PLATFORM_BEGIN 0x4000
00856 #define EFI_HII_DEFAULT_CLASS_PLATFORM_END   0x7fff
00857 #define EFI_HII_DEFAULT_CLASS_HARDWARE_BEGIN 0x8000
00858 #define EFI_HII_DEFAULT_CLASS_HARDWARE_END   0xbfff
00859 #define EFI_HII_DEFAULT_CLASS_FIRMWARE_BEGIN 0xc000
00860 #define EFI_HII_DEFAULT_CLASS_FIRMWARE_END   0xffff
00861 
00862 typedef struct _EFI_IFR_VARSTORE {
00863   EFI_IFR_OP_HEADER        Header;
00864   EFI_GUID                 Guid;
00865   EFI_VARSTORE_ID          VarStoreId;
00866   UINT16                   Size;
00867   UINT8                    Name[1];
00868 } EFI_IFR_VARSTORE;
00869 
00870 typedef struct _EFI_IFR_VARSTORE_EFI {
00871   EFI_IFR_OP_HEADER        Header;
00872   EFI_VARSTORE_ID          VarStoreId;
00873   EFI_GUID                 Guid;
00874   UINT32                   Attributes;
00875   UINT16                   Size;
00876   UINT8                    Name[1];
00877 } EFI_IFR_VARSTORE_EFI;
00878 
00879 typedef struct _EFI_IFR_VARSTORE_NAME_VALUE {
00880   EFI_IFR_OP_HEADER        Header;
00881   EFI_VARSTORE_ID          VarStoreId;
00882   EFI_GUID                 Guid;
00883 } EFI_IFR_VARSTORE_NAME_VALUE;
00884 
00885 typedef struct _EFI_IFR_FORM_SET {
00886   EFI_IFR_OP_HEADER        Header;
00887   EFI_GUID                 Guid;
00888   EFI_STRING_ID            FormSetTitle;
00889   EFI_STRING_ID            Help;
00890   UINT8                    Flags;
00891   // EFI_GUID              ClassGuid[];
00892 } EFI_IFR_FORM_SET;
00893 
00894 typedef struct _EFI_IFR_END {
00895   EFI_IFR_OP_HEADER        Header;
00896 } EFI_IFR_END;
00897 
00898 typedef struct _EFI_IFR_FORM {
00899   EFI_IFR_OP_HEADER        Header;
00900   UINT16                   FormId;
00901   EFI_STRING_ID            FormTitle;
00902 } EFI_IFR_FORM;
00903 
00904 typedef struct _EFI_IFR_IMAGE {
00905   EFI_IFR_OP_HEADER        Header;
00906   EFI_IMAGE_ID             Id;
00907 } EFI_IFR_IMAGE;
00908 
00909 typedef struct _EFI_IFR_MODAL_TAG {
00910   EFI_IFR_OP_HEADER        Header;
00911 } EFI_IFR_MODAL_TAG;
00912 
00913 typedef struct _EFI_IFR_LOCKED {
00914   EFI_IFR_OP_HEADER        Header;
00915 } EFI_IFR_LOCKED;
00916 
00917 typedef struct _EFI_IFR_RULE {
00918   EFI_IFR_OP_HEADER        Header;
00919   UINT8                    RuleId;
00920 } EFI_IFR_RULE;
00921 
00922 typedef struct _EFI_IFR_DEFAULT {
00923   EFI_IFR_OP_HEADER        Header;
00924   UINT16                   DefaultId;
00925   UINT8                    Type;
00926   EFI_IFR_TYPE_VALUE       Value;
00927 } EFI_IFR_DEFAULT;
00928 
00929 typedef struct _EFI_IFR_DEFAULT_2 {
00930   EFI_IFR_OP_HEADER        Header;
00931   UINT16                   DefaultId;
00932   UINT8                    Type;
00933 } EFI_IFR_DEFAULT_2;
00934 
00935 typedef struct _EFI_IFR_VALUE {
00936   EFI_IFR_OP_HEADER        Header;
00937 } EFI_IFR_VALUE;
00938 
00939 typedef struct _EFI_IFR_SUBTITLE {
00940   EFI_IFR_OP_HEADER        Header;
00941   EFI_IFR_STATEMENT_HEADER Statement;
00942   UINT8                    Flags;
00943 } EFI_IFR_SUBTITLE;
00944 
00945 #define EFI_IFR_FLAGS_HORIZONTAL       0x01
00946 
00947 typedef struct _EFI_IFR_CHECKBOX {
00948   EFI_IFR_OP_HEADER        Header;
00949   EFI_IFR_QUESTION_HEADER  Question;
00950   UINT8                    Flags;
00951 } EFI_IFR_CHECKBOX;
00952 
00953 #define EFI_IFR_CHECKBOX_DEFAULT       0x01
00954 #define EFI_IFR_CHECKBOX_DEFAULT_MFG   0x02
00955 
00956 typedef struct _EFI_IFR_TEXT {
00957   EFI_IFR_OP_HEADER        Header;
00958   EFI_IFR_STATEMENT_HEADER Statement;
00959   EFI_STRING_ID            TextTwo;
00960 } EFI_IFR_TEXT;
00961 
00962 typedef struct _EFI_IFR_REF {
00963   EFI_IFR_OP_HEADER        Header;
00964   EFI_IFR_QUESTION_HEADER  Question;
00965   EFI_FORM_ID              FormId;
00966 } EFI_IFR_REF;
00967 
00968 typedef struct _EFI_IFR_REF2 {
00969   EFI_IFR_OP_HEADER        Header;
00970   EFI_IFR_QUESTION_HEADER  Question;
00971   EFI_FORM_ID              FormId;
00972   EFI_QUESTION_ID          QuestionId;
00973 } EFI_IFR_REF2;
00974 
00975 typedef struct _EFI_IFR_REF3 {
00976   EFI_IFR_OP_HEADER        Header;
00977   EFI_IFR_QUESTION_HEADER  Question;
00978   EFI_FORM_ID              FormId;
00979   EFI_QUESTION_ID          QuestionId;
00980   EFI_GUID                 FormSetId;
00981 } EFI_IFR_REF3;
00982 
00983 typedef struct _EFI_IFR_REF4 {
00984   EFI_IFR_OP_HEADER        Header;
00985   EFI_IFR_QUESTION_HEADER  Question;
00986   EFI_FORM_ID              FormId;
00987   EFI_QUESTION_ID          QuestionId;
00988   EFI_GUID                 FormSetId;
00989   EFI_STRING_ID            DevicePath;
00990 } EFI_IFR_REF4;
00991 
00992 typedef struct _EFI_IFR_REF5 {
00993   EFI_IFR_OP_HEADER Header;
00994   EFI_IFR_QUESTION_HEADER Question;
00995 } EFI_IFR_REF5;
00996 
00997 typedef struct _EFI_IFR_RESET_BUTTON {
00998   EFI_IFR_OP_HEADER        Header;
00999   EFI_IFR_STATEMENT_HEADER Statement;
01000   EFI_DEFAULT_ID           DefaultId;
01001 } EFI_IFR_RESET_BUTTON;
01002 
01003 typedef struct _EFI_IFR_ACTION {
01004   EFI_IFR_OP_HEADER        Header;
01005   EFI_IFR_QUESTION_HEADER  Question;
01006   EFI_STRING_ID            QuestionConfig;
01007 } EFI_IFR_ACTION;
01008 
01009 typedef struct _EFI_IFR_ACTION_1 {
01010   EFI_IFR_OP_HEADER        Header;
01011   EFI_IFR_QUESTION_HEADER  Question;
01012 } EFI_IFR_ACTION_1;
01013 
01014 typedef struct _EFI_IFR_DATE {
01015   EFI_IFR_OP_HEADER        Header;
01016   EFI_IFR_QUESTION_HEADER  Question;
01017   UINT8                    Flags;
01018 } EFI_IFR_DATE;
01019 
01020 //
01021 // Flags that describe the behavior of the question.
01022 //
01023 #define EFI_QF_DATE_YEAR_SUPPRESS      0x01
01024 #define EFI_QF_DATE_MONTH_SUPPRESS     0x02
01025 #define EFI_QF_DATE_DAY_SUPPRESS       0x04
01026 
01027 #define EFI_QF_DATE_STORAGE            0x30
01028 #define     QF_DATE_STORAGE_NORMAL     0x00
01029 #define     QF_DATE_STORAGE_TIME       0x10
01030 #define     QF_DATE_STORAGE_WAKEUP     0x20
01031 
01032 typedef union {
01033   struct {
01034     UINT8 MinValue;
01035     UINT8 MaxValue;
01036     UINT8 Step;
01037   } u8;
01038   struct {
01039     UINT16 MinValue;
01040     UINT16 MaxValue;
01041     UINT16 Step;
01042   } u16;
01043   struct {
01044     UINT32 MinValue;
01045     UINT32 MaxValue;
01046     UINT32 Step;
01047   } u32;
01048   struct {
01049     UINT64 MinValue;
01050     UINT64 MaxValue;
01051     UINT64 Step;
01052   } u64;
01053 } MINMAXSTEP_DATA;
01054 
01055 typedef struct _EFI_IFR_NUMERIC {
01056   EFI_IFR_OP_HEADER        Header;
01057   EFI_IFR_QUESTION_HEADER  Question;
01058   UINT8                    Flags;
01059   MINMAXSTEP_DATA          data;
01060 } EFI_IFR_NUMERIC;
01061 
01062 //
01063 // Flags related to the numeric question
01064 //
01065 #define EFI_IFR_NUMERIC_SIZE           0x03
01066 #define   EFI_IFR_NUMERIC_SIZE_1       0x00
01067 #define   EFI_IFR_NUMERIC_SIZE_2       0x01
01068 #define   EFI_IFR_NUMERIC_SIZE_4       0x02
01069 #define   EFI_IFR_NUMERIC_SIZE_8       0x03
01070 
01071 #define EFI_IFR_DISPLAY                0x30
01072 #define   EFI_IFR_DISPLAY_INT_DEC      0x00
01073 #define   EFI_IFR_DISPLAY_UINT_DEC     0x10
01074 #define   EFI_IFR_DISPLAY_UINT_HEX     0x20
01075 
01076 typedef struct _EFI_IFR_ONE_OF {
01077   EFI_IFR_OP_HEADER        Header;
01078   EFI_IFR_QUESTION_HEADER  Question;
01079   UINT8                    Flags;
01080   MINMAXSTEP_DATA          data;
01081 } EFI_IFR_ONE_OF;
01082 
01083 typedef struct _EFI_IFR_STRING {
01084   EFI_IFR_OP_HEADER        Header;
01085   EFI_IFR_QUESTION_HEADER  Question;
01086   UINT8                    MinSize;
01087   UINT8                    MaxSize;
01088   UINT8                    Flags;
01089 } EFI_IFR_STRING;
01090 
01091 #define EFI_IFR_STRING_MULTI_LINE      0x01
01092 
01093 typedef struct _EFI_IFR_PASSWORD {
01094   EFI_IFR_OP_HEADER        Header;
01095   EFI_IFR_QUESTION_HEADER  Question;
01096   UINT16                   MinSize;
01097   UINT16                   MaxSize;
01098 } EFI_IFR_PASSWORD;
01099 
01100 typedef struct _EFI_IFR_ORDERED_LIST {
01101   EFI_IFR_OP_HEADER        Header;
01102   EFI_IFR_QUESTION_HEADER  Question;
01103   UINT8                    MaxContainers;
01104   UINT8                    Flags;
01105 } EFI_IFR_ORDERED_LIST;
01106 
01107 #define EFI_IFR_UNIQUE_SET             0x01
01108 #define EFI_IFR_NO_EMPTY_SET           0x02
01109 
01110 typedef struct _EFI_IFR_TIME {
01111   EFI_IFR_OP_HEADER        Header;
01112   EFI_IFR_QUESTION_HEADER  Question;
01113   UINT8                    Flags;
01114 } EFI_IFR_TIME;
01115 
01116 //
01117 // A bit-mask that determines which unique settings are active for this opcode.
01118 //
01119 #define QF_TIME_HOUR_SUPPRESS          0x01
01120 #define QF_TIME_MINUTE_SUPPRESS        0x02
01121 #define QF_TIME_SECOND_SUPPRESS        0x04
01122 
01123 #define QF_TIME_STORAGE                0x30
01124 #define   QF_TIME_STORAGE_NORMAL       0x00
01125 #define   QF_TIME_STORAGE_TIME         0x10
01126 #define   QF_TIME_STORAGE_WAKEUP       0x20
01127 
01128 typedef struct _EFI_IFR_DISABLE_IF {
01129   EFI_IFR_OP_HEADER        Header;
01130 } EFI_IFR_DISABLE_IF;
01131 
01132 typedef struct _EFI_IFR_SUPPRESS_IF {
01133   EFI_IFR_OP_HEADER        Header;
01134 } EFI_IFR_SUPPRESS_IF;
01135 
01136 typedef struct _EFI_IFR_GRAY_OUT_IF {
01137   EFI_IFR_OP_HEADER        Header;
01138 } EFI_IFR_GRAY_OUT_IF;
01139 
01140 typedef struct _EFI_IFR_INCONSISTENT_IF {
01141   EFI_IFR_OP_HEADER        Header;
01142   EFI_STRING_ID            Error;
01143 } EFI_IFR_INCONSISTENT_IF;
01144 
01145 typedef struct _EFI_IFR_NO_SUBMIT_IF {
01146   EFI_IFR_OP_HEADER        Header;
01147   EFI_STRING_ID            Error;
01148 } EFI_IFR_NO_SUBMIT_IF;
01149 
01150 typedef struct _EFI_IFR_WARNING_IF {
01151   EFI_IFR_OP_HEADER        Header;
01152   EFI_STRING_ID            Warning;
01153   UINT8                    TimeOut;
01154 } EFI_IFR_WARNING_IF;
01155 
01156 typedef struct _EFI_IFR_REFRESH {
01157   EFI_IFR_OP_HEADER        Header;
01158   UINT8                    RefreshInterval;
01159 } EFI_IFR_REFRESH;
01160 
01161 typedef struct _EFI_IFR_VARSTORE_DEVICE {
01162   EFI_IFR_OP_HEADER        Header;
01163   EFI_STRING_ID            DevicePath;
01164 } EFI_IFR_VARSTORE_DEVICE;
01165 
01166 typedef struct _EFI_IFR_ONE_OF_OPTION {
01167   EFI_IFR_OP_HEADER        Header;
01168   EFI_STRING_ID            Option;
01169   UINT8                    Flags;
01170   UINT8                    Type;
01171   EFI_IFR_TYPE_VALUE       Value;
01172 } EFI_IFR_ONE_OF_OPTION;
01173 
01174 //
01175 // Types of the option's value.
01176 //
01177 #define EFI_IFR_TYPE_NUM_SIZE_8        0x00
01178 #define EFI_IFR_TYPE_NUM_SIZE_16       0x01
01179 #define EFI_IFR_TYPE_NUM_SIZE_32       0x02
01180 #define EFI_IFR_TYPE_NUM_SIZE_64       0x03
01181 #define EFI_IFR_TYPE_BOOLEAN           0x04
01182 #define EFI_IFR_TYPE_TIME              0x05
01183 #define EFI_IFR_TYPE_DATE              0x06
01184 #define EFI_IFR_TYPE_STRING            0x07
01185 #define EFI_IFR_TYPE_OTHER             0x08
01186 #define EFI_IFR_TYPE_UNDEFINED         0x09
01187 #define EFI_IFR_TYPE_ACTION            0x0A
01188 #define EFI_IFR_TYPE_BUFFER            0x0B
01189 #define EFI_IFR_TYPE_REF               0x0C
01190 
01191 #define EFI_IFR_OPTION_DEFAULT         0x10
01192 #define EFI_IFR_OPTION_DEFAULT_MFG     0x20
01193 
01194 typedef struct _EFI_IFR_GUID {
01195   EFI_IFR_OP_HEADER        Header;
01196   EFI_GUID                 Guid;
01197   //Optional Data Follows
01198 } EFI_IFR_GUID;
01199 
01200 typedef struct _EFI_IFR_REFRESH_ID {
01201   EFI_IFR_OP_HEADER Header;
01202   EFI_GUID          RefreshEventGroupId;
01203 } EFI_IFR_REFRESH_ID;
01204 
01205 typedef struct _EFI_IFR_DUP {
01206   EFI_IFR_OP_HEADER        Header;
01207 } EFI_IFR_DUP;
01208 
01209 typedef struct _EFI_IFR_EQ_ID_ID {
01210   EFI_IFR_OP_HEADER        Header;
01211   EFI_QUESTION_ID          QuestionId1;
01212   EFI_QUESTION_ID          QuestionId2;
01213 } EFI_IFR_EQ_ID_ID;
01214 
01215 typedef struct _EFI_IFR_EQ_ID_VAL {
01216   EFI_IFR_OP_HEADER        Header;
01217   EFI_QUESTION_ID          QuestionId;
01218   UINT16                   Value;
01219 } EFI_IFR_EQ_ID_VAL;
01220 
01221 typedef struct _EFI_IFR_EQ_ID_VAL_LIST {
01222   EFI_IFR_OP_HEADER        Header;
01223   EFI_QUESTION_ID          QuestionId;
01224   UINT16                   ListLength;
01225   UINT16                   ValueList[1];
01226 } EFI_IFR_EQ_ID_VAL_LIST;
01227 
01228 typedef struct _EFI_IFR_UINT8 {
01229   EFI_IFR_OP_HEADER        Header;
01230   UINT8 Value;
01231 } EFI_IFR_UINT8;
01232 
01233 typedef struct _EFI_IFR_UINT16 {
01234   EFI_IFR_OP_HEADER        Header;
01235   UINT16                   Value;
01236 } EFI_IFR_UINT16;
01237 
01238 typedef struct _EFI_IFR_UINT32 {
01239   EFI_IFR_OP_HEADER        Header;
01240   UINT32                   Value;
01241 } EFI_IFR_UINT32;
01242 
01243 typedef struct _EFI_IFR_UINT64 {
01244   EFI_IFR_OP_HEADER        Header;
01245   UINT64 Value;
01246 } EFI_IFR_UINT64;
01247 
01248 typedef struct _EFI_IFR_QUESTION_REF1 {
01249   EFI_IFR_OP_HEADER        Header;
01250   EFI_QUESTION_ID          QuestionId;
01251 } EFI_IFR_QUESTION_REF1;
01252 
01253 typedef struct _EFI_IFR_QUESTION_REF2 {
01254   EFI_IFR_OP_HEADER        Header;
01255 } EFI_IFR_QUESTION_REF2;
01256 
01257 typedef struct _EFI_IFR_QUESTION_REF3 {
01258   EFI_IFR_OP_HEADER        Header;
01259 } EFI_IFR_QUESTION_REF3;
01260 
01261 typedef struct _EFI_IFR_QUESTION_REF3_2 {
01262   EFI_IFR_OP_HEADER        Header;
01263   EFI_STRING_ID            DevicePath;
01264 } EFI_IFR_QUESTION_REF3_2;
01265 
01266 typedef struct _EFI_IFR_QUESTION_REF3_3 {
01267   EFI_IFR_OP_HEADER        Header;
01268   EFI_STRING_ID            DevicePath;
01269   EFI_GUID                 Guid;
01270 } EFI_IFR_QUESTION_REF3_3;
01271 
01272 typedef struct _EFI_IFR_RULE_REF {
01273   EFI_IFR_OP_HEADER        Header;
01274   UINT8                    RuleId;
01275 } EFI_IFR_RULE_REF;
01276 
01277 typedef struct _EFI_IFR_STRING_REF1 {
01278   EFI_IFR_OP_HEADER        Header;
01279   EFI_STRING_ID            StringId;
01280 } EFI_IFR_STRING_REF1;
01281 
01282 typedef struct _EFI_IFR_STRING_REF2 {
01283   EFI_IFR_OP_HEADER        Header;
01284 } EFI_IFR_STRING_REF2;
01285 
01286 typedef struct _EFI_IFR_THIS {
01287   EFI_IFR_OP_HEADER        Header;
01288 } EFI_IFR_THIS;
01289 
01290 typedef struct _EFI_IFR_TRUE {
01291   EFI_IFR_OP_HEADER        Header;
01292 } EFI_IFR_TRUE;
01293 
01294 typedef struct _EFI_IFR_FALSE {
01295   EFI_IFR_OP_HEADER        Header;
01296 } EFI_IFR_FALSE;
01297 
01298 typedef struct _EFI_IFR_ONE {
01299   EFI_IFR_OP_HEADER        Header;
01300 } EFI_IFR_ONE;
01301 
01302 typedef struct _EFI_IFR_ONES {
01303   EFI_IFR_OP_HEADER        Header;
01304 } EFI_IFR_ONES;
01305 
01306 typedef struct _EFI_IFR_ZERO {
01307   EFI_IFR_OP_HEADER        Header;
01308 } EFI_IFR_ZERO;
01309 
01310 typedef struct _EFI_IFR_UNDEFINED {
01311   EFI_IFR_OP_HEADER        Header;
01312 } EFI_IFR_UNDEFINED;
01313 
01314 typedef struct _EFI_IFR_VERSION {
01315   EFI_IFR_OP_HEADER        Header;
01316 } EFI_IFR_VERSION;
01317 
01318 typedef struct _EFI_IFR_LENGTH {
01319   EFI_IFR_OP_HEADER        Header;
01320 } EFI_IFR_LENGTH;
01321 
01322 typedef struct _EFI_IFR_NOT {
01323   EFI_IFR_OP_HEADER        Header;
01324 } EFI_IFR_NOT;
01325 
01326 typedef struct _EFI_IFR_BITWISE_NOT {
01327   EFI_IFR_OP_HEADER        Header;
01328 } EFI_IFR_BITWISE_NOT;
01329 
01330 typedef struct _EFI_IFR_TO_BOOLEAN {
01331   EFI_IFR_OP_HEADER        Header;
01332 } EFI_IFR_TO_BOOLEAN;
01333 
01334 ///
01335 /// For EFI_IFR_TO_STRING, when converting from
01336 /// unsigned integers, these flags control the format:
01337 /// 0 = unsigned decimal.
01338 /// 1 = signed decimal.
01339 /// 2 = hexadecimal (lower-case alpha).
01340 /// 3 = hexadecimal (upper-case alpha).
01341 ///@{
01342 #define EFI_IFR_STRING_UNSIGNED_DEC      0
01343 #define EFI_IFR_STRING_SIGNED_DEC        1
01344 #define EFI_IFR_STRING_LOWERCASE_HEX     2
01345 #define EFI_IFR_STRING_UPPERCASE_HEX     3
01346 ///@}
01347 
01348 ///
01349 /// When converting from a buffer, these flags control the format:
01350 /// 0 = ASCII.
01351 /// 8 = Unicode.
01352 ///@{
01353 #define EFI_IFR_STRING_ASCII             0
01354 #define EFI_IFR_STRING_UNICODE           8
01355 ///@}
01356 
01357 typedef struct _EFI_IFR_TO_STRING {
01358   EFI_IFR_OP_HEADER        Header;
01359   UINT8                    Format;
01360 } EFI_IFR_TO_STRING;
01361 
01362 typedef struct _EFI_IFR_TO_UINT {
01363   EFI_IFR_OP_HEADER        Header;
01364 } EFI_IFR_TO_UINT;
01365 
01366 typedef struct _EFI_IFR_TO_UPPER {
01367   EFI_IFR_OP_HEADER        Header;
01368 } EFI_IFR_TO_UPPER;
01369 
01370 typedef struct _EFI_IFR_TO_LOWER {
01371   EFI_IFR_OP_HEADER        Header;
01372 } EFI_IFR_TO_LOWER;
01373 
01374 typedef struct _EFI_IFR_ADD {
01375   EFI_IFR_OP_HEADER        Header;
01376 } EFI_IFR_ADD;
01377 
01378 typedef struct _EFI_IFR_AND {
01379   EFI_IFR_OP_HEADER        Header;
01380 } EFI_IFR_AND;
01381 
01382 typedef struct _EFI_IFR_BITWISE_AND {
01383   EFI_IFR_OP_HEADER        Header;
01384 } EFI_IFR_BITWISE_AND;
01385 
01386 typedef struct _EFI_IFR_BITWISE_OR {
01387   EFI_IFR_OP_HEADER        Header;
01388 } EFI_IFR_BITWISE_OR;
01389 
01390 typedef struct _EFI_IFR_CATENATE {
01391   EFI_IFR_OP_HEADER        Header;
01392 } EFI_IFR_CATENATE;
01393 
01394 typedef struct _EFI_IFR_DIVIDE {
01395   EFI_IFR_OP_HEADER        Header;
01396 } EFI_IFR_DIVIDE;
01397 
01398 typedef struct _EFI_IFR_EQUAL {
01399   EFI_IFR_OP_HEADER        Header;
01400 } EFI_IFR_EQUAL;
01401 
01402 typedef struct _EFI_IFR_GREATER_EQUAL {
01403   EFI_IFR_OP_HEADER        Header;
01404 } EFI_IFR_GREATER_EQUAL;
01405 
01406 typedef struct _EFI_IFR_GREATER_THAN {
01407   EFI_IFR_OP_HEADER        Header;
01408 } EFI_IFR_GREATER_THAN;
01409 
01410 typedef struct _EFI_IFR_LESS_EQUAL {
01411   EFI_IFR_OP_HEADER        Header;
01412 } EFI_IFR_LESS_EQUAL;
01413 
01414 typedef struct _EFI_IFR_LESS_THAN {
01415   EFI_IFR_OP_HEADER        Header;
01416 } EFI_IFR_LESS_THAN;
01417 
01418 typedef struct _EFI_IFR_MATCH {
01419   EFI_IFR_OP_HEADER        Header;
01420 } EFI_IFR_MATCH;
01421 
01422 typedef struct _EFI_IFR_MATCH2 {
01423   EFI_IFR_OP_HEADER        Header;
01424   EFI_GUID                 SyntaxType;
01425 } EFI_IFR_MATCH2;
01426 
01427 typedef struct _EFI_IFR_MULTIPLY {
01428   EFI_IFR_OP_HEADER        Header;
01429 } EFI_IFR_MULTIPLY;
01430 
01431 typedef struct _EFI_IFR_MODULO {
01432   EFI_IFR_OP_HEADER        Header;
01433 } EFI_IFR_MODULO;
01434 
01435 typedef struct _EFI_IFR_NOT_EQUAL {
01436   EFI_IFR_OP_HEADER        Header;
01437 } EFI_IFR_NOT_EQUAL;
01438 
01439 typedef struct _EFI_IFR_OR {
01440   EFI_IFR_OP_HEADER        Header;
01441 } EFI_IFR_OR;
01442 
01443 typedef struct _EFI_IFR_SHIFT_LEFT {
01444   EFI_IFR_OP_HEADER        Header;
01445 } EFI_IFR_SHIFT_LEFT;
01446 
01447 typedef struct _EFI_IFR_SHIFT_RIGHT {
01448   EFI_IFR_OP_HEADER        Header;
01449 } EFI_IFR_SHIFT_RIGHT;
01450 
01451 typedef struct _EFI_IFR_SUBTRACT {
01452   EFI_IFR_OP_HEADER        Header;
01453 } EFI_IFR_SUBTRACT;
01454 
01455 typedef struct _EFI_IFR_CONDITIONAL {
01456   EFI_IFR_OP_HEADER        Header;
01457 } EFI_IFR_CONDITIONAL;
01458 
01459 //
01460 // Flags governing the matching criteria of EFI_IFR_FIND
01461 //
01462 #define EFI_IFR_FF_CASE_SENSITIVE    0x00
01463 #define EFI_IFR_FF_CASE_INSENSITIVE  0x01
01464 
01465 typedef struct _EFI_IFR_FIND {
01466   EFI_IFR_OP_HEADER        Header;
01467   UINT8                    Format;
01468 } EFI_IFR_FIND;
01469 
01470 typedef struct _EFI_IFR_MID {
01471   EFI_IFR_OP_HEADER        Header;
01472 } EFI_IFR_MID;
01473 
01474 typedef struct _EFI_IFR_TOKEN {
01475   EFI_IFR_OP_HEADER        Header;
01476 } EFI_IFR_TOKEN;
01477 
01478 //
01479 // Flags specifying whether to find the first matching string
01480 // or the first non-matching string.
01481 //
01482 #define EFI_IFR_FLAGS_FIRST_MATCHING     0x00
01483 #define EFI_IFR_FLAGS_FIRST_NON_MATCHING 0x01
01484 
01485 typedef struct _EFI_IFR_SPAN {
01486   EFI_IFR_OP_HEADER        Header;
01487   UINT8                    Flags;
01488 } EFI_IFR_SPAN;
01489 
01490 typedef struct _EFI_IFR_SECURITY {
01491   ///
01492   /// Standard opcode header, where Header.Op = EFI_IFR_SECURITY_OP.
01493   ///
01494   EFI_IFR_OP_HEADER        Header;
01495   ///
01496   /// Security permission level.
01497   ///
01498   EFI_GUID                 Permissions;
01499 } EFI_IFR_SECURITY;
01500 
01501 typedef struct _EFI_IFR_FORM_MAP_METHOD {
01502   ///
01503   /// The string identifier which provides the human-readable name of
01504   /// the configuration method for this standards map form.
01505   ///
01506   EFI_STRING_ID            MethodTitle;
01507   ///
01508   /// Identifier which uniquely specifies the configuration methods
01509   /// associated with this standards map form.
01510   ///
01511   EFI_GUID                 MethodIdentifier;
01512 } EFI_IFR_FORM_MAP_METHOD;
01513 
01514 typedef struct _EFI_IFR_FORM_MAP {
01515   ///
01516   /// The sequence that defines the type of opcode as well as the length
01517   /// of the opcode being defined. Header.OpCode = EFI_IFR_FORM_MAP_OP.
01518   ///
01519   EFI_IFR_OP_HEADER        Header;
01520   ///
01521   /// The unique identifier for this particular form.
01522   ///
01523   EFI_FORM_ID              FormId;
01524   ///
01525   /// One or more configuration method's name and unique identifier.
01526   ///
01527   // EFI_IFR_FORM_MAP_METHOD  Methods[];
01528 } EFI_IFR_FORM_MAP;
01529 
01530 typedef struct _EFI_IFR_SET {
01531   ///
01532   /// The sequence that defines the type of opcode as well as the length
01533   /// of the opcode being defined. Header.OpCode = EFI_IFR_SET_OP.
01534   ///
01535   EFI_IFR_OP_HEADER  Header;
01536   ///
01537   /// Specifies the identifier of a previously declared variable store to
01538   /// use when storing the question's value.
01539   ///
01540   EFI_VARSTORE_ID    VarStoreId;
01541   union {
01542     ///
01543     /// A 16-bit Buffer Storage offset.
01544     ///
01545     EFI_STRING_ID    VarName;
01546     ///
01547     /// A Name Value or EFI Variable name (VarName).
01548     ///
01549     UINT16           VarOffset;
01550   }                  VarStoreInfo;
01551   ///
01552   /// Specifies the type used for storage.
01553   ///
01554   UINT8              VarStoreType;
01555 } EFI_IFR_SET;
01556 
01557 typedef struct _EFI_IFR_GET {
01558   ///
01559   /// The sequence that defines the type of opcode as well as the length
01560   /// of the opcode being defined. Header.OpCode = EFI_IFR_GET_OP.
01561   ///
01562   EFI_IFR_OP_HEADER  Header;
01563   ///
01564   /// Specifies the identifier of a previously declared variable store to
01565   /// use when retrieving the value.
01566   ///
01567   EFI_VARSTORE_ID    VarStoreId;
01568   union {
01569     ///
01570     /// A 16-bit Buffer Storage offset.
01571     ///
01572     EFI_STRING_ID    VarName;
01573     ///
01574     /// A Name Value or EFI Variable name (VarName).
01575     ///
01576     UINT16           VarOffset;
01577   }                  VarStoreInfo;
01578   ///
01579   /// Specifies the type used for storage.
01580   ///
01581   UINT8              VarStoreType;
01582 } EFI_IFR_GET;
01583 
01584 typedef struct _EFI_IFR_READ {
01585   EFI_IFR_OP_HEADER       Header;
01586 } EFI_IFR_READ;
01587 
01588 typedef struct _EFI_IFR_WRITE {
01589   EFI_IFR_OP_HEADER      Header;
01590 } EFI_IFR_WRITE;
01591 
01592 typedef struct _EFI_IFR_MAP {
01593   EFI_IFR_OP_HEADER      Header;
01594 } EFI_IFR_MAP;
01595 //
01596 // Definitions for Keyboard Package
01597 // Releated definitions are in Section of EFI_HII_DATABASE_PROTOCOL
01598 //
01599 
01600 ///
01601 /// Each enumeration values maps a physical key on a keyboard.
01602 ///
01603 typedef enum {
01604   EfiKeyLCtrl,
01605   EfiKeyA0,
01606   EfiKeyLAlt,
01607   EfiKeySpaceBar,
01608   EfiKeyA2,
01609   EfiKeyA3,
01610   EfiKeyA4,
01611   EfiKeyRCtrl,
01612   EfiKeyLeftArrow,
01613   EfiKeyDownArrow,
01614   EfiKeyRightArrow,
01615   EfiKeyZero,
01616   EfiKeyPeriod,
01617   EfiKeyEnter,
01618   EfiKeyLShift,
01619   EfiKeyB0,
01620   EfiKeyB1,
01621   EfiKeyB2,
01622   EfiKeyB3,
01623   EfiKeyB4,
01624   EfiKeyB5,
01625   EfiKeyB6,
01626   EfiKeyB7,
01627   EfiKeyB8,
01628   EfiKeyB9,
01629   EfiKeyB10,
01630   EfiKeyRShift,
01631   EfiKeyUpArrow,
01632   EfiKeyOne,
01633   EfiKeyTwo,
01634   EfiKeyThree,
01635   EfiKeyCapsLock,
01636   EfiKeyC1,
01637   EfiKeyC2,
01638   EfiKeyC3,
01639   EfiKeyC4,
01640   EfiKeyC5,
01641   EfiKeyC6,
01642   EfiKeyC7,
01643   EfiKeyC8,
01644   EfiKeyC9,
01645   EfiKeyC10,
01646   EfiKeyC11,
01647   EfiKeyC12,
01648   EfiKeyFour,
01649   EfiKeyFive,
01650   EfiKeySix,
01651   EfiKeyPlus,
01652   EfiKeyTab,
01653   EfiKeyD1,
01654   EfiKeyD2,
01655   EfiKeyD3,
01656   EfiKeyD4,
01657   EfiKeyD5,
01658   EfiKeyD6,
01659   EfiKeyD7,
01660   EfiKeyD8,
01661   EfiKeyD9,
01662   EfiKeyD10,
01663   EfiKeyD11,
01664   EfiKeyD12,
01665   EfiKeyD13,
01666   EfiKeyDel,
01667   EfiKeyEnd,
01668   EfiKeyPgDn,
01669   EfiKeySeven,
01670   EfiKeyEight,
01671   EfiKeyNine,
01672   EfiKeyE0,
01673   EfiKeyE1,
01674   EfiKeyE2,
01675   EfiKeyE3,
01676   EfiKeyE4,
01677   EfiKeyE5,
01678   EfiKeyE6,
01679   EfiKeyE7,
01680   EfiKeyE8,
01681   EfiKeyE9,
01682   EfiKeyE10,
01683   EfiKeyE11,
01684   EfiKeyE12,
01685   EfiKeyBackSpace,
01686   EfiKeyIns,
01687   EfiKeyHome,
01688   EfiKeyPgUp,
01689   EfiKeyNLck,
01690   EfiKeySlash,
01691   EfiKeyAsterisk,
01692   EfiKeyMinus,
01693   EfiKeyEsc,
01694   EfiKeyF1,
01695   EfiKeyF2,
01696   EfiKeyF3,
01697   EfiKeyF4,
01698   EfiKeyF5,
01699   EfiKeyF6,
01700   EfiKeyF7,
01701   EfiKeyF8,
01702   EfiKeyF9,
01703   EfiKeyF10,
01704   EfiKeyF11,
01705   EfiKeyF12,
01706   EfiKeyPrint,
01707   EfiKeySLck,
01708   EfiKeyPause
01709 } EFI_KEY;
01710 
01711 typedef struct {
01712   ///
01713   /// Used to describe a physical key on a keyboard.
01714   ///
01715   EFI_KEY                 Key;
01716   ///
01717   /// Unicode character code for the Key.
01718   ///
01719   CHAR16                  Unicode;
01720   ///
01721   /// Unicode character code for the key with the shift key being held down.
01722   ///
01723   CHAR16                  ShiftedUnicode;
01724   ///
01725   /// Unicode character code for the key with the Alt-GR being held down.
01726   ///
01727   CHAR16                  AltGrUnicode;
01728   ///
01729   /// Unicode character code for the key with the Alt-GR and shift keys being held down.
01730   ///
01731   CHAR16                  ShiftedAltGrUnicode;
01732   ///
01733   /// Modifier keys are defined to allow for special functionality that is not necessarily
01734   /// accomplished by a printable character. Many of these modifier keys are flags to toggle
01735   /// certain state bits on and off inside of a keyboard driver.
01736   ///
01737   UINT16                  Modifier;
01738   UINT16                  AffectedAttribute;
01739 } EFI_KEY_DESCRIPTOR;
01740 
01741 ///
01742 /// A key which is affected by all the standard shift modifiers.
01743 /// Most keys would be expected to have this bit active.
01744 ///
01745 #define EFI_AFFECTED_BY_STANDARD_SHIFT       0x0001
01746 
01747 ///
01748 /// This key is affected by the caps lock so that if a keyboard driver
01749 /// would need to disambiguate between a key which had a "1" defined
01750 /// versus an "a" character.  Having this bit turned on would tell
01751 /// the keyboard driver to use the appropriate shifted state or not.
01752 ///
01753 #define EFI_AFFECTED_BY_CAPS_LOCK            0x0002
01754 
01755 ///
01756 /// Similar to the case of CAPS lock, if this bit is active, the key
01757 /// is affected by the num lock being turned on.
01758 ///
01759 #define EFI_AFFECTED_BY_NUM_LOCK             0x0004
01760 
01761 typedef struct {
01762   UINT16                  LayoutLength;
01763   EFI_GUID                Guid;
01764   UINT32                  LayoutDescriptorStringOffset;
01765   UINT8                   DescriptorCount;
01766   // EFI_KEY_DESCRIPTOR    Descriptors[];
01767 } EFI_HII_KEYBOARD_LAYOUT;
01768 
01769 typedef struct {
01770   EFI_HII_PACKAGE_HEADER  Header;
01771   UINT16                  LayoutCount;
01772   // EFI_HII_KEYBOARD_LAYOUT Layout[];
01773 } EFI_HII_KEYBOARD_PACKAGE_HDR;
01774 
01775 //
01776 // Modifier values
01777 //
01778 #define EFI_NULL_MODIFIER                0x0000
01779 #define EFI_LEFT_CONTROL_MODIFIER        0x0001
01780 #define EFI_RIGHT_CONTROL_MODIFIER       0x0002
01781 #define EFI_LEFT_ALT_MODIFIER            0x0003
01782 #define EFI_RIGHT_ALT_MODIFIER           0x0004
01783 #define EFI_ALT_GR_MODIFIER              0x0005
01784 #define EFI_INSERT_MODIFIER              0x0006
01785 #define EFI_DELETE_MODIFIER              0x0007
01786 #define EFI_PAGE_DOWN_MODIFIER           0x0008
01787 #define EFI_PAGE_UP_MODIFIER             0x0009
01788 #define EFI_HOME_MODIFIER                0x000A
01789 #define EFI_END_MODIFIER                 0x000B
01790 #define EFI_LEFT_SHIFT_MODIFIER          0x000C
01791 #define EFI_RIGHT_SHIFT_MODIFIER         0x000D
01792 #define EFI_CAPS_LOCK_MODIFIER           0x000E
01793 #define EFI_NUM_LOCK_MODIFIER            0x000F
01794 #define EFI_LEFT_ARROW_MODIFIER          0x0010
01795 #define EFI_RIGHT_ARROW_MODIFIER         0x0011
01796 #define EFI_DOWN_ARROW_MODIFIER          0x0012
01797 #define EFI_UP_ARROW_MODIFIER            0x0013
01798 #define EFI_NS_KEY_MODIFIER              0x0014
01799 #define EFI_NS_KEY_DEPENDENCY_MODIFIER   0x0015
01800 #define EFI_FUNCTION_KEY_ONE_MODIFIER    0x0016
01801 #define EFI_FUNCTION_KEY_TWO_MODIFIER    0x0017
01802 #define EFI_FUNCTION_KEY_THREE_MODIFIER  0x0018
01803 #define EFI_FUNCTION_KEY_FOUR_MODIFIER   0x0019
01804 #define EFI_FUNCTION_KEY_FIVE_MODIFIER   0x001A
01805 #define EFI_FUNCTION_KEY_SIX_MODIFIER    0x001B
01806 #define EFI_FUNCTION_KEY_SEVEN_MODIFIER  0x001C
01807 #define EFI_FUNCTION_KEY_EIGHT_MODIFIER  0x001D
01808 #define EFI_FUNCTION_KEY_NINE_MODIFIER   0x001E
01809 #define EFI_FUNCTION_KEY_TEN_MODIFIER    0x001F
01810 #define EFI_FUNCTION_KEY_ELEVEN_MODIFIER 0x0020
01811 #define EFI_FUNCTION_KEY_TWELVE_MODIFIER 0x0021
01812 
01813 //
01814 // Keys that have multiple control functions based on modifier
01815 // settings are handled in the keyboard driver implementation.
01816 // For instance, PRINT_KEY might have a modifier held down and
01817 // is still a nonprinting character, but might have an alternate
01818 // control function like SYSREQUEST
01819 //
01820 #define EFI_PRINT_MODIFIER               0x0022
01821 #define EFI_SYS_REQUEST_MODIFIER         0x0023
01822 #define EFI_SCROLL_LOCK_MODIFIER         0x0024
01823 #define EFI_PAUSE_MODIFIER               0x0025
01824 #define EFI_BREAK_MODIFIER               0x0026
01825 
01826 #define EFI_LEFT_LOGO_MODIFIER           0x0027
01827 #define EFI_RIGHT_LOGO_MODIFIER          0x0028
01828 #define EFI_MENU_MODIFIER                0x0029
01829 
01830 ///
01831 /// Animation IFR opcode
01832 ///
01833 typedef struct _EFI_IFR_ANIMATION {
01834   ///
01835   /// Standard opcode header, where Header.OpCode is
01836   /// EFI_IFR_ANIMATION_OP.
01837   ///
01838   EFI_IFR_OP_HEADER        Header;
01839   ///
01840   /// Animation identifier in the HII database.
01841   ///
01842   EFI_ANIMATION_ID         Id;
01843 } EFI_IFR_ANIMATION;
01844 
01845 ///
01846 /// HII animation package header.
01847 ///
01848 typedef struct _EFI_HII_ANIMATION_PACKAGE_HDR {
01849   ///
01850   /// Standard package header, where Header.Type = EFI_HII_PACKAGE_ANIMATIONS.
01851   ///
01852   EFI_HII_PACKAGE_HEADER  Header;
01853   ///
01854   /// Offset, relative to this header, of the animation information. If
01855   /// this is zero, then there are no animation sequences in the package.
01856   ///
01857   UINT32                  AnimationInfoOffset;
01858 } EFI_HII_ANIMATION_PACKAGE_HDR;
01859 
01860 ///
01861 /// Animation information is encoded as a series of blocks,
01862 /// with each block prefixed by a single byte header EFI_HII_ANIMATION_BLOCK.
01863 ///
01864 typedef struct _EFI_HII_ANIMATION_BLOCK {
01865   UINT8  BlockType;
01866   //UINT8  BlockBody[];
01867 } EFI_HII_ANIMATION_BLOCK;
01868 
01869 ///
01870 /// Animation block types.
01871 ///
01872 #define EFI_HII_AIBT_END                 0x00
01873 #define EFI_HII_AIBT_OVERLAY_IMAGES      0x10
01874 #define EFI_HII_AIBT_CLEAR_IMAGES        0x11
01875 #define EFI_HII_AIBT_RESTORE_SCRN        0x12
01876 #define EFI_HII_AIBT_OVERLAY_IMAGES_LOOP 0x18
01877 #define EFI_HII_AIBT_CLEAR_IMAGES_LOOP   0x19
01878 #define EFI_HII_AIBT_RESTORE_SCRN_LOOP   0x1A
01879 #define EFI_HII_AIBT_DUPLICATE           0x20
01880 #define EFI_HII_AIBT_SKIP2               0x21
01881 #define EFI_HII_AIBT_SKIP1               0x22
01882 #define EFI_HII_AIBT_EXT1                0x30
01883 #define EFI_HII_AIBT_EXT2                0x31
01884 #define EFI_HII_AIBT_EXT4                0x32
01885 
01886 ///
01887 /// Extended block headers used for variable sized animation records
01888 /// which need an explicit length.
01889 ///
01890 
01891 typedef struct _EFI_HII_AIBT_EXT1_BLOCK  {
01892   ///
01893   /// Standard animation header, where Header.BlockType = EFI_HII_AIBT_EXT1.
01894   ///
01895   EFI_HII_ANIMATION_BLOCK  Header;
01896   ///
01897   /// The block type.
01898   ///
01899   UINT8                    BlockType2;
01900   ///
01901   /// Size of the animation block, in bytes, including the animation block header.
01902   ///
01903   UINT8                    Length;
01904 } EFI_HII_AIBT_EXT1_BLOCK;
01905 
01906 typedef struct _EFI_HII_AIBT_EXT2_BLOCK {
01907   ///
01908   /// Standard animation header, where Header.BlockType = EFI_HII_AIBT_EXT2.
01909   ///
01910   EFI_HII_ANIMATION_BLOCK  Header;
01911   ///
01912   /// The block type
01913   ///
01914   UINT8                    BlockType2;
01915   ///
01916   /// Size of the animation block, in bytes, including the animation block header.
01917   ///
01918   UINT16                   Length;
01919 } EFI_HII_AIBT_EXT2_BLOCK;
01920 
01921 typedef struct _EFI_HII_AIBT_EXT4_BLOCK {
01922   ///
01923   /// Standard animation header, where Header.BlockType = EFI_HII_AIBT_EXT4.
01924   ///
01925   EFI_HII_ANIMATION_BLOCK  Header;
01926   ///
01927   /// The block type
01928   ///
01929   UINT8                    BlockType2;
01930   ///
01931   /// Size of the animation block, in bytes, including the animation block header.
01932   ///
01933   UINT32                   Length;
01934 } EFI_HII_AIBT_EXT4_BLOCK;
01935 
01936 typedef struct _EFI_HII_ANIMATION_CELL {
01937   ///
01938   /// The X offset from the upper left hand corner of the logical
01939   /// window to position the indexed image.
01940   ///
01941   UINT16                    OffsetX;
01942   ///
01943   /// The Y offset from the upper left hand corner of the logical
01944   /// window to position the indexed image.
01945   ///
01946   UINT16                    OffsetY;
01947   ///
01948   /// The image to display at the specified offset from the upper left
01949   /// hand corner of the logical window.
01950   ///
01951   EFI_IMAGE_ID              ImageId;
01952   ///
01953   /// The number of milliseconds to delay after displaying the indexed
01954   /// image and before continuing on to the next linked image.  If value
01955   /// is zero, no delay.
01956   ///
01957   UINT16                    Delay;
01958 } EFI_HII_ANIMATION_CELL;
01959 
01960 ///
01961 /// An animation block to describe an animation sequence that does not cycle, and
01962 /// where one image is simply displayed over the previous image.
01963 ///
01964 typedef struct _EFI_HII_AIBT_OVERLAY_IMAGES_BLOCK {
01965   ///
01966   /// This is image that is to be reference by the image protocols, if the
01967   /// animation function is not supported or disabled. This image can
01968   /// be one particular image from the animation sequence (if any one
01969   /// of the animation frames has a complete image) or an alternate
01970   /// image that can be displayed alone. If the value is zero, no image
01971   /// is displayed.
01972   ///
01973   EFI_IMAGE_ID            DftImageId;
01974   ///
01975   /// The overall width of the set of images (logical window width).
01976   ///
01977   UINT16                  Width;
01978   ///
01979   /// The overall height of the set of images (logical window height).
01980   ///
01981   UINT16                  Height;
01982   ///
01983   /// The number of EFI_HII_ANIMATION_CELL contained in the
01984   /// animation sequence.
01985   ///
01986   UINT16                  CellCount;
01987   ///
01988   /// An array of CellCount animation cells.
01989   ///
01990   EFI_HII_ANIMATION_CELL  AnimationCell[1];
01991 } EFI_HII_AIBT_OVERLAY_IMAGES_BLOCK;
01992 
01993 ///
01994 /// An animation block to describe an animation sequence that does not cycle,
01995 /// and where the logical window is cleared to the specified color before
01996 /// the next image is displayed.
01997 ///
01998 typedef struct _EFI_HII_AIBT_CLEAR_IMAGES_BLOCK {
01999   ///
02000   /// This is image that is to be reference by the image protocols, if the
02001   /// animation function is not supported or disabled. This image can
02002   /// be one particular image from the animation sequence (if any one
02003   /// of the animation frames has a complete image) or an alternate
02004   /// image that can be displayed alone. If the value is zero, no image
02005   /// is displayed.
02006   ///
02007   EFI_IMAGE_ID       DftImageId;
02008   ///
02009   /// The overall width of the set of images (logical window width).
02010   ///
02011   UINT16             Width;
02012   ///
02013   /// The overall height of the set of images (logical window height).
02014   ///
02015   UINT16             Height;
02016   ///
02017   /// The number of EFI_HII_ANIMATION_CELL contained in the
02018   /// animation sequence.
02019   ///
02020   UINT16             CellCount;
02021   ///
02022   /// The color to clear the logical window to before displaying the
02023   /// indexed image.
02024   ///
02025   EFI_HII_RGB_PIXEL  BackgndColor;
02026   ///
02027   /// An array of CellCount animation cells.
02028   ///
02029   EFI_HII_ANIMATION_CELL AnimationCell[1];
02030 } EFI_HII_AIBT_CLEAR_IMAGES_BLOCK;
02031 
02032 ///
02033 /// An animation block to describe an animation sequence that does not cycle,
02034 /// and where the screen is restored to the original state before the next
02035 /// image is displayed.
02036 ///
02037 typedef struct _EFI_HII_AIBT_RESTORE_SCRN_BLOCK {
02038   ///
02039   /// This is image that is to be reference by the image protocols, if the
02040   /// animation function is not supported or disabled. This image can
02041   /// be one particular image from the animation sequence (if any one
02042   /// of the animation frames has a complete image) or an alternate
02043   /// image that can be displayed alone. If the value is zero, no image
02044   /// is displayed.
02045   ///
02046   EFI_IMAGE_ID            DftImageId;
02047   ///
02048   /// The overall width of the set of images (logical window width).
02049   ///
02050   UINT16                  Width;
02051   ///
02052   /// The overall height of the set of images (logical window height).
02053   ///
02054   UINT16                  Height;
02055   ///
02056   /// The number of EFI_HII_ANIMATION_CELL contained in the
02057   /// animation sequence.
02058   ///
02059   UINT16                  CellCount;
02060   ///
02061   /// An array of CellCount animation cells.
02062   ///
02063   EFI_HII_ANIMATION_CELL  AnimationCell[1];
02064 } EFI_HII_AIBT_RESTORE_SCRN_BLOCK;
02065 
02066 ///
02067 /// An animation block to describe an animation sequence that continuously cycles,
02068 /// and where one image is simply displayed over the previous image.
02069 ///
02070 typedef EFI_HII_AIBT_OVERLAY_IMAGES_BLOCK  EFI_HII_AIBT_OVERLAY_IMAGES_LOOP_BLOCK;
02071 
02072 ///
02073 /// An animation block to describe an animation sequence that continuously cycles,
02074 /// and where the logical window is cleared to the specified color before
02075 /// the next image is displayed.
02076 ///
02077 typedef EFI_HII_AIBT_CLEAR_IMAGES_BLOCK    EFI_HII_AIBT_CLEAR_IMAGES_LOOP_BLOCK;
02078 
02079 ///
02080 /// An animation block to describe an animation sequence that continuously cycles,
02081 /// and where the screen is restored to the original state before
02082 /// the next image is displayed.
02083 ///
02084 typedef EFI_HII_AIBT_RESTORE_SCRN_BLOCK    EFI_HII_AIBT_RESTORE_SCRN_LOOP_BLOCK;
02085 
02086 ///
02087 /// Assigns a new character value to a previously defined animation sequence.
02088 ///
02089 typedef struct _EFI_HII_AIBT_DUPLICATE_BLOCK {
02090   ///
02091   /// The previously defined animation ID with the exact same
02092   /// animation information.
02093   ///
02094   EFI_ANIMATION_ID  AnimationId;
02095 } EFI_HII_AIBT_DUPLICATE_BLOCK;
02096 
02097 ///
02098 /// Skips animation IDs.
02099 ///
02100 typedef struct _EFI_HII_AIBT_SKIP1_BLOCK {
02101   ///
02102   /// The unsigned 8-bit value to add to AnimationIdCurrent.
02103   ///
02104   UINT8  SkipCount;
02105 } EFI_HII_AIBT_SKIP1_BLOCK;
02106 
02107 ///
02108 /// Skips animation IDs.
02109 ///
02110 typedef struct _EFI_HII_AIBT_SKIP2_BLOCK {
02111   ///
02112   /// The unsigned 16-bit value to add to AnimationIdCurrent.
02113   ///
02114   UINT16  SkipCount;
02115 } EFI_HII_AIBT_SKIP2_BLOCK;
02116 
02117 #pragma pack()
02118 
02119 
02120 
02121 ///
02122 /// References to string tokens must use this macro to enable scanning for
02123 /// token usages.
02124 ///
02125 ///
02126 /// STRING_TOKEN is not defined in UEFI specification. But it is placed
02127 /// here for the easy access by C files and VFR source files.
02128 ///
02129 #define STRING_TOKEN(t) t
02130 
02131 ///
02132 /// IMAGE_TOKEN is not defined in UEFI specification. But it is placed
02133 /// here for the easy access by C files and VFR source files.
02134 ///
02135 #define IMAGE_TOKEN(t) t
02136 
02137 #endif