1 /*++
2 
3 Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution.  The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8 
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 
12 Module Name:
13 
14   EfiHii.h
15 
16 Abstract:
17 
18   Hii relative definitions, such as Hii package, IFR OpCode etc
19 
20 Revision History
21 
22 --*/
23 
24 #ifndef _EFI_HII_H_
25 #define _EFI_HII_H_
26 
27 #include "EfiCommon.h"
28 #include EFI_PROTOCOL_DEFINITION (DevicePath)
29 
30 typedef VOID    *EFI_HII_HANDLE;
31 typedef CHAR16  *EFI_STRING;
32 typedef UINT16  EFI_QUESTION_ID;
33 typedef UINT16  EFI_IMAGE_ID;
34 typedef UINT16  EFI_STRING_ID;
35 typedef UINT16  EFI_FORM_ID;
36 typedef UINT16  EFI_VARSTORE_ID;
37 typedef UINT16  EFI_DEFAULT_ID;
38 typedef UINT32  EFI_HII_FONT_STYLE;
39 
40 //
41 // Type defined for backward compatible with Framework HII
42 //
43 typedef EFI_STRING_ID  STRING_REF;
44 
45 #pragma pack(1)
46 
47 //
48 // HII package list
49 //
50 typedef struct {
51   EFI_GUID               PackageListGuid;
52   UINT32                 PackageLength;
53 } EFI_HII_PACKAGE_LIST_HEADER;
54 
55 typedef struct {
56   UINT32                 Length:24;
57   UINT32                 Type:8;
58 } EFI_HII_PACKAGE_HEADER;
59 
60 #define EFI_HII_PACKAGE_TYPE_ALL             0x00
61 #define EFI_HII_PACKAGE_TYPE_GUID            0x01
62 #define EFI_HII_PACKAGE_FORMS                0x02
63 #define EFI_HII_PACKAGE_STRINGS              0x04
64 #define EFI_HII_PACKAGE_FONTS                0x05
65 #define EFI_HII_PACKAGE_IMAGES               0x06
66 #define EFI_HII_PACKAGE_SIMPLE_FONTS         0x07
67 #define EFI_HII_PACKAGE_DEVICE_PATH          0x08
68 #define EFI_HII_PACKAGE_KEYBOARD_LAYOUT      0x09
69 #define EFI_HII_PACKAGE_END                  0xDF
70 #define EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN    0xE0
71 #define EFI_HII_PACKAGE_TYPE_SYSTEM_END      0xFF
72 
73 //
74 // Simplified Font Package
75 //
76 
77 #define EFI_GLYPH_HEIGHT                     19
78 #define EFI_GLYPH_WIDTH                      8
79 //
80 // Contents of EFI_NARROW_GLYPH.Attributes
81 //
82 #define EFI_GLYPH_NON_SPACING                0x01
83 #define EFI_GLYPH_WIDE                       0x02
84 
85 typedef struct {
86   CHAR16                 UnicodeWeight;
87   UINT8                  Attributes;
88   UINT8                  GlyphCol1[EFI_GLYPH_HEIGHT];
89 } EFI_NARROW_GLYPH;
90 
91 typedef struct {
92   CHAR16                 UnicodeWeight;
93   UINT8                  Attributes;
94   UINT8                  GlyphCol1[EFI_GLYPH_HEIGHT];
95   UINT8                  GlyphCol2[EFI_GLYPH_HEIGHT];
96   UINT8                  Pad[3];
97 } EFI_WIDE_GLYPH;
98 
99 typedef struct _EFI_HII_SIMPLE_FONT_PACKAGE_HDR {
100   EFI_HII_PACKAGE_HEADER Header;
101   UINT16                 NumberOfNarrowGlyphs;
102   UINT16                 NumberOfWideGlyphs;
103   // EFI_NARROW_GLYPH       NarrowGlyphs[];
104   // EFI_WIDE_GLYPH         WideGlyphs[];
105 } EFI_HII_SIMPLE_FONT_PACKAGE_HDR;
106 
107 //
108 // Font Package
109 //
110 
111 #define EFI_HII_FONT_STYLE_NORMAL            0x00000000
112 #define EFI_HII_FONT_STYLE_BOLD              0x00000001
113 #define EFI_HII_FONT_STYLE_ITALIC            0x00000002
114 #define EFI_HII_FONT_STYLE_EMBOSS            0x00010000
115 #define EFI_HII_FONT_STYLE_OUTLINE           0x00020000
116 #define EFI_HII_FONT_STYLE_SHADOW            0x00040000
117 #define EFI_HII_FONT_STYLE_UNDERLINE         0x00080000
118 #define EFI_HII_FONT_STYLE_DBL_UNDER         0x00100000
119 
120 typedef struct _EFI_HII_GLYPH_INFO {
121   UINT16                 Width;
122   UINT16                 Height;
123   INT16                  OffsetX;
124   INT16                  OffsetY;
125   INT16                  AdvanceX;
126 } EFI_HII_GLYPH_INFO;
127 
128 typedef struct _EFI_HII_FONT_PACKAGE_HDR {
129   EFI_HII_PACKAGE_HEADER Header;
130   UINT32                 HdrSize;
131   UINT32                 GlyphBlockOffset;
132   EFI_HII_GLYPH_INFO     Cell;
133   EFI_HII_FONT_STYLE     FontStyle;
134   CHAR16                 FontFamily[1];
135 } EFI_HII_FONT_PACKAGE_HDR;
136 
137 #define EFI_HII_GIBT_END                  0x00
138 #define EFI_HII_GIBT_GLYPH                0x10
139 #define EFI_HII_GIBT_GLYPHS               0x11
140 #define EFI_HII_GIBT_GLYPH_DEFAULT        0x12
141 #define EFI_HII_GIBT_GLYPHS_DEFAULT       0x13
142 #define EFI_HII_GIBT_DUPLICATE            0x20
143 #define EFI_HII_GIBT_SKIP2                0x21
144 #define EFI_HII_GIBT_SKIP1                0x22
145 #define EFI_HII_GIBT_DEFAULTS             0x23
146 #define EFI_HII_GIBT_EXT1                 0x30
147 #define EFI_HII_GIBT_EXT2                 0x31
148 #define EFI_HII_GIBT_EXT4                 0x32
149 
150 typedef struct _EFI_HII_GLYPH_BLOCK {
151   UINT8                  BlockType;
152 } EFI_HII_GLYPH_BLOCK;
153 
154 typedef struct _EFI_HII_GIBT_DEFAULTS_BLOCK {
155   EFI_HII_GLYPH_BLOCK    Header;
156   EFI_HII_GLYPH_INFO     Cell;
157 } EFI_HII_GIBT_DEFAULTS_BLOCK;
158 
159 typedef struct _EFI_HII_GIBT_DUPLICATE_BLOCK {
160   EFI_HII_GLYPH_BLOCK    Header;
161   CHAR16                 CharValue;
162 } EFI_HII_GIBT_DUPLICATE_BLOCK;
163 
164 typedef struct _EFI_GLYPH_GIBT_END_BLOCK {
165   EFI_HII_GLYPH_BLOCK    Header;
166 } EFI_GLYPH_GIBT_END_BLOCK;
167 
168 typedef struct _EFI_HII_GIBT_EXT1_BLOCK {
169   EFI_HII_GLYPH_BLOCK    Header;
170   UINT8                  BlockType2;
171   UINT8                  Length;
172 } EFI_HII_GIBT_EXT1_BLOCK;
173 
174 typedef struct _EFI_HII_GIBT_EXT2_BLOCK {
175   EFI_HII_GLYPH_BLOCK    Header;
176   UINT8                  BlockType2;
177   UINT16                 Length;
178 } EFI_HII_GIBT_EXT2_BLOCK;
179 
180 typedef struct _EFI_HII_GIBT_EXT4_BLOCK {
181   EFI_HII_GLYPH_BLOCK    Header;
182   UINT8                  BlockType2;
183   UINT32                 Length;
184 } EFI_HII_GIBT_EXT4_BLOCK;
185 
186 typedef struct _EFI_HII_GIBT_GLYPH_BLOCK {
187   EFI_HII_GLYPH_BLOCK    Header;
188   EFI_HII_GLYPH_INFO     Cell;
189   UINT8                  BitmapData[1]; // the number of bytes per bitmap can be calculated by ((Cell.Width+7)/8)*Cell.Height
190 } EFI_HII_GIBT_GLYPH_BLOCK;
191 
192 typedef struct _EFI_HII_GIBT_GLYPHS_BLOCK {
193   EFI_HII_GLYPH_BLOCK    Header;
194   EFI_HII_GLYPH_INFO     Cell;
195   UINT16                 Count;
196   UINT8                  BitmapData[1]; // the number of bytes per bitmap can be calculated by ((Cell.Width+7)/8)*Cell.Height
197 } EFI_HII_GIBT_GLYPHS_BLOCK;
198 
199 typedef struct _EFI_HII_GIBT_GLYPH_DEFAULT_BLOCK {
200   EFI_HII_GLYPH_BLOCK    Header;
201   UINT8                  BitmapData[1]; // the number of bytes per bitmap can be calculated by ((Global.Cell.Width+7)/8)*Global.Cell.Height
202 } EFI_HII_GIBT_GLYPH_DEFAULT_BLOCK;
203 
204 typedef struct _EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK {
205   EFI_HII_GLYPH_BLOCK    Header;
206   UINT16                 Count;
207   UINT8                  BitmapData[1]; // the number of bytes per bitmap can be calculated by ((Global.Cell.Width+7)/8)*Global.Cell.Height
208 } EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK;
209 
210 typedef struct _EFI_HII_GIBT_SKIP1_BLOCK {
211   EFI_HII_GLYPH_BLOCK    Header;
212   UINT8                  SkipCount;
213 } EFI_HII_GIBT_SKIP1_BLOCK;
214 
215 typedef struct _EFI_HII_GIBT_SKIP2_BLOCK {
216   EFI_HII_GLYPH_BLOCK    Header;
217   UINT16                 SkipCount;
218 } EFI_HII_GIBT_SKIP2_BLOCK;
219 
220 //
221 // Device Path Package
222 //
223 typedef struct _EFI_HII_DEVICE_PATH_PACKAGE {
224   EFI_HII_PACKAGE_HEADER   Header;
225   // EFI_DEVICE_PATH_PROTOCOL DevicePath[];
226 } EFI_HII_DEVICE_PATH_PACKAGE;
227 
228 //
229 // GUID Package
230 //
231 typedef struct _EFI_HII_GUID_PACKAGE_HDR {
232   EFI_HII_PACKAGE_HEADER  Header;
233   EFI_GUID                Guid;
234   // Data per GUID definition may follow
235 } EFI_HII_GUID_PACKAGE_HDR;
236 
237 //
238 // String Package
239 //
240 
241 #define UEFI_CONFIG_LANG   "x-UEFI"
242 #define UEFI_CONFIG_LANG_2 "x-i-UEFI"
243 
244 typedef struct _EFI_HII_STRING_PACKAGE_HDR {
245   EFI_HII_PACKAGE_HEADER  Header;
246   UINT32                  HdrSize;
247   UINT32                  StringInfoOffset;
248   CHAR16                  LanguageWindow[16];
249   EFI_STRING_ID           LanguageName;
250   CHAR8                   Language[1];
251 } EFI_HII_STRING_PACKAGE_HDR;
252 
253 typedef struct {
254   UINT8                   BlockType;
255 } EFI_HII_STRING_BLOCK;
256 
257 #define EFI_HII_SIBT_END                     0x00
258 #define EFI_HII_SIBT_STRING_SCSU             0x10
259 #define EFI_HII_SIBT_STRING_SCSU_FONT        0x11
260 #define EFI_HII_SIBT_STRINGS_SCSU            0x12
261 #define EFI_HII_SIBT_STRINGS_SCSU_FONT       0x13
262 #define EFI_HII_SIBT_STRING_UCS2             0x14
263 #define EFI_HII_SIBT_STRING_UCS2_FONT        0x15
264 #define EFI_HII_SIBT_STRINGS_UCS2            0x16
265 #define EFI_HII_SIBT_STRINGS_UCS2_FONT       0x17
266 #define EFI_HII_SIBT_DUPLICATE               0x20
267 #define EFI_HII_SIBT_SKIP2                   0x21
268 #define EFI_HII_SIBT_SKIP1                   0x22
269 #define EFI_HII_SIBT_EXT1                    0x30
270 #define EFI_HII_SIBT_EXT2                    0x31
271 #define EFI_HII_SIBT_EXT4                    0x32
272 #define EFI_HII_SIBT_FONT                    0x40
273 
274 typedef struct _EFI_HII_SIBT_DUPLICATE_BLOCK {
275   EFI_HII_STRING_BLOCK    Header;
276   EFI_STRING_ID           StringId;
277 } EFI_HII_SIBT_DUPLICATE_BLOCK;
278 
279 typedef struct _EFI_HII_SIBT_END_BLOCK {
280   EFI_HII_STRING_BLOCK    Header;
281 } EFI_HII_SIBT_END_BLOCK;
282 
283 typedef struct _EFI_HII_SIBT_EXT1_BLOCK {
284   EFI_HII_STRING_BLOCK    Header;
285   UINT8                   BlockType2;
286   UINT8                   Length;
287 } EFI_HII_SIBT_EXT1_BLOCK;
288 
289 typedef struct _EFI_HII_SIBT_EXT2_BLOCK {
290   EFI_HII_STRING_BLOCK    Header;
291   UINT8                   BlockType2;
292   UINT16                  Length;
293 } EFI_HII_SIBT_EXT2_BLOCK;
294 
295 typedef struct _EFI_HII_SIBT_EXT4_BLOCK {
296   EFI_HII_STRING_BLOCK    Header;
297   UINT8                   BlockType2;
298   UINT32                  Length;
299 } EFI_HII_SIBT_EXT4_BLOCK;
300 
301 typedef struct _EFI_HII_SIBT_FONT_BLOCK {
302   EFI_HII_SIBT_EXT2_BLOCK Header;
303   UINT8                   FontId;
304   UINT16                  FontSize;
305   EFI_HII_FONT_STYLE      FontStyle;
306   CHAR16                  FontName[1];
307 } EFI_HII_SIBT_FONT_BLOCK;
308 
309 typedef struct _EFI_HII_SIBT_SKIP1_BLOCK {
310   EFI_HII_STRING_BLOCK    Header;
311   UINT8                   SkipCount;
312 } EFI_HII_SIBT_SKIP1_BLOCK;
313 
314 typedef struct _EFI_HII_SIBT_SKIP2_BLOCK {
315   EFI_HII_STRING_BLOCK    Header;
316   UINT16                  SkipCount;
317 } EFI_HII_SIBT_SKIP2_BLOCK;
318 
319 typedef struct _EFI_HII_SIBT_STRING_SCSU_BLOCK {
320   EFI_HII_STRING_BLOCK    Header;
321   UINT8                   StringText[1];
322 } EFI_HII_SIBT_STRING_SCSU_BLOCK;
323 
324 typedef struct _EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK {
325   EFI_HII_STRING_BLOCK    Header;
326   UINT8                   FontIdentifier;
327   UINT8                   StringText[1];
328 } EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK;
329 
330 typedef struct _EFI_HII_SIBT_STRINGS_SCSU_BLOCK {
331   EFI_HII_STRING_BLOCK    Header;
332   UINT16                  StringCount;
333   UINT8                   StringText[1];
334 } EFI_HII_SIBT_STRINGS_SCSU_BLOCK;
335 
336 typedef struct _EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK {
337   EFI_HII_STRING_BLOCK    Header;
338   UINT8                   FontIdentifier;
339   UINT16                  StringCount;
340   UINT8                   StringText[1];
341 } EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK;
342 
343 typedef struct _EFI_HII_SIBT_STRING_UCS2_BLOCK {
344   EFI_HII_STRING_BLOCK    Header;
345   CHAR16                  StringText[1];
346 } EFI_HII_SIBT_STRING_UCS2_BLOCK;
347 
348 typedef struct _EFI_HII_SIBT_STRING_UCS2_FONT_BLOCK {
349   EFI_HII_STRING_BLOCK    Header;
350   UINT8                   FontIdentifier;
351   CHAR16                  StringText[1];
352 } EFI_HII_SIBT_STRING_UCS2_FONT_BLOCK;
353 
354 typedef struct _EFI_HII_SIBT_STRINGS_UCS2_BLOCK {
355   EFI_HII_STRING_BLOCK    Header;
356   UINT16                  StringCount;
357   CHAR16                  StringText[1];
358 } EFI_HII_SIBT_STRINGS_UCS2_BLOCK;
359 
360 typedef struct _EFI_HII_SIBT_STRINGS_UCS2_FONT_BLOCK {
361   EFI_HII_STRING_BLOCK    Header;
362   UINT8                   FontIdentifier;
363   UINT16                  StringCount;
364   CHAR16                  StringText[1];
365 } EFI_HII_SIBT_STRINGS_UCS2_FONT_BLOCK;
366 
367 //
368 // Image Packages
369 //
370 
371 typedef struct _EFI_HII_IMAGE_PACKAGE_HDR {
372   EFI_HII_PACKAGE_HEADER  Header;
373   UINT32                  ImageInfoOffset;
374   UINT32                  PaletteInfoOffset;
375 } EFI_HII_IMAGE_PACKAGE_HDR;
376 
377 typedef struct _EFI_HII_IMAGE_BLOCK {
378   UINT8                   BlockType;
379 } EFI_HII_IMAGE_BLOCK;
380 
381 #define EFI_HII_IIBT_END               0x00
382 #define EFI_HII_IIBT_IMAGE_1BIT        0x10
383 #define EFI_HII_IIBT_IMAGE_1BIT_TRANS  0x11
384 #define EFI_HII_IIBT_IMAGE_4BIT        0x12
385 #define EFI_HII_IIBT_IMAGE_4BIT_TRANS  0x13
386 #define EFI_HII_IIBT_IMAGE_8BIT        0x14
387 #define EFI_HII_IIBT_IMAGE_8BIT_TRANS  0x15
388 #define EFI_HII_IIBT_IMAGE_24BIT       0x16
389 #define EFI_HII_IIBT_IMAGE_24BIT_TRANS 0x17
390 #define EFI_HII_IIBT_IMAGE_JPEG        0x18
391 #define EFI_HII_IIBT_DUPLICATE         0x20
392 #define EFI_HII_IIBT_SKIP2             0x21
393 #define EFI_HII_IIBT_SKIP1             0x22
394 #define EFI_HII_IIBT_EXT1              0x30
395 #define EFI_HII_IIBT_EXT2              0x31
396 #define EFI_HII_IIBT_EXT4              0x32
397 
398 typedef struct _EFI_HII_IIBT_END_BLOCK {
399   EFI_HII_IMAGE_BLOCK          Header;
400 } EFI_HII_IIBT_END_BLOCK;
401 
402 typedef struct _EFI_HII_IIBT_EXT1_BLOCK {
403   EFI_HII_IMAGE_BLOCK          Header;
404   UINT8                        BlockType2;
405   UINT8                        Length;
406 } EFI_HII_IIBT_EXT1_BLOCK;
407 
408 typedef struct _EFI_HII_IIBT_EXT2_BLOCK {
409   EFI_HII_IMAGE_BLOCK          Header;
410   UINT8                        BlockType2;
411   UINT16                       Length;
412 } EFI_HII_IIBT_EXT2_BLOCK;
413 
414 typedef struct _EFI_HII_IIBT_EXT4_BLOCK {
415   EFI_HII_IMAGE_BLOCK          Header;
416   UINT8                        BlockType2;
417   UINT32                       Length;
418 } EFI_HII_IIBT_EXT4_BLOCK;
419 
420 typedef struct _EFI_HII_IIBT_IMAGE_1BIT_BASE {
421   UINT16                       Width;
422   UINT16                       Height;
423   UINT8                        Data[1];
424 } EFI_HII_IIBT_IMAGE_1BIT_BASE;
425 
426 typedef struct _EFI_HII_IIBT_IMAGE_1BIT_BLOCK {
427   EFI_HII_IMAGE_BLOCK          Header;
428   UINT8                        PaletteIndex;
429   EFI_HII_IIBT_IMAGE_1BIT_BASE Bitmap;
430 } EFI_HII_IIBT_IMAGE_1BIT_BLOCK;
431 
432 typedef struct _EFI_HII_IIBT_IMAGE_1BIT_TRANS_BLOCK {
433   EFI_HII_IMAGE_BLOCK          Header;
434   UINT8                        PaletteIndex;
435   EFI_HII_IIBT_IMAGE_1BIT_BASE Bitmap;
436 } EFI_HII_IIBT_IMAGE_1BIT_TRANS_BLOCK;
437 
438 typedef struct _EFI_HII_RGB_PIXEL {
439   UINT8                        b;
440   UINT8                        g;
441   UINT8                        r;
442 } EFI_HII_RGB_PIXEL;
443 
444 typedef struct _EFI_HII_IIBT_IMAGE_24BIT_BASE {
445   UINT16                       Width;
446   UINT16                       Height;
447   EFI_HII_RGB_PIXEL            Bitmap[1];
448 } EFI_HII_IIBT_IMAGE_24BIT_BASE;
449 
450 typedef struct _EFI_HII_IIBT_IMAGE_24BIT_BLOCK {
451   EFI_HII_IMAGE_BLOCK           Header;
452   EFI_HII_IIBT_IMAGE_24BIT_BASE Bitmap;
453 } EFI_HII_IIBT_IMAGE_24BIT_BLOCK;
454 
455 typedef struct _EFI_HII_IIBT_IMAGE_24BIT_TRANS_BLOCK {
456   EFI_HII_IMAGE_BLOCK           Header;
457   EFI_HII_IIBT_IMAGE_24BIT_BASE Bitmap;
458 } EFI_HII_IIBT_IMAGE_24BIT_TRANS_BLOCK;
459 
460 typedef struct _EFI_HII_IIBT_IMAGE_4BIT_BASE {
461   UINT16                       Width;
462   UINT16                       Height;
463   UINT8                        Data[1];
464 } EFI_HII_IIBT_IMAGE_4BIT_BASE;
465 
466 typedef struct _EFI_HII_IIBT_IMAGE_4BIT_BLOCK {
467   EFI_HII_IMAGE_BLOCK          Header;
468   UINT8                        PaletteIndex;
469   EFI_HII_IIBT_IMAGE_4BIT_BASE Bitmap;
470 } EFI_HII_IIBT_IMAGE_4BIT_BLOCK;
471 
472 typedef struct _EFI_HII_IIBT_IMAGE_4BIT_TRANS_BLOCK {
473   EFI_HII_IMAGE_BLOCK          Header;
474   UINT8                        PaletteIndex;
475   EFI_HII_IIBT_IMAGE_4BIT_BASE Bitmap;
476 } EFI_HII_IIBT_IMAGE_4BIT_TRANS_BLOCK;
477 
478 typedef struct _EFI_HII_IIBT_IMAGE_8BIT_BASE {
479   UINT16                       Width;
480   UINT16                       Height;
481   UINT8                        Data[1];
482 } EFI_HII_IIBT_IMAGE_8BIT_BASE;
483 
484 typedef struct _EFI_HII_IIBT_IMAGE_8BIT_PALETTE_BLOCK {
485   EFI_HII_IMAGE_BLOCK          Header;
486   UINT8                        PaletteIndex;
487   EFI_HII_IIBT_IMAGE_8BIT_BASE Bitmap;
488 } EFI_HII_IIBT_IMAGE_8BIT_BLOCK;
489 
490 typedef struct _EFI_HII_IIBT_IMAGE_8BIT_TRANS_BLOCK {
491   EFI_HII_IMAGE_BLOCK          Header;
492   UINT8                        PaletteIndex;
493   EFI_HII_IIBT_IMAGE_8BIT_BASE Bitmap;
494 } EFI_HII_IIBT_IMAGE_8BIT_TRAN_BLOCK;
495 
496 typedef struct _EFI_HII_IIBT_DUPLICATE_BLOCK {
497   EFI_HII_IMAGE_BLOCK          Header;
498   EFI_IMAGE_ID                 ImageId;
499 } EFI_HII_IIBT_DUPLICATE_BLOCK;
500 
501 typedef struct _EFI_HII_IIBT_JPEG_BLOCK {
502   EFI_HII_IMAGE_BLOCK          Header;
503   UINT32                       Size;
504   UINT8                        Data[1];
505 } EFI_HII_IIBT_JPEG_BLOCK;
506 
507 typedef struct _EFI_HII_IIBT_SKIP1_BLOCK {
508   EFI_HII_IMAGE_BLOCK          Header;
509   UINT8                        SkipCount;
510 } EFI_HII_IIBT_SKIP1_BLOCK;
511 
512 typedef struct _EFI_HII_IIBT_SKIP2_BLOCK {
513   EFI_HII_IMAGE_BLOCK          Header;
514   UINT16                       SkipCount;
515 } EFI_HII_IIBT_SKIP2_BLOCK;
516 
517 typedef struct _EFI_HII_IMAGE_PALETTE_INFO_HEADER {
518   UINT16                       PaletteCount;
519 } EFI_HII_IMAGE_PALETTE_INFO_HEADER;
520 
521 typedef struct _EFI_HII_IMAGE_PALETTE_INFO {
522   UINT16                       PaletteSize;
523   EFI_HII_RGB_PIXEL            PaletteValue[1];
524 } EFI_HII_IMAGE_PALETTE_INFO;
525 
526 //
527 // Forms Package
528 //
529 
530 typedef struct _EFI_HII_FORM_PACKAGE {
531   EFI_HII_PACKAGE_HEADER       Header;
532   // EFI_IFR_OP_HEADER         OpCodeHeader;
533   // More op-codes follow
534 } EFI_HII_FORM_PACKAGE;
535 
536 typedef struct {
537   UINT8 Hour;
538   UINT8 Minute;
539   UINT8 Second;
540 } EFI_HII_TIME;
541 
542 typedef struct {
543   UINT16 Year;
544   UINT8  Month;
545   UINT8  Day;
546 } EFI_HII_DATE;
547 
548 typedef union {
549   UINT8           u8;
550   UINT16          u16;
551   UINT32          u32;
552   UINT64          u64;
553   BOOLEAN         b;
554   EFI_HII_TIME    time;
555   EFI_HII_DATE    date;
556   EFI_STRING_ID   string;
557 } EFI_IFR_TYPE_VALUE;
558 
559 #define EFI_IFR_FORM_OP                0x01
560 #define EFI_IFR_SUBTITLE_OP            0x02
561 #define EFI_IFR_TEXT_OP                0x03
562 #define EFI_IFR_IMAGE_OP               0x04
563 #define EFI_IFR_ONE_OF_OP              0x05
564 #define EFI_IFR_CHECKBOX_OP            0x06
565 #define EFI_IFR_NUMERIC_OP             0x07
566 #define EFI_IFR_PASSWORD_OP            0x08
567 #define EFI_IFR_ONE_OF_OPTION_OP       0x09
568 #define EFI_IFR_SUPPRESS_IF_OP         0x0A
569 #define EFI_IFR_LOCKED_OP              0x0B
570 #define EFI_IFR_ACTION_OP              0x0C
571 #define EFI_IFR_RESET_BUTTON_OP        0x0D
572 #define EFI_IFR_FORM_SET_OP            0x0E
573 #define EFI_IFR_REF_OP                 0x0F
574 #define EFI_IFR_NO_SUBMIT_IF_OP        0x10
575 #define EFI_IFR_INCONSISTENT_IF_OP     0x11
576 #define EFI_IFR_EQ_ID_VAL_OP           0x12
577 #define EFI_IFR_EQ_ID_ID_OP            0x13
578 #define EFI_IFR_EQ_ID_LIST_OP          0x14
579 #define EFI_IFR_AND_OP                 0x15
580 #define EFI_IFR_OR_OP                  0x16
581 #define EFI_IFR_NOT_OP                 0x17
582 #define EFI_IFR_RULE_OP                0x18
583 #define EFI_IFR_GRAY_OUT_IF_OP         0x19
584 #define EFI_IFR_DATE_OP                0x1A
585 #define EFI_IFR_TIME_OP                0x1B
586 #define EFI_IFR_STRING_OP              0x1C
587 #define EFI_IFR_REFRESH_OP             0x1D
588 #define EFI_IFR_DISABLE_IF_OP          0x1E
589 #define EFI_IFR_TO_LOWER_OP            0x20
590 #define EFI_IFR_TO_UPPER_OP            0x21
591 #define EFI_IFR_ORDERED_LIST_OP        0x23
592 #define EFI_IFR_VARSTORE_OP            0x24
593 #define EFI_IFR_VARSTORE_NAME_VALUE_OP 0x25
594 #define EFI_IFR_VARSTORE_EFI_OP        0x26
595 #define EFI_IFR_VARSTORE_DEVICE_OP     0x27
596 #define EFI_IFR_VERSION_OP             0x28
597 #define EFI_IFR_END_OP                 0x29
598 #define EFI_IFR_MATCH_OP               0x2A
599 #define EFI_IFR_EQUAL_OP               0x2F
600 #define EFI_IFR_NOT_EQUAL_OP           0x30
601 #define EFI_IFR_GREATER_THAN_OP        0x31
602 #define EFI_IFR_GREATER_EQUAL_OP       0x32
603 #define EFI_IFR_LESS_THAN_OP           0x33
604 #define EFI_IFR_LESS_EQUAL_OP          0x34
605 #define EFI_IFR_BITWISE_AND_OP         0x35
606 #define EFI_IFR_BITWISE_OR_OP          0x36
607 #define EFI_IFR_BITWISE_NOT_OP         0x37
608 #define EFI_IFR_SHIFT_LEFT_OP          0x38
609 #define EFI_IFR_SHIFT_RIGHT_OP         0x39
610 #define EFI_IFR_ADD_OP                 0x3A
611 #define EFI_IFR_SUBTRACT_OP            0x3B
612 #define EFI_IFR_MULTIPLY_OP            0x3C
613 #define EFI_IFR_DIVIDE_OP              0x3D
614 #define EFI_IFR_MODULO_OP              0x3E
615 #define EFI_IFR_RULE_REF_OP            0x3F
616 #define EFI_IFR_QUESTION_REF1_OP       0x40
617 #define EFI_IFR_QUESTION_REF2_OP       0x41
618 #define EFI_IFR_UINT8_OP               0x42
619 #define EFI_IFR_UINT16_OP              0x43
620 #define EFI_IFR_UINT32_OP              0x44
621 #define EFI_IFR_UINT64_OP              0x45
622 #define EFI_IFR_TRUE_OP                0x46
623 #define EFI_IFR_FALSE_OP               0x47
624 #define EFI_IFR_TO_UINT_OP             0x48
625 #define EFI_IFR_TO_STRING_OP           0x49
626 #define EFI_IFR_TO_BOOLEAN_OP          0x4A
627 #define EFI_IFR_MID_OP                 0x4B
628 #define EFI_IFR_FIND_OP                0x4C
629 #define EFI_IFR_TOKEN_OP               0x4D
630 #define EFI_IFR_STRING_REF1_OP         0x4E
631 #define EFI_IFR_STRING_REF2_OP         0x4F
632 #define EFI_IFR_CONDITIONAL_OP         0x50
633 #define EFI_IFR_QUESTION_REF3_OP       0x51
634 #define EFI_IFR_ZERO_OP                0x52
635 #define EFI_IFR_ONE_OP                 0x53
636 #define EFI_IFR_ONES_OP                0x54
637 #define EFI_IFR_UNDEFINED_OP           0x55
638 #define EFI_IFR_LENGTH_OP              0x56
639 #define EFI_IFR_DUP_OP                 0x57
640 #define EFI_IFR_THIS_OP                0x58
641 #define EFI_IFR_SPAN_OP                0x59
642 #define EFI_IFR_VALUE_OP               0x5A
643 #define EFI_IFR_DEFAULT_OP             0x5B
644 #define EFI_IFR_DEFAULTSTORE_OP        0x5C
645 #define EFI_IFR_CATENATE_OP            0x5E
646 #define EFI_IFR_GUID_OP                0x5F
647 
648 typedef struct _EFI_IFR_OP_HEADER {
649   UINT8                    OpCode;
650   UINT8                    Length:7;
651   UINT8                    Scope:1;
652 } EFI_IFR_OP_HEADER;
653 
654 typedef struct _EFI_IFR_STATEMENT_HEADER {
655   EFI_STRING_ID            Prompt;
656   EFI_STRING_ID            Help;
657 } EFI_IFR_STATEMENT_HEADER;
658 
659 typedef struct _EFI_IFR_QUESTION_HEADER {
660   EFI_IFR_STATEMENT_HEADER Header;
661   EFI_QUESTION_ID          QuestionId;
662   EFI_VARSTORE_ID          VarStoreId;
663   union {
664     EFI_STRING_ID          VarName;
665     UINT16                 VarOffset;
666   }                        VarStoreInfo;
667   UINT8                    Flags;
668 } EFI_IFR_QUESTION_HEADER;
669 
670 #define EFI_IFR_FLAG_READ_ONLY         0x01
671 #define EFI_IFR_FLAG_CALLBACK          0x04
672 #define EFI_IFR_FLAG_RESET_REQUIRED    0x10
673 #define EFI_IFR_FLAG_OPTIONS_ONLY      0x80
674 
675 typedef struct _EFI_IFR_DEFAULTSTORE {
676   EFI_IFR_OP_HEADER        Header;
677   EFI_STRING_ID            DefaultName;
678   UINT16                   DefaultId;
679 } EFI_IFR_DEFAULTSTORE;
680 
681 #define EFI_HII_DEFAULT_CLASS_STANDARD       0x0000
682 #define EFI_HII_DEFAULT_CLASS_MANUFACTURING  0x0001
683 #define EFI_HII_DEFAULT_CLASS_SAFE           0x0002
684 #define EFI_HII_DEFAULT_CLASS_PLATFORM_BEGIN 0x4000
685 #define EFI_HII_DEFAULT_CLASS_PLATFORM_END   0x7fff
686 #define EFI_HII_DEFAULT_CLASS_HARDWARE_BEGIN 0x8000
687 #define EFI_HII_DEFAULT_CLASS_HARDWARE_END   0xbfff
688 #define EFI_HII_DEFAULT_CLASS_FIRMWARE_BEGIN 0xc000
689 #define EFI_HII_DEFAULT_CLASS_FIRMWARE_END   0xffff
690 
691 typedef struct _EFI_IFR_VARSTORE {
692   EFI_IFR_OP_HEADER        Header;
693   EFI_GUID                 Guid;
694   EFI_VARSTORE_ID          VarStoreId;
695   UINT16                   Size;
696   UINT8                    Name[1];
697 } EFI_IFR_VARSTORE;
698 
699 typedef struct _EFI_IFR_VARSTORE_EFI {
700   EFI_IFR_OP_HEADER        Header;
701   EFI_VARSTORE_ID          VarStoreId;
702   EFI_GUID                 Guid;
703   UINT32                   Attributes;
704 } EFI_IFR_VARSTORE_EFI;
705 
706 typedef struct _EFI_IFR_VARSTORE_NAME_VALUE {
707   EFI_IFR_OP_HEADER        Header;
708   EFI_VARSTORE_ID          VarStoreId;
709   EFI_GUID                 Guid;
710 } EFI_IFR_VARSTORE_NAME_VALUE;
711 
712 typedef struct _EFI_IFR_FORM_SET {
713   EFI_IFR_OP_HEADER        Header;
714   EFI_GUID                 Guid;
715   EFI_STRING_ID            FormSetTitle;
716   EFI_STRING_ID            Help;
717   UINT8                    Flags;
718   EFI_GUID                 ClassGuid[1];
719 } EFI_IFR_FORM_SET;
720 
721 #define EFI_HII_PLATFORM_SETUP_FORMSET_GUID \
722   { 0x93039971, 0x8545, 0x4b04, { 0xb4, 0x5e, 0x32, 0xeb, 0x83, 0x26, 0x4, 0xe } }
723 
724 typedef struct _EFI_IFR_END {
725   EFI_IFR_OP_HEADER        Header;
726 } EFI_IFR_END;
727 
728 typedef struct _EFI_IFR_FORM {
729   EFI_IFR_OP_HEADER        Header;
730   UINT16                   FormId;
731   EFI_STRING_ID            FormTitle;
732 } EFI_IFR_FORM;
733 
734 typedef struct _EFI_IFR_IMAGE {
735   EFI_IFR_OP_HEADER        Header;
736   EFI_IMAGE_ID             Id;
737 } EFI_IFR_IMAGE;
738 
739 typedef struct _EFI_IFR_LOCKED {
740   EFI_IFR_OP_HEADER        Header;
741 } EFI_IFR_LOCKED;
742 
743 typedef struct _EFI_IFR_RULE {
744   EFI_IFR_OP_HEADER        Header;
745   UINT8                    RuleId;
746 } EFI_IFR_RULE;
747 
748 typedef struct _EFI_IFR_DEFAULT {
749   EFI_IFR_OP_HEADER        Header;
750   UINT16                   DefaultId;
751   UINT8                    Type;
752   EFI_IFR_TYPE_VALUE       Value;
753 } EFI_IFR_DEFAULT;
754 
755 typedef struct _EFI_IFR_VALUE {
756   EFI_IFR_OP_HEADER        Header;
757 } EFI_IFR_VALUE;
758 
759 typedef struct _EFI_IFR_SUBTITLE {
760   EFI_IFR_OP_HEADER        Header;
761   EFI_IFR_STATEMENT_HEADER Statement;
762   UINT8                    Flags;
763 } EFI_IFR_SUBTITLE;
764 
765 #define EFI_IFR_FLAGS_HORIZONTAL       0x01
766 
767 typedef struct _EFI_IFR_CHECKBOX {
768   EFI_IFR_OP_HEADER        Header;
769   EFI_IFR_QUESTION_HEADER  Question;
770   UINT8                    Flags;
771 } EFI_IFR_CHECKBOX;
772 
773 #define EFI_IFR_CHECKBOX_DEFAULT       0x01
774 #define EFI_IFR_CHECKBOX_DEFAULT_MFG   0x02
775 
776 typedef struct _EFI_IFR_TEXT {
777   EFI_IFR_OP_HEADER        Header;
778   EFI_IFR_STATEMENT_HEADER Statement;
779   EFI_STRING_ID            TextTwo;
780 } EFI_IFR_TEXT;
781 
782 typedef struct _EFI_IFR_REF {
783   EFI_IFR_OP_HEADER        Header;
784   EFI_IFR_QUESTION_HEADER  Question;
785   EFI_FORM_ID              FormId;
786 } EFI_IFR_REF;
787 
788 typedef struct _EFI_IFR_REF2 {
789   EFI_IFR_OP_HEADER        Header;
790   EFI_IFR_QUESTION_HEADER  Question;
791   EFI_FORM_ID              FormId;
792   EFI_QUESTION_ID          QuestionId;
793 } EFI_IFR_REF2;
794 
795 typedef struct _EFI_IFR_REF3 {
796   EFI_IFR_OP_HEADER        Header;
797   EFI_IFR_QUESTION_HEADER  Question;
798   EFI_FORM_ID              FormId;
799   EFI_QUESTION_ID          QuestionId;
800   EFI_GUID                 FormSetId;
801 } EFI_IFR_REF3;
802 
803 typedef struct _EFI_IFR_REF4 {
804   EFI_IFR_OP_HEADER        Header;
805   EFI_IFR_QUESTION_HEADER  Question;
806   EFI_FORM_ID              FormId;
807   EFI_QUESTION_ID          QuestionId;
808   EFI_GUID                 FormSetId;
809   EFI_STRING_ID            DevicePath;
810 } EFI_IFR_REF4;
811 
812 typedef struct _EFI_IFR_RESET_BUTTON {
813   EFI_IFR_OP_HEADER        Header;
814   EFI_IFR_STATEMENT_HEADER Statement;
815   EFI_DEFAULT_ID           DefaultId;
816 } EFI_IFR_RESET_BUTTON;
817 
818 typedef struct _EFI_IFR_ACTION {
819   EFI_IFR_OP_HEADER        Header;
820   EFI_IFR_QUESTION_HEADER  Question;
821   EFI_STRING_ID            QuestionConfig;
822 } EFI_IFR_ACTION;
823 
824 typedef struct _EFI_IFR_ACTION_1 {
825   EFI_IFR_OP_HEADER        Header;
826   EFI_IFR_QUESTION_HEADER  Question;
827 } EFI_IFR_ACTION_1;
828 
829 typedef struct _EFI_IFR_DATE {
830   EFI_IFR_OP_HEADER        Header;
831   EFI_IFR_QUESTION_HEADER  Question;
832   UINT8                    Flags;
833 } EFI_IFR_DATE;
834 
835 #define EFI_QF_DATE_YEAR_SUPPRESS      0x01
836 #define EFI_QF_DATE_MONTH_SUPPRESS     0x02
837 #define EFI_QF_DATE_DAY_SUPPRESS       0x04
838 
839 #define EFI_QF_DATE_STORAGE            0x30
840 #define     QF_DATE_STORAGE_NORMAL     0x00
841 #define     QF_DATE_STORAGE_TIME       0x10
842 #define     QF_DATE_STORAGE_WAKEUP     0x20
843 
844 typedef union {
845   struct {
846     UINT8 MinValue;
847     UINT8 MaxValue;
848     UINT8 Step;
849   } u8;
850   struct {
851     UINT16 MinValue;
852     UINT16 MaxValue;
853     UINT16 Step;
854   } u16;
855   struct {
856     UINT32 MinValue;
857     UINT32 MaxValue;
858     UINT32 Step;
859   } u32;
860   struct {
861     UINT64 MinValue;
862     UINT64 MaxValue;
863     UINT64 Step;
864   } u64;
865 } MINMAXSTEP_DATA;
866 
867 typedef struct _EFI_IFR_NUMERIC {
868   EFI_IFR_OP_HEADER        Header;
869   EFI_IFR_QUESTION_HEADER  Question;
870   UINT8                    Flags;
871   MINMAXSTEP_DATA          data;
872 } EFI_IFR_NUMERIC;
873 
874 #define EFI_IFR_NUMERIC_SIZE           0x03
875 #define EFI_IFR_NUMERIC_SIZE_1         0x00
876 #define EFI_IFR_NUMERIC_SIZE_2         0x01
877 #define EFI_IFR_NUMERIC_SIZE_4         0x02
878 #define EFI_IFR_NUMERIC_SIZE_8         0x03
879 
880 #define EFI_IFR_DISPLAY                0x30
881 #define EFI_IFR_DISPLAY_INT_DEC        0x00
882 #define EFI_IFR_DISPLAY_UINT_DEC       0x10
883 #define EFI_IFR_DISPLAY_UINT_HEX       0x20
884 
885 typedef struct _EFI_IFR_ONE_OF {
886   EFI_IFR_OP_HEADER        Header;
887   EFI_IFR_QUESTION_HEADER  Question;
888   UINT8                    Flags;
889   MINMAXSTEP_DATA          data;
890 } EFI_IFR_ONE_OF;
891 
892 typedef struct _EFI_IFR_STRING {
893   EFI_IFR_OP_HEADER        Header;
894   EFI_IFR_QUESTION_HEADER  Question;
895   UINT8                    MinSize;
896   UINT8                    MaxSize;
897   UINT8                    Flags;
898 } EFI_IFR_STRING;
899 
900 #define EFI_IFR_STRING_MULTI_LINE      0x01
901 
902 typedef struct _EFI_IFR_PASSWORD {
903   EFI_IFR_OP_HEADER        Header;
904   EFI_IFR_QUESTION_HEADER  Question;
905   UINT16                   MinSize;
906   UINT16                   MaxSize;
907 } EFI_IFR_PASSWORD;
908 
909 typedef struct _EFI_IFR_ORDERED_LIST {
910   EFI_IFR_OP_HEADER        Header;
911   EFI_IFR_QUESTION_HEADER  Question;
912   UINT8                    MaxContainers;
913   UINT8                    Flags;
914 } EFI_IFR_ORDERED_LIST;
915 
916 #define EFI_IFR_UNIQUE_SET             0x01
917 #define EFI_IFR_NO_EMPTY_SET           0x02
918 
919 typedef struct _EFI_IFR_TIME {
920   EFI_IFR_OP_HEADER        Header;
921   EFI_IFR_QUESTION_HEADER  Question;
922   UINT8                    Flags;
923 } EFI_IFR_TIME;
924 
925 #define QF_TIME_HOUR_SUPPRESS          0x01
926 #define QF_TIME_MINUTE_SUPPRESS        0x02
927 #define QF_TIME_SECOND_SUPPRESS        0x04
928 
929 #define QF_TIME_STORAGE                0x30
930 #define QF_TIME_STORAGE_NORMAL         0x00
931 #define QF_TIME_STORAGE_TIME           0x10
932 #define QF_TIME_STORAGE_WAKEUP         0x20
933 
934 typedef struct _EFI_IFR_DISABLE_IF {
935   EFI_IFR_OP_HEADER        Header;
936 } EFI_IFR_DISABLE_IF;
937 
938 typedef struct _EFI_IFR_SUPPRESS_IF {
939   EFI_IFR_OP_HEADER        Header;
940 } EFI_IFR_SUPPRESS_IF;
941 
942 typedef struct _EFI_IFR_GRAY_OUT_IF {
943   EFI_IFR_OP_HEADER        Header;
944 } EFI_IFR_GRAY_OUT_IF;
945 
946 typedef struct _EFI_IFR_INCONSISTENT_IF {
947   EFI_IFR_OP_HEADER        Header;
948   EFI_STRING_ID            Error;
949 } EFI_IFR_INCONSISTENT_IF;
950 
951 typedef struct _EFI_IFR_NO_SUBMIT_IF {
952   EFI_IFR_OP_HEADER        Header;
953   EFI_STRING_ID            Error;
954 } EFI_IFR_NO_SUBMIT_IF;
955 
956 typedef struct _EFI_IFR_REFRESH {
957   EFI_IFR_OP_HEADER        Header;
958   UINT8                    RefreshInterval;
959 } EFI_IFR_REFRESH;
960 
961 typedef struct _EFI_IFR_VARSTORE_DEVICE {
962   EFI_IFR_OP_HEADER        Header;
963   EFI_STRING_ID            DevicePath;
964 } EFI_IFR_VARSTORE_DEVICE;
965 
966 typedef struct _EFI_IFR_ONE_OF_OPTION {
967   EFI_IFR_OP_HEADER        Header;
968   EFI_STRING_ID            Option;
969   UINT8                    Flags;
970   UINT8                    Type;
971   EFI_IFR_TYPE_VALUE       Value;
972 } EFI_IFR_ONE_OF_OPTION;
973 
974 #define EFI_IFR_TYPE_NUM_SIZE_8        0x00
975 #define EFI_IFR_TYPE_NUM_SIZE_16       0x01
976 #define EFI_IFR_TYPE_NUM_SIZE_32       0x02
977 #define EFI_IFR_TYPE_NUM_SIZE_64       0x03
978 #define EFI_IFR_TYPE_BOOLEAN           0x04
979 #define EFI_IFR_TYPE_TIME              0x05
980 #define EFI_IFR_TYPE_DATE              0x06
981 #define EFI_IFR_TYPE_STRING            0x07
982 #define EFI_IFR_TYPE_OTHER             0x08
983 
984 #define EFI_IFR_OPTION_DEFAULT         0x10
985 #define EFI_IFR_OPTION_DEFAULT_MFG     0x20
986 
987 typedef struct _EFI_IFR_GUID {
988   EFI_IFR_OP_HEADER        Header;
989   EFI_GUID                 Guid;
990   //Optional Data Follows
991 } EFI_IFR_GUID;
992 
993 typedef struct _EFI_IFR_DUP {
994   EFI_IFR_OP_HEADER        Header;
995 } EFI_IFR_DUP;
996 
997 typedef struct _EFI_IFR_EQ_ID_ID {
998   EFI_IFR_OP_HEADER        Header;
999   EFI_QUESTION_ID          QuestionId1;
1000   EFI_QUESTION_ID          QuestionId2;
1001 } EFI_IFR_EQ_ID_ID;
1002 
1003 typedef struct _EFI_IFR_EQ_ID_VAL {
1004   EFI_IFR_OP_HEADER        Header;
1005   EFI_QUESTION_ID          QuestionId;
1006   UINT16                   Value;
1007 } EFI_IFR_EQ_ID_VAL;
1008 
1009 typedef struct _EFI_IFR_EQ_ID_LIST {
1010   EFI_IFR_OP_HEADER        Header;
1011   EFI_QUESTION_ID          QuestionId;
1012   UINT16                   ListLength;
1013   UINT16                   ValueList[1];
1014 } EFI_IFR_EQ_ID_LIST;
1015 
1016 typedef struct _EFI_IFR_QUESTION_REF1 {
1017   EFI_IFR_OP_HEADER        Header;
1018   EFI_QUESTION_ID          QuestionId;
1019 } EFI_IFR_QUESTION_REF1;
1020 
1021 typedef struct _EFI_IFR_UINT8 {
1022   EFI_IFR_OP_HEADER        Header;
1023   UINT8 Value;
1024 } EFI_IFR_UINT8;
1025 
1026 typedef struct _EFI_IFR_UINT16 {
1027   EFI_IFR_OP_HEADER        Header;
1028   UINT16                   Value;
1029 } EFI_IFR_UINT16;
1030 
1031 typedef struct _EFI_IFR_QUESTION_REF2 {
1032   EFI_IFR_OP_HEADER        Header;
1033 } EFI_IFR_QUESTION_REF2;
1034 
1035 typedef struct _EFI_IFR_UINT32 {
1036   EFI_IFR_OP_HEADER        Header;
1037   UINT32                   Value;
1038 } EFI_IFR_UINT32;
1039 
1040 typedef struct _EFI_IFR_UINT64 {
1041   EFI_IFR_OP_HEADER        Header;
1042   UINT64 Value;
1043 } EFI_IFR_UINT64;
1044 
1045 typedef struct _EFI_IFR_QUESTION_REF3 {
1046   EFI_IFR_OP_HEADER        Header;
1047 } EFI_IFR_QUESTION_REF3;
1048 
1049 typedef struct _EFI_IFR_QUESTION_REF3_2 {
1050   EFI_IFR_OP_HEADER        Header;
1051   EFI_STRING_ID            DevicePath;
1052 } EFI_IFR_QUESTION_REF3_2;
1053 
1054 typedef struct _EFI_IFR_QUESTION_REF3_3 {
1055   EFI_IFR_OP_HEADER        Header;
1056   EFI_STRING_ID            DevicePath;
1057   EFI_GUID                 Guid;
1058 } EFI_IFR_QUESTION_REF3_3;
1059 
1060 typedef struct _EFI_IFR_RULE_REF {
1061   EFI_IFR_OP_HEADER        Header;
1062   UINT8                    RuleId;
1063 } EFI_IFR_RULE_REF;
1064 
1065 typedef struct _EFI_IFR_STRING_REF1 {
1066   EFI_IFR_OP_HEADER        Header;
1067   EFI_STRING_ID            StringId;
1068 } EFI_IFR_STRING_REF1;
1069 
1070 typedef struct _EFI_IFR_STRING_REF2 {
1071   EFI_IFR_OP_HEADER        Header;
1072 } EFI_IFR_STRING_REF2;
1073 
1074 typedef struct _EFI_IFR_THIS {
1075   EFI_IFR_OP_HEADER        Header;
1076 } EFI_IFR_THIS;
1077 
1078 typedef struct _EFI_IFR_TRUE {
1079   EFI_IFR_OP_HEADER        Header;
1080 } EFI_IFR_TRUE;
1081 
1082 typedef struct _EFI_IFR_FALSE {
1083   EFI_IFR_OP_HEADER        Header;
1084 } EFI_IFR_FALSE;
1085 
1086 typedef struct _EFI_IFR_ONE {
1087   EFI_IFR_OP_HEADER        Header;
1088 } EFI_IFR_ONE;
1089 
1090 typedef struct _EFI_IFR_ONES {
1091   EFI_IFR_OP_HEADER        Header;
1092 } EFI_IFR_ONES;
1093 
1094 typedef struct _EFI_IFR_ZERO {
1095   EFI_IFR_OP_HEADER        Header;
1096 } EFI_IFR_ZERO;
1097 
1098 typedef struct _EFI_IFR_UNDEFINED {
1099   EFI_IFR_OP_HEADER        Header;
1100 } EFI_IFR_UNDEFINED;
1101 
1102 typedef struct _EFI_IFR_VERSION {
1103   EFI_IFR_OP_HEADER        Header;
1104 } EFI_IFR_VERSION;
1105 
1106 typedef struct _EFI_IFR_LENGTH {
1107   EFI_IFR_OP_HEADER        Header;
1108 } EFI_IFR_LENGTH;
1109 
1110 typedef struct _EFI_IFR_NOT {
1111   EFI_IFR_OP_HEADER        Header;
1112 } EFI_IFR_NOT;
1113 
1114 typedef struct _EFI_IFR_BITWISE_NOT {
1115   EFI_IFR_OP_HEADER        Header;
1116 } EFI_IFR_BITWISE_NOT;
1117 
1118 typedef struct _EFI_IFR_TO_BOOLEAN {
1119   EFI_IFR_OP_HEADER        Header;
1120 } EFI_IFR_TO_BOOLEAN;
1121 
1122 #define EFI_IFR_STRING_UNSIGNED_DEC      0
1123 #define EFI_IFR_STRING_SIGNED_DEC        1
1124 #define EFI_IFR_STRING_LOWERCASE_HEX     2
1125 #define EFI_IFR_STRING_UPPERCASE_HEX     3
1126 
1127 #define EFI_IFR_STRING_ASCII             0
1128 #define EFI_IFR_STRING_UNICODE           8
1129 
1130 typedef struct _EFI_IFR_TO_STRING {
1131   EFI_IFR_OP_HEADER        Header;
1132   UINT8                    Format;
1133 } EFI_IFR_TO_STRING;
1134 
1135 typedef struct _EFI_IFR_TO_UINT {
1136   EFI_IFR_OP_HEADER        Header;
1137 } EFI_IFR_TO_UINT;
1138 
1139 typedef struct _EFI_IFR_TO_UPPER {
1140   EFI_IFR_OP_HEADER        Header;
1141 } EFI_IFR_TO_UPPER;
1142 
1143 typedef struct _EFI_IFR_TO_LOWER {
1144   EFI_IFR_OP_HEADER        Header;
1145 } EFI_IFR_TO_LOWER;
1146 
1147 typedef struct _EFI_IFR_ADD {
1148   EFI_IFR_OP_HEADER        Header;
1149 } EFI_IFR_ADD;
1150 
1151 typedef struct _EFI_IFR_AND {
1152   EFI_IFR_OP_HEADER        Header;
1153 } EFI_IFR_AND;
1154 
1155 typedef struct _EFI_IFR_BITWISE_AND {
1156   EFI_IFR_OP_HEADER        Header;
1157 } EFI_IFR_BITWISE_AND;
1158 
1159 typedef struct _EFI_IFR_BITWISE_OR {
1160   EFI_IFR_OP_HEADER        Header;
1161 } EFI_IFR_BITWISE_OR;
1162 
1163 typedef struct _EFI_IFR_CATENATE {
1164   EFI_IFR_OP_HEADER        Header;
1165 } EFI_IFR_CATENATE;
1166 
1167 typedef struct _EFI_IFR_DIVIDE {
1168   EFI_IFR_OP_HEADER        Header;
1169 } EFI_IFR_DIVIDE;
1170 
1171 typedef struct _EFI_IFR_EQUAL {
1172   EFI_IFR_OP_HEADER        Header;
1173 } EFI_IFR_EQUAL;
1174 
1175 typedef struct _EFI_IFR_GREATER_EQUAL {
1176   EFI_IFR_OP_HEADER        Header;
1177 } EFI_IFR_GREATER_EQUAL;
1178 
1179 typedef struct _EFI_IFR_GREATER_THAN {
1180   EFI_IFR_OP_HEADER        Header;
1181 } EFI_IFR_GREATER_THAN;
1182 
1183 typedef struct _EFI_IFR_LESS_EQUAL {
1184   EFI_IFR_OP_HEADER        Header;
1185 } EFI_IFR_LESS_EQUAL;
1186 
1187 typedef struct _EFI_IFR_LESS_THAN {
1188   EFI_IFR_OP_HEADER        Header;
1189 } EFI_IFR_LESS_THAN;
1190 
1191 typedef struct _EFI_IFR_MATCH {
1192   EFI_IFR_OP_HEADER        Header;
1193 } EFI_IFR_MATCH;
1194 
1195 typedef struct _EFI_IFR_MULTIPLY {
1196   EFI_IFR_OP_HEADER        Header;
1197 } EFI_IFR_MULTIPLY;
1198 
1199 typedef struct _EFI_IFR_MODULO {
1200   EFI_IFR_OP_HEADER        Header;
1201 } EFI_IFR_MODULO;
1202 
1203 typedef struct _EFI_IFR_NOT_EQUAL {
1204   EFI_IFR_OP_HEADER        Header;
1205 } EFI_IFR_NOT_EQUAL;
1206 
1207 typedef struct _EFI_IFR_OR {
1208   EFI_IFR_OP_HEADER        Header;
1209 } EFI_IFR_OR;
1210 
1211 typedef struct _EFI_IFR_SHIFT_LEFT {
1212   EFI_IFR_OP_HEADER        Header;
1213 } EFI_IFR_SHIFT_LEFT;
1214 
1215 typedef struct _EFI_IFR_SHIFT_RIGHT {
1216   EFI_IFR_OP_HEADER        Header;
1217 } EFI_IFR_SHIFT_RIGHT;
1218 
1219 typedef struct _EFI_IFR_SUBTRACT {
1220   EFI_IFR_OP_HEADER        Header;
1221 } EFI_IFR_SUBTRACT;
1222 
1223 typedef struct _EFI_IFR_CONDITIONAL {
1224   EFI_IFR_OP_HEADER        Header;
1225 } EFI_IFR_CONDITIONAL;
1226 
1227 #define EFI_IFR_FF_CASE_SENSITIVE    0x00
1228 #define EFI_IFR_FF_CASE_INSENSITIVE  0x01
1229 
1230 typedef struct _EFI_IFR_FIND {
1231   EFI_IFR_OP_HEADER        Header;
1232   UINT8                    Format;
1233 } EFI_IFR_FIND;
1234 
1235 typedef struct _EFI_IFR_MID {
1236   EFI_IFR_OP_HEADER        Header;
1237 } EFI_IFR_MID;
1238 
1239 typedef struct _EFI_IFR_TOKEN {
1240   EFI_IFR_OP_HEADER        Header;
1241 } EFI_IFR_TOKEN;
1242 
1243 #define EFI_IFR_FLAGS_FIRST_MATCHING     0x00
1244 #define EFI_IFR_FLAGS_FIRST_NON_MATCHING 0x01
1245 
1246 typedef struct _EFI_IFR_SPAN {
1247   EFI_IFR_OP_HEADER        Header;
1248   UINT8                    Flags;
1249 } EFI_IFR_SPAN;
1250 
1251 //
1252 // Keyboard Package
1253 //
1254 
1255 typedef enum {
1256   EfiKeyLCtrl,
1257   EfiKeyA0,
1258   EfiKeyLAlt,
1259   EfiKeySpaceBar,
1260   EfiKeyA2,
1261   EfiKeyA3,
1262   EfiKeyA4,
1263   EfiKeyRCtrl,
1264   EfiKeyLeftArrow,
1265   EfiKeyDownArrow,
1266   EfiKeyRightArrow,
1267   EfiKeyZero,
1268   EfiKeyPeriod,
1269   EfiKeyEnter,
1270   EfiKeyLShift,
1271   EfiKeyB0,
1272   EfiKeyB1,
1273   EfiKeyB2,
1274   EfiKeyB3,
1275   EfiKeyB4,
1276   EfiKeyB5,
1277   EfiKeyB6,
1278   EfiKeyB7,
1279   EfiKeyB8,
1280   EfiKeyB9,
1281   EfiKeyB10,
1282   EfiKeyRShift,
1283   EfiKeyUpArrow,
1284   EfiKeyOne,
1285   EfiKeyTwo,
1286   EfiKeyThree,
1287   EfiKeyCapsLock,
1288   EfiKeyC1,
1289   EfiKeyC2,
1290   EfiKeyC3,
1291   EfiKeyC4,
1292   EfiKeyC5,
1293   EfiKeyC6,
1294   EfiKeyC7,
1295   EfiKeyC8,
1296   EfiKeyC9,
1297   EfiKeyC10,
1298   EfiKeyC11,
1299   EfiKeyC12,
1300   EfiKeyFour,
1301   EfiKeyFive,
1302   EfiKeySix,
1303   EfiKeyPlus,
1304   EfiKeyTab,
1305   EfiKeyD1,
1306   EfiKeyD2,
1307   EfiKeyD3,
1308   EfiKeyD4,
1309   EfiKeyD5,
1310   EfiKeyD6,
1311   EfiKeyD7,
1312   EfiKeyD8,
1313   EfiKeyD9,
1314   EfiKeyD10,
1315   EfiKeyD11,
1316   EfiKeyD12,
1317   EfiKeyD13,
1318   EfiKeyDel,
1319   EfiKeyEnd,
1320   EfiKeyPgDn,
1321   EfiKeySeven,
1322   EfiKeyEight,
1323   EfiKeyNine,
1324   EfiKeyE0,
1325   EfiKeyE1,
1326   EfiKeyE2,
1327   EfiKeyE3,
1328   EfiKeyE4,
1329   EfiKeyE5,
1330   EfiKeyE6,
1331   EfiKeyE7,
1332   EfiKeyE8,
1333   EfiKeyE9,
1334   EfiKeyE10,
1335   EfiKeyE11,
1336   EfiKeyE12,
1337   EfiKeyBackSpace,
1338   EfiKeyIns,
1339   EfiKeyHome,
1340   EfiKeyPgUp,
1341   EfiKeyNLck,
1342   EfiKeySlash,
1343   EfiKeyAsterisk,
1344   EfiKeyMinus,
1345   EfiKeyEsc,
1346   EfiKeyF1,
1347   EfiKeyF2,
1348   EfiKeyF3,
1349   EfiKeyF4,
1350   EfiKeyF5,
1351   EfiKeyF6,
1352   EfiKeyF7,
1353   EfiKeyF8,
1354   EfiKeyF9,
1355   EfiKeyF10,
1356   EfiKeyF11,
1357   EfiKeyF12,
1358   EfiKeyPrint,
1359   EfiKeySLck,
1360   EfiKeyPause
1361 } EFI_KEY;
1362 
1363 typedef struct {
1364   EFI_KEY                 Key;
1365   CHAR16                  Unicode;
1366   CHAR16                  ShiftedUnicode;
1367   CHAR16                  AltGrUnicode;
1368   CHAR16                  ShiftedAltGrUnicode;
1369   UINT16                  Modifier;
1370   UINT16                  AffectedAttribute;
1371 } EFI_KEY_DESCRIPTOR;
1372 
1373 //
1374 // A key which is affected by all the standard shift modifiers.
1375 // Most keys would be expected to have this bit active.
1376 //
1377 #define EFI_AFFECTED_BY_STANDARD_SHIFT       0x0001
1378 //
1379 // This key is affected by the caps lock so that if a keyboard driver
1380 // would need to disambiguate between a key which had a "1" defined
1381 // versus a "a" character.  Having this bit turned on would tell
1382 // the keyboard driver to use the appropriate shifted state or not.
1383 //
1384 #define EFI_AFFECTED_BY_CAPS_LOCK            0x0002
1385 //
1386 // Similar to the case of CAPS lock, if this bit is active, the key
1387 // is affected by the num lock being turned on.
1388 //
1389 #define EFI_AFFECTED_BY_NUM_LOCK             0x0004
1390 
1391 typedef struct {
1392   UINT16                  LayoutLength;
1393   EFI_GUID                Guid;
1394   UINT32                  LayoutDescriptorStringOffset;
1395   UINT8                   DescriptorCount;
1396   // EFI_KEY_DESCRIPTOR    Descriptors[];
1397 } EFI_HII_KEYBOARD_LAYOUT;
1398 
1399 typedef struct {
1400   EFI_HII_PACKAGE_HEADER  Header;
1401   UINT16                  LayoutCount;
1402   // EFI_HII_KEYBOARD_LAYOUT Layout[];
1403 } EFI_HII_KEYBOARD_PACKAGE_HDR;
1404 
1405 //typedef struct {
1406 //  CHAR16                  Language[];           // RFC4646 Language Code
1407 //  CHAR16                  Space;
1408 //  CHAR16                  DescriptionString[];
1409 //} EFI_DESCRIPTION_STRING;
1410 
1411 //typedef struct {
1412 //  UINT16                  DescriptionCount;
1413 //  EFI_DESCRIPTION_STRING  DescriptionString[];
1414 //} EFI_DESCRIPTION_STRING_BUNDLE;
1415 
1416 //
1417 // Modifier values
1418 //
1419 #define EFI_NULL_MODIFIER                0x0000
1420 #define EFI_LEFT_CONTROL_MODIFIER        0x0001
1421 #define EFI_RIGHT_CONTROL_MODIFIER       0x0002
1422 #define EFI_LEFT_ALT_MODIFIER            0x0003
1423 #define EFI_RIGHT_ALT_MODIFIER           0x0004
1424 #define EFI_ALT_GR_MODIFIER              0x0005
1425 #define EFI_INSERT_MODIFIER              0x0006
1426 #define EFI_DELETE_MODIFIER              0x0007
1427 #define EFI_PAGE_DOWN_MODIFIER           0x0008
1428 #define EFI_PAGE_UP_MODIFIER             0x0009
1429 #define EFI_HOME_MODIFIER                0x000A
1430 #define EFI_END_MODIFIER                 0x000B
1431 #define EFI_LEFT_SHIFT_MODIFIER          0x000C
1432 #define EFI_RIGHT_SHIFT_MODIFIER         0x000D
1433 #define EFI_CAPS_LOCK_MODIFIER           0x000E
1434 #define EFI_NUM_LOCK_MODIFIER            0x000F
1435 #define EFI_LEFT_ARROW_MODIFIER          0x0010
1436 #define EFI_RIGHT_ARROW_MODIFIER         0x0011
1437 #define EFI_DOWN_ARROW_MODIFIER          0x0012
1438 #define EFI_UP_ARROW_MODIFIER            0x0013
1439 #define EFI_NS_KEY_MODIFIER              0x0014
1440 #define EFI_NS_KEY_DEPENDENCY_MODIFIER   0x0015
1441 #define EFI_FUNCTION_KEY_ONE_MODIFIER    0x0016
1442 #define EFI_FUNCTION_KEY_TWO_MODIFIER    0x0017
1443 #define EFI_FUNCTION_KEY_THREE_MODIFIER  0x0018
1444 #define EFI_FUNCTION_KEY_FOUR_MODIFIER   0x0019
1445 #define EFI_FUNCTION_KEY_FIVE_MODIFIER   0x001A
1446 #define EFI_FUNCTION_KEY_SIX_MODIFIER    0x001B
1447 #define EFI_FUNCTION_KEY_SEVEN_MODIFIER  0x001C
1448 #define EFI_FUNCTION_KEY_EIGHT_MODIFIER  0x001D
1449 #define EFI_FUNCTION_KEY_NINE_MODIFIER   0x001E
1450 #define EFI_FUNCTION_KEY_TEN_MODIFIER    0x001F
1451 #define EFI_FUNCTION_KEY_ELEVEN_MODIFIER 0x0020
1452 #define EFI_FUNCTION_KEY_TWELVE_MODIFIER 0x0021
1453 
1454 //
1455 // Keys that have multiple control functions based on modifier
1456 // settings are handled in the keyboard driver implementation.
1457 // For instance PRINT_KEY might have a modifier held down and
1458 // is still a nonprinting character, but might have an alternate
1459 // control function like SYSREQUEST
1460 //
1461 #define EFI_PRINT_MODIFIER               0x0022
1462 #define EFI_SYS_REQUEST_MODIFIER         0x0023
1463 #define EFI_SCROLL_LOCK_MODIFIER         0x0024
1464 #define EFI_PAUSE_MODIFIER               0x0025
1465 #define EFI_BREAK_MODIFIER               0x0026
1466 
1467 #define EFI_LEFT_LOGO_MODIFIER           0x0027
1468 #define EFI_RIGHT_LOGO_MODIFIER          0x0028
1469 #define EFI_MENU_MODIFIER                0x0029
1470 
1471 #pragma pack()
1472 
1473 #endif
1474