]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Csm/Include/Framework/FrameworkInternalFormRepresentation.h
OvmfPkg: Apply uncrustify changes
[mirror_edk2.git] / OvmfPkg / Csm / 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 - 2018, Intel Corporation. All rights reserved.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8
9 @par Revision Reference:
10 These definitions are from the Framework Specification HII 0.92.
11
12 **/
13
14 #ifndef __FRAMEWORK_INTERNAL_FORMREPRESENTATION_H__
15 #define __FRAMEWORK_INTERNAL_FORMREPRESENTATION_H__
16
17 typedef UINT16 STRING_REF;
18
19 //
20 // IFR Op codes
21 //
22 #define FRAMEWORK_EFI_IFR_FORM_OP 0x01
23 #define FRAMEWORK_EFI_IFR_SUBTITLE_OP 0x02
24 #define FRAMEWORK_EFI_IFR_TEXT_OP 0x03
25 #define EFI_IFR_GRAPHIC_OP 0x04
26 #define FRAMEWORK_EFI_IFR_ONE_OF_OP 0x05
27 #define FRAMEWORK_EFI_IFR_CHECKBOX_OP 0x06
28 #define FRAMEWORK_EFI_IFR_NUMERIC_OP 0x07
29 #define FRAMEWORK_EFI_IFR_PASSWORD_OP 0x08
30 #define FRAMEWORK_EFI_IFR_ONE_OF_OPTION_OP 0x09 ///< ONEOF OPTION field.
31 #define FRAMEWORK_EFI_IFR_SUPPRESS_IF_OP 0x0A
32 #define EFI_IFR_END_FORM_OP 0x0B
33 #define EFI_IFR_HIDDEN_OP 0x0C
34 #define EFI_IFR_END_FORM_SET_OP 0x0D
35 #define FRAMEWORK_EFI_IFR_FORM_SET_OP 0x0E
36 #define FRAMEWORK_EFI_IFR_REF_OP 0x0F
37 #define EFI_IFR_END_ONE_OF_OP 0x10
38 #define FRAMEWORK_EFI_IFR_END_OP EFI_IFR_END_ONE_OF_OP
39 #define FRAMEWORK_EFI_IFR_INCONSISTENT_IF_OP 0x11
40 #define FRAMEWORK_EFI_IFR_EQ_ID_VAL_OP 0x12
41 #define FRAMEWORK_EFI_IFR_EQ_ID_ID_OP 0x13
42 #define FRAMEWORK_EFI_IFR_EQ_ID_LIST_OP 0x14
43 #define FRAMEWORK_EFI_IFR_AND_OP 0x15
44 #define FRAMEWORK_EFI_IFR_OR_OP 0x16
45 #define FRAMEWORK_EFI_IFR_NOT_OP 0x17
46 #define EFI_IFR_END_IF_OP 0x18 ///< For endif of inconsistentif, suppressif, grayoutif.
47 #define EFI_IFR_GRAYOUT_IF_OP 0x19
48 #define FRAMEWORK_EFI_IFR_DATE_OP 0x1A
49 #define FRAMEWORK_EFI_IFR_TIME_OP 0x1B
50 #define FRAMEWORK_EFI_IFR_STRING_OP 0x1C
51 #define EFI_IFR_LABEL_OP 0x1D
52 #define EFI_IFR_SAVE_DEFAULTS_OP 0x1E
53 #define EFI_IFR_RESTORE_DEFAULTS_OP 0x1F
54 #define EFI_IFR_BANNER_OP 0x20
55 #define EFI_IFR_INVENTORY_OP 0x21
56 #define EFI_IFR_EQ_VAR_VAL_OP 0x22
57 #define FRAMEWORK_EFI_IFR_ORDERED_LIST_OP 0x23
58 #define FRAMEWORK_EFI_IFR_VARSTORE_OP 0x24
59 #define EFI_IFR_VARSTORE_SELECT_OP 0x25
60 #define EFI_IFR_VARSTORE_SELECT_PAIR_OP 0x26
61 #define EFI_IFR_LAST_OPCODE EFI_IFR_VARSTORE_SELECT_PAIR_OP
62 #define EFI_IFR_OEM_OP 0xFE
63 #define EFI_IFR_NV_ACCESS_COMMAND 0xFF
64
65 //
66 // Define values for the flags fields in some VFR opcodes. These are
67 // bitmasks.
68 //
69 #define EFI_IFR_FLAG_DEFAULT 0x01
70 #define EFI_IFR_FLAG_MANUFACTURING 0x02
71 #define EFI_IFR_FLAG_INTERACTIVE 0x04
72 #define EFI_IFR_FLAG_NV_ACCESS 0x08
73 #define EFI_IFR_FLAG_RESET_REQUIRED 0x10
74 #define EFI_IFR_FLAG_LATE_CHECK 0x20
75
76 #define EFI_NON_DEVICE_CLASS 0x00 ///< Useful when you do not want something in the Device Manager.
77 #define EFI_DISK_DEVICE_CLASS 0x01
78 #define EFI_VIDEO_DEVICE_CLASS 0x02
79 #define EFI_NETWORK_DEVICE_CLASS 0x04
80 #define EFI_INPUT_DEVICE_CLASS 0x08
81 #define EFI_ON_BOARD_DEVICE_CLASS 0x10
82 #define EFI_OTHER_DEVICE_CLASS 0x20
83
84 #define EFI_SETUP_APPLICATION_SUBCLASS 0x00
85 #define EFI_GENERAL_APPLICATION_SUBCLASS 0x01
86 #define EFI_FRONT_PAGE_SUBCLASS 0x02
87 #define EFI_SINGLE_USE_SUBCLASS 0x03 ///< Used to display a single entity ,and then exit.
88
89 ///
90 /// Used to flag dynamically created op-codes. This is meaningful to the IFR Library set
91 /// and the browser because we need to distinguish between compiled NV map data and created data.
92 /// We do not allow new entries to be created in the NV map dynamically, but we do need
93 /// to display this information correctly. To dynamically create op-codes and assume that their
94 /// data will be saved, ensure that the NV starting location they refer to is pre-defined in the
95 /// NV map.
96 ///
97 #define EFI_IFR_FLAG_CREATED 128
98
99 #pragma pack(1)
100 //
101 // IFR Structure definitions
102 //
103 typedef struct {
104 UINT8 OpCode;
105 UINT8 Length;
106 } FRAMEWORK_EFI_IFR_OP_HEADER;
107
108 typedef struct {
109 FRAMEWORK_EFI_IFR_OP_HEADER Header;
110 EFI_GUID Guid;
111 STRING_REF FormSetTitle;
112 STRING_REF Help;
113 EFI_PHYSICAL_ADDRESS CallbackHandle;
114 UINT16 Class;
115 UINT16 SubClass;
116 UINT16 NvDataSize; ///< Set once; the size of the NV data as defined in the script.
117 } FRAMEWORK_EFI_IFR_FORM_SET;
118
119 typedef struct {
120 FRAMEWORK_EFI_IFR_OP_HEADER Header;
121 UINT16 FormId;
122 STRING_REF FormTitle;
123 } FRAMEWORK_EFI_IFR_FORM;
124
125 typedef struct {
126 FRAMEWORK_EFI_IFR_OP_HEADER Header;
127 UINT16 LabelId;
128 } EFI_IFR_LABEL;
129
130 typedef struct {
131 FRAMEWORK_EFI_IFR_OP_HEADER Header;
132 STRING_REF SubTitle;
133 } FRAMEWORK_EFI_IFR_SUBTITLE;
134
135 typedef struct {
136 FRAMEWORK_EFI_IFR_OP_HEADER Header;
137 STRING_REF Help;
138 STRING_REF Text;
139 STRING_REF TextTwo;
140 UINT8 Flags; ///< This is included solely for purposes of interactive/dynamic support.
141 UINT16 Key; ///< The value to be passed to the caller to identify this particular op-code.
142 } FRAMEWORK_EFI_IFR_TEXT;
143
144 //
145 // goto
146 //
147 typedef struct {
148 FRAMEWORK_EFI_IFR_OP_HEADER Header;
149 UINT16 FormId;
150 STRING_REF Prompt;
151 STRING_REF Help; ///< The string Token for the context-help.
152 UINT8 Flags; ///< This is included solely for purposes of interactive/dynamic support.
153 UINT16 Key; ///< The value to be passed to the caller to identify this particular op-code.
154 } FRAMEWORK_EFI_IFR_REF;
155
156 typedef struct {
157 FRAMEWORK_EFI_IFR_OP_HEADER Header;
158 } EFI_IFR_END_FORM;
159
160 typedef struct {
161 FRAMEWORK_EFI_IFR_OP_HEADER Header;
162 } EFI_IFR_END_FORM_SET;
163
164 //
165 // Also notice that the IFR_ONE_OF and IFR_CHECK_BOX are identical in structure......
166 // code assumes this to be true, if this ever changes we need to revisit the InitializeTagStructures code
167 //
168 typedef struct {
169 FRAMEWORK_EFI_IFR_OP_HEADER Header;
170 UINT16 QuestionId; ///< The ID designating what the question is about...
171 UINT8 Width; ///< The Size of the Data being saved.
172 STRING_REF Prompt; ///< The String Token for the Prompt.
173 STRING_REF Help; ///< The string Token for the context-help.
174 } FRAMEWORK_EFI_IFR_ONE_OF;
175
176 typedef struct {
177 FRAMEWORK_EFI_IFR_OP_HEADER Header;
178 UINT16 QuestionId; ///< The offset in NV for storage of the data.
179 UINT8 MaxEntries; ///< The maximum number of options in the ordered list (=size of NVStore).
180 STRING_REF Prompt; ///< The string token for the prompt.
181 STRING_REF Help; ///< The string token for the context-help.
182 } FRAMEWORK_EFI_IFR_ORDERED_LIST;
183
184 typedef struct {
185 FRAMEWORK_EFI_IFR_OP_HEADER Header;
186 UINT16 QuestionId; ///< The ID designating what the question is about...
187 UINT8 Width; ///< The Size of the Data being saved.
188 STRING_REF Prompt; ///< The String Token for the Prompt.
189 STRING_REF Help; ///< The string Token for the context-help.
190 UINT8 Flags; ///< If non-zero, it means that it is the default option.
191 UINT16 Key; ///< Value to be passed to caller to identify this particular op-code.
192 } FRAMEWORK_EFI_IFR_CHECKBOX, EFI_IFR_CHECK_BOX;
193
194 typedef struct {
195 FRAMEWORK_EFI_IFR_OP_HEADER Header;
196 STRING_REF Option; ///< The string token describing the option.
197 UINT16 Value; ///< The value associated with this option that is stored in the NVRAM.
198 UINT8 Flags; ///< If non-zero, it means that it is the default option.
199 UINT16 Key; ///< Value to be passed to caller to identify this particular op-code.
200 } FRAMEWORK_EFI_IFR_ONE_OF_OPTION;
201
202 typedef struct {
203 FRAMEWORK_EFI_IFR_OP_HEADER Header;
204 UINT16 QuestionId; ///< The ID designating what the question is about...
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; ///< This is included solely for purposes of interactive/dynamic support.
209 UINT16 Key; ///< The value to be passed to caller to identify this particular op-code.
210 UINT16 Minimum;
211 UINT16 Maximum;
212 UINT16 Step; ///< Zero means manual input. Otherwise, arrow selection is called for.
213 UINT16 Default;
214 } FRAMEWORK_EFI_IFR_NUMERIC;
215
216 //
217 // There is an interesting twist with regards to Time and Date. This is one of the few items which can accept input
218 // from a user, and may or may not need to use storage in the NVRAM space. The decided method for determining
219 // if NVRAM space will be used (only for a TimeOp or DateOp) is: If .QuestionId == 0 && .Width == 0 (normally an
220 // impossibility) then use system resources to store the data away and not NV resources. In other words, the setup
221 // engine will call gRT->SetTime, and gRT->SetDate for the saving of data, and the values displayed will be from the
222 // gRT->GetXXXX series of calls.
223 //
224 typedef struct {
225 FRAMEWORK_EFI_IFR_NUMERIC Hour;
226 FRAMEWORK_EFI_IFR_NUMERIC Minute;
227 FRAMEWORK_EFI_IFR_NUMERIC Second;
228 } FRAMEWORK_EFI_IFR_TIME;
229
230 typedef struct {
231 FRAMEWORK_EFI_IFR_NUMERIC Year;
232 FRAMEWORK_EFI_IFR_NUMERIC Month;
233 FRAMEWORK_EFI_IFR_NUMERIC Day;
234 } FRAMEWORK_EFI_IFR_DATE;
235
236 typedef struct {
237 FRAMEWORK_EFI_IFR_OP_HEADER Header;
238 UINT16 QuestionId; ///< The ID designating what the question is about...
239 UINT8 Width; ///< The Size of the Data being saved.
240 STRING_REF Prompt; ///< The String Token for the Prompt.
241 STRING_REF Help; ///< The string Token for the context-help.
242 UINT8 Flags; ///< This is included solely for purposes of interactive/dynamic support.
243 UINT16 Key; ///< The value to be passed to caller to identify this particular op-code.
244 UINT8 MinSize; ///< Minimum allowable sized password.
245 UINT8 MaxSize; ///< Maximum allowable sized password.
246 UINT16 Encoding;
247 } FRAMEWORK_EFI_IFR_PASSWORD;
248
249 typedef struct {
250 FRAMEWORK_EFI_IFR_OP_HEADER Header;
251 UINT16 QuestionId; ///< The ID designating what the question is about...
252 UINT8 Width; ///< The Size of the Data being saved.
253 STRING_REF Prompt; ///< The String Token for the Prompt.
254 STRING_REF Help; ///< The string Token for the context-help.
255 UINT8 Flags; ///< This is included solely for purposes of interactive/dynamic support.
256 UINT16 Key; ///< The value to be passed to caller to identify this particular op-code.
257 UINT8 MinSize; ///< Minimum allowable sized password.
258 UINT8 MaxSize; ///< Maximum allowable sized password.
259 } FRAMEWORK_EFI_IFR_STRING;
260
261 typedef struct {
262 FRAMEWORK_EFI_IFR_OP_HEADER Header;
263 } EFI_IFR_END_ONE_OF;
264
265 typedef struct {
266 FRAMEWORK_EFI_IFR_OP_HEADER Header;
267 UINT16 Value;
268 UINT16 Key;
269 } EFI_IFR_HIDDEN;
270
271 ///
272 /// Inconsistent with specification here:
273 /// The following definition may not comply with Framework Specification HII 0.92. To
274 /// keep the inconsistant is for implementation needed.
275 ///@{
276 typedef struct {
277 FRAMEWORK_EFI_IFR_OP_HEADER Header;
278 UINT8 Flags;
279 } EFI_IFR_SUPPRESS;
280
281 typedef struct {
282 FRAMEWORK_EFI_IFR_OP_HEADER Header;
283 UINT8 Flags;
284 } EFI_IFR_GRAY_OUT;
285
286 typedef struct {
287 FRAMEWORK_EFI_IFR_OP_HEADER Header;
288 STRING_REF Popup;
289 UINT8 Flags;
290 } EFI_IFR_INCONSISTENT;
291
292 typedef struct {
293 FRAMEWORK_EFI_IFR_OP_HEADER Header;
294 UINT16 QuestionId; ///< The offset into variable storage.
295 UINT8 Width; ///< The size of variable storage.
296 UINT16 Value; ///< The 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; ///< The offset into variable storage.
302 UINT8 Width; ///< The 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; ///< The offset into variable storage for first value to compare.
310 UINT8 Width; ///< The size of variable storage (must be same for both).
311 UINT16 QuestionId2; ///< The 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; ///< The offset into variable storage.
317 UINT16 Value; ///< The value to compare against.
318 } EFI_IFR_EQ_VAR_VAL;
319 ///@}
320
321 typedef struct {
322 FRAMEWORK_EFI_IFR_OP_HEADER Header;
323 } FRAMEWORK_EFI_IFR_AND;
324
325 typedef struct {
326 FRAMEWORK_EFI_IFR_OP_HEADER Header;
327 } FRAMEWORK_EFI_IFR_OR;
328
329 typedef struct {
330 FRAMEWORK_EFI_IFR_OP_HEADER Header;
331 } FRAMEWORK_EFI_IFR_NOT;
332
333 typedef struct {
334 FRAMEWORK_EFI_IFR_OP_HEADER Header;
335 } EFI_IFR_END_EXPR, EFI_IFR_END_IF;
336
337 typedef struct {
338 FRAMEWORK_EFI_IFR_OP_HEADER Header;
339 UINT16 FormId;
340 STRING_REF Prompt;
341 STRING_REF Help;
342 UINT8 Flags;
343 UINT16 Key;
344 } EFI_IFR_SAVE_DEFAULTS;
345
346 typedef struct {
347 FRAMEWORK_EFI_IFR_OP_HEADER Header;
348 STRING_REF Help;
349 STRING_REF Text;
350 STRING_REF TextTwo; ///< Optional text.
351 } EFI_IFR_INVENTORY;
352
353 typedef struct {
354 FRAMEWORK_EFI_IFR_OP_HEADER Header;
355 EFI_GUID Guid; ///< GUID for the variable.
356 UINT16 VarId; ///< The variable store ID, as referenced elsewhere in the form.
357 UINT16 Size; ///< The size of the variable storage.
358 } FRAMEWORK_EFI_IFR_VARSTORE;
359
360 typedef struct {
361 FRAMEWORK_EFI_IFR_OP_HEADER Header;
362 UINT16 VarId; ///< The variable store ID, as referenced elsewhere in the form.
363 } EFI_IFR_VARSTORE_SELECT;
364
365 ///
366 /// Used for the ideqid VFR statement where two variable stores may be referenced in the
367 /// same VFR statement.
368 /// A browser should treat this as an FRAMEWORK_EFI_IFR_VARSTORE_SELECT statement and assume that all following
369 /// IFR opcodes use the VarId as defined here.
370 ///
371 typedef struct {
372 FRAMEWORK_EFI_IFR_OP_HEADER Header;
373 UINT16 VarId; ///< The variable store ID, as referenced elsewhere in the form.
374 UINT16 SecondaryVarId; ///< The variable store ID, as referenced elsewhere in the form.
375 } EFI_IFR_VARSTORE_SELECT_PAIR;
376
377 ///
378 /// Save defaults and restore defaults have same structure.
379 ///
380 #define EFI_IFR_RESTORE_DEFAULTS EFI_IFR_SAVE_DEFAULTS
381
382 typedef struct {
383 FRAMEWORK_EFI_IFR_OP_HEADER Header;
384 STRING_REF Title; ///< The string token for the banner title.
385 UINT16 LineNumber; ///< 1-based line number.
386 UINT8 Alignment; ///< Left, center, or right-aligned.
387 } EFI_IFR_BANNER;
388
389 #define EFI_IFR_BANNER_ALIGN_LEFT 0
390 #define EFI_IFR_BANNER_ALIGN_CENTER 1
391 #define EFI_IFR_BANNER_ALIGN_RIGHT 2
392 #define EFI_IFR_BANNER_TIMEOUT 0xFF
393
394 #pragma pack()
395
396 #endif