]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkPkg/Include/Framework/FrameworkInternalFormRepresentation.h
Update comment in SMM Library class include file.
[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
6 Copyright (c) 2007, Intel Corporation \r
7 All rights reserved. This program and the accompanying materials \r
8 are licensed and made available under the terms and conditions of the BSD License \r
9 which accompanies this distribution. The full text of the license may be found at \r
10 http://opensource.org/licenses/bsd-license.php \r
11\r
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
14\r
15 @par Revision Reference:\r
16 These definitions are from Framework Specification HII 0.92.\r
17\r
18**/\r
19\r
20#ifndef __FRAMEWORK_INTERNAL_FORMREPRESENTATION_H__\r
21#define __FRAMEWORK_INTERNAL_FORMREPRESENTATION_H__\r
22\r
61789197 23//\r
24// IFR Op codes\r
25//\r
26#define FRAMEWORK_EFI_IFR_FORM_OP 0x01\r
27#define FRAMEWORK_EFI_IFR_SUBTITLE_OP 0x02\r
28#define FRAMEWORK_EFI_IFR_TEXT_OP 0x03\r
29#define FRAMEWORK_EFI_IFR_GRAPHIC_OP 0x04\r
30#define FRAMEWORK_EFI_IFR_ONE_OF_OP 0x05\r
31#define FRAMEWORK_EFI_IFR_CHECKBOX_OP 0x06\r
32#define FRAMEWORK_EFI_IFR_NUMERIC_OP 0x07\r
33#define FRAMEWORK_EFI_IFR_PASSWORD_OP 0x08\r
34#define FRAMEWORK_EFI_IFR_ONE_OF_OPTION_OP 0x09 // ONEOF OPTION field\r
35#define FRAMEWORK_EFI_IFR_SUPPRESS_IF_OP 0x0A\r
36#define FRAMEWORK_EFI_IFR_END_FORM_OP 0x0B\r
37#define FRAMEWORK_EFI_IFR_HIDDEN_OP 0x0C\r
38#define FRAMEWORK_EFI_IFR_END_FORM_SET_OP 0x0D\r
39#define FRAMEWORK_EFI_IFR_FORM_SET_OP 0x0E\r
40#define FRAMEWORK_EFI_IFR_REF_OP 0x0F\r
41#define FRAMEWORK_EFI_IFR_END_ONE_OF_OP 0x10\r
42#define FRAMEWORK_EFI_IFR_END_OP FRAMEWORK_EFI_IFR_END_ONE_OF_OP\r
43#define FRAMEWORK_EFI_IFR_INCONSISTENT_IF_OP 0x11\r
44#define FRAMEWORK_EFI_IFR_EQ_ID_VAL_OP 0x12\r
45#define FRAMEWORK_EFI_IFR_EQ_ID_ID_OP 0x13\r
46#define FRAMEWORK_EFI_IFR_EQ_ID_LIST_OP 0x14\r
47#define FRAMEWORK_EFI_IFR_AND_OP 0x15\r
48#define FRAMEWORK_EFI_IFR_OR_OP 0x16\r
49#define FRAMEWORK_EFI_IFR_NOT_OP 0x17\r
50#define FRAMEWORK_EFI_IFR_END_IF_OP 0x18 // for endif of inconsistentif, suppressif, grayoutif\r
51#define FRAMEWORK_EFI_IFR_GRAYOUT_IF_OP 0x19\r
52#define FRAMEWORK_EFI_IFR_DATE_OP 0x1A\r
53#define FRAMEWORK_EFI_IFR_TIME_OP 0x1B\r
54#define FRAMEWORK_EFI_IFR_STRING_OP 0x1C\r
55#define FRAMEWORK_EFI_IFR_LABEL_OP 0x1D\r
56#define FRAMEWORK_EFI_IFR_SAVE_DEFAULTS_OP 0x1E\r
57#define FRAMEWORK_EFI_IFR_RESTORE_DEFAULTS_OP 0x1F\r
58#define FRAMEWORK_EFI_IFR_BANNER_OP 0x20\r
59#define FRAMEWORK_EFI_IFR_INVENTORY_OP 0x21\r
60#define FRAMEWORK_EFI_IFR_EQ_VAR_VAL_OP 0x22\r
61#define FRAMEWORK_EFI_IFR_ORDERED_LIST_OP 0x23\r
62#define FRAMEWORK_EFI_IFR_VARSTORE_OP 0x24\r
63#define FRAMEWORK_EFI_IFR_VARSTORE_SELECT_OP 0x25\r
64#define FRAMEWORK_EFI_IFR_VARSTORE_SELECT_PAIR_OP 0x26\r
65#define FRAMEWORK_EFI_IFR_TRUE_OP 0x27\r
66#define FRAMEWORK_EFI_IFR_FALSE_OP 0x28\r
67#define FRAMEWORK_EFI_IFR_GT_OP 0x29\r
68#define FRAMEWORK_EFI_IFR_GE_OP 0x2A\r
69#define FRAMEWORK_EFI_IFR_OEM_DEFINED_OP 0x2B\r
70#define FRAMEWORK_EFI_IFR_LAST_OPCODE FRAMEWORK_EFI_IFR_OEM_DEFINED_OP\r
71#define FRAMEWORK_EFI_IFR_OEM_OP 0xFE\r
72#define FRAMEWORK_EFI_IFR_NV_ACCESS_COMMAND 0xFF\r
73\r
74//\r
75// Define values for the flags fields in some VFR opcodes. These are\r
76// bitmasks.\r
77//\r
9205b2d7 78#define FRAMEWORK_EFI_IFR_FLAG_DEFAULT 0x01\r
79#define FRAMEWORK_EFI_IFR_FLAG_MANUFACTURING 0x02\r
80#define FRAMEWORK_EFI_IFR_FLAG_INTERACTIVE 0x04\r
81#define FRAMEWORK_EFI_IFR_FLAG_NV_ACCESS 0x08\r
82#define FRAMEWORK_EFI_IFR_FLAG_RESET_REQUIRED 0x10\r
83#define FRAMEWORK_EFI_IFR_FLAG_LATE_CHECK 0x20\r
61789197 84\r
85#define EFI_NON_DEVICE_CLASS 0x00 // Useful when you do not want something in the Device Manager\r
86#define EFI_DISK_DEVICE_CLASS 0x01\r
87#define EFI_VIDEO_DEVICE_CLASS 0x02\r
88#define EFI_NETWORK_DEVICE_CLASS 0x04\r
89#define EFI_INPUT_DEVICE_CLASS 0x08\r
90#define EFI_ON_BOARD_DEVICE_CLASS 0x10\r
91#define EFI_OTHER_DEVICE_CLASS 0x20\r
92\r
93#define EFI_SETUP_APPLICATION_SUBCLASS 0x00\r
94#define EFI_GENERAL_APPLICATION_SUBCLASS 0x01\r
95#define EFI_FRONT_PAGE_SUBCLASS 0x02\r
96#define EFI_SINGLE_USE_SUBCLASS 0x03 // Used to display a single entity and then exit\r
97\r
98//\r
99// Used to flag dynamically created op-codes. This is meaningful to the IFR Library set\r
100// and the browser since we need to distinguish between compiled NV map data and created data.\r
101// We do not allow new entries to be created in the NV map dynamically however we still need\r
102// to display this information correctly. To dynamically create op-codes and assume that their\r
103// data will be saved, ensure that the NV starting location they refer to is pre-defined in the\r
104// NV map.\r
105//\r
106#define FRAMEWORK_EFI_IFR_FLAG_CREATED 128\r
107\r
108\r
109#pragma pack(1)\r
110//\r
111// IFR Structure definitions\r
112//\r
113typedef struct {\r
9205b2d7 114 UINT8 OpCode;\r
115 UINT8 Length;\r
61789197 116} FRAMEWORK_EFI_IFR_OP_HEADER;\r
117\r
118typedef struct {\r
9205b2d7 119 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
120 EFI_GUID Guid;\r
121 STRING_REF FormSetTitle;\r
122 STRING_REF Help;\r
123 EFI_PHYSICAL_ADDRESS CallbackHandle;\r
124 UINT16 Class;\r
125 UINT16 SubClass;\r
126 UINT16 NvDataSize; // set once, size of the NV data as defined in the script\r
61789197 127} FRAMEWORK_EFI_IFR_FORM_SET;\r
128\r
129typedef struct {\r
9205b2d7 130 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
131 UINT16 FormId;\r
132 STRING_REF FormTitle;\r
61789197 133} FRAMEWORK_EFI_IFR_FORM;\r
134\r
135typedef struct {\r
9205b2d7 136 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
137 UINT16 LabelId;\r
61789197 138} FRAMEWORK_EFI_IFR_LABEL;\r
139\r
140typedef struct {\r
9205b2d7 141 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
142 STRING_REF SubTitle;\r
61789197 143} FRAMEWORK_EFI_IFR_SUBTITLE;\r
144\r
145typedef struct {\r
9205b2d7 146 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
147 STRING_REF Help;\r
148 STRING_REF Text;\r
149 STRING_REF TextTwo;\r
150 UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.\r
151 UINT16 Key; // Value to be passed to caller to identify this particular op-code\r
61789197 152} FRAMEWORK_EFI_IFR_TEXT;\r
153\r
154//\r
155// goto\r
156//\r
157typedef struct {\r
9205b2d7 158 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
159 UINT16 FormId;\r
160 STRING_REF Prompt;\r
161 STRING_REF Help; // The string Token for the context-help\r
162 UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.\r
163 UINT16 Key; // Value to be passed to caller to identify this particular op-code\r
61789197 164} FRAMEWORK_EFI_IFR_REF;\r
165\r
166typedef struct {\r
9205b2d7 167 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
61789197 168} FRAMEWORK_EFI_IFR_END_FORM;\r
169\r
170typedef struct {\r
9205b2d7 171 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
61789197 172} FRAMEWORK_EFI_IFR_END_FORM_SET;\r
173\r
174//\r
9205b2d7 175// Also notice that the IFR_ONE_OF and IFR_CHECK_BOX are identical in structure......\r
176// code assumes this to be true, if this ever changes we need to revisit the InitializeTagStructures code\r
61789197 177//\r
178typedef struct {\r
9205b2d7 179 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
180 UINT16 QuestionId; // The ID designating what the question is about...\r
181 UINT8 Width; // The Size of the Data being saved\r
182 STRING_REF Prompt; // The String Token for the Prompt\r
183 STRING_REF Help; // The string Token for the context-help\r
61789197 184} FRAMEWORK_EFI_IFR_ONE_OF;\r
185\r
186typedef struct {\r
9205b2d7 187 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
188 UINT16 QuestionId; // The offset in NV for storage of the data\r
189 UINT8 MaxEntries; // The maximum number of options in the ordered list (=size of NVStore)\r
190 STRING_REF Prompt; // The string token for the prompt\r
191 STRING_REF Help; // The string token for the context-help\r
61789197 192} FRAMEWORK_EFI_IFR_ORDERED_LIST;\r
193\r
194typedef struct {\r
9205b2d7 195 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
196 UINT16 QuestionId; // The ID designating what the question is about...\r
197 UINT8 Width; // The Size of the Data being saved\r
198 STRING_REF Prompt; // The String Token for the Prompt\r
199 STRING_REF Help; // The string Token for the context-help\r
200 UINT8 Flags; // If non-zero, means that it is the default option\r
201 UINT16 Key; // Value to be passed to caller to identify this particular op-code\r
61789197 202} FRAMEWORK_EFI_IFR_CHECKBOX, FRAMEWORK_EFI_IFR_CHECK_BOX;\r
203\r
204typedef struct {\r
9205b2d7 205 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
206 STRING_REF Option; // The string token describing the option\r
207 UINT16 Value; // The value associated with this option that is stored in the NVRAM\r
208 UINT8 Flags; // If non-zero, means that it is the default option\r
209 UINT16 Key; // Value to be passed to caller to identify this particular op-code\r
61789197 210} FRAMEWORK_EFI_IFR_ONE_OF_OPTION;\r
211\r
212typedef struct {\r
9205b2d7 213 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
214 UINT16 QuestionId; // The ID designating what the question is about...\r
215 UINT8 Width; // The Size of the Data being saved\r
216 STRING_REF Prompt; // The String Token for the Prompt\r
217 STRING_REF Help; // The string Token for the context-help\r
218 UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.\r
219 UINT16 Key; // Value to be passed to caller to identify this particular op-code\r
220 UINT16 Minimum;\r
221 UINT16 Maximum;\r
222 UINT16 Step; // Zero means manual input, otherwise, arrow selection is called for\r
223 UINT16 Default;\r
61789197 224} FRAMEWORK_EFI_IFR_NUMERIC;\r
225\r
226//\r
9205b2d7 227// There is an interesting twist with regards to Time and Date. This is one of the few items which can accept input\r
228// from a user, however may or may not need to use storage in the NVRAM space. The decided method for determining \r
229// if NVRAM space will be used (only for a TimeOp or DateOp) is: If .QuestionId == 0 && .Width == 0 (normally an \r
230// impossibility) then use system resources to store the data away and not NV resources. In other words, the setup\r
231// engine will call gRT->SetTime, and gRT->SetDate for the saving of data, and the values displayed will be from the\r
232// gRT->GetXXXX series of calls.\r
61789197 233//\r
234typedef struct {\r
9205b2d7 235 FRAMEWORK_EFI_IFR_NUMERIC Hour;\r
236 FRAMEWORK_EFI_IFR_NUMERIC Minute;\r
237 FRAMEWORK_EFI_IFR_NUMERIC Second;\r
61789197 238} FRAMEWORK_EFI_IFR_TIME;\r
239\r
240typedef struct {\r
9205b2d7 241 FRAMEWORK_EFI_IFR_NUMERIC Year;\r
242 FRAMEWORK_EFI_IFR_NUMERIC Month;\r
243 FRAMEWORK_EFI_IFR_NUMERIC Day;\r
61789197 244} FRAMEWORK_EFI_IFR_DATE;\r
245\r
246typedef struct {\r
9205b2d7 247 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
248 UINT16 QuestionId;// The ID designating what the question is about...\r
249 UINT8 Width; // The Size of the Data being saved\r
250 STRING_REF Prompt; // The String Token for the Prompt\r
251 STRING_REF Help; // The string Token for the context-help\r
252 UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.\r
253 UINT16 Key; // Value to be passed to caller to identify this particular op-code\r
254 UINT8 MinSize; // Minimum allowable sized password\r
255 UINT8 MaxSize; // Maximum allowable sized password\r
256 UINT16 Encoding;\r
61789197 257} FRAMEWORK_EFI_IFR_PASSWORD;\r
258\r
259typedef struct {\r
9205b2d7 260 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
261 UINT16 QuestionId; // The ID designating what the question is about...\r
262 UINT8 Width; // The Size of the Data being saved \r
263 STRING_REF Prompt; // The String Token for the Prompt\r
264 STRING_REF Help; // The string Token for the context-help\r
265 UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.\r
266 UINT16 Key; // Value to be passed to caller to identify this particular op-code\r
267 UINT8 MinSize; // Minimum allowable sized password\r
268 UINT8 MaxSize; // Maximum allowable sized password\r
61789197 269} FRAMEWORK_EFI_IFR_STRING;\r
270\r
271typedef struct {\r
9205b2d7 272 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
61789197 273} FRAMEWORK_EFI_IFR_END_ONE_OF;\r
274\r
275typedef struct {\r
9205b2d7 276 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
277 UINT16 Value;\r
278 UINT16 Key;\r
61789197 279} FRAMEWORK_EFI_IFR_HIDDEN;\r
280\r
281typedef struct {\r
9205b2d7 282 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
283 UINT8 Flags;\r
61789197 284} FRAMEWORK_EFI_IFR_SUPPRESS;\r
285\r
286typedef struct {\r
9205b2d7 287 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
288 UINT8 Flags;\r
61789197 289} FRAMEWORK_EFI_IFR_GRAY_OUT;\r
290\r
291typedef struct {\r
9205b2d7 292 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
293 STRING_REF Popup;\r
294 UINT8 Flags;\r
61789197 295} FRAMEWORK_EFI_IFR_INCONSISTENT;\r
296\r
297typedef struct {\r
9205b2d7 298 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
299 UINT16 QuestionId; // offset into variable storage\r
300 UINT8 Width; // size of variable storage\r
301 UINT16 Value; // value to compare against\r
61789197 302} FRAMEWORK_EFI_IFR_EQ_ID_VAL;\r
303\r
304typedef struct {\r
9205b2d7 305 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
306 UINT16 QuestionId; // offset into variable storage\r
307 UINT8 Width; // size of variable storage\r
308 UINT16 ListLength;\r
309 UINT16 ValueList[1];\r
61789197 310} FRAMEWORK_EFI_IFR_EQ_ID_LIST;\r
311\r
312typedef struct {\r
9205b2d7 313 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
314 UINT16 QuestionId1; // offset into variable storage for first value to compare\r
315 UINT8 Width; // size of variable storage (must be same for both)\r
316 UINT16 QuestionId2; // offset into variable storage for second value to compare\r
61789197 317} FRAMEWORK_EFI_IFR_EQ_ID_ID;\r
318\r
319typedef struct {\r
9205b2d7 320 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
321 UINT16 VariableId; // offset into variable storage\r
322 UINT16 Value; // value to compare against\r
61789197 323} FRAMEWORK_EFI_IFR_EQ_VAR_VAL;\r
324\r
325typedef struct {\r
9205b2d7 326 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
61789197 327} FRAMEWORK_EFI_IFR_AND;\r
328\r
329typedef struct {\r
9205b2d7 330 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
61789197 331} FRAMEWORK_EFI_IFR_OR;\r
332\r
333typedef struct {\r
9205b2d7 334 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
61789197 335} FRAMEWORK_EFI_IFR_NOT;\r
336\r
337typedef struct {\r
9205b2d7 338 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
61789197 339} FRAMEWORK_EFI_IFR_END_EXPR, FRAMEWORK_EFI_IFR_END_IF;\r
340\r
341typedef struct {\r
9205b2d7 342 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
343 UINT16 FormId;\r
344 STRING_REF Prompt;\r
345 STRING_REF Help;\r
346 UINT8 Flags;\r
347 UINT16 Key;\r
61789197 348} FRAMEWORK_EFI_IFR_SAVE_DEFAULTS;\r
349\r
350typedef struct {\r
9205b2d7 351 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
352 STRING_REF Help;\r
353 STRING_REF Text;\r
354 STRING_REF TextTwo; // optional text\r
61789197 355} FRAMEWORK_EFI_IFR_INVENTORY;\r
356\r
357typedef struct {\r
9205b2d7 358 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
359 EFI_GUID Guid; // GUID for the variable\r
360 UINT16 VarId; // variable store ID, as referenced elsewhere in the form\r
361 UINT16 Size; // size of the variable storage\r
61789197 362} FRAMEWORK_EFI_IFR_VARSTORE;\r
363\r
364typedef struct {\r
9205b2d7 365 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
366 UINT16 VarId; // variable store ID, as referenced elsewhere in the form\r
61789197 367} FRAMEWORK_EFI_IFR_VARSTORE_SELECT;\r
368\r
369//\r
370// Used for the ideqid VFR statement where two variable stores may be referenced in the\r
371// same VFR statement.\r
372// A browser should treat this as an FRAMEWORK_EFI_IFR_VARSTORE_SELECT statement and assume that all following\r
373// IFR opcodes use the VarId as defined here.\r
374//\r
375typedef struct {\r
9205b2d7 376 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
377 UINT16 VarId; // variable store ID, as referenced elsewhere in the form\r
378 UINT16 SecondaryVarId; // variable store ID, as referenced elsewhere in the form\r
61789197 379} FRAMEWORK_EFI_IFR_VARSTORE_SELECT_PAIR;\r
380\r
381typedef struct {\r
9205b2d7 382 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
61789197 383} FRAMEWORK_EFI_IFR_TRUE;\r
384\r
385typedef struct {\r
9205b2d7 386 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
61789197 387} FRAMEWORK_EFI_IFR_FALSE;\r
388\r
389typedef struct {\r
9205b2d7 390 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
61789197 391} FRAMEWORK_EFI_IFR_GT;\r
392\r
393typedef struct {\r
9205b2d7 394 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
61789197 395} FRAMEWORK_EFI_IFR_GE;\r
396\r
397//\r
398// Save defaults and restore defaults have same structure\r
399//\r
400#define FRAMEWORK_EFI_IFR_RESTORE_DEFAULTS FRAMEWORK_EFI_IFR_SAVE_DEFAULTS\r
401\r
402typedef struct {\r
9205b2d7 403 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
404 STRING_REF Title; // The string token for the banner title\r
405 UINT16 LineNumber; // 1-based line number\r
406 UINT8 Alignment; // left, center, or right-aligned\r
61789197 407} FRAMEWORK_EFI_IFR_BANNER;\r
408\r
409#define FRAMEWORK_EFI_IFR_BANNER_ALIGN_LEFT 0\r
410#define FRAMEWORK_EFI_IFR_BANNER_ALIGN_CENTER 1\r
411#define FRAMEWORK_EFI_IFR_BANNER_ALIGN_RIGHT 2\r
412#define FRAMEWORK_EFI_IFR_BANNER_TIMEOUT 0xFF\r
413\r
414#pragma pack()\r
415\r
416#endif\r