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