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