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
101 // IFR Structure definitions
106 } FRAMEWORK_EFI_IFR_OP_HEADER
;
109 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
111 STRING_REF FormSetTitle
;
113 EFI_PHYSICAL_ADDRESS CallbackHandle
;
116 UINT16 NvDataSize
; ///< Set once; the size of the NV data as defined in the script.
117 } FRAMEWORK_EFI_IFR_FORM_SET
;
120 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
122 STRING_REF FormTitle
;
123 } FRAMEWORK_EFI_IFR_FORM
;
126 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
131 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
133 } FRAMEWORK_EFI_IFR_SUBTITLE
;
136 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
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
;
148 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
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
;
157 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
161 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
162 } EFI_IFR_END_FORM_SET
;
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
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
;
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
;
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
;
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
;
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.
212 UINT16 Step
; ///< Zero means manual input. Otherwise, arrow selection is called for.
214 } FRAMEWORK_EFI_IFR_NUMERIC
;
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.
225 FRAMEWORK_EFI_IFR_NUMERIC Hour
;
226 FRAMEWORK_EFI_IFR_NUMERIC Minute
;
227 FRAMEWORK_EFI_IFR_NUMERIC Second
;
228 } FRAMEWORK_EFI_IFR_TIME
;
231 FRAMEWORK_EFI_IFR_NUMERIC Year
;
232 FRAMEWORK_EFI_IFR_NUMERIC Month
;
233 FRAMEWORK_EFI_IFR_NUMERIC Day
;
234 } FRAMEWORK_EFI_IFR_DATE
;
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.
247 } FRAMEWORK_EFI_IFR_PASSWORD
;
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
;
262 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
263 } EFI_IFR_END_ONE_OF
;
266 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
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.
277 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
282 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
287 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
290 } EFI_IFR_INCONSISTENT
;
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
;
300 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
301 UINT16 QuestionId
; ///< The offset into variable storage.
302 UINT8 Width
; ///< The size of variable storage.
305 } FRAMEWORK_EFI_IFR_EQ_ID_LIST
;
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
;
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
;
322 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
323 } FRAMEWORK_EFI_IFR_AND
;
326 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
327 } FRAMEWORK_EFI_IFR_OR
;
330 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
331 } FRAMEWORK_EFI_IFR_NOT
;
334 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
335 } EFI_IFR_END_EXPR
, EFI_IFR_END_IF
;
338 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
344 } EFI_IFR_SAVE_DEFAULTS
;
347 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
350 STRING_REF TextTwo
; ///< Optional text.
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
;
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
;
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.
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
;
378 /// Save defaults and restore defaults have same structure.
380 #define EFI_IFR_RESTORE_DEFAULTS EFI_IFR_SAVE_DEFAULTS
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.
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