3 This file defines the encoding for the VFR (Visual Form Representation) language.
4 IFR is primarily consumed by the EFI presentation engine, and produced by EFI
5 internal application and drivers as well as all add-in card option-ROM drivers
7 Copyright (c) 2006 - 2007, Intel Corporation
8 All rights reserved. This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 @par Revision Reference:
17 These definitions are from UEFI2.1.
21 #ifndef __UEFI_INTERNAL_FORMREPRESENTATION_H__
22 #define __UEFI_INTERNAL_FORMREPRESENTATION_H__
25 // The following types are currently defined:
27 typedef UINT32 RELOFST
;
29 typedef CHAR16
*EFI_STRING
;
30 typedef UINT16 EFI_IMAGE_ID
;
31 typedef UINT16 EFI_QUESTION_ID
;
32 typedef UINT16 EFI_STRING_ID
;
33 typedef UINT16 EFI_FORM_ID
;
34 typedef UINT16 EFI_VARSTORE_ID
;
40 #define EFI_IFR_FORM_OP 0x01
41 #define EFI_IFR_SUBTITLE_OP 0x02
42 #define EFI_IFR_TEXT_OP 0x03
43 #define EFI_IFR_GRAPHIC_OP 0x04
44 #define EFI_IFR_ONE_OF_OP 0x05
45 #define EFI_IFR_CHECKBOX_OP 0x06
46 #define EFI_IFR_NUMERIC_OP 0x07
47 #define EFI_IFR_PASSWORD_OP 0x08
48 #define EFI_IFR_ONE_OF_OPTION_OP 0x09 // ONEOF OPTION field
49 #define EFI_IFR_SUPPRESS_IF_OP 0x0A
50 #define EFI_IFR_END_FORM_OP 0x0B
51 #define EFI_IFR_HIDDEN_OP 0x0C
52 #define EFI_IFR_END_FORM_SET_OP 0x0D
53 #define EFI_IFR_FORM_SET_OP 0x0E
54 #define EFI_IFR_REF_OP 0x0F
55 #define EFI_IFR_END_ONE_OF_OP 0x10
56 #define EFI_IFR_END_OP EFI_IFR_END_ONE_OF_OP
57 #define EFI_IFR_INCONSISTENT_IF_OP 0x11
58 #define EFI_IFR_EQ_ID_VAL_OP 0x12
59 #define EFI_IFR_EQ_ID_ID_OP 0x13
60 #define EFI_IFR_EQ_ID_LIST_OP 0x14
61 #define EFI_IFR_AND_OP 0x15
62 #define EFI_IFR_OR_OP 0x16
63 #define EFI_IFR_NOT_OP 0x17
64 #define EFI_IFR_END_IF_OP 0x18 // for endif of inconsistentif, suppressif, grayoutif
65 #define EFI_IFR_GRAYOUT_IF_OP 0x19
66 #define EFI_IFR_DATE_OP 0x1A
67 #define EFI_IFR_TIME_OP 0x1B
68 #define EFI_IFR_STRING_OP 0x1C
69 #define EFI_IFR_LABEL_OP 0x1D
70 #define EFI_IFR_SAVE_DEFAULTS_OP 0x1E
71 #define EFI_IFR_RESTORE_DEFAULTS_OP 0x1F
72 #define EFI_IFR_BANNER_OP 0x20
73 #define EFI_IFR_INVENTORY_OP 0x21
74 #define EFI_IFR_EQ_VAR_VAL_OP 0x22
75 #define EFI_IFR_ORDERED_LIST_OP 0x23
76 #define EFI_IFR_VARSTORE_OP 0x24
77 #define EFI_IFR_VARSTORE_SELECT_OP 0x25
78 #define EFI_IFR_VARSTORE_SELECT_PAIR_OP 0x26
79 #define EFI_IFR_TRUE_OP 0x27
80 #define EFI_IFR_FALSE_OP 0x28
81 #define EFI_IFR_GT_OP 0x29
82 #define EFI_IFR_GE_OP 0x2A
83 #define EFI_IFR_OEM_DEFINED_OP 0x2B
84 #define EFI_IFR_LAST_OPCODE EFI_IFR_OEM_DEFINED_OP
85 #define EFI_IFR_OEM_OP 0xFE
86 #define EFI_IFR_NV_ACCESS_COMMAND 0xFF
89 // Define values for the flags fields in some VFR opcodes. These are
92 #define EFI_IFR_FLAG_DEFAULT 0x01
93 #define EFI_IFR_FLAG_MANUFACTURING 0x02
94 #define EFI_IFR_FLAG_INTERACTIVE 0x04
95 #define EFI_IFR_FLAG_NV_ACCESS 0x08
96 #define EFI_IFR_FLAG_RESET_REQUIRED 0x10
97 #define EFI_IFR_FLAG_LATE_CHECK 0x20
99 #define EFI_NON_DEVICE_CLASS 0x00 // Useful when you do not want something in the Device Manager
100 #define EFI_DISK_DEVICE_CLASS 0x01
101 #define EFI_VIDEO_DEVICE_CLASS 0x02
102 #define EFI_NETWORK_DEVICE_CLASS 0x04
103 #define EFI_INPUT_DEVICE_CLASS 0x08
104 #define EFI_ON_BOARD_DEVICE_CLASS 0x10
105 #define EFI_OTHER_DEVICE_CLASS 0x20
107 #define EFI_SETUP_APPLICATION_SUBCLASS 0x00
108 #define EFI_GENERAL_APPLICATION_SUBCLASS 0x01
109 #define EFI_FRONT_PAGE_SUBCLASS 0x02
110 #define EFI_SINGLE_USE_SUBCLASS 0x03 // Used to display a single entity and then exit
113 // Used to flag dynamically created op-codes. This is meaningful to the IFR Library set
114 // and the browser since we need to distinguish between compiled NV map data and created data.
115 // We do not allow new entries to be created in the NV map dynamically however we still need
116 // to display this information correctly. To dynamically create op-codes and assume that their
117 // data will be saved, ensure that the NV starting location they refer to is pre-defined in the
120 #define EFI_IFR_FLAG_CREATED 128
124 // IFR Structure definitions
132 EFI_IFR_OP_HEADER Header
;
134 STRING_REF FormSetTitle
;
136 EFI_PHYSICAL_ADDRESS CallbackHandle
;
139 UINT16 NvDataSize
; // set once, size of the NV data as defined in the script
143 EFI_IFR_OP_HEADER Header
;
145 STRING_REF FormTitle
;
149 EFI_IFR_OP_HEADER Header
;
154 EFI_IFR_OP_HEADER Header
;
159 EFI_IFR_OP_HEADER Header
;
163 UINT8 Flags
; // This is included solely for purposes of interactive/dynamic support.
164 UINT16 Key
; // Value to be passed to caller to identify this particular op-code
171 EFI_IFR_OP_HEADER Header
;
174 STRING_REF Help
; // The string Token for the context-help
175 UINT8 Flags
; // This is included solely for purposes of interactive/dynamic support.
176 UINT16 Key
; // Value to be passed to caller to identify this particular op-code
180 EFI_IFR_OP_HEADER Header
;
184 EFI_IFR_OP_HEADER Header
;
185 } EFI_IFR_END_FORM_SET
;
188 // Also notice that the IFR_ONE_OF and IFR_CHECK_BOX are identical in structure......code assumes this to be true, if this ever
189 // changes we need to revisit the InitializeTagStructures code
192 EFI_IFR_OP_HEADER Header
;
193 UINT16 QuestionId
; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
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
200 EFI_IFR_OP_HEADER Header
;
201 UINT16 QuestionId
; // The offset in NV for storage of the data
202 UINT8 MaxEntries
; // The maximum number of options in the ordered list (=size of NVStore)
203 STRING_REF Prompt
; // The string token for the prompt
204 STRING_REF Help
; // The string token for the context-help
205 } EFI_IFR_ORDERED_LIST
;
208 EFI_IFR_OP_HEADER Header
;
209 UINT16 QuestionId
; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
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
; // For now, if non-zero, means that it is the default option, - further definition likely
214 UINT16 Key
; // Value to be passed to caller to identify this particular op-code
215 } EFI_IFR_CHECKBOX
, EFI_IFR_CHECK_BOX
;
218 EFI_IFR_OP_HEADER Header
;
219 STRING_REF Option
; // The string token describing the option
220 UINT16 Value
; // The value associated with this option that is stored in the NVRAM if chosen
221 UINT8 Flags
; // For now, if non-zero, means that it is the default option, - further definition likely above
222 UINT16 Key
; // Value to be passed to caller to identify this particular op-code
223 } EFI_IFR_ONE_OF_OPTION
;
226 EFI_IFR_OP_HEADER Header
;
227 UINT16 QuestionId
; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
228 UINT8 Width
; // The Size of the Data being saved
229 STRING_REF Prompt
; // The String Token for the Prompt
230 STRING_REF Help
; // The string Token for the context-help
231 UINT8 Flags
; // This is included solely for purposes of interactive/dynamic support.
232 UINT16 Key
; // Value to be passed to caller to identify this particular op-code
235 UINT16 Step
; // If step is 0, then manual input is specified, otherwise, left/right arrow selection is called for
240 // There is an interesting twist with regards to Time and Date. This is one of the few items which can accept input from
241 // a user, however may or may not need to use storage in the NVRAM space. The decided method for determining if NVRAM space
242 // will be used (only for a TimeOp or DateOp) is: If .QuestionId == 0 && .Width == 0 (normally an impossibility) then use system
243 // resources to store the data away and not NV resources. In other words, the setup engine will call gRT->SetTime, and gRT->SetDate
244 // for the saving of data, and the values displayed will be from the gRT->GetXXXX series of calls.
247 EFI_IFR_NUMERIC Hour
;
248 EFI_IFR_NUMERIC Minute
;
249 EFI_IFR_NUMERIC Second
;
253 EFI_IFR_NUMERIC Year
;
254 EFI_IFR_NUMERIC Month
;
259 EFI_IFR_OP_HEADER Header
;
260 UINT16 QuestionId
; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
261 UINT8 Width
; // The Size of the Data being saved -- BUGBUG -- remove someday
262 STRING_REF Prompt
; // The String Token for the Prompt
263 STRING_REF Help
; // The string Token for the context-help
264 UINT8 Flags
; // This is included solely for purposes of interactive/dynamic support.
265 UINT16 Key
; // Value to be passed to caller to identify this particular op-code
266 UINT8 MinSize
; // Minimum allowable sized password
267 UINT8 MaxSize
; // Maximum allowable sized password
272 EFI_IFR_OP_HEADER Header
;
273 UINT16 QuestionId
; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
274 UINT8 Width
; // The Size of the Data being saved -- BUGBUG -- remove someday
275 STRING_REF Prompt
; // The String Token for the Prompt
276 STRING_REF Help
; // The string Token for the context-help
277 UINT8 Flags
; // This is included solely for purposes of interactive/dynamic support.
278 UINT16 Key
; // Value to be passed to caller to identify this particular op-code
279 UINT8 MinSize
; // Minimum allowable sized password
280 UINT8 MaxSize
; // Maximum allowable sized password
284 EFI_IFR_OP_HEADER Header
;
285 } EFI_IFR_END_ONE_OF
;
288 EFI_IFR_OP_HEADER Header
;
294 EFI_IFR_OP_HEADER Header
;
299 EFI_IFR_OP_HEADER Header
;
304 EFI_IFR_OP_HEADER Header
;
307 } EFI_IFR_INCONSISTENT
;
310 EFI_IFR_OP_HEADER Header
;
311 UINT16 QuestionId
; // offset into variable storage
312 UINT8 Width
; // size of variable storage
313 UINT16 Value
; // value to compare against
317 EFI_IFR_OP_HEADER Header
;
318 UINT16 QuestionId
; // offset into variable storage
319 UINT8 Width
; // size of variable storage
322 } EFI_IFR_EQ_ID_LIST
;
325 EFI_IFR_OP_HEADER Header
;
326 UINT16 QuestionId1
; // offset into variable storage for first value to compare
327 UINT8 Width
; // size of variable storage (must be same for both)
328 UINT16 QuestionId2
; // offset into variable storage for second value to compare
332 EFI_IFR_OP_HEADER Header
;
333 UINT16 VariableId
; // offset into variable storage
334 UINT16 Value
; // value to compare against
335 } EFI_IFR_EQ_VAR_VAL
;
338 EFI_IFR_OP_HEADER Header
;
342 EFI_IFR_OP_HEADER Header
;
346 EFI_IFR_OP_HEADER Header
;
350 EFI_IFR_OP_HEADER Header
;
351 } EFI_IFR_END_EXPR
, EFI_IFR_END_IF
;
354 EFI_IFR_OP_HEADER Header
;
360 } EFI_IFR_SAVE_DEFAULTS
;
363 EFI_IFR_OP_HEADER Header
;
366 STRING_REF TextTwo
; // optional text
370 EFI_IFR_OP_HEADER Header
;
371 EFI_GUID Guid
; // GUID for the variable
372 UINT16 VarId
; // variable store ID, as referenced elsewhere in the form
373 UINT16 Size
; // size of the variable storage
377 EFI_IFR_OP_HEADER Header
;
378 UINT16 VarId
; // variable store ID, as referenced elsewhere in the form
379 } EFI_IFR_VARSTORE_SELECT
;
382 // Used for the ideqid VFR statement where two variable stores may be referenced in the
383 // same VFR statement.
384 // A browser should treat this as an EFI_IFR_VARSTORE_SELECT statement and assume that all following
385 // IFR opcodes use the VarId as defined here.
388 EFI_IFR_OP_HEADER Header
;
389 UINT16 VarId
; // variable store ID, as referenced elsewhere in the form
390 UINT16 SecondaryVarId
; // variable store ID, as referenced elsewhere in the form
391 } EFI_IFR_VARSTORE_SELECT_PAIR
;
394 EFI_IFR_OP_HEADER Header
;
398 EFI_IFR_OP_HEADER Header
;
402 EFI_IFR_OP_HEADER Header
;
406 EFI_IFR_OP_HEADER Header
;
410 // Save defaults and restore defaults have same structure
412 #define EFI_IFR_RESTORE_DEFAULTS EFI_IFR_SAVE_DEFAULTS
415 EFI_IFR_OP_HEADER Header
;
416 STRING_REF Title
; // The string token for the banner title
417 UINT16 LineNumber
; // 1-based line number
418 UINT8 Alignment
; // left, center, or right-aligned
421 #define EFI_IFR_BANNER_ALIGN_LEFT 0
422 #define EFI_IFR_BANNER_ALIGN_CENTER 1
423 #define EFI_IFR_BANNER_ALIGN_RIGHT 2
424 #define EFI_IFR_BANNER_TIMEOUT 0xFF