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