2 This file defines the encoding for the VFR (Visual Form Representation) language.
3 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) 2006, 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 Module Name: InternalFormRepresentation.h
17 @par Revision Reference:
18 These definitions are from Human Interface Infrastructure Spec Version 0.92.
22 #ifndef __EFI_INTERNAL_FORM_REPRESENTATION_H__
23 #define __EFI_INTERNAL_FORM_REPRESENTATION_H__
26 // The following types are currently defined:
28 typedef UINT32 RELOFST
;
29 typedef CHAR16
*EFI_STRING
;
34 #define EFI_IFR_FORM_OP 0x01
35 #define EFI_IFR_SUBTITLE_OP 0x02
36 #define EFI_IFR_TEXT_OP 0x03
37 #define EFI_IFR_GRAPHIC_OP 0x04
38 #define EFI_IFR_ONE_OF_OP 0x05
39 #define EFI_IFR_CHECKBOX_OP 0x06
40 #define EFI_IFR_NUMERIC_OP 0x07
41 #define EFI_IFR_PASSWORD_OP 0x08
42 #define EFI_IFR_ONE_OF_OPTION_OP 0x09 // ONEOF OPTION field
43 #define EFI_IFR_SUPPRESS_IF_OP 0x0A
44 #define EFI_IFR_END_FORM_OP 0x0B
45 #define EFI_IFR_HIDDEN_OP 0x0C
46 #define EFI_IFR_END_FORM_SET_OP 0x0D
47 #define EFI_IFR_FORM_SET_OP 0x0E
48 #define EFI_IFR_REF_OP 0x0F
49 #define EFI_IFR_END_ONE_OF_OP 0x10
50 #define EFI_IFR_END_OP EFI_IFR_END_ONE_OF_OP
51 #define EFI_IFR_INCONSISTENT_IF_OP 0x11
52 #define EFI_IFR_EQ_ID_VAL_OP 0x12
53 #define EFI_IFR_EQ_ID_ID_OP 0x13
54 #define EFI_IFR_EQ_ID_LIST_OP 0x14
55 #define EFI_IFR_AND_OP 0x15
56 #define EFI_IFR_OR_OP 0x16
57 #define EFI_IFR_NOT_OP 0x17
58 #define EFI_IFR_END_IF_OP 0x18 // for endif of inconsistentif, suppressif, grayoutif
59 #define EFI_IFR_GRAYOUT_IF_OP 0x19
60 #define EFI_IFR_DATE_OP 0x1A
61 #define EFI_IFR_TIME_OP 0x1B
62 #define EFI_IFR_STRING_OP 0x1C
63 #define EFI_IFR_LABEL_OP 0x1D
64 #define EFI_IFR_SAVE_DEFAULTS_OP 0x1E
65 #define EFI_IFR_RESTORE_DEFAULTS_OP 0x1F
66 #define EFI_IFR_BANNER_OP 0x20
67 #define EFI_IFR_INVENTORY_OP 0x21
68 #define EFI_IFR_EQ_VAR_VAL_OP 0x22
69 #define EFI_IFR_ORDERED_LIST_OP 0x23
70 #define EFI_IFR_VARSTORE_OP 0x24
71 #define EFI_IFR_VARSTORE_SELECT_OP 0x25
72 #define EFI_IFR_VARSTORE_SELECT_PAIR_OP 0x26
73 #define EFI_IFR_TRUE_OP 0x27
74 #define EFI_IFR_FALSE_OP 0x28
75 #define EFI_IFR_GT_OP 0x29
76 #define EFI_IFR_GE_OP 0x2A
77 #define EFI_IFR_OEM_DEFINED_OP 0x2B
78 #define EFI_IFR_LAST_OPCODE EFI_IFR_OEM_DEFINED_OP
79 #define EFI_IFR_OEM_OP 0xFE
80 #define EFI_IFR_NV_ACCESS_COMMAND 0xFF
83 // Define values for the flags fields in some VFR opcodes. These are
86 #define EFI_IFR_FLAG_DEFAULT 0x01
87 #define EFI_IFR_FLAG_MANUFACTURING 0x02
88 #define EFI_IFR_FLAG_INTERACTIVE 0x04
89 #define EFI_IFR_FLAG_NV_ACCESS 0x08
90 #define EFI_IFR_FLAG_RESET_REQUIRED 0x10
91 #define EFI_IFR_FLAG_LATE_CHECK 0x20
93 #define EFI_NON_DEVICE_CLASS 0x00 // Useful when you do not want something in the Device Manager
94 #define EFI_DISK_DEVICE_CLASS 0x01
95 #define EFI_VIDEO_DEVICE_CLASS 0x02
96 #define EFI_NETWORK_DEVICE_CLASS 0x04
97 #define EFI_INPUT_DEVICE_CLASS 0x08
98 #define EFI_ON_BOARD_DEVICE_CLASS 0x10
99 #define EFI_OTHER_DEVICE_CLASS 0x20
101 #define EFI_SETUP_APPLICATION_SUBCLASS 0x00
102 #define EFI_GENERAL_APPLICATION_SUBCLASS 0x01
103 #define EFI_FRONT_PAGE_SUBCLASS 0x02
104 #define EFI_SINGLE_USE_SUBCLASS 0x03 // Used to display a single entity and then exit
107 // Used to flag dynamically created op-codes. This is meaningful to the IFR Library set
108 // and the browser since we need to distinguish between compiled NV map data and created data.
109 // We do not allow new entries to be created in the NV map dynamically however we still need
110 // to display this information correctly. To dynamically create op-codes and assume that their
111 // data will be saved, ensure that the NV starting location they refer to is pre-defined in the
114 #define EFI_IFR_FLAG_CREATED 128
118 // IFR Structure definitions
126 EFI_IFR_OP_HEADER Header
;
128 STRING_REF FormSetTitle
;
130 EFI_PHYSICAL_ADDRESS CallbackHandle
;
133 UINT16 NvDataSize
; // set once, size of the NV data as defined in the script
137 EFI_IFR_OP_HEADER Header
;
139 STRING_REF FormTitle
;
143 EFI_IFR_OP_HEADER Header
;
148 EFI_IFR_OP_HEADER Header
;
153 EFI_IFR_OP_HEADER Header
;
157 UINT8 Flags
; // This is included solely for purposes of interactive/dynamic support.
158 UINT16 Key
; // Value to be passed to caller to identify this particular op-code
165 EFI_IFR_OP_HEADER Header
;
168 STRING_REF Help
; // The string Token for the context-help
169 UINT8 Flags
; // This is included solely for purposes of interactive/dynamic support.
170 UINT16 Key
; // Value to be passed to caller to identify this particular op-code
174 EFI_IFR_OP_HEADER Header
;
178 EFI_IFR_OP_HEADER Header
;
179 } EFI_IFR_END_FORM_SET
;
182 // Also notice that the IFR_ONE_OF and IFR_CHECK_BOX are identical in structure......code assumes this to be true, if this ever
183 // changes we need to revisit the InitializeTagStructures code
186 EFI_IFR_OP_HEADER Header
;
187 UINT16 QuestionId
; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
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
194 EFI_IFR_OP_HEADER Header
;
195 UINT16 QuestionId
; // The offset in NV for storage of the data
196 UINT8 MaxEntries
; // The maximum number of options in the ordered list (=size of NVStore)
197 STRING_REF Prompt
; // The string token for the prompt
198 STRING_REF Help
; // The string token for the context-help
199 } EFI_IFR_ORDERED_LIST
;
202 EFI_IFR_OP_HEADER Header
;
203 UINT16 QuestionId
; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
204 UINT8 Width
; // The Size of the Data being saved
205 STRING_REF Prompt
; // The String Token for the Prompt
206 STRING_REF Help
; // The string Token for the context-help
207 UINT8 Flags
; // For now, if non-zero, means that it is the default option, - further definition likely
208 UINT16 Key
; // Value to be passed to caller to identify this particular op-code
209 } EFI_IFR_CHECKBOX
, EFI_IFR_CHECK_BOX
;
212 EFI_IFR_OP_HEADER Header
;
213 STRING_REF Option
; // The string token describing the option
214 UINT16 Value
; // The value associated with this option that is stored in the NVRAM if chosen
215 UINT8 Flags
; // For now, if non-zero, means that it is the default option, - further definition likely above
216 UINT16 Key
; // Value to be passed to caller to identify this particular op-code
217 } EFI_IFR_ONE_OF_OPTION
;
220 EFI_IFR_OP_HEADER Header
;
221 UINT16 QuestionId
; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
222 UINT8 Width
; // The Size of the Data being saved
223 STRING_REF Prompt
; // The String Token for the Prompt
224 STRING_REF Help
; // The string Token for the context-help
225 UINT8 Flags
; // This is included solely for purposes of interactive/dynamic support.
226 UINT16 Key
; // Value to be passed to caller to identify this particular op-code
229 UINT16 Step
; // If step is 0, then manual input is specified, otherwise, left/right arrow selection is called for
234 // There is an interesting twist with regards to Time and Date. This is one of the few items which can accept input from
235 // a user, however may or may not need to use storage in the NVRAM space. The decided method for determining if NVRAM space
236 // will be used (only for a TimeOp or DateOp) is: If .QuestionId == 0 && .Width == 0 (normally an impossibility) then use system
237 // resources to store the data away and not NV resources. In other words, the setup engine will call gRT->SetTime, and gRT->SetDate
238 // for the saving of data, and the values displayed will be from the gRT->GetXXXX series of calls.
241 EFI_IFR_NUMERIC Hour
;
242 EFI_IFR_NUMERIC Minute
;
243 EFI_IFR_NUMERIC Second
;
247 EFI_IFR_NUMERIC Year
;
248 EFI_IFR_NUMERIC Month
;
253 EFI_IFR_OP_HEADER Header
;
254 UINT16 QuestionId
; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
255 UINT8 Width
; // The Size of the Data being saved -- BUGBUG -- remove someday
256 STRING_REF Prompt
; // The String Token for the Prompt
257 STRING_REF Help
; // The string Token for the context-help
258 UINT8 Flags
; // This is included solely for purposes of interactive/dynamic support.
259 UINT16 Key
; // Value to be passed to caller to identify this particular op-code
260 UINT8 MinSize
; // Minimum allowable sized password
261 UINT8 MaxSize
; // Maximum allowable sized password
266 EFI_IFR_OP_HEADER Header
;
267 UINT16 QuestionId
; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
268 UINT8 Width
; // The Size of the Data being saved -- BUGBUG -- remove someday
269 STRING_REF Prompt
; // The String Token for the Prompt
270 STRING_REF Help
; // The string Token for the context-help
271 UINT8 Flags
; // This is included solely for purposes of interactive/dynamic support.
272 UINT16 Key
; // Value to be passed to caller to identify this particular op-code
273 UINT8 MinSize
; // Minimum allowable sized password
274 UINT8 MaxSize
; // Maximum allowable sized password
278 EFI_IFR_OP_HEADER Header
;
279 } EFI_IFR_END_ONE_OF
;
282 EFI_IFR_OP_HEADER Header
;
288 EFI_IFR_OP_HEADER Header
;
293 EFI_IFR_OP_HEADER Header
;
298 EFI_IFR_OP_HEADER Header
;
301 } EFI_IFR_INCONSISTENT
;
304 EFI_IFR_OP_HEADER Header
;
305 UINT16 QuestionId
; // offset into variable storage
306 UINT8 Width
; // size of variable storage
307 UINT16 Value
; // value to compare against
311 EFI_IFR_OP_HEADER Header
;
312 UINT16 QuestionId
; // offset into variable storage
313 UINT8 Width
; // size of variable storage
316 } EFI_IFR_EQ_ID_LIST
;
319 EFI_IFR_OP_HEADER Header
;
320 UINT16 QuestionId1
; // offset into variable storage for first value to compare
321 UINT8 Width
; // size of variable storage (must be same for both)
322 UINT16 QuestionId2
; // offset into variable storage for second value to compare
326 EFI_IFR_OP_HEADER Header
;
327 UINT16 VariableId
; // offset into variable storage
328 UINT16 Value
; // value to compare against
329 } EFI_IFR_EQ_VAR_VAL
;
332 EFI_IFR_OP_HEADER Header
;
336 EFI_IFR_OP_HEADER Header
;
340 EFI_IFR_OP_HEADER Header
;
344 EFI_IFR_OP_HEADER Header
;
345 } EFI_IFR_END_EXPR
, EFI_IFR_END_IF
;
348 EFI_IFR_OP_HEADER Header
;
354 } EFI_IFR_SAVE_DEFAULTS
;
357 EFI_IFR_OP_HEADER Header
;
360 STRING_REF TextTwo
; // optional text
364 EFI_IFR_OP_HEADER Header
;
365 EFI_GUID Guid
; // GUID for the variable
366 UINT16 VarId
; // variable store ID, as referenced elsewhere in the form
367 UINT16 Size
; // size of the variable storage
371 EFI_IFR_OP_HEADER Header
;
372 UINT16 VarId
; // variable store ID, as referenced elsewhere in the form
373 } EFI_IFR_VARSTORE_SELECT
;
376 // Used for the ideqid VFR statement where two variable stores may be referenced in the
377 // same VFR statement.
378 // A browser should treat this as an EFI_IFR_VARSTORE_SELECT statement and assume that all following
379 // IFR opcodes use the VarId as defined here.
382 EFI_IFR_OP_HEADER Header
;
383 UINT16 VarId
; // variable store ID, as referenced elsewhere in the form
384 UINT16 SecondaryVarId
; // variable store ID, as referenced elsewhere in the form
385 } EFI_IFR_VARSTORE_SELECT_PAIR
;
388 EFI_IFR_OP_HEADER Header
;
392 EFI_IFR_OP_HEADER Header
;
396 EFI_IFR_OP_HEADER Header
;
400 EFI_IFR_OP_HEADER Header
;
404 // Save defaults and restore defaults have same structure
406 #define EFI_IFR_RESTORE_DEFAULTS EFI_IFR_SAVE_DEFAULTS
409 EFI_IFR_OP_HEADER Header
;
410 STRING_REF Title
; // The string token for the banner title
411 UINT16 LineNumber
; // 1-based line number
412 UINT8 Alignment
; // left, center, or right-aligned
415 #define EFI_IFR_BANNER_ALIGN_LEFT 0
416 #define EFI_IFR_BANNER_ALIGN_CENTER 1
417 #define EFI_IFR_BANNER_ALIGN_RIGHT 2
418 #define EFI_IFR_BANNER_TIMEOUT 0xFF