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