]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkPkg/Include/Framework/FrameworkInternalFormRepresentation.h
Remove IntelFrameworkModulePkg
[mirror_edk2.git] / IntelFrameworkPkg / Include / Framework / FrameworkInternalFormRepresentation.h
CommitLineData
61789197 1/** @file\r
2 This file defines the encoding for the VFR (Visual Form Representation) language.\r
3 Framework IFR is primarily consumed by the EFI presentation engine, and produced by EFI\r
4 internal application and drivers as well as all add-in card option-ROM drivers\r
5\r
1c2f052d 6Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
22a69a5e 7SPDX-License-Identifier: BSD-2-Clause-Patent\r
61789197 8\r
9 @par Revision Reference:\r
f22f941e 10 These definitions are from the Framework Specification HII 0.92.\r
61789197 11\r
12**/\r
13\r
14#ifndef __FRAMEWORK_INTERNAL_FORMREPRESENTATION_H__\r
15#define __FRAMEWORK_INTERNAL_FORMREPRESENTATION_H__\r
16\r
0e0eeeca
LG
17typedef UINT16 STRING_REF;\r
18\r
61789197 19//\r
20// IFR Op codes\r
21//\r
22#define FRAMEWORK_EFI_IFR_FORM_OP 0x01\r
23#define FRAMEWORK_EFI_IFR_SUBTITLE_OP 0x02\r
24#define FRAMEWORK_EFI_IFR_TEXT_OP 0x03\r
33801c0c 25#define EFI_IFR_GRAPHIC_OP 0x04\r
61789197 26#define FRAMEWORK_EFI_IFR_ONE_OF_OP 0x05\r
27#define FRAMEWORK_EFI_IFR_CHECKBOX_OP 0x06\r
28#define FRAMEWORK_EFI_IFR_NUMERIC_OP 0x07\r
29#define FRAMEWORK_EFI_IFR_PASSWORD_OP 0x08\r
f22f941e 30#define FRAMEWORK_EFI_IFR_ONE_OF_OPTION_OP 0x09 ///< ONEOF OPTION field.\r
61789197 31#define FRAMEWORK_EFI_IFR_SUPPRESS_IF_OP 0x0A\r
33801c0c
LG
32#define EFI_IFR_END_FORM_OP 0x0B\r
33#define EFI_IFR_HIDDEN_OP 0x0C\r
34#define EFI_IFR_END_FORM_SET_OP 0x0D\r
61789197 35#define FRAMEWORK_EFI_IFR_FORM_SET_OP 0x0E\r
36#define FRAMEWORK_EFI_IFR_REF_OP 0x0F\r
33801c0c 37#define EFI_IFR_END_ONE_OF_OP 0x10\r
108854b2 38#define FRAMEWORK_EFI_IFR_END_OP EFI_IFR_END_ONE_OF_OP\r
61789197 39#define FRAMEWORK_EFI_IFR_INCONSISTENT_IF_OP 0x11\r
40#define FRAMEWORK_EFI_IFR_EQ_ID_VAL_OP 0x12\r
41#define FRAMEWORK_EFI_IFR_EQ_ID_ID_OP 0x13\r
42#define FRAMEWORK_EFI_IFR_EQ_ID_LIST_OP 0x14\r
43#define FRAMEWORK_EFI_IFR_AND_OP 0x15\r
44#define FRAMEWORK_EFI_IFR_OR_OP 0x16\r
45#define FRAMEWORK_EFI_IFR_NOT_OP 0x17\r
f22f941e 46#define EFI_IFR_END_IF_OP 0x18 ///< For endif of inconsistentif, suppressif, grayoutif.\r
33801c0c 47#define EFI_IFR_GRAYOUT_IF_OP 0x19\r
61789197 48#define FRAMEWORK_EFI_IFR_DATE_OP 0x1A\r
49#define FRAMEWORK_EFI_IFR_TIME_OP 0x1B\r
50#define FRAMEWORK_EFI_IFR_STRING_OP 0x1C\r
33801c0c
LG
51#define EFI_IFR_LABEL_OP 0x1D\r
52#define EFI_IFR_SAVE_DEFAULTS_OP 0x1E\r
53#define EFI_IFR_RESTORE_DEFAULTS_OP 0x1F\r
54#define EFI_IFR_BANNER_OP 0x20\r
55#define EFI_IFR_INVENTORY_OP 0x21\r
56#define EFI_IFR_EQ_VAR_VAL_OP 0x22\r
61789197 57#define FRAMEWORK_EFI_IFR_ORDERED_LIST_OP 0x23\r
58#define FRAMEWORK_EFI_IFR_VARSTORE_OP 0x24\r
33801c0c
LG
59#define EFI_IFR_VARSTORE_SELECT_OP 0x25\r
60#define EFI_IFR_VARSTORE_SELECT_PAIR_OP 0x26\r
61#define EFI_IFR_LAST_OPCODE EFI_IFR_VARSTORE_SELECT_PAIR_OP\r
62#define EFI_IFR_OEM_OP 0xFE\r
63#define EFI_IFR_NV_ACCESS_COMMAND 0xFF\r
61789197 64\r
65//\r
66// Define values for the flags fields in some VFR opcodes. These are\r
67// bitmasks.\r
68//\r
108854b2
LG
69#define EFI_IFR_FLAG_DEFAULT 0x01\r
70#define EFI_IFR_FLAG_MANUFACTURING 0x02\r
71#define EFI_IFR_FLAG_INTERACTIVE 0x04\r
72#define EFI_IFR_FLAG_NV_ACCESS 0x08\r
73#define EFI_IFR_FLAG_RESET_REQUIRED 0x10\r
74#define EFI_IFR_FLAG_LATE_CHECK 0x20\r
61789197 75\r
f22f941e 76#define EFI_NON_DEVICE_CLASS 0x00 ///< Useful when you do not want something in the Device Manager.\r
61789197 77#define EFI_DISK_DEVICE_CLASS 0x01\r
78#define EFI_VIDEO_DEVICE_CLASS 0x02\r
79#define EFI_NETWORK_DEVICE_CLASS 0x04\r
80#define EFI_INPUT_DEVICE_CLASS 0x08\r
81#define EFI_ON_BOARD_DEVICE_CLASS 0x10\r
82#define EFI_OTHER_DEVICE_CLASS 0x20\r
83\r
84#define EFI_SETUP_APPLICATION_SUBCLASS 0x00\r
85#define EFI_GENERAL_APPLICATION_SUBCLASS 0x01\r
86#define EFI_FRONT_PAGE_SUBCLASS 0x02\r
f22f941e 87#define EFI_SINGLE_USE_SUBCLASS 0x03 ///< Used to display a single entity ,and then exit.\r
2bbaeb0d 88\r
89///\r
90/// Used to flag dynamically created op-codes. This is meaningful to the IFR Library set\r
f22f941e 91/// and the browser because we need to distinguish between compiled NV map data and created data.\r
5259c97d 92/// We do not allow new entries to be created in the NV map dynamically, but we do need\r
2bbaeb0d 93/// to display this information correctly. To dynamically create op-codes and assume that their\r
94/// data will be saved, ensure that the NV starting location they refer to is pre-defined in the\r
95/// NV map.\r
96///\r
108854b2 97#define EFI_IFR_FLAG_CREATED 128\r
61789197 98\r
99\r
100#pragma pack(1)\r
101//\r
102// IFR Structure definitions\r
103//\r
104typedef struct {\r
9205b2d7 105 UINT8 OpCode;\r
106 UINT8 Length;\r
61789197 107} FRAMEWORK_EFI_IFR_OP_HEADER;\r
108\r
109typedef struct {\r
9205b2d7 110 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
111 EFI_GUID Guid;\r
112 STRING_REF FormSetTitle;\r
113 STRING_REF Help;\r
114 EFI_PHYSICAL_ADDRESS CallbackHandle;\r
115 UINT16 Class;\r
116 UINT16 SubClass;\r
f22f941e 117 UINT16 NvDataSize; ///< Set once; the size of the NV data as defined in the script.\r
61789197 118} FRAMEWORK_EFI_IFR_FORM_SET;\r
119\r
120typedef struct {\r
9205b2d7 121 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
122 UINT16 FormId;\r
123 STRING_REF FormTitle;\r
61789197 124} FRAMEWORK_EFI_IFR_FORM;\r
125\r
126typedef struct {\r
9205b2d7 127 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
128 UINT16 LabelId;\r
108854b2 129} EFI_IFR_LABEL;\r
61789197 130\r
131typedef struct {\r
9205b2d7 132 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
133 STRING_REF SubTitle;\r
61789197 134} FRAMEWORK_EFI_IFR_SUBTITLE;\r
135\r
136typedef struct {\r
9205b2d7 137 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
138 STRING_REF Help;\r
139 STRING_REF Text;\r
140 STRING_REF TextTwo;\r
2bbaeb0d 141 UINT8 Flags; ///< This is included solely for purposes of interactive/dynamic support.\r
f22f941e 142 UINT16 Key; ///< The value to be passed to the caller to identify this particular op-code.\r
61789197 143} FRAMEWORK_EFI_IFR_TEXT;\r
144\r
145//\r
146// goto\r
147//\r
148typedef struct {\r
9205b2d7 149 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
150 UINT16 FormId;\r
151 STRING_REF Prompt;\r
f22f941e 152 STRING_REF Help; ///< The string Token for the context-help.\r
2bbaeb0d 153 UINT8 Flags; ///< This is included solely for purposes of interactive/dynamic support.\r
f22f941e 154 UINT16 Key; ///< The value to be passed to the caller to identify this particular op-code.\r
61789197 155} FRAMEWORK_EFI_IFR_REF;\r
156\r
157typedef struct {\r
9205b2d7 158 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
108854b2 159} EFI_IFR_END_FORM;\r
61789197 160\r
161typedef struct {\r
9205b2d7 162 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
108854b2 163} EFI_IFR_END_FORM_SET;\r
61789197 164\r
165//\r
9205b2d7 166// Also notice that the IFR_ONE_OF and IFR_CHECK_BOX are identical in structure......\r
167// code assumes this to be true, if this ever changes we need to revisit the InitializeTagStructures code\r
61789197 168//\r
169typedef struct {\r
9205b2d7 170 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
2bbaeb0d 171 UINT16 QuestionId; ///< The ID designating what the question is about...\r
f22f941e 172 UINT8 Width; ///< The Size of the Data being saved.\r
173 STRING_REF Prompt; ///< The String Token for the Prompt.\r
174 STRING_REF Help; ///< The string Token for the context-help.\r
61789197 175} FRAMEWORK_EFI_IFR_ONE_OF;\r
176\r
177typedef struct {\r
9205b2d7 178 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
f22f941e 179 UINT16 QuestionId; ///< The offset in NV for storage of the data.\r
180 UINT8 MaxEntries; ///< The maximum number of options in the ordered list (=size of NVStore).\r
181 STRING_REF Prompt; ///< The string token for the prompt.\r
182 STRING_REF Help; ///< The string token for the context-help.\r
61789197 183} FRAMEWORK_EFI_IFR_ORDERED_LIST;\r
184\r
185typedef struct {\r
9205b2d7 186 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
2bbaeb0d 187 UINT16 QuestionId; ///< The ID designating what the question is about...\r
f22f941e 188 UINT8 Width; ///< The Size of the Data being saved.\r
189 STRING_REF Prompt; ///< The String Token for the Prompt.\r
190 STRING_REF Help; ///< The string Token for the context-help.\r
191 UINT8 Flags; ///< If non-zero, it means that it is the default option.\r
192 UINT16 Key; ///< Value to be passed to caller to identify this particular op-code.\r
108854b2 193} FRAMEWORK_EFI_IFR_CHECKBOX, EFI_IFR_CHECK_BOX;\r
61789197 194\r
195typedef struct {\r
9205b2d7 196 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
f22f941e 197 STRING_REF Option; ///< The string token describing the option.\r
198 UINT16 Value; ///< The value associated with this option that is stored in the NVRAM.\r
199 UINT8 Flags; ///< If non-zero, it means that it is the default option.\r
200 UINT16 Key; ///< Value to be passed to caller to identify this particular op-code.\r
61789197 201} FRAMEWORK_EFI_IFR_ONE_OF_OPTION;\r
202\r
203typedef struct {\r
9205b2d7 204 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
2bbaeb0d 205 UINT16 QuestionId; ///< The ID designating what the question is about...\r
f22f941e 206 UINT8 Width; ///< The Size of the Data being saved.\r
207 STRING_REF Prompt; ///< The String Token for the Prompt.\r
208 STRING_REF Help; ///< The string Token for the context-help.\r
2bbaeb0d 209 UINT8 Flags; ///< This is included solely for purposes of interactive/dynamic support.\r
f22f941e 210 UINT16 Key; ///< The value to be passed to caller to identify this particular op-code.\r
9205b2d7 211 UINT16 Minimum;\r
212 UINT16 Maximum;\r
f22f941e 213 UINT16 Step; ///< Zero means manual input. Otherwise, arrow selection is called for.\r
9205b2d7 214 UINT16 Default;\r
61789197 215} FRAMEWORK_EFI_IFR_NUMERIC;\r
216\r
217//\r
9205b2d7 218// There is an interesting twist with regards to Time and Date. This is one of the few items which can accept input\r
1c2f052d
LG
219// from a user, and may or may not need to use storage in the NVRAM space. The decided method for determining\r
220// if NVRAM space will be used (only for a TimeOp or DateOp) is: If .QuestionId == 0 && .Width == 0 (normally an\r
9205b2d7 221// impossibility) then use system resources to store the data away and not NV resources. In other words, the setup\r
222// engine will call gRT->SetTime, and gRT->SetDate for the saving of data, and the values displayed will be from the\r
223// gRT->GetXXXX series of calls.\r
61789197 224//\r
225typedef struct {\r
9205b2d7 226 FRAMEWORK_EFI_IFR_NUMERIC Hour;\r
227 FRAMEWORK_EFI_IFR_NUMERIC Minute;\r
228 FRAMEWORK_EFI_IFR_NUMERIC Second;\r
61789197 229} FRAMEWORK_EFI_IFR_TIME;\r
230\r
231typedef struct {\r
9205b2d7 232 FRAMEWORK_EFI_IFR_NUMERIC Year;\r
233 FRAMEWORK_EFI_IFR_NUMERIC Month;\r
234 FRAMEWORK_EFI_IFR_NUMERIC Day;\r
61789197 235} FRAMEWORK_EFI_IFR_DATE;\r
236\r
237typedef struct {\r
9205b2d7 238 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
2bbaeb0d 239 UINT16 QuestionId;///< The ID designating what the question is about...\r
f22f941e 240 UINT8 Width; ///< The Size of the Data being saved.\r
241 STRING_REF Prompt; ///< The String Token for the Prompt.\r
242 STRING_REF Help; ///< The string Token for the context-help.\r
2bbaeb0d 243 UINT8 Flags; ///< This is included solely for purposes of interactive/dynamic support.\r
f22f941e 244 UINT16 Key; ///< The value to be passed to caller to identify this particular op-code.\r
245 UINT8 MinSize; ///< Minimum allowable sized password.\r
246 UINT8 MaxSize; ///< Maximum allowable sized password.\r
9205b2d7 247 UINT16 Encoding;\r
61789197 248} FRAMEWORK_EFI_IFR_PASSWORD;\r
249\r
250typedef struct {\r
9205b2d7 251 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
2bbaeb0d 252 UINT16 QuestionId; ///< The ID designating what the question is about...\r
1c2f052d 253 UINT8 Width; ///< The Size of the Data being saved.\r
f22f941e 254 STRING_REF Prompt; ///< The String Token for the Prompt.\r
255 STRING_REF Help; ///< The string Token for the context-help.\r
2bbaeb0d 256 UINT8 Flags; ///< This is included solely for purposes of interactive/dynamic support.\r
f22f941e 257 UINT16 Key; ///< The value to be passed to caller to identify this particular op-code.\r
258 UINT8 MinSize; ///< Minimum allowable sized password.\r
259 UINT8 MaxSize; ///< Maximum allowable sized password.\r
61789197 260} FRAMEWORK_EFI_IFR_STRING;\r
261\r
262typedef struct {\r
9205b2d7 263 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
108854b2 264} EFI_IFR_END_ONE_OF;\r
61789197 265\r
266typedef struct {\r
9205b2d7 267 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
268 UINT16 Value;\r
269 UINT16 Key;\r
108854b2 270} EFI_IFR_HIDDEN;\r
61789197 271\r
6d1824fc 272///\r
273/// Inconsistent with specification here:\r
1c2f052d 274/// The following defintion may not comply with Framework Specification HII 0.92. To\r
6d1824fc 275/// keep the inconsistant is for implementation needed.\r
33d228aa 276///@{\r
61789197 277typedef struct {\r
9205b2d7 278 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
279 UINT8 Flags;\r
108854b2 280} EFI_IFR_SUPPRESS;\r
61789197 281\r
282typedef struct {\r
9205b2d7 283 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
284 UINT8 Flags;\r
108854b2 285} EFI_IFR_GRAY_OUT;\r
61789197 286\r
287typedef struct {\r
9205b2d7 288 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
289 STRING_REF Popup;\r
290 UINT8 Flags;\r
108854b2 291} EFI_IFR_INCONSISTENT;\r
61789197 292\r
293typedef struct {\r
9205b2d7 294 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
f22f941e 295 UINT16 QuestionId; ///< The offset into variable storage.\r
296 UINT8 Width; ///< The size of variable storage.\r
297 UINT16 Value; ///< The value to compare against.\r
61789197 298} FRAMEWORK_EFI_IFR_EQ_ID_VAL;\r
299\r
300typedef struct {\r
9205b2d7 301 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
f22f941e 302 UINT16 QuestionId; ///< The offset into variable storage.\r
303 UINT8 Width; ///< The size of variable storage.\r
9205b2d7 304 UINT16 ListLength;\r
305 UINT16 ValueList[1];\r
61789197 306} FRAMEWORK_EFI_IFR_EQ_ID_LIST;\r
307\r
308typedef struct {\r
9205b2d7 309 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
f22f941e 310 UINT16 QuestionId1; ///< The offset into variable storage for first value to compare.\r
311 UINT8 Width; ///< The size of variable storage (must be same for both).\r
312 UINT16 QuestionId2; ///< The offset into variable storage for second value to compare.\r
61789197 313} FRAMEWORK_EFI_IFR_EQ_ID_ID;\r
314\r
315typedef struct {\r
9205b2d7 316 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
f22f941e 317 UINT16 VariableId; ///< The offset into variable storage.\r
318 UINT16 Value; ///< The value to compare against.\r
108854b2 319} EFI_IFR_EQ_VAR_VAL;\r
33d228aa 320///@}\r
61789197 321\r
322typedef struct {\r
9205b2d7 323 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
61789197 324} FRAMEWORK_EFI_IFR_AND;\r
325\r
326typedef struct {\r
9205b2d7 327 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
61789197 328} FRAMEWORK_EFI_IFR_OR;\r
329\r
330typedef struct {\r
9205b2d7 331 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
61789197 332} FRAMEWORK_EFI_IFR_NOT;\r
333\r
334typedef struct {\r
9205b2d7 335 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
108854b2 336} EFI_IFR_END_EXPR, EFI_IFR_END_IF;\r
61789197 337\r
338typedef struct {\r
9205b2d7 339 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
340 UINT16 FormId;\r
341 STRING_REF Prompt;\r
342 STRING_REF Help;\r
343 UINT8 Flags;\r
344 UINT16 Key;\r
108854b2 345} EFI_IFR_SAVE_DEFAULTS;\r
61789197 346\r
347typedef struct {\r
9205b2d7 348 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
349 STRING_REF Help;\r
350 STRING_REF Text;\r
f22f941e 351 STRING_REF TextTwo; ///< Optional text.\r
108854b2 352} EFI_IFR_INVENTORY;\r
61789197 353\r
354typedef struct {\r
9205b2d7 355 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
f22f941e 356 EFI_GUID Guid; ///< GUID for the variable.\r
357 UINT16 VarId; ///< The variable store ID, as referenced elsewhere in the form.\r
358 UINT16 Size; ///< The size of the variable storage.\r
61789197 359} FRAMEWORK_EFI_IFR_VARSTORE;\r
360\r
361typedef struct {\r
9205b2d7 362 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
f22f941e 363 UINT16 VarId; ///< The variable store ID, as referenced elsewhere in the form.\r
108854b2 364} EFI_IFR_VARSTORE_SELECT;\r
61789197 365\r
2bbaeb0d 366///\r
367/// Used for the ideqid VFR statement where two variable stores may be referenced in the\r
368/// same VFR statement.\r
369/// A browser should treat this as an FRAMEWORK_EFI_IFR_VARSTORE_SELECT statement and assume that all following\r
370/// IFR opcodes use the VarId as defined here.\r
371///\r
61789197 372typedef struct {\r
9205b2d7 373 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
f22f941e 374 UINT16 VarId; ///< The variable store ID, as referenced elsewhere in the form.\r
375 UINT16 SecondaryVarId; ///< The variable store ID, as referenced elsewhere in the form.\r
108854b2 376} EFI_IFR_VARSTORE_SELECT_PAIR;\r
61789197 377\r
2bbaeb0d 378///\r
f22f941e 379/// Save defaults and restore defaults have same structure.\r
2bbaeb0d 380///\r
108854b2 381#define EFI_IFR_RESTORE_DEFAULTS EFI_IFR_SAVE_DEFAULTS\r
61789197 382\r
383typedef struct {\r
9205b2d7 384 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
f22f941e 385 STRING_REF Title; ///< The string token for the banner title.\r
386 UINT16 LineNumber; ///< 1-based line number.\r
387 UINT8 Alignment; ///< Left, center, or right-aligned.\r
108854b2 388} EFI_IFR_BANNER;\r
61789197 389\r
108854b2
LG
390#define EFI_IFR_BANNER_ALIGN_LEFT 0\r
391#define EFI_IFR_BANNER_ALIGN_CENTER 1\r
392#define EFI_IFR_BANNER_ALIGN_RIGHT 2\r
393#define EFI_IFR_BANNER_TIMEOUT 0xFF\r
61789197 394\r
395#pragma pack()\r
396\r
397#endif\r