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 - 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
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.
15 @par Revision Reference:
16 These definitions are from Framework Specification HII 0.92.
20 #ifndef __FRAMEWORK_INTERNAL_FORMREPRESENTATION_H__
21 #define __FRAMEWORK_INTERNAL_FORMREPRESENTATION_H__
23 typedef UINT16 STRING_REF
;
28 #define FRAMEWORK_EFI_IFR_FORM_OP 0x01
29 #define FRAMEWORK_EFI_IFR_SUBTITLE_OP 0x02
30 #define FRAMEWORK_EFI_IFR_TEXT_OP 0x03
31 #define EFI_IFR_GRAPHIC_OP 0x04
32 #define FRAMEWORK_EFI_IFR_ONE_OF_OP 0x05
33 #define FRAMEWORK_EFI_IFR_CHECKBOX_OP 0x06
34 #define FRAMEWORK_EFI_IFR_NUMERIC_OP 0x07
35 #define FRAMEWORK_EFI_IFR_PASSWORD_OP 0x08
36 #define FRAMEWORK_EFI_IFR_ONE_OF_OPTION_OP 0x09 ///< ONEOF OPTION field
37 #define FRAMEWORK_EFI_IFR_SUPPRESS_IF_OP 0x0A
38 #define EFI_IFR_END_FORM_OP 0x0B
39 #define EFI_IFR_HIDDEN_OP 0x0C
40 #define EFI_IFR_END_FORM_SET_OP 0x0D
41 #define FRAMEWORK_EFI_IFR_FORM_SET_OP 0x0E
42 #define FRAMEWORK_EFI_IFR_REF_OP 0x0F
43 #define EFI_IFR_END_ONE_OF_OP 0x10
44 #define FRAMEWORK_EFI_IFR_END_OP EFI_IFR_END_ONE_OF_OP
45 #define FRAMEWORK_EFI_IFR_INCONSISTENT_IF_OP 0x11
46 #define FRAMEWORK_EFI_IFR_EQ_ID_VAL_OP 0x12
47 #define FRAMEWORK_EFI_IFR_EQ_ID_ID_OP 0x13
48 #define FRAMEWORK_EFI_IFR_EQ_ID_LIST_OP 0x14
49 #define FRAMEWORK_EFI_IFR_AND_OP 0x15
50 #define FRAMEWORK_EFI_IFR_OR_OP 0x16
51 #define FRAMEWORK_EFI_IFR_NOT_OP 0x17
52 #define EFI_IFR_END_IF_OP 0x18 ///< for endif of inconsistentif, suppressif, grayoutif
53 #define EFI_IFR_GRAYOUT_IF_OP 0x19
54 #define FRAMEWORK_EFI_IFR_DATE_OP 0x1A
55 #define FRAMEWORK_EFI_IFR_TIME_OP 0x1B
56 #define FRAMEWORK_EFI_IFR_STRING_OP 0x1C
57 #define EFI_IFR_LABEL_OP 0x1D
58 #define EFI_IFR_SAVE_DEFAULTS_OP 0x1E
59 #define EFI_IFR_RESTORE_DEFAULTS_OP 0x1F
60 #define EFI_IFR_BANNER_OP 0x20
61 #define EFI_IFR_INVENTORY_OP 0x21
62 #define EFI_IFR_EQ_VAR_VAL_OP 0x22
63 #define FRAMEWORK_EFI_IFR_ORDERED_LIST_OP 0x23
64 #define FRAMEWORK_EFI_IFR_VARSTORE_OP 0x24
65 #define EFI_IFR_VARSTORE_SELECT_OP 0x25
66 #define EFI_IFR_VARSTORE_SELECT_PAIR_OP 0x26
67 #define EFI_IFR_LAST_OPCODE EFI_IFR_VARSTORE_SELECT_PAIR_OP
68 #define EFI_IFR_OEM_OP 0xFE
69 #define EFI_IFR_NV_ACCESS_COMMAND 0xFF
72 // Define values for the flags fields in some VFR opcodes. These are
75 #define EFI_IFR_FLAG_DEFAULT 0x01
76 #define EFI_IFR_FLAG_MANUFACTURING 0x02
77 #define EFI_IFR_FLAG_INTERACTIVE 0x04
78 #define EFI_IFR_FLAG_NV_ACCESS 0x08
79 #define EFI_IFR_FLAG_RESET_REQUIRED 0x10
80 #define EFI_IFR_FLAG_LATE_CHECK 0x20
82 #define EFI_NON_DEVICE_CLASS 0x00 ///< Useful when you do not want something in the Device Manager
83 #define EFI_DISK_DEVICE_CLASS 0x01
84 #define EFI_VIDEO_DEVICE_CLASS 0x02
85 #define EFI_NETWORK_DEVICE_CLASS 0x04
86 #define EFI_INPUT_DEVICE_CLASS 0x08
87 #define EFI_ON_BOARD_DEVICE_CLASS 0x10
88 #define EFI_OTHER_DEVICE_CLASS 0x20
90 #define EFI_SETUP_APPLICATION_SUBCLASS 0x00
91 #define EFI_GENERAL_APPLICATION_SUBCLASS 0x01
92 #define EFI_FRONT_PAGE_SUBCLASS 0x02
93 #define EFI_SINGLE_USE_SUBCLASS 0x03 ///< Used to display a single entity and then exit
96 /// Used to flag dynamically created op-codes. This is meaningful to the IFR Library set
97 /// and the browser since we need to distinguish between compiled NV map data and created data.
98 /// We do not allow new entries to be created in the NV map dynamically however we still need
99 /// to display this information correctly. To dynamically create op-codes and assume that their
100 /// data will be saved, ensure that the NV starting location they refer to is pre-defined in the
103 #define EFI_IFR_FLAG_CREATED 128
108 // IFR Structure definitions
113 } FRAMEWORK_EFI_IFR_OP_HEADER
;
116 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
118 STRING_REF FormSetTitle
;
120 EFI_PHYSICAL_ADDRESS CallbackHandle
;
123 UINT16 NvDataSize
; ///< set once, size of the NV data as defined in the script
124 } FRAMEWORK_EFI_IFR_FORM_SET
;
127 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
129 STRING_REF FormTitle
;
130 } FRAMEWORK_EFI_IFR_FORM
;
133 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
138 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
140 } FRAMEWORK_EFI_IFR_SUBTITLE
;
143 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
147 UINT8 Flags
; ///< This is included solely for purposes of interactive/dynamic support.
148 UINT16 Key
; ///< Value to be passed to caller to identify this particular op-code
149 } FRAMEWORK_EFI_IFR_TEXT
;
155 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
158 STRING_REF Help
; ///< The string Token for the context-help
159 UINT8 Flags
; ///< This is included solely for purposes of interactive/dynamic support.
160 UINT16 Key
; ///< Value to be passed to caller to identify this particular op-code
161 } FRAMEWORK_EFI_IFR_REF
;
164 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
168 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
169 } EFI_IFR_END_FORM_SET
;
172 // Also notice that the IFR_ONE_OF and IFR_CHECK_BOX are identical in structure......
173 // code assumes this to be true, if this ever changes we need to revisit the InitializeTagStructures code
176 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
177 UINT16 QuestionId
; ///< The ID designating what the question is about...
178 UINT8 Width
; ///< The Size of the Data being saved
179 STRING_REF Prompt
; ///< The String Token for the Prompt
180 STRING_REF Help
; ///< The string Token for the context-help
181 } FRAMEWORK_EFI_IFR_ONE_OF
;
184 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
185 UINT16 QuestionId
; ///< The offset in NV for storage of the data
186 UINT8 MaxEntries
; ///< The maximum number of options in the ordered list (=size of NVStore)
187 STRING_REF Prompt
; ///< The string token for the prompt
188 STRING_REF Help
; ///< The string token for the context-help
189 } FRAMEWORK_EFI_IFR_ORDERED_LIST
;
192 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
193 UINT16 QuestionId
; ///< The ID designating what the question is about...
194 UINT8 Width
; ///< The Size of the Data being saved
195 STRING_REF Prompt
; ///< The String Token for the Prompt
196 STRING_REF Help
; ///< The string Token for the context-help
197 UINT8 Flags
; ///< If non-zero, means that it is the default option
198 UINT16 Key
; ///< Value to be passed to caller to identify this particular op-code
199 } FRAMEWORK_EFI_IFR_CHECKBOX
, EFI_IFR_CHECK_BOX
;
202 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
203 STRING_REF Option
; ///< The string token describing the option
204 UINT16 Value
; ///< The value associated with this option that is stored in the NVRAM
205 UINT8 Flags
; ///< If non-zero, means that it is the default option
206 UINT16 Key
; ///< Value to be passed to caller to identify this particular op-code
207 } FRAMEWORK_EFI_IFR_ONE_OF_OPTION
;
210 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
211 UINT16 QuestionId
; ///< The ID designating what the question is about...
212 UINT8 Width
; ///< The Size of the Data being saved
213 STRING_REF Prompt
; ///< The String Token for the Prompt
214 STRING_REF Help
; ///< The string Token for the context-help
215 UINT8 Flags
; ///< This is included solely for purposes of interactive/dynamic support.
216 UINT16 Key
; ///< Value to be passed to caller to identify this particular op-code
219 UINT16 Step
; ///< Zero means manual input, otherwise, arrow selection is called for
221 } FRAMEWORK_EFI_IFR_NUMERIC
;
224 // There is an interesting twist with regards to Time and Date. This is one of the few items which can accept input
225 // from a user, however may or may not need to use storage in the NVRAM space. The decided method for determining
226 // if NVRAM space will be used (only for a TimeOp or DateOp) is: If .QuestionId == 0 && .Width == 0 (normally an
227 // impossibility) then use system resources to store the data away and not NV resources. In other words, the setup
228 // engine will call gRT->SetTime, and gRT->SetDate for the saving of data, and the values displayed will be from the
229 // gRT->GetXXXX series of calls.
232 FRAMEWORK_EFI_IFR_NUMERIC Hour
;
233 FRAMEWORK_EFI_IFR_NUMERIC Minute
;
234 FRAMEWORK_EFI_IFR_NUMERIC Second
;
235 } FRAMEWORK_EFI_IFR_TIME
;
238 FRAMEWORK_EFI_IFR_NUMERIC Year
;
239 FRAMEWORK_EFI_IFR_NUMERIC Month
;
240 FRAMEWORK_EFI_IFR_NUMERIC Day
;
241 } FRAMEWORK_EFI_IFR_DATE
;
244 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
245 UINT16 QuestionId
;///< The ID designating what the question is about...
246 UINT8 Width
; ///< The Size of the Data being saved
247 STRING_REF Prompt
; ///< The String Token for the Prompt
248 STRING_REF Help
; ///< The string Token for the context-help
249 UINT8 Flags
; ///< This is included solely for purposes of interactive/dynamic support.
250 UINT16 Key
; ///< Value to be passed to caller to identify this particular op-code
251 UINT8 MinSize
; ///< Minimum allowable sized password
252 UINT8 MaxSize
; ///< Maximum allowable sized password
254 } FRAMEWORK_EFI_IFR_PASSWORD
;
257 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
258 UINT16 QuestionId
; ///< The ID designating what the question is about...
259 UINT8 Width
; ///< The Size of the Data being saved
260 STRING_REF Prompt
; ///< The String Token for the Prompt
261 STRING_REF Help
; ///< The string Token for the context-help
262 UINT8 Flags
; ///< This is included solely for purposes of interactive/dynamic support.
263 UINT16 Key
; ///< Value to be passed to caller to identify this particular op-code
264 UINT8 MinSize
; ///< Minimum allowable sized password
265 UINT8 MaxSize
; ///< Maximum allowable sized password
266 } FRAMEWORK_EFI_IFR_STRING
;
269 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
270 } EFI_IFR_END_ONE_OF
;
273 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
279 /// Inconsistent with specification here:
280 /// Following defintion may not comply with Framework Specification HII 0.92. To
281 /// keep the inconsistant is for implementation needed.
284 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
289 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
294 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
297 } EFI_IFR_INCONSISTENT
;
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
;
307 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
308 UINT16 QuestionId
; ///< offset into variable storage
309 UINT8 Width
; ///< size of variable storage
312 } FRAMEWORK_EFI_IFR_EQ_ID_LIST
;
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
;
322 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
323 UINT16 VariableId
; ///< offset into variable storage
324 UINT16 Value
; ///< value to compare against
325 } EFI_IFR_EQ_VAR_VAL
;
328 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
329 } FRAMEWORK_EFI_IFR_AND
;
332 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
333 } FRAMEWORK_EFI_IFR_OR
;
336 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
337 } FRAMEWORK_EFI_IFR_NOT
;
340 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
341 } EFI_IFR_END_EXPR
, EFI_IFR_END_IF
;
344 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
350 } EFI_IFR_SAVE_DEFAULTS
;
353 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
356 STRING_REF TextTwo
; ///< optional text
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
;
367 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
368 UINT16 VarId
; ///< variable store ID, as referenced elsewhere in the form
369 } EFI_IFR_VARSTORE_SELECT
;
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.
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 } EFI_IFR_VARSTORE_SELECT_PAIR
;
384 /// Save defaults and restore defaults have same structure
386 #define EFI_IFR_RESTORE_DEFAULTS EFI_IFR_SAVE_DEFAULTS
389 FRAMEWORK_EFI_IFR_OP_HEADER Header
;
390 STRING_REF Title
; ///< The string token for the banner title
391 UINT16 LineNumber
; ///< 1-based line number
392 UINT8 Alignment
; ///< left, center, or right-aligned
395 #define EFI_IFR_BANNER_ALIGN_LEFT 0
396 #define EFI_IFR_BANNER_ALIGN_CENTER 1
397 #define EFI_IFR_BANNER_ALIGN_RIGHT 2
398 #define EFI_IFR_BANNER_TIMEOUT 0xFF