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
6 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
9 @par Revision Reference:
10 These definitions are from the Framework Specification HII 0.92.
14 #ifndef __FRAMEWORK_INTERNAL_FORMREPRESENTATION_H__
15 #define __FRAMEWORK_INTERNAL_FORMREPRESENTATION_H__
17 typedef UINT16 STRING_REF
;
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
66 // Define values for the flags fields in some VFR opcodes. These are
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
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
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.
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
97 #define EFI_IFR_FLAG_CREATED 128
102 // IFR Structure definitions
107 } FRAMEWORK_EFI_IFR_OP_HEADER
;
110 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
112 STRING_REF FormSetTitle
;
114 EFI_PHYSICAL_ADDRESS CallbackHandle
;
117 UINT16 NvDataSize
; ///< Set once; the size of the NV data as defined in the script.
118 } FRAMEWORK_EFI_IFR_FORM_SET
;
121 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
123 STRING_REF FormTitle
;
124 } FRAMEWORK_EFI_IFR_FORM
;
127 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
132 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
134 } FRAMEWORK_EFI_IFR_SUBTITLE
;
137 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
141 UINT8 Flags
; ///< This is included solely for purposes of interactive/dynamic support.
142 UINT16 Key
; ///< The value to be passed to the caller to identify this particular op-code.
143 } FRAMEWORK_EFI_IFR_TEXT
;
149 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
152 STRING_REF Help
; ///< The string Token for the context-help.
153 UINT8 Flags
; ///< This is included solely for purposes of interactive/dynamic support.
154 UINT16 Key
; ///< The value to be passed to the caller to identify this particular op-code.
155 } FRAMEWORK_EFI_IFR_REF
;
158 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
162 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
163 } EFI_IFR_END_FORM_SET
;
166 // Also notice that the IFR_ONE_OF and IFR_CHECK_BOX are identical in structure......
167 // code assumes this to be true, if this ever changes we need to revisit the InitializeTagStructures code
170 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
171 UINT16 QuestionId
; ///< The ID designating what the question is about...
172 UINT8 Width
; ///< The Size of the Data being saved.
173 STRING_REF Prompt
; ///< The String Token for the Prompt.
174 STRING_REF Help
; ///< The string Token for the context-help.
175 } FRAMEWORK_EFI_IFR_ONE_OF
;
178 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
179 UINT16 QuestionId
; ///< The offset in NV for storage of the data.
180 UINT8 MaxEntries
; ///< The maximum number of options in the ordered list (=size of NVStore).
181 STRING_REF Prompt
; ///< The string token for the prompt.
182 STRING_REF Help
; ///< The string token for the context-help.
183 } FRAMEWORK_EFI_IFR_ORDERED_LIST
;
186 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
187 UINT16 QuestionId
; ///< The ID designating what the question is about...
188 UINT8 Width
; ///< The Size of the Data being saved.
189 STRING_REF Prompt
; ///< The String Token for the Prompt.
190 STRING_REF Help
; ///< The string Token for the context-help.
191 UINT8 Flags
; ///< If non-zero, it means that it is the default option.
192 UINT16 Key
; ///< Value to be passed to caller to identify this particular op-code.
193 } FRAMEWORK_EFI_IFR_CHECKBOX
, EFI_IFR_CHECK_BOX
;
196 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
197 STRING_REF Option
; ///< The string token describing the option.
198 UINT16 Value
; ///< The value associated with this option that is stored in the NVRAM.
199 UINT8 Flags
; ///< If non-zero, it means that it is the default option.
200 UINT16 Key
; ///< Value to be passed to caller to identify this particular op-code.
201 } FRAMEWORK_EFI_IFR_ONE_OF_OPTION
;
204 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
205 UINT16 QuestionId
; ///< The ID designating what the question is about...
206 UINT8 Width
; ///< The Size of the Data being saved.
207 STRING_REF Prompt
; ///< The String Token for the Prompt.
208 STRING_REF Help
; ///< The string Token for the context-help.
209 UINT8 Flags
; ///< This is included solely for purposes of interactive/dynamic support.
210 UINT16 Key
; ///< The value to be passed to caller to identify this particular op-code.
213 UINT16 Step
; ///< Zero means manual input. Otherwise, arrow selection is called for.
215 } FRAMEWORK_EFI_IFR_NUMERIC
;
218 // There is an interesting twist with regards to Time and Date. This is one of the few items which can accept input
219 // from a user, and may or may not need to use storage in the NVRAM space. The decided method for determining
220 // if NVRAM space will be used (only for a TimeOp or DateOp) is: If .QuestionId == 0 && .Width == 0 (normally an
221 // impossibility) then use system resources to store the data away and not NV resources. In other words, the setup
222 // engine will call gRT->SetTime, and gRT->SetDate for the saving of data, and the values displayed will be from the
223 // gRT->GetXXXX series of calls.
226 FRAMEWORK_EFI_IFR_NUMERIC Hour
;
227 FRAMEWORK_EFI_IFR_NUMERIC Minute
;
228 FRAMEWORK_EFI_IFR_NUMERIC Second
;
229 } FRAMEWORK_EFI_IFR_TIME
;
232 FRAMEWORK_EFI_IFR_NUMERIC Year
;
233 FRAMEWORK_EFI_IFR_NUMERIC Month
;
234 FRAMEWORK_EFI_IFR_NUMERIC Day
;
235 } FRAMEWORK_EFI_IFR_DATE
;
238 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
239 UINT16 QuestionId
;///< The ID designating what the question is about...
240 UINT8 Width
; ///< The Size of the Data being saved.
241 STRING_REF Prompt
; ///< The String Token for the Prompt.
242 STRING_REF Help
; ///< The string Token for the context-help.
243 UINT8 Flags
; ///< This is included solely for purposes of interactive/dynamic support.
244 UINT16 Key
; ///< The value to be passed to caller to identify this particular op-code.
245 UINT8 MinSize
; ///< Minimum allowable sized password.
246 UINT8 MaxSize
; ///< Maximum allowable sized password.
248 } FRAMEWORK_EFI_IFR_PASSWORD
;
251 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
252 UINT16 QuestionId
; ///< The ID designating what the question is about...
253 UINT8 Width
; ///< The Size of the Data being saved.
254 STRING_REF Prompt
; ///< The String Token for the Prompt.
255 STRING_REF Help
; ///< The string Token for the context-help.
256 UINT8 Flags
; ///< This is included solely for purposes of interactive/dynamic support.
257 UINT16 Key
; ///< The value to be passed to caller to identify this particular op-code.
258 UINT8 MinSize
; ///< Minimum allowable sized password.
259 UINT8 MaxSize
; ///< Maximum allowable sized password.
260 } FRAMEWORK_EFI_IFR_STRING
;
263 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
264 } EFI_IFR_END_ONE_OF
;
267 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
273 /// Inconsistent with specification here:
274 /// The following defintion may not comply with Framework Specification HII 0.92. To
275 /// keep the inconsistant is for implementation needed.
278 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
283 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
288 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
291 } EFI_IFR_INCONSISTENT
;
294 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
295 UINT16 QuestionId
; ///< The offset into variable storage.
296 UINT8 Width
; ///< The size of variable storage.
297 UINT16 Value
; ///< The value to compare against.
298 } FRAMEWORK_EFI_IFR_EQ_ID_VAL
;
301 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
302 UINT16 QuestionId
; ///< The offset into variable storage.
303 UINT8 Width
; ///< The size of variable storage.
306 } FRAMEWORK_EFI_IFR_EQ_ID_LIST
;
309 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
310 UINT16 QuestionId1
; ///< The offset into variable storage for first value to compare.
311 UINT8 Width
; ///< The size of variable storage (must be same for both).
312 UINT16 QuestionId2
; ///< The offset into variable storage for second value to compare.
313 } FRAMEWORK_EFI_IFR_EQ_ID_ID
;
316 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
317 UINT16 VariableId
; ///< The offset into variable storage.
318 UINT16 Value
; ///< The value to compare against.
319 } EFI_IFR_EQ_VAR_VAL
;
323 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
324 } FRAMEWORK_EFI_IFR_AND
;
327 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
328 } FRAMEWORK_EFI_IFR_OR
;
331 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
332 } FRAMEWORK_EFI_IFR_NOT
;
335 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
336 } EFI_IFR_END_EXPR
, EFI_IFR_END_IF
;
339 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
345 } EFI_IFR_SAVE_DEFAULTS
;
348 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
351 STRING_REF TextTwo
; ///< Optional text.
355 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
356 EFI_GUID Guid
; ///< GUID for the variable.
357 UINT16 VarId
; ///< The variable store ID, as referenced elsewhere in the form.
358 UINT16 Size
; ///< The size of the variable storage.
359 } FRAMEWORK_EFI_IFR_VARSTORE
;
362 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
363 UINT16 VarId
; ///< The variable store ID, as referenced elsewhere in the form.
364 } EFI_IFR_VARSTORE_SELECT
;
367 /// Used for the ideqid VFR statement where two variable stores may be referenced in the
368 /// same VFR statement.
369 /// A browser should treat this as an FRAMEWORK_EFI_IFR_VARSTORE_SELECT statement and assume that all following
370 /// IFR opcodes use the VarId as defined here.
373 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
374 UINT16 VarId
; ///< The variable store ID, as referenced elsewhere in the form.
375 UINT16 SecondaryVarId
; ///< The variable store ID, as referenced elsewhere in the form.
376 } EFI_IFR_VARSTORE_SELECT_PAIR
;
379 /// Save defaults and restore defaults have same structure.
381 #define EFI_IFR_RESTORE_DEFAULTS EFI_IFR_SAVE_DEFAULTS
384 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
385 STRING_REF Title
; ///< The string token for the banner title.
386 UINT16 LineNumber
; ///< 1-based line number.
387 UINT8 Alignment
; ///< Left, center, or right-aligned.
390 #define EFI_IFR_BANNER_ALIGN_LEFT 0
391 #define EFI_IFR_BANNER_ALIGN_CENTER 1
392 #define EFI_IFR_BANNER_ALIGN_RIGHT 2
393 #define EFI_IFR_BANNER_TIMEOUT 0xFF