]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Framework/FrameworkInternalFormRepresentation.h
c2baa8fcecf2b66bcd969a96277426aae19a11d2
[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 - 2009, 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_LAST_OPCODE FRAMEWORK_EFI_IFR_VARSTORE_SELECT_PAIR_OP
66 #define FRAMEWORK_EFI_IFR_OEM_OP 0xFE
67 #define FRAMEWORK_EFI_IFR_NV_ACCESS_COMMAND 0xFF
68
69 //
70 // Define values for the flags fields in some VFR opcodes. These are
71 // bitmasks.
72 //
73 #define FRAMEWORK_EFI_IFR_FLAG_DEFAULT 0x01
74 #define FRAMEWORK_EFI_IFR_FLAG_MANUFACTURING 0x02
75 #define FRAMEWORK_EFI_IFR_FLAG_INTERACTIVE 0x04
76 #define FRAMEWORK_EFI_IFR_FLAG_NV_ACCESS 0x08
77 #define FRAMEWORK_EFI_IFR_FLAG_RESET_REQUIRED 0x10
78 #define FRAMEWORK_EFI_IFR_FLAG_LATE_CHECK 0x20
79
80 #define EFI_NON_DEVICE_CLASS 0x00 ///< Useful when you do not want something in the Device Manager
81 #define EFI_DISK_DEVICE_CLASS 0x01
82 #define EFI_VIDEO_DEVICE_CLASS 0x02
83 #define EFI_NETWORK_DEVICE_CLASS 0x04
84 #define EFI_INPUT_DEVICE_CLASS 0x08
85 #define EFI_ON_BOARD_DEVICE_CLASS 0x10
86 #define EFI_OTHER_DEVICE_CLASS 0x20
87
88 #define EFI_SETUP_APPLICATION_SUBCLASS 0x00
89 #define EFI_GENERAL_APPLICATION_SUBCLASS 0x01
90 #define EFI_FRONT_PAGE_SUBCLASS 0x02
91 #define EFI_SINGLE_USE_SUBCLASS 0x03 ///< Used to display a single entity and then exit
92
93 ///
94 /// Used to flag dynamically created op-codes. This is meaningful to the IFR Library set
95 /// and the browser since we need to distinguish between compiled NV map data and created data.
96 /// We do not allow new entries to be created in the NV map dynamically however we still need
97 /// to display this information correctly. To dynamically create op-codes and assume that their
98 /// data will be saved, ensure that the NV starting location they refer to is pre-defined in the
99 /// NV map.
100 ///
101 #define FRAMEWORK_EFI_IFR_FLAG_CREATED 128
102
103
104 #pragma pack(1)
105 //
106 // IFR Structure definitions
107 //
108 typedef struct {
109 UINT8 OpCode;
110 UINT8 Length;
111 } FRAMEWORK_EFI_IFR_OP_HEADER;
112
113 typedef struct {
114 FRAMEWORK_EFI_IFR_OP_HEADER Header;
115 EFI_GUID Guid;
116 STRING_REF FormSetTitle;
117 STRING_REF Help;
118 EFI_PHYSICAL_ADDRESS CallbackHandle;
119 UINT16 Class;
120 UINT16 SubClass;
121 UINT16 NvDataSize; ///< set once, size of the NV data as defined in the script
122 } FRAMEWORK_EFI_IFR_FORM_SET;
123
124 typedef struct {
125 FRAMEWORK_EFI_IFR_OP_HEADER Header;
126 UINT16 FormId;
127 STRING_REF FormTitle;
128 } FRAMEWORK_EFI_IFR_FORM;
129
130 typedef struct {
131 FRAMEWORK_EFI_IFR_OP_HEADER Header;
132 UINT16 LabelId;
133 } FRAMEWORK_EFI_IFR_LABEL;
134
135 typedef struct {
136 FRAMEWORK_EFI_IFR_OP_HEADER Header;
137 STRING_REF SubTitle;
138 } FRAMEWORK_EFI_IFR_SUBTITLE;
139
140 typedef struct {
141 FRAMEWORK_EFI_IFR_OP_HEADER Header;
142 STRING_REF Help;
143 STRING_REF Text;
144 STRING_REF TextTwo;
145 UINT8 Flags; ///< This is included solely for purposes of interactive/dynamic support.
146 UINT16 Key; ///< Value to be passed to caller to identify this particular op-code
147 } FRAMEWORK_EFI_IFR_TEXT;
148
149 //
150 // goto
151 //
152 typedef struct {
153 FRAMEWORK_EFI_IFR_OP_HEADER Header;
154 UINT16 FormId;
155 STRING_REF Prompt;
156 STRING_REF Help; ///< The string Token for the context-help
157 UINT8 Flags; ///< This is included solely for purposes of interactive/dynamic support.
158 UINT16 Key; ///< Value to be passed to caller to identify this particular op-code
159 } FRAMEWORK_EFI_IFR_REF;
160
161 typedef struct {
162 FRAMEWORK_EFI_IFR_OP_HEADER Header;
163 } FRAMEWORK_EFI_IFR_END_FORM;
164
165 typedef struct {
166 FRAMEWORK_EFI_IFR_OP_HEADER Header;
167 } FRAMEWORK_EFI_IFR_END_FORM_SET;
168
169 //
170 // Also notice that the IFR_ONE_OF and IFR_CHECK_BOX are identical in structure......
171 // code assumes this to be true, if this ever changes we need to revisit the InitializeTagStructures code
172 //
173 typedef struct {
174 FRAMEWORK_EFI_IFR_OP_HEADER Header;
175 UINT16 QuestionId; ///< The ID designating what the question is about...
176 UINT8 Width; ///< The Size of the Data being saved
177 STRING_REF Prompt; ///< The String Token for the Prompt
178 STRING_REF Help; ///< The string Token for the context-help
179 } FRAMEWORK_EFI_IFR_ONE_OF;
180
181 typedef struct {
182 FRAMEWORK_EFI_IFR_OP_HEADER Header;
183 UINT16 QuestionId; ///< The offset in NV for storage of the data
184 UINT8 MaxEntries; ///< The maximum number of options in the ordered list (=size of NVStore)
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_ORDERED_LIST;
188
189 typedef struct {
190 FRAMEWORK_EFI_IFR_OP_HEADER Header;
191 UINT16 QuestionId; ///< The ID designating what the question is about...
192 UINT8 Width; ///< The Size of the Data being saved
193 STRING_REF Prompt; ///< The String Token for the Prompt
194 STRING_REF Help; ///< The string Token for the context-help
195 UINT8 Flags; ///< If non-zero, means that it is the default option
196 UINT16 Key; ///< Value to be passed to caller to identify this particular op-code
197 } FRAMEWORK_EFI_IFR_CHECKBOX, FRAMEWORK_EFI_IFR_CHECK_BOX;
198
199 typedef struct {
200 FRAMEWORK_EFI_IFR_OP_HEADER Header;
201 STRING_REF Option; ///< The string token describing the option
202 UINT16 Value; ///< The value associated with this option that is stored in the NVRAM
203 UINT8 Flags; ///< If non-zero, means that it is the default option
204 UINT16 Key; ///< Value to be passed to caller to identify this particular op-code
205 } FRAMEWORK_EFI_IFR_ONE_OF_OPTION;
206
207 typedef struct {
208 FRAMEWORK_EFI_IFR_OP_HEADER Header;
209 UINT16 QuestionId; ///< The ID designating what the question is about...
210 UINT8 Width; ///< The Size of the Data being saved
211 STRING_REF Prompt; ///< The String Token for the Prompt
212 STRING_REF Help; ///< The string Token for the context-help
213 UINT8 Flags; ///< This is included solely for purposes of interactive/dynamic support.
214 UINT16 Key; ///< Value to be passed to caller to identify this particular op-code
215 UINT16 Minimum;
216 UINT16 Maximum;
217 UINT16 Step; ///< Zero means manual input, otherwise, arrow selection is called for
218 UINT16 Default;
219 } FRAMEWORK_EFI_IFR_NUMERIC;
220
221 //
222 // There is an interesting twist with regards to Time and Date. This is one of the few items which can accept input
223 // from a user, however may or may not need to use storage in the NVRAM space. The decided method for determining
224 // if NVRAM space will be used (only for a TimeOp or DateOp) is: If .QuestionId == 0 && .Width == 0 (normally an
225 // impossibility) then use system resources to store the data away and not NV resources. In other words, the setup
226 // engine will call gRT->SetTime, and gRT->SetDate for the saving of data, and the values displayed will be from the
227 // gRT->GetXXXX series of calls.
228 //
229 typedef struct {
230 FRAMEWORK_EFI_IFR_NUMERIC Hour;
231 FRAMEWORK_EFI_IFR_NUMERIC Minute;
232 FRAMEWORK_EFI_IFR_NUMERIC Second;
233 } FRAMEWORK_EFI_IFR_TIME;
234
235 typedef struct {
236 FRAMEWORK_EFI_IFR_NUMERIC Year;
237 FRAMEWORK_EFI_IFR_NUMERIC Month;
238 FRAMEWORK_EFI_IFR_NUMERIC Day;
239 } FRAMEWORK_EFI_IFR_DATE;
240
241 typedef struct {
242 FRAMEWORK_EFI_IFR_OP_HEADER Header;
243 UINT16 QuestionId;///< The ID designating what the question is about...
244 UINT8 Width; ///< The Size of the Data being saved
245 STRING_REF Prompt; ///< The String Token for the Prompt
246 STRING_REF Help; ///< The string Token for the context-help
247 UINT8 Flags; ///< This is included solely for purposes of interactive/dynamic support.
248 UINT16 Key; ///< Value to be passed to caller to identify this particular op-code
249 UINT8 MinSize; ///< Minimum allowable sized password
250 UINT8 MaxSize; ///< Maximum allowable sized password
251 UINT16 Encoding;
252 } FRAMEWORK_EFI_IFR_PASSWORD;
253
254 typedef struct {
255 FRAMEWORK_EFI_IFR_OP_HEADER Header;
256 UINT16 QuestionId; ///< The ID designating what the question is about...
257 UINT8 Width; ///< The Size of the Data being saved
258 STRING_REF Prompt; ///< The String Token for the Prompt
259 STRING_REF Help; ///< The string Token for the context-help
260 UINT8 Flags; ///< This is included solely for purposes of interactive/dynamic support.
261 UINT16 Key; ///< Value to be passed to caller to identify this particular op-code
262 UINT8 MinSize; ///< Minimum allowable sized password
263 UINT8 MaxSize; ///< Maximum allowable sized password
264 } FRAMEWORK_EFI_IFR_STRING;
265
266 typedef struct {
267 FRAMEWORK_EFI_IFR_OP_HEADER Header;
268 } FRAMEWORK_EFI_IFR_END_ONE_OF;
269
270 typedef struct {
271 FRAMEWORK_EFI_IFR_OP_HEADER Header;
272 UINT16 Value;
273 UINT16 Key;
274 } FRAMEWORK_EFI_IFR_HIDDEN;
275
276 typedef struct {
277 FRAMEWORK_EFI_IFR_OP_HEADER Header;
278 UINT8 Flags;
279 } FRAMEWORK_EFI_IFR_SUPPRESS;
280
281 typedef struct {
282 FRAMEWORK_EFI_IFR_OP_HEADER Header;
283 UINT8 Flags;
284 } FRAMEWORK_EFI_IFR_GRAY_OUT;
285
286 typedef struct {
287 FRAMEWORK_EFI_IFR_OP_HEADER Header;
288 STRING_REF Popup;
289 UINT8 Flags;
290 } FRAMEWORK_EFI_IFR_INCONSISTENT;
291
292 typedef struct {
293 FRAMEWORK_EFI_IFR_OP_HEADER Header;
294 UINT16 QuestionId; ///< offset into variable storage
295 UINT8 Width; ///< size of variable storage
296 UINT16 Value; ///< value to compare against
297 } FRAMEWORK_EFI_IFR_EQ_ID_VAL;
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 ListLength;
304 UINT16 ValueList[1];
305 } FRAMEWORK_EFI_IFR_EQ_ID_LIST;
306
307 typedef struct {
308 FRAMEWORK_EFI_IFR_OP_HEADER Header;
309 UINT16 QuestionId1; ///< offset into variable storage for first value to compare
310 UINT8 Width; ///< size of variable storage (must be same for both)
311 UINT16 QuestionId2; ///< offset into variable storage for second value to compare
312 } FRAMEWORK_EFI_IFR_EQ_ID_ID;
313
314 typedef struct {
315 FRAMEWORK_EFI_IFR_OP_HEADER Header;
316 UINT16 VariableId; ///< offset into variable storage
317 UINT16 Value; ///< value to compare against
318 } FRAMEWORK_EFI_IFR_EQ_VAR_VAL;
319
320 typedef struct {
321 FRAMEWORK_EFI_IFR_OP_HEADER Header;
322 } FRAMEWORK_EFI_IFR_AND;
323
324 typedef struct {
325 FRAMEWORK_EFI_IFR_OP_HEADER Header;
326 } FRAMEWORK_EFI_IFR_OR;
327
328 typedef struct {
329 FRAMEWORK_EFI_IFR_OP_HEADER Header;
330 } FRAMEWORK_EFI_IFR_NOT;
331
332 typedef struct {
333 FRAMEWORK_EFI_IFR_OP_HEADER Header;
334 } FRAMEWORK_EFI_IFR_END_EXPR, FRAMEWORK_EFI_IFR_END_IF;
335
336 typedef struct {
337 FRAMEWORK_EFI_IFR_OP_HEADER Header;
338 UINT16 FormId;
339 STRING_REF Prompt;
340 STRING_REF Help;
341 UINT8 Flags;
342 UINT16 Key;
343 } FRAMEWORK_EFI_IFR_SAVE_DEFAULTS;
344
345 typedef struct {
346 FRAMEWORK_EFI_IFR_OP_HEADER Header;
347 STRING_REF Help;
348 STRING_REF Text;
349 STRING_REF TextTwo; ///< optional text
350 } FRAMEWORK_EFI_IFR_INVENTORY;
351
352 typedef struct {
353 FRAMEWORK_EFI_IFR_OP_HEADER Header;
354 EFI_GUID Guid; ///< GUID for the variable
355 UINT16 VarId; ///< variable store ID, as referenced elsewhere in the form
356 UINT16 Size; ///< size of the variable storage
357 } FRAMEWORK_EFI_IFR_VARSTORE;
358
359 typedef struct {
360 FRAMEWORK_EFI_IFR_OP_HEADER Header;
361 UINT16 VarId; ///< variable store ID, as referenced elsewhere in the form
362 } FRAMEWORK_EFI_IFR_VARSTORE_SELECT;
363
364 ///
365 /// Used for the ideqid VFR statement where two variable stores may be referenced in the
366 /// same VFR statement.
367 /// A browser should treat this as an FRAMEWORK_EFI_IFR_VARSTORE_SELECT statement and assume that all following
368 /// IFR opcodes use the VarId as defined here.
369 ///
370 typedef struct {
371 FRAMEWORK_EFI_IFR_OP_HEADER Header;
372 UINT16 VarId; ///< variable store ID, as referenced elsewhere in the form
373 UINT16 SecondaryVarId; ///< variable store ID, as referenced elsewhere in the form
374 } FRAMEWORK_EFI_IFR_VARSTORE_SELECT_PAIR;
375
376 ///
377 /// Save defaults and restore defaults have same structure
378 ///
379 #define FRAMEWORK_EFI_IFR_RESTORE_DEFAULTS FRAMEWORK_EFI_IFR_SAVE_DEFAULTS
380
381 typedef struct {
382 FRAMEWORK_EFI_IFR_OP_HEADER Header;
383 STRING_REF Title; ///< The string token for the banner title
384 UINT16 LineNumber; ///< 1-based line number
385 UINT8 Alignment; ///< left, center, or right-aligned
386 } FRAMEWORK_EFI_IFR_BANNER;
387
388 #define FRAMEWORK_EFI_IFR_BANNER_ALIGN_LEFT 0
389 #define FRAMEWORK_EFI_IFR_BANNER_ALIGN_CENTER 1
390 #define FRAMEWORK_EFI_IFR_BANNER_ALIGN_RIGHT 2
391 #define FRAMEWORK_EFI_IFR_BANNER_TIMEOUT 0xFF
392
393 #pragma pack()
394
395 #endif