]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Uefi/UefiInternalFormRepresentation.h
Checked in the Protocols introduced in UEFI/PI.
[mirror_edk2.git] / MdePkg / Include / Uefi / UefiInternalFormRepresentation.h
1
2 /** @file
3 This file defines the encoding for the VFR (Visual Form Representation) language.
4 IFR is primarily consumed by the EFI presentation engine, and produced by EFI
5 internal application and drivers as well as all add-in card option-ROM drivers
6
7 Copyright (c) 2006 - 2007, Intel Corporation
8 All rights reserved. This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
12
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15
16 Module Name: UefiInternalFormRepresentation.h
17
18 @par Revision Reference:
19 These definitions are from UEFI2.1.
20
21 **/
22
23 #ifndef __UEFI_INTERNAL_FORMREPRESENTATION_H__
24 #define __UEFI_INTERNAL_FORMREPRESENTATION_H__
25
26 //
27 // The following types are currently defined:
28 //
29 typedef UINT32 RELOFST;
30
31 typedef CHAR16 *EFI_STRING;
32 typedef UINT16 EFI_IMAGE_ID;
33 typedef UINT16 EFI_QUESTION_ID;
34 typedef UINT16 EFI_STRING_ID;
35 typedef UINT16 EFI_FORM_ID;
36 typedef UINT16 EFI_VARSTORE_ID;
37
38 //
39 // BugBug in UEFI2.1
40 //
41 typedef VOID *EFI_FONT_HANDLE;
42
43
44 //
45 // IFR Op codes
46 //
47 #define EFI_IFR_FORM_OP 0x01
48 #define EFI_IFR_SUBTITLE_OP 0x02
49 #define EFI_IFR_TEXT_OP 0x03
50 #define EFI_IFR_GRAPHIC_OP 0x04
51 #define EFI_IFR_ONE_OF_OP 0x05
52 #define EFI_IFR_CHECKBOX_OP 0x06
53 #define EFI_IFR_NUMERIC_OP 0x07
54 #define EFI_IFR_PASSWORD_OP 0x08
55 #define EFI_IFR_ONE_OF_OPTION_OP 0x09 // ONEOF OPTION field
56 #define EFI_IFR_SUPPRESS_IF_OP 0x0A
57 #define EFI_IFR_END_FORM_OP 0x0B
58 #define EFI_IFR_HIDDEN_OP 0x0C
59 #define EFI_IFR_END_FORM_SET_OP 0x0D
60 #define EFI_IFR_FORM_SET_OP 0x0E
61 #define EFI_IFR_REF_OP 0x0F
62 #define EFI_IFR_END_ONE_OF_OP 0x10
63 #define EFI_IFR_END_OP EFI_IFR_END_ONE_OF_OP
64 #define EFI_IFR_INCONSISTENT_IF_OP 0x11
65 #define EFI_IFR_EQ_ID_VAL_OP 0x12
66 #define EFI_IFR_EQ_ID_ID_OP 0x13
67 #define EFI_IFR_EQ_ID_LIST_OP 0x14
68 #define EFI_IFR_AND_OP 0x15
69 #define EFI_IFR_OR_OP 0x16
70 #define EFI_IFR_NOT_OP 0x17
71 #define EFI_IFR_END_IF_OP 0x18 // for endif of inconsistentif, suppressif, grayoutif
72 #define EFI_IFR_GRAYOUT_IF_OP 0x19
73 #define EFI_IFR_DATE_OP 0x1A
74 #define EFI_IFR_TIME_OP 0x1B
75 #define EFI_IFR_STRING_OP 0x1C
76 #define EFI_IFR_LABEL_OP 0x1D
77 #define EFI_IFR_SAVE_DEFAULTS_OP 0x1E
78 #define EFI_IFR_RESTORE_DEFAULTS_OP 0x1F
79 #define EFI_IFR_BANNER_OP 0x20
80 #define EFI_IFR_INVENTORY_OP 0x21
81 #define EFI_IFR_EQ_VAR_VAL_OP 0x22
82 #define EFI_IFR_ORDERED_LIST_OP 0x23
83 #define EFI_IFR_VARSTORE_OP 0x24
84 #define EFI_IFR_VARSTORE_SELECT_OP 0x25
85 #define EFI_IFR_VARSTORE_SELECT_PAIR_OP 0x26
86 #define EFI_IFR_TRUE_OP 0x27
87 #define EFI_IFR_FALSE_OP 0x28
88 #define EFI_IFR_GT_OP 0x29
89 #define EFI_IFR_GE_OP 0x2A
90 #define EFI_IFR_OEM_DEFINED_OP 0x2B
91 #define EFI_IFR_LAST_OPCODE EFI_IFR_OEM_DEFINED_OP
92 #define EFI_IFR_OEM_OP 0xFE
93 #define EFI_IFR_NV_ACCESS_COMMAND 0xFF
94
95 //
96 // Define values for the flags fields in some VFR opcodes. These are
97 // bitmasks.
98 //
99 #define EFI_IFR_FLAG_DEFAULT 0x01
100 #define EFI_IFR_FLAG_MANUFACTURING 0x02
101 #define EFI_IFR_FLAG_INTERACTIVE 0x04
102 #define EFI_IFR_FLAG_NV_ACCESS 0x08
103 #define EFI_IFR_FLAG_RESET_REQUIRED 0x10
104 #define EFI_IFR_FLAG_LATE_CHECK 0x20
105
106 #define EFI_NON_DEVICE_CLASS 0x00 // Useful when you do not want something in the Device Manager
107 #define EFI_DISK_DEVICE_CLASS 0x01
108 #define EFI_VIDEO_DEVICE_CLASS 0x02
109 #define EFI_NETWORK_DEVICE_CLASS 0x04
110 #define EFI_INPUT_DEVICE_CLASS 0x08
111 #define EFI_ON_BOARD_DEVICE_CLASS 0x10
112 #define EFI_OTHER_DEVICE_CLASS 0x20
113
114 #define EFI_SETUP_APPLICATION_SUBCLASS 0x00
115 #define EFI_GENERAL_APPLICATION_SUBCLASS 0x01
116 #define EFI_FRONT_PAGE_SUBCLASS 0x02
117 #define EFI_SINGLE_USE_SUBCLASS 0x03 // Used to display a single entity and then exit
118
119 //
120 // Used to flag dynamically created op-codes. This is meaningful to the IFR Library set
121 // and the browser since we need to distinguish between compiled NV map data and created data.
122 // We do not allow new entries to be created in the NV map dynamically however we still need
123 // to display this information correctly. To dynamically create op-codes and assume that their
124 // data will be saved, ensure that the NV starting location they refer to is pre-defined in the
125 // NV map.
126 //
127 #define EFI_IFR_FLAG_CREATED 128
128
129 #pragma pack(1)
130 //
131 // IFR Structure definitions
132 //
133 typedef struct {
134 UINT8 OpCode;
135 UINT8 Length;
136 } EFI_IFR_OP_HEADER;
137
138 typedef struct {
139 EFI_IFR_OP_HEADER Header;
140 EFI_GUID Guid;
141 STRING_REF FormSetTitle;
142 STRING_REF Help;
143 EFI_PHYSICAL_ADDRESS CallbackHandle;
144 UINT16 Class;
145 UINT16 SubClass;
146 UINT16 NvDataSize; // set once, size of the NV data as defined in the script
147 } EFI_IFR_FORM_SET;
148
149 typedef struct {
150 EFI_IFR_OP_HEADER Header;
151 UINT16 FormId;
152 STRING_REF FormTitle;
153 } EFI_IFR_FORM;
154
155 typedef struct {
156 EFI_IFR_OP_HEADER Header;
157 UINT16 LabelId;
158 } EFI_IFR_LABEL;
159
160 typedef struct {
161 EFI_IFR_OP_HEADER Header;
162 STRING_REF SubTitle;
163 } EFI_IFR_SUBTITLE;
164
165 typedef struct {
166 EFI_IFR_OP_HEADER Header;
167 STRING_REF Help;
168 STRING_REF Text;
169 STRING_REF TextTwo;
170 UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.
171 UINT16 Key; // Value to be passed to caller to identify this particular op-code
172 } EFI_IFR_TEXT;
173
174 //
175 // goto
176 //
177 typedef struct {
178 EFI_IFR_OP_HEADER Header;
179 UINT16 FormId;
180 STRING_REF Prompt;
181 STRING_REF Help; // The string Token for the context-help
182 UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.
183 UINT16 Key; // Value to be passed to caller to identify this particular op-code
184 } EFI_IFR_REF;
185
186 typedef struct {
187 EFI_IFR_OP_HEADER Header;
188 } EFI_IFR_END_FORM;
189
190 typedef struct {
191 EFI_IFR_OP_HEADER Header;
192 } EFI_IFR_END_FORM_SET;
193
194 //
195 // Also notice that the IFR_ONE_OF and IFR_CHECK_BOX are identical in structure......code assumes this to be true, if this ever
196 // changes we need to revisit the InitializeTagStructures code
197 //
198 typedef struct {
199 EFI_IFR_OP_HEADER Header;
200 UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
201 UINT8 Width; // The Size of the Data being saved
202 STRING_REF Prompt; // The String Token for the Prompt
203 STRING_REF Help; // The string Token for the context-help
204 } EFI_IFR_ONE_OF;
205
206 typedef struct {
207 EFI_IFR_OP_HEADER Header;
208 UINT16 QuestionId; // The offset in NV for storage of the data
209 UINT8 MaxEntries; // The maximum number of options in the ordered list (=size of NVStore)
210 STRING_REF Prompt; // The string token for the prompt
211 STRING_REF Help; // The string token for the context-help
212 } EFI_IFR_ORDERED_LIST;
213
214 typedef struct {
215 EFI_IFR_OP_HEADER Header;
216 UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
217 UINT8 Width; // The Size of the Data being saved
218 STRING_REF Prompt; // The String Token for the Prompt
219 STRING_REF Help; // The string Token for the context-help
220 UINT8 Flags; // For now, if non-zero, means that it is the default option, - further definition likely
221 UINT16 Key; // Value to be passed to caller to identify this particular op-code
222 } EFI_IFR_CHECKBOX, EFI_IFR_CHECK_BOX;
223
224 typedef struct {
225 EFI_IFR_OP_HEADER Header;
226 STRING_REF Option; // The string token describing the option
227 UINT16 Value; // The value associated with this option that is stored in the NVRAM if chosen
228 UINT8 Flags; // For now, if non-zero, means that it is the default option, - further definition likely above
229 UINT16 Key; // Value to be passed to caller to identify this particular op-code
230 } EFI_IFR_ONE_OF_OPTION;
231
232 typedef struct {
233 EFI_IFR_OP_HEADER Header;
234 UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
235 UINT8 Width; // The Size of the Data being saved
236 STRING_REF Prompt; // The String Token for the Prompt
237 STRING_REF Help; // The string Token for the context-help
238 UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.
239 UINT16 Key; // Value to be passed to caller to identify this particular op-code
240 UINT16 Minimum;
241 UINT16 Maximum;
242 UINT16 Step; // If step is 0, then manual input is specified, otherwise, left/right arrow selection is called for
243 UINT16 Default;
244 } EFI_IFR_NUMERIC;
245
246 //
247 // There is an interesting twist with regards to Time and Date. This is one of the few items which can accept input from
248 // a user, however may or may not need to use storage in the NVRAM space. The decided method for determining if NVRAM space
249 // will be used (only for a TimeOp or DateOp) is: If .QuestionId == 0 && .Width == 0 (normally an impossibility) then use system
250 // resources to store the data away and not NV resources. In other words, the setup engine will call gRT->SetTime, and gRT->SetDate
251 // for the saving of data, and the values displayed will be from the gRT->GetXXXX series of calls.
252 //
253 typedef struct {
254 EFI_IFR_NUMERIC Hour;
255 EFI_IFR_NUMERIC Minute;
256 EFI_IFR_NUMERIC Second;
257 } EFI_IFR_TIME;
258
259 typedef struct {
260 EFI_IFR_NUMERIC Year;
261 EFI_IFR_NUMERIC Month;
262 EFI_IFR_NUMERIC Day;
263 } EFI_IFR_DATE;
264
265 typedef struct {
266 EFI_IFR_OP_HEADER Header;
267 UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
268 UINT8 Width; // The Size of the Data being saved -- BUGBUG -- remove someday
269 STRING_REF Prompt; // The String Token for the Prompt
270 STRING_REF Help; // The string Token for the context-help
271 UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.
272 UINT16 Key; // Value to be passed to caller to identify this particular op-code
273 UINT8 MinSize; // Minimum allowable sized password
274 UINT8 MaxSize; // Maximum allowable sized password
275 UINT16 Encoding;
276 } EFI_IFR_PASSWORD;
277
278 typedef struct {
279 EFI_IFR_OP_HEADER Header;
280 UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
281 UINT8 Width; // The Size of the Data being saved -- BUGBUG -- remove someday
282 STRING_REF Prompt; // The String Token for the Prompt
283 STRING_REF Help; // The string Token for the context-help
284 UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.
285 UINT16 Key; // Value to be passed to caller to identify this particular op-code
286 UINT8 MinSize; // Minimum allowable sized password
287 UINT8 MaxSize; // Maximum allowable sized password
288 } EFI_IFR_STRING;
289
290 typedef struct {
291 EFI_IFR_OP_HEADER Header;
292 } EFI_IFR_END_ONE_OF;
293
294 typedef struct {
295 EFI_IFR_OP_HEADER Header;
296 UINT16 Value;
297 UINT16 Key;
298 } EFI_IFR_HIDDEN;
299
300 typedef struct {
301 EFI_IFR_OP_HEADER Header;
302 UINT8 Flags;
303 } EFI_IFR_SUPPRESS;
304
305 typedef struct {
306 EFI_IFR_OP_HEADER Header;
307 UINT8 Flags;
308 } EFI_IFR_GRAY_OUT;
309
310 typedef struct {
311 EFI_IFR_OP_HEADER Header;
312 STRING_REF Popup;
313 UINT8 Flags;
314 } EFI_IFR_INCONSISTENT;
315
316 typedef struct {
317 EFI_IFR_OP_HEADER Header;
318 UINT16 QuestionId; // offset into variable storage
319 UINT8 Width; // size of variable storage
320 UINT16 Value; // value to compare against
321 } EFI_IFR_EQ_ID_VAL;
322
323 typedef struct {
324 EFI_IFR_OP_HEADER Header;
325 UINT16 QuestionId; // offset into variable storage
326 UINT8 Width; // size of variable storage
327 UINT16 ListLength;
328 UINT16 ValueList[1];
329 } EFI_IFR_EQ_ID_LIST;
330
331 typedef struct {
332 EFI_IFR_OP_HEADER Header;
333 UINT16 QuestionId1; // offset into variable storage for first value to compare
334 UINT8 Width; // size of variable storage (must be same for both)
335 UINT16 QuestionId2; // offset into variable storage for second value to compare
336 } EFI_IFR_EQ_ID_ID;
337
338 typedef struct {
339 EFI_IFR_OP_HEADER Header;
340 UINT16 VariableId; // offset into variable storage
341 UINT16 Value; // value to compare against
342 } EFI_IFR_EQ_VAR_VAL;
343
344 typedef struct {
345 EFI_IFR_OP_HEADER Header;
346 } EFI_IFR_AND;
347
348 typedef struct {
349 EFI_IFR_OP_HEADER Header;
350 } EFI_IFR_OR;
351
352 typedef struct {
353 EFI_IFR_OP_HEADER Header;
354 } EFI_IFR_NOT;
355
356 typedef struct {
357 EFI_IFR_OP_HEADER Header;
358 } EFI_IFR_END_EXPR, EFI_IFR_END_IF;
359
360 typedef struct {
361 EFI_IFR_OP_HEADER Header;
362 UINT16 FormId;
363 STRING_REF Prompt;
364 STRING_REF Help;
365 UINT8 Flags;
366 UINT16 Key;
367 } EFI_IFR_SAVE_DEFAULTS;
368
369 typedef struct {
370 EFI_IFR_OP_HEADER Header;
371 STRING_REF Help;
372 STRING_REF Text;
373 STRING_REF TextTwo; // optional text
374 } EFI_IFR_INVENTORY;
375
376 typedef struct {
377 EFI_IFR_OP_HEADER Header;
378 EFI_GUID Guid; // GUID for the variable
379 UINT16 VarId; // variable store ID, as referenced elsewhere in the form
380 UINT16 Size; // size of the variable storage
381 } EFI_IFR_VARSTORE;
382
383 typedef struct {
384 EFI_IFR_OP_HEADER Header;
385 UINT16 VarId; // variable store ID, as referenced elsewhere in the form
386 } EFI_IFR_VARSTORE_SELECT;
387
388 //
389 // Used for the ideqid VFR statement where two variable stores may be referenced in the
390 // same VFR statement.
391 // A browser should treat this as an EFI_IFR_VARSTORE_SELECT statement and assume that all following
392 // IFR opcodes use the VarId as defined here.
393 //
394 typedef struct {
395 EFI_IFR_OP_HEADER Header;
396 UINT16 VarId; // variable store ID, as referenced elsewhere in the form
397 UINT16 SecondaryVarId; // variable store ID, as referenced elsewhere in the form
398 } EFI_IFR_VARSTORE_SELECT_PAIR;
399
400 typedef struct {
401 EFI_IFR_OP_HEADER Header;
402 } EFI_IFR_TRUE;
403
404 typedef struct {
405 EFI_IFR_OP_HEADER Header;
406 } EFI_IFR_FALSE;
407
408 typedef struct {
409 EFI_IFR_OP_HEADER Header;
410 } EFI_IFR_GT;
411
412 typedef struct {
413 EFI_IFR_OP_HEADER Header;
414 } EFI_IFR_GE;
415
416 //
417 // Save defaults and restore defaults have same structure
418 //
419 #define EFI_IFR_RESTORE_DEFAULTS EFI_IFR_SAVE_DEFAULTS
420
421 typedef struct {
422 EFI_IFR_OP_HEADER Header;
423 STRING_REF Title; // The string token for the banner title
424 UINT16 LineNumber; // 1-based line number
425 UINT8 Alignment; // left, center, or right-aligned
426 } EFI_IFR_BANNER;
427
428 #define EFI_IFR_BANNER_ALIGN_LEFT 0
429 #define EFI_IFR_BANNER_ALIGN_CENTER 1
430 #define EFI_IFR_BANNER_ALIGN_RIGHT 2
431 #define EFI_IFR_BANNER_TIMEOUT 0xFF
432
433 #pragma pack()
434
435
436
437 #endif