]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/Hii.h
1. Bug fix for "EDK GenericBds WriteBootToOsPerformanceData() uses AcpiReclaimMemory";
[mirror_edk2.git] / MdePkg / Include / Protocol / Hii.h
CommitLineData
878ddf1f 1/** @file\r
2 This file defines the Human Interface Infrastructure protocol which will \r
3 be used by resources which want to publish IFR/Font/String data and have it \r
4 collected by the Configuration engine.\r
5\r
6 Copyright (c) 2006, Intel Corporation \r
7 All rights reserved. This program and the accompanying materials \r
8 are licensed and made available under the terms and conditions of the BSD License \r
9 which accompanies this distribution. The full text of the license may be found at \r
10 http://opensource.org/licenses/bsd-license.php \r
11\r
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
14\r
15 Module Name: Hii.h\r
16\r
17 @par Revision Reference:\r
18 This protocol is defined in HII spec 0.92.\r
19\r
20**/\r
21\r
22#ifndef __HII_H__\r
23#define __HII_H__\r
24\r
25\r
26#define EFI_HII_PROTOCOL_GUID \\r
27 { \\r
28 0xea816d2c, 0xcee5, 0x4f02, {0x99, 0xb5, 0xd3, 0x90, 0x5c, 0xbb, 0xd0, 0x77 } \\r
29 }\r
30\r
31// BugBug:\r
32//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r
33// If UGA goes away we need to put this some place. I'm not sure where?\r
34//\r
35//typedef struct {\r
36// UINT8 Blue;\r
37// UINT8 Green;\r
38// UINT8 Red;\r
39// UINT8 Reserved;\r
40//} EFI_UGA_PIXEL;\r
41\r
42//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r
43//\r
44\r
45typedef struct _EFI_HII_PROTOCOL EFI_HII_PROTOCOL;\r
46\r
47//\r
48// Global definition\r
49//\r
50#define NARROW_CHAR 0xFFF0\r
51#define WIDE_CHAR 0xFFF1\r
52#define NON_BREAKING_CHAR 0xFFF2\r
53#define GLYPH_WIDTH 8\r
54#define GLYPH_HEIGHT 19\r
55\r
56#define EFI_HII_FONT 1\r
57#define EFI_HII_STRING 2\r
58#define EFI_HII_IFR 3\r
59#define EFI_HII_KEYBOARD 4\r
60#define EFI_HII_HANDLES 5\r
61#define EFI_HII_VARIABLE 6\r
62#define EFI_HII_DEVICE_PATH 7\r
63\r
64\r
65// References to string tokens must use this macro to enable scanning for\r
66// token usages.\r
67//\r
68#define STRING_TOKEN(t) t\r
69\r
70//\r
71// The following types are currently defined:\r
72//\r
73typedef UINT16 EFI_FORM_ID;\r
74typedef UINT16 EFI_FORM_LABEL;\r
75\r
76#pragma pack(1)\r
77\r
78typedef struct {\r
79 UINT32 Length;\r
80 UINT16 Type;\r
81} EFI_HII_PACK_HEADER;\r
82\r
83//\r
84// A form list consists of a large variety of structure\r
85// possibilities so to represent the binary blob of data\r
86// associated with a package of forms, we will assume a\r
87// pointer to a self-describing data buffer.\r
88//\r
89typedef struct {\r
90 EFI_HII_PACK_HEADER Header;\r
91} EFI_HII_IFR_PACK;\r
92\r
93typedef struct {\r
94 EFI_HII_PACK_HEADER Header; // Must be filled in\r
95 EFI_HANDLE ImageHandle; // Must be filled in\r
96 EFI_HANDLE DeviceHandle; // Optional\r
97 EFI_HANDLE ControllerHandle; // Optional\r
98 EFI_HANDLE CallbackHandle; // Optional\r
99 EFI_HANDLE COBExportHandle; // Optional\r
100} EFI_HII_HANDLE_PACK;\r
101\r
102//\r
103// ********************************************************\r
104// EFI_VARIABLE_CONTENTS\r
105// ********************************************************\r
106//\r
107typedef struct {\r
108 EFI_HII_PACK_HEADER Header;\r
109 EFI_GUID VariableGuid;\r
110 UINT32 VariableNameLength;\r
111 UINT16 VariableId;\r
112 //\r
113 // CHAR16 VariableName[]; //Null-terminated\r
114 //\r
115} EFI_HII_VARIABLE_PACK;\r
116\r
117//\r
118// ********************************************************\r
119// EFI_DEVICE_PATH_PACK\r
120// ********************************************************\r
121//\r
122typedef struct {\r
123 EFI_HII_PACK_HEADER Header;\r
124 //\r
125 // EFI_DEVICE_PATH DevicePath[];\r
126 //\r
127} EFI_HII_DEVICE_PATH_PACK;\r
128\r
129//\r
130// ********************************************************\r
131// EFI_HII_DATA_TABLE\r
132// ********************************************************\r
133//\r
134typedef struct {\r
135 EFI_HII_HANDLE HiiHandle;\r
136 EFI_GUID PackageGuid;\r
137 UINT32 DataTableSize;\r
138 UINT32 IfrDataOffset;\r
139 UINT32 StringDataOffset;\r
140 UINT32 VariableDataOffset;\r
141 UINT32 DevicePathOffset;\r
142 UINT32 NumberOfVariableData;\r
143 UINT32 NumberOfLanguages;\r
144 //\r
145 // EFI_HII_DEVICE_PATH_PACK DevicePath[];\r
146 // EFI_HII_VARIABLE_PACK VariableData[];\r
147 // EFI_HII_IFR_PACK IfrData;\r
148 // EFI_HII_STRING_PACK StringData[];\r
149 //\r
150} EFI_HII_DATA_TABLE;\r
151\r
152//\r
153// ********************************************************\r
154// EFI_HII_EXPORT_TABLE\r
155// ********************************************************\r
156//\r
157typedef struct {\r
158 UINT32 NumberOfHiiDataTables;\r
159 EFI_GUID Revision;\r
160 //\r
161 // EFI_HII_DATA_TABLE HiiDataTable[];\r
162 //\r
163} EFI_HII_EXPORT_TABLE;\r
164\r
165typedef struct {\r
166 BOOLEAN FormSetUpdate; // If TRUE, next variable is significant\r
167 EFI_PHYSICAL_ADDRESS FormCallbackHandle; // If not 0, will update Formset with this info\r
168 BOOLEAN FormUpdate; // If TRUE, next variable is significant\r
169 UINT16 FormValue; // specify which form is to be updated if FormUpdate value is TRUE.\r
170 STRING_REF FormTitle; // If not 0, will update Form with this info\r
171 UINT16 DataCount; // The number of Data entries in this structure\r
172 UINT8 *Data; // An array of 1+ op-codes, specified by DataCount\r
173} EFI_HII_UPDATE_DATA;\r
174\r
175//\r
176// String attributes\r
177//\r
178#define LANG_RIGHT_TO_LEFT 0x00000001\r
179\r
180//\r
181// A string package is used to localize strings to a particular\r
182// language. The package is associated with a particular driver\r
183// or set of drivers. Tools are used to associate tokens with\r
184// string references in forms and in programs. These tokens are\r
185// language agnostic. When paired with a language pack (directly\r
186// or indirectly), the string token resolves into an actual\r
187// UNICODE string. The NumStringPointers determines how many\r
188// StringPointers (offset values) there are as well as the total\r
189// number of Strings that are defined.\r
190//\r
191typedef struct {\r
192 EFI_HII_PACK_HEADER Header;\r
193 RELOFST LanguageNameString;\r
194 RELOFST PrintableLanguageName;\r
195 UINT32 NumStringPointers;\r
196 UINT32 Attributes;\r
197 //\r
198 // RELOFST StringPointers[];\r
199 // EFI_STRING Strings[];\r
200 //\r
201} EFI_HII_STRING_PACK;\r
202\r
203//\r
204// Glyph Attributes\r
205//\r
206#define EFI_GLYPH_NON_SPACING 1\r
207#define EFI_GLYPH_WIDE 2\r
208\r
209typedef struct {\r
210 CHAR16 UnicodeWeight;\r
211 UINT8 Attributes;\r
212 UINT8 GlyphCol1[GLYPH_HEIGHT];\r
213} EFI_NARROW_GLYPH;\r
214\r
215typedef struct {\r
216 CHAR16 UnicodeWeight;\r
217 UINT8 Attributes;\r
218 UINT8 GlyphCol1[GLYPH_HEIGHT];\r
219 UINT8 GlyphCol2[GLYPH_HEIGHT];\r
220 UINT8 Pad[3];\r
221} EFI_WIDE_GLYPH;\r
222\r
223//\r
224// A font list consists of a font header followed by a series\r
225// of glyph structures. Note that fonts are not language specific.\r
226//\r
227typedef struct {\r
228 EFI_HII_PACK_HEADER Header;\r
229 UINT16 NumberOfNarrowGlyphs;\r
230 UINT16 NumberOfWideGlyphs;\r
231} EFI_HII_FONT_PACK;\r
232\r
233//\r
234// The IfrData in the EFI_HII_IFR_PACK structure definition\r
235// is variable length, and not really part of the header. To\r
236// simplify from code the size of the header, define an\r
237// identical structure that does not include the IfrData field.\r
238// Then use sizeof() this new structure to determine the\r
239// actual size of the header.\r
240//\r
241typedef struct {\r
242 EFI_HII_PACK_HEADER Header;\r
243} EFI_HII_IFR_PACK_HEADER;\r
244\r
245//\r
246// pedef EFI_HII_PACK_HEADER EFI_HII_IFR_PACK_HEADER;\r
247//\r
248typedef enum {\r
249 EfiKeyLCtrl,\r
250 EfiKeyA0,\r
251 EfiKeyLAlt,\r
252 EfiKeySpaceBar,\r
253 EfiKeyA2,\r
254 EfiKeyA3,\r
255 EfiKeyA4,\r
256 EfiKeyRCtrl,\r
257 EfiKeyLeftArrow,\r
258 EfiKeyDownArrow,\r
259 EfiKeyRightArrow,\r
260 EfiKeyZero,\r
261 EfiKeyPeriod,\r
262 EfiKeyEnter,\r
263 EfiKeyLShift,\r
264 EfiKeyB0,\r
265 EfiKeyB1,\r
266 EfiKeyB2,\r
267 EfiKeyB3,\r
268 EfiKeyB4,\r
269 EfiKeyB5,\r
270 EfiKeyB6,\r
271 EfiKeyB7,\r
272 EfiKeyB8,\r
273 EfiKeyB9,\r
274 EfiKeyB10,\r
275 EfiKeyRshift,\r
276 EfiKeyUpArrow,\r
277 EfiKeyOne,\r
278 EfiKeyTwo,\r
279 EfiKeyThree,\r
280 EfiKeyCapsLock,\r
281 EfiKeyC1,\r
282 EfiKeyC2,\r
283 EfiKeyC3,\r
284 EfiKeyC4,\r
285 EfiKeyC5,\r
286 EfiKeyC6,\r
287 EfiKeyC7,\r
288 EfiKeyC8,\r
289 EfiKeyC9,\r
290 EfiKeyC10,\r
291 EfiKeyC11,\r
292 EfiKeyC12,\r
293 EfiKeyFour,\r
294 EfiKeyFive,\r
295 EfiKeySix,\r
296 EfiKeyPlus,\r
297 EfiKeyTab,\r
298 EfiKeyD1,\r
299 EfiKeyD2,\r
300 EfiKeyD3,\r
301 EfiKeyD4,\r
302 EfiKeyD5,\r
303 EfiKeyD6,\r
304 EfiKeyD7,\r
305 EfiKeyD8,\r
306 EfiKeyD9,\r
307 EfiKeyD10,\r
308 EfiKeyD11,\r
309 EfiKeyD12,\r
310 EfiKeyD13,\r
311 EfiKeyDel,\r
312 EfiKeyEnd,\r
313 EfiKeyPgDn,\r
314 EfiKeySeven,\r
315 EfiKeyEight,\r
316 EfiKeyNine,\r
317 EfiKeyE0,\r
318 EfiKeyE1,\r
319 EfiKeyE2,\r
320 EfiKeyE3,\r
321 EfiKeyE4,\r
322 EfiKeyE5,\r
323 EfiKeyE6,\r
324 EfiKeyE7,\r
325 EfiKeyE8,\r
326 EfiKeyE9,\r
327 EfiKeyE10,\r
328 EfiKeyE11,\r
329 EfiKeyE12,\r
330 EfiKeyBackSpace,\r
331 EfiKeyIns,\r
332 EfiKeyHome,\r
333 EfiKeyPgUp,\r
334 EfiKeyNLck,\r
335 EfiKeySlash,\r
336 EfiKeyAsterisk,\r
337 EfiKeyMinus,\r
338 EfiKeyEsc,\r
339 EfiKeyF1,\r
340 EfiKeyF2,\r
341 EfiKeyF3,\r
342 EfiKeyF4,\r
343 EfiKeyF5,\r
344 EfiKeyF6,\r
345 EfiKeyF7,\r
346 EfiKeyF8,\r
347 EfiKeyF9,\r
348 EfiKeyF10,\r
349 EfiKeyF11,\r
350 EfiKeyF12,\r
351 EfiKeyPrint,\r
352 EfiKeySLck,\r
353 EfiKeyPause\r
354} EFI_KEY;\r
355\r
356typedef struct {\r
357 EFI_KEY Key;\r
358 CHAR16 Unicode;\r
359 CHAR16 ShiftedUnicode;\r
360 CHAR16 AltGrUnicode;\r
361 CHAR16 ShiftedAltGrUnicode;\r
362 UINT16 Modifier;\r
363} EFI_KEY_DESCRIPTOR;\r
364\r
365//\r
366// This structure allows a sparse set of keys to be redefined\r
367// or a complete redefinition of the keyboard layout. Most\r
368// keyboards have a lot of commonality in their layouts, therefore\r
369// only defining those keys that need to change from the default\r
370// minimizes the passed in information.\r
371//\r
372// Additionally, when an update occurs, the active keyboard layout\r
373// will be switched to the newly updated keyboard layout. This\r
374// allows for situations that when a keyboard layout driver is\r
375// loaded as part of system initialization, the system will default\r
376// the keyboard behavior to the new layout.\r
377//\r
378// Each call to update the keyboard mapping should contain the\r
379// complete set of key descriptors to be updated, since every\r
380// call to the HII which contains an EFI_HII_KEYBOARD_PACK will\r
381// wipe the previous set of overrides. A call to\r
382//\r
383typedef struct {\r
384 EFI_HII_PACK_HEADER Header;\r
385 EFI_KEY_DESCRIPTOR *Descriptor;\r
386 UINT8 DescriptorCount;\r
387} EFI_HII_KEYBOARD_PACK;\r
388\r
389//\r
390// The EFI_HII_PACKAGES can contain different types of packages just\r
391// after the structure as inline data.\r
392//\r
393typedef struct {\r
394 UINTN NumberOfPackages;\r
395 EFI_GUID *GuidId;\r
396 //\r
397 // EFI_HII_HANDLE_PACK *HandlePack; // Only one pack.\r
398 // EFI_HII_IFR_PACK *IfrPack; // Only one pack.\r
399 // EFI_HII_FONT_PACK *FontPack[]; // Multiple packs ok\r
400 // EFI_HII_STRING_PACK *StringPack[]; // Multiple packs ok\r
401 // EFI_HII_KEYBOARD_PACK *KeyboardPack[]; // Multiple packs ok\r
402 //\r
403} EFI_HII_PACKAGES;\r
404\r
405typedef struct _EFI_HII_VARIABLE_PACK_LIST {\r
406 struct _EFI_HII_VARIABLE_PACK_LIST *NextVariablePack;\r
407 EFI_HII_VARIABLE_PACK *VariablePack;\r
408} EFI_HII_VARIABLE_PACK_LIST;\r
409\r
410#pragma pack()\r
411\r
412/**\r
413 Registers the various packs that are passed in via the Packages parameter. \r
414\r
0647c9ad
LG
415 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
416 @param Packages A pointer to an EFI_HII_PACKAGES package instance.\r
417 @param Handle A pointer to the EFI_HII_HANDLE instance.\r
878ddf1f 418\r
0647c9ad
LG
419 @retval EFI_SUCCESS Data was extracted from Packages, the database\r
420 was updated with the data, and Handle returned successfully.\r
421 @retval EFI_INVALID_PARAMETER The content of Packages was invalid.\r
878ddf1f 422\r
423**/\r
424typedef\r
425EFI_STATUS\r
426(EFIAPI *EFI_HII_NEW_PACK) (\r
427 IN EFI_HII_PROTOCOL *This,\r
428 IN EFI_HII_PACKAGES *Packages,\r
429 OUT EFI_HII_HANDLE *Handle\r
430 );\r
431\r
432/**\r
433 Removes a package from the HII database. \r
434\r
0647c9ad
LG
435 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
436 @param Handle The handle that was registered to the data that is requested\r
437 for removal.\r
878ddf1f 438\r
0647c9ad
LG
439 @retval EFI_SUCCESS The data associated with the Handle was removed\r
440 from the HII database.\r
441 @retval EFI_INVALID_PARAMETER The Handle was not valid.\r
878ddf1f 442\r
443**/\r
444typedef\r
445EFI_STATUS\r
446(EFIAPI *EFI_HII_REMOVE_PACK) (\r
447 IN EFI_HII_PROTOCOL *This,\r
448 IN EFI_HII_HANDLE Handle\r
449 );\r
450\r
451/**\r
452 Determines the handles that are currently active in the database.\r
453\r
0647c9ad
LG
454 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
455 @param HandleBufferLength On input, a pointer to the length of the handle\r
456 buffer. On output, the length of the handle buffer that is required\r
457 for the handles found.\r
458 @param Handle An array of EFI_HII_HANDLE instances returned.\r
878ddf1f 459\r
0647c9ad
LG
460 @retval EFI_SUCCESS Handle was updated successfully.\r
461 @retval EFI_BUFFER_TOO_SMALL The HandleBufferLength parameter indicates\r
462 that Handle is too small to support the number of handles.\r
878ddf1f 463\r
464**/\r
465typedef\r
466EFI_STATUS\r
467(EFIAPI *EFI_HII_FIND_HANDLES) (\r
468 IN EFI_HII_PROTOCOL *This,\r
469 IN OUT UINT16 *HandleBufferLength,\r
470 OUT EFI_HII_HANDLE *Handle\r
471 );\r
472\r
473/**\r
474 Exports the contents of the database into a buffer.\r
475\r
0647c9ad
LG
476 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
477 @param Handle An EFI_HII_HANDLE that corresponds to the desired\r
478 handle to export. If the value is 0, the entire database will be exported.\r
479 In either case, the data will be exported in a format described by the\r
480 structure definition of EFI_HII_EXPORT_TABLE.\r
878ddf1f 481 @param BufferSize\r
482 On input, a pointer to the length of the buffer. On output, the length \r
483 of the buffer that is required for the export data.\r
0647c9ad 484 @param Buffer A pointer to a buffer that will contain the results of the export function.\r
878ddf1f 485\r
0647c9ad
LG
486 @retval EFI_SUCCESS The buffer was successfully filled with BufferSize amount of data.\r
487 @retval EFI_BUFFER_TOO_SMALL The value in BufferSize was too small to contain the export data.\r
878ddf1f 488\r
489**/\r
490typedef\r
491EFI_STATUS\r
492(EFIAPI *EFI_HII_EXPORT) (\r
493 IN EFI_HII_PROTOCOL *This,\r
494 IN EFI_HII_HANDLE Handle,\r
495 IN OUT UINTN *BufferSize,\r
496 OUT VOID *Buffer\r
497 );\r
498\r
499/**\r
500 Remove any new strings that were added after the initial string export \r
501 for this handle.\r
502\r
0647c9ad
LG
503 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
504 @param Handle The handle on which the string resides.\r
878ddf1f 505\r
0647c9ad 506 @retval EFI_SUCCESS Remove strings from the handle successfully.\r
878ddf1f 507 @retval EFI_INVALID_PARAMETER The Handle was unknown.\r
508\r
509**/\r
510typedef\r
511EFI_STATUS\r
512(EFIAPI *EFI_HII_RESET_STRINGS) (\r
513 IN EFI_HII_PROTOCOL *This,\r
514 IN EFI_HII_HANDLE Handle\r
515 );\r
516\r
517/**\r
518 Tests if all of the characters in a string have corresponding font characters.\r
519\r
0647c9ad
LG
520 @param This A pointer to the EFI_HII_PROTOCOL instance.\r
521 @param StringToTest A pointer to a Unicode string.\r
522 @param FirstMissing A pointer to an index into the string. On input,\r
523 the index of the first character in the StringToTest to examine. On exit,\r
524 the index of the first character encountered for which a glyph is unavailable.\r
525 If all glyphs in the string are available, the index is the index of the\r
526 terminator of the string.\r
527 @param GlyphBufferSize A pointer to a value. On output, if the function\r
528 returns EFI_SUCCESS, it contains the amount of memory that is required to\r
529