]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Framework/FrameworkInternalFormRepresentation.h
7c257c69ded737eb04af0779f57e6130cfb88692
[mirror_edk2.git] / IntelFrameworkPkg / Include / Framework / FrameworkInternalFormRepresentation.h
1 /** @file
2 This file defines the encoding for the VFR (Visual Form Representation) language.
3 Framework IFR is primarily consumed by the EFI presentation engine, and produced by EFI
4 internal application and drivers as well as all add-in card option-ROM drivers
5
6 Copyright (c) 2007, Intel Corporation
7 All rights reserved. This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
11
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14
15 @par Revision Reference:
16 These definitions are from Framework Specification HII 0.92.
17
18 **/
19
20 #ifndef __FRAMEWORK_INTERNAL_FORMREPRESENTATION_H__
21 #define __FRAMEWORK_INTERNAL_FORMREPRESENTATION_H__
22
23 //
24 // IFR Op codes
25 //
26 #define FRAMEWORK_EFI_IFR_FORM_OP 0x01
27 #define FRAMEWORK_EFI_IFR_SUBTITLE_OP 0x02
28 #define FRAMEWORK_EFI_IFR_TEXT_OP 0x03
29 #define FRAMEWORK_EFI_IFR_GRAPHIC_OP 0x04
30 #define FRAMEWORK_EFI_IFR_ONE_OF_OP 0x05
31 #define FRAMEWORK_EFI_IFR_CHECKBOX_OP 0x06
32 #define FRAMEWORK_EFI_IFR_NUMERIC_OP 0x07
33 #define FRAMEWORK_EFI_IFR_PASSWORD_OP 0x08
34 #define FRAMEWORK_EFI_IFR_ONE_OF_OPTION_OP 0x09 // ONEOF OPTION field
35 #define FRAMEWORK_EFI_IFR_SUPPRESS_IF_OP 0x0A
36 #define FRAMEWORK_EFI_IFR_END_FORM_OP 0x0B
37 #define FRAMEWORK_EFI_IFR_HIDDEN_OP 0x0C
38 #define FRAMEWORK_EFI_IFR_END_FORM_SET_OP 0x0D
39 #define FRAMEWORK_EFI_IFR_FORM_SET_OP 0x0E
40 #define FRAMEWORK_EFI_IFR_REF_OP 0x0F
41 #define FRAMEWORK_EFI_IFR_END_ONE_OF_OP 0x10
42 #define FRAMEWORK_EFI_IFR_END_OP FRAMEWORK_EFI_IFR_END_ONE_OF_OP
43 #define FRAMEWORK_EFI_IFR_INCONSISTENT_IF_OP 0x11
44 #define FRAMEWORK_EFI_IFR_EQ_ID_VAL_OP 0x12
45 #define FRAMEWORK_EFI_IFR_EQ_ID_ID_OP 0x13
46 #define FRAMEWORK_EFI_IFR_EQ_ID_LIST_OP 0x14
47 #define FRAMEWORK_EFI_IFR_AND_OP 0x15
48 #define FRAMEWORK_EFI_IFR_OR_OP 0x16
49 #define FRAMEWORK_EFI_IFR_NOT_OP 0x17
50 #define FRAMEWORK_EFI_IFR_END_IF_OP 0x18 // for endif of inconsistentif, suppressif, grayoutif
51 #define FRAMEWORK_EFI_IFR_GRAYOUT_IF_OP 0x19
52 #define FRAMEWORK_EFI_IFR_DATE_OP 0x1A
53 #define FRAMEWORK_EFI_IFR_TIME_OP 0x1B
54 #define FRAMEWORK_EFI_IFR_STRING_OP 0x1C
55 #define FRAMEWORK_EFI_IFR_LABEL_OP 0x1D
56 #define FRAMEWORK_EFI_IFR_SAVE_DEFAULTS_OP 0x1E
57 #define FRAMEWORK_EFI_IFR_RESTORE_DEFAULTS_OP 0x1F
58 #define FRAMEWORK_EFI_IFR_BANNER_OP 0x20
59 #define FRAMEWORK_EFI_IFR_INVENTORY_OP 0x21
60 #define FRAMEWORK_EFI_IFR_EQ_VAR_VAL_OP 0x22
61 #define FRAMEWORK_EFI_IFR_ORDERED_LIST_OP 0x23
62 #define FRAMEWORK_EFI_IFR_VARSTORE_OP 0x24
63 #define FRAMEWORK_EFI_IFR_VARSTORE_SELECT_OP 0x25
64 #define FRAMEWORK_EFI_IFR_VARSTORE_SELECT_PAIR_OP 0x26
65 #define FRAMEWORK_EFI_IFR_TRUE_OP 0x27
66 #define FRAMEWORK_EFI_IFR_FALSE_OP 0x28
67 #define FRAMEWORK_EFI_IFR_GT_OP 0x29
68 #define FRAMEWORK_EFI_IFR_GE_OP 0x2A
69 #define FRAMEWORK_EFI_IFR_OEM_DEFINED_OP 0x2B
70 #define FRAMEWORK_EFI_IFR_LAST_OPCODE FRAMEWORK_EFI_IFR_OEM_DEFINED_OP
71 #define FRAMEWORK_EFI_IFR_OEM_OP 0xFE
72 #define FRAMEWORK_EFI_IFR_NV_ACCESS_COMMAND 0xFF
73
74 //
75 // Define values for the flags fields in some VFR opcodes. These are
76 // bitmasks.
77 //
78 #define FRAMEWORK_EFI_IFR_FLAG_DEFAULT 0x01
79 #define FRAMEWORK_EFI_IFR_FLAG_MANUFACTURING 0x02
80 #define FRAMEWORK_EFI_IFR_FLAG_INTERACTIVE 0x04
81 #define FRAMEWORK_EFI_IFR_FLAG_NV_ACCESS 0x08
82 #define FRAMEWORK_EFI_IFR_FLAG_RESET_REQUIRED 0x10
83 #define FRAMEWORK_EFI_IFR_FLAG_LATE_CHECK 0x20
84
85 #define EFI_NON_DEVICE_CLASS 0x00 // Useful when you do not want something in the Device Manager
86 #define EFI_DISK_DEVICE_CLASS 0x01
87 #define EFI_VIDEO_DEVICE_CLASS 0x02
88 #define EFI_NETWORK_DEVICE_CLASS 0x04
89 #define EFI_INPUT_DEVICE_CLASS 0x08
90 #define EFI_ON_BOARD_DEVICE_CLASS 0x10
91 #define EFI_OTHER_DEVICE_CLASS 0x20
92
93 #define EFI_SETUP_APPLICATION_SUBCLASS 0x00
94 #define EFI_GENERAL_APPLICATION_SUBCLASS 0x01
95 #define EFI_FRONT_PAGE_SUBCLASS 0x02
96 #define EFI_SINGLE_USE_SUBCLASS 0x03 // Used to display a single entity and then exit
97
98 //
99 // Used to flag dynamically created op-codes. This is meaningful to the IFR Library set
100 // and the browser since we need to distinguish between compiled NV map data and created data.
101 // We do not allow new entries to be created in the NV map dynamically however we still need
102 // to display this information correctly. To dynamically create op-codes and assume that their
103 // data will be saved, ensure that the NV starting location they refer to is pre-defined in the
104 // NV map.
105 //
106 #define FRAMEWORK_EFI_IFR_FLAG_CREATED 128
107
108
109 #pragma pack(1)
110 //
111 // IFR Structure definitions
112 //
113 typedef struct {
114 UINT8 OpCode;
115 UINT8 Length;
116 } FRAMEWORK_EFI_IFR_OP_HEADER;
117
118 typedef struct {
119 FRAMEWORK_EFI_IFR_OP_HEADER Header;
120 EFI_GUID Guid;
121 STRING_REF FormSetTitle;
122 STRING_REF Help;
123 EFI_PHYSICAL_ADDRESS CallbackHandle;
124 UINT16 Class;
125 UINT16 SubClass;
126 UINT16 NvDataSize; // set once, size of the NV data as defined in the script
127 } FRAMEWORK_EFI_IFR_FORM_SET;
128
129 typedef struct {
130 FRAMEWORK_EFI_IFR_OP_HEADER Header;
131 UINT16 FormId;
132 STRING_REF FormTitle;
133 } FRAMEWORK_EFI_IFR_FORM;
134
135 typedef struct {
136 FRAMEWORK_EFI_IFR_OP_HEADER Header;
137 UINT16 LabelId;
138 } FRAMEWORK_EFI_IFR_LABEL;
139
140 typedef struct {
141 FRAMEWORK_EFI_IFR_OP_HEADER Header;
142 STRING_REF SubTitle;
143 } FRAMEWORK_EFI_IFR_SUBTITLE;
144
145 typedef struct {
146 FRAMEWORK_EFI_IFR_OP_HEADER Header;
147 STRING_REF Help;
148 STRING_REF Text;
149 STRING_REF TextTwo;
150 UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.
151 UINT16 Key; // Value to be passed to caller to identify this particular op-code
152 } FRAMEWORK_EFI_IFR_TEXT;
153
154 //
155 // goto
156 //
157 typedef struct {
158 FRAMEWORK_EFI_IFR_OP_HEADER Header;
159 UINT16 FormId;
160 STRING_REF Prompt;
161 STRING_REF Help; // The string Token for the context-help
162 UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.
163 UINT16 Key; // Value to be passed to caller to identify this particular op-code
164 } FRAMEWORK_EFI_IFR_REF;
165
166 typedef struct {
167 FRAMEWORK_EFI_IFR_OP_HEADER Header;
168 } FRAMEWORK_EFI_IFR_END_FORM;
169
170 typedef struct {
171 FRAMEWORK_EFI_IFR_OP_HEADER Header;
172 } FRAMEWORK_EFI_IFR_END_FORM_SET;
173
174 //
175 // Also notice that the IFR_ONE_OF and IFR_CHECK_BOX are identical in structure......code assumes this to be true, if this ever
176 // changes we need to revisit the InitializeTagStructures code
177 //
178 typedef struct {
179 FRAMEWORK_EFI_IFR_OP_HEADER Header;
180 UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
181 UINT8 Width; // The Size of the Data being saved
182 STRING_REF Prompt; // The String Token for the Prompt
183 STRING_REF Help; // The string Token for the context-help
184 } FRAMEWORK_EFI_IFR_ONE_OF;
185
186 typedef struct {
187 FRAMEWORK_EFI_IFR_OP_HEADER Header;
188 UINT16 QuestionId; // The offset in NV for storage of the data
189 UINT8 MaxEntries; // The maximum number of options in the ordered list (=size of NVStore)
190 STRING_REF Prompt; // The string token for the prompt
191 STRING_REF Help; // The string token for the context-help
192 } FRAMEWORK_EFI_IFR_ORDERED_LIST;
193
194 typedef struct {
195 FRAMEWORK_EFI_IFR_OP_HEADER Header;
196 UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
197 UINT8 Width; // The Size of the Data being saved
198 STRING_REF Prompt; // The String Token for the Prompt
199 STRING_REF Help; // The string Token for the context-help
200 UINT8 Flags; // For now, if non-zero, means that it is the default option, - further definition likely
201 UINT16 Key; // Value to be passed to caller to identify this particular op-code
202 } FRAMEWORK_EFI_IFR_CHECKBOX, FRAMEWORK_EFI_IFR_CHECK_BOX;
203
204 typedef struct {
205 FRAMEWORK_EFI_IFR_OP_HEADER Header;
206 STRING_REF Option; // The string token describing the option
207 UINT16 Value; // The value associated with this option that is stored in the NVRAM if chosen
208 UINT8 Flags; // For now, if non-zero, means that it is the default option, - further definition likely above
209 UINT16 Key; // Value to be passed to caller to identify this particular op-code
210 } FRAMEWORK_EFI_IFR_ONE_OF_OPTION;
211
212 typedef struct {
213 FRAMEWORK_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; // This is included solely for purposes of interactive/dynamic support.
219 UINT16 Key; // Value to be passed to caller to identify this particular op-code
220 UINT16 Minimum;
221 UINT16 Maximum;
222 UINT16 Step; // If step is 0, then manual input is specified, otherwise, left/right arrow selection is called for
223 UINT16 Default;
224 } FRAMEWORK_EFI_IFR_NUMERIC;
225
226 //
227 // There is an interesting twist with regards to Time and Date. This is one of the few items which can accept input from
228 // a user, however may or may not need to use storage in the NVRAM space. The decided method for determining if NVRAM space
229 // will be used (only for a TimeOp or DateOp) is: If .QuestionId == 0 && .Width == 0 (normally an impossibility) then use system
230 // resources to store the data away and not NV resources. In other words, the setup engine will call gRT->SetTime, and gRT->SetDate
231 // for the saving of data, and the values displayed will be from the gRT->GetXXXX series of calls.
232 //
233 typedef struct {
234 FRAMEWORK_EFI_IFR_NUMERIC Hour;
235 FRAMEWORK_EFI_IFR_NUMERIC Minute;
236 FRAMEWORK_EFI_IFR_NUMERIC Second;
237 } FRAMEWORK_EFI_IFR_TIME;
238
239 typedef struct {
240 FRAMEWORK_EFI_IFR_NUMERIC Year;
241 FRAMEWORK_EFI_IFR_NUMERIC Month;
242 FRAMEWORK_EFI_IFR_NUMERIC Day;
243 } FRAMEWORK_EFI_IFR_DATE;
244
245 typedef struct {
246 FRAMEWORK_EFI_IFR_OP_HEADER Header;
247 UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
248 UINT8 Width; // The Size of the Data being saved @bug -- remove someday
249 STRING_REF Prompt; // The String Token for the Prompt
250 STRING_REF Help; // The string Token for the context-help
251 UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.
252 UINT16 Key; // Value to be passed to caller to identify this particular op-code
253 UINT8 MinSize; // Minimum allowable sized password
254 UINT8 MaxSize; // Maximum allowable sized password
255 UINT16 Encoding;
256 } FRAMEWORK_EFI_IFR_PASSWORD;
257
258 typedef struct {
259 FRAMEWORK_EFI_IFR_OP_HEADER Header;
260 UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
261 UINT8 Width; // The Size of the Data being saved @bug -- remove someday
262 STRING_REF Prompt; // The String Token for the Prompt
263 STRING_REF Help; // The string Token for the context-help
264 UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.
265 UINT16 Key; // Value to be passed to caller to identify this particular op-code
266 UINT8 MinSize; // Minimum allowable sized password
267 UINT8 MaxSize; // Maximum allowable sized password
268 } FRAMEWORK_EFI_IFR_STRING;
269
270 typedef struct {
271 FRAMEWORK_EFI_IFR_OP_HEADER Header;
272 } FRAMEWORK_EFI_IFR_END_ONE_OF;
273
274 typedef struct {
275 FRAMEWORK_EFI_IFR_OP_HEADER Header;
276 UINT16 Value;
277 UINT16 Key;
278 } FRAMEWORK_EFI_IFR_HIDDEN;
279
280 typedef struct {
281 FRAMEWORK_EFI_IFR_OP_HEADER Header;
282 UINT8 Flags;
283 } FRAMEWORK_EFI_IFR_SUPPRESS;
284
285 typedef struct {
286 FRAMEWORK_EFI_IFR_OP_HEADER Header;
287 UINT8 Flags;
288 } FRAMEWORK_EFI_IFR_GRAY_OUT;
289
290 typedef struct {
291 FRAMEWORK_EFI_IFR_OP_HEADER Header;
292 STRING_REF Popup;
293 UINT8 Flags;
294 } FRAMEWORK_EFI_IFR_INCONSISTENT;
295
296 typedef struct {
297 FRAMEWORK_EFI_IFR_OP_HEADER Header;
298 UINT16 QuestionId; // offset into variable storage
299 UINT8 Width; // size of variable storage
300 UINT16 Value; // value to compare against
301 } FRAMEWORK_EFI_IFR_EQ_ID_VAL;
302
303 typedef struct {
304 FRAMEWORK_EFI_IFR_OP_HEADER Header;
305 UINT16 QuestionId; // offset into variable storage
306 UINT8 Width; // size of variable storage
307 UINT16 ListLength;
308 UINT16 ValueList[1];
309 } FRAMEWORK_EFI_IFR_EQ_ID_LIST;
310
311 typedef struct {
312 FRAMEWORK_EFI_IFR_OP_HEADER Header;
313 UINT16 QuestionId1; // offset into variable storage for first value to compare
314 UINT8 Width; // size of variable storage (must be same for both)
315 UINT16 QuestionId2; // offset into variable storage for second value to compare
316 } FRAMEWORK_EFI_IFR_EQ_ID_ID;
317
318 typedef struct {
319 FRAMEWORK_EFI_IFR_OP_HEADER Header;
320 UINT16 VariableId; // offset into variable storage
321 UINT16 Value; // value to compare against
322 } FRAMEWORK_EFI_IFR_EQ_VAR_VAL;
323
324 typedef struct {
325 FRAMEWORK_EFI_IFR_OP_HEADER Header;
326 } FRAMEWORK_EFI_IFR_AND;
327
328 typedef struct {
329 FRAMEWORK_EFI_IFR_OP_HEADER Header;
330 } FRAMEWORK_EFI_IFR_OR;
331
332 typedef struct {
333 FRAMEWORK_EFI_IFR_OP_HEADER Header;
334 } FRAMEWORK_EFI_IFR_NOT;
335
336 typedef struct {
337 FRAMEWORK_EFI_IFR_OP_HEADER Header;
338 } FRAMEWORK_EFI_IFR_END_EXPR, FRAMEWORK_EFI_IFR_END_IF;
339
340 typedef struct {
341 FRAMEWORK_EFI_IFR_OP_HEADER Header;
342 UINT16 FormId;
343 STRING_REF Prompt;
344 STRING_REF Help;
345 UINT8 Flags;
346 UINT16 Key;
347 } FRAMEWORK_EFI_IFR_SAVE_DEFAULTS;
348
349 typedef struct {
350 FRAMEWORK_EFI_IFR_OP_HEADER Header;
351 STRING_REF Help;
352 STRING_REF Text;
353 STRING_REF TextTwo; // optional text
354 } FRAMEWORK_EFI_IFR_INVENTORY;
355
356 typedef struct {
357 FRAMEWORK_EFI_IFR_OP_HEADER Header;
358 EFI_GUID Guid; // GUID for the variable
359 UINT16 VarId; // variable store ID, as referenced elsewhere in the form
360 UINT16 Size; // size of the variable storage
361 } FRAMEWORK_EFI_IFR_VARSTORE;
362
363 typedef struct {
364 FRAMEWORK_EFI_IFR_OP_HEADER Header;
365 UINT16 VarId; // variable store ID, as referenced elsewhere in the form
366 } FRAMEWORK_EFI_IFR_VARSTORE_SELECT;
367
368 //
369 // Used for the ideqid VFR statement where two variable stores may be referenced in the
370 // same VFR statement.
371 // A browser should treat this as an FRAMEWORK_EFI_IFR_VARSTORE_SELECT statement and assume that all following
372 // IFR opcodes use the VarId as defined here.
373 //
374 typedef struct {
375 FRAMEWORK_EFI_IFR_OP_HEADER Header;
376 UINT16 VarId; // variable store ID, as referenced elsewhere in the form
377 UINT16 SecondaryVarId; // variable store ID, as referenced elsewhere in the form
378 } FRAMEWORK_EFI_IFR_VARSTORE_SELECT_PAIR;
379
380 typedef struct {
381 FRAMEWORK_EFI_IFR_OP_HEADER Header;
382 } FRAMEWORK_EFI_IFR_TRUE;
383
384 typedef struct {
385 FRAMEWORK_EFI_IFR_OP_HEADER Header;
386 } FRAMEWORK_EFI_IFR_FALSE;
387
388 typedef struct {
389 FRAMEWORK_EFI_IFR_OP_HEADER Header;
390 } FRAMEWORK_EFI_IFR_GT;
391
392 typedef struct {
393 FRAMEWORK_EFI_IFR_OP_HEADER Header;
394 } FRAMEWORK_EFI_IFR_GE;
395
396 //
397 // Save defaults and restore defaults have same structure
398 //
399 #define FRAMEWORK_EFI_IFR_RESTORE_DEFAULTS FRAMEWORK_EFI_IFR_SAVE_DEFAULTS
400
401 typedef struct {
402 FRAMEWORK_EFI_IFR_OP_HEADER Header;
403 STRING_REF Title; // The string token for the banner title
404 UINT16 LineNumber; // 1-based line number
405 UINT8 Alignment; // left, center, or right-aligned
406 } FRAMEWORK_EFI_IFR_BANNER;
407
408 #define FRAMEWORK_EFI_IFR_BANNER_ALIGN_LEFT 0
409 #define FRAMEWORK_EFI_IFR_BANNER_ALIGN_CENTER 1
410 #define FRAMEWORK_EFI_IFR_BANNER_ALIGN_RIGHT 2
411 #define FRAMEWORK_EFI_IFR_BANNER_TIMEOUT 0xFF
412
413 #pragma pack()
414
415 #endif