]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Uefi/UefiInternalFormRepresentation.h
Import Pal.h and Sal.h.
[mirror_edk2.git] / MdePkg / Include / Uefi / UefiInternalFormRepresentation.h
CommitLineData
959ccb23 1\r
2/** @file\r
3 This file defines the encoding for the VFR (Visual Form Representation) language.\r
4 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) 2006 - 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 Module Name: UefiInternalFormRepresentation.h\r
17\r
18 @par Revision Reference:\r
19 These definitions are from UEFI2.1.\r
20\r
21**/\r
22\r
23#ifndef __UEFI_INTERNAL_FORMREPRESENTATION_H__\r
24#define __UEFI_INTERNAL_FORMREPRESENTATION_H__\r
25\r
26//\r
27// The following types are currently defined:\r
28//\r
29typedef UINT32 RELOFST;\r
d1f95000 30\r
959ccb23 31typedef CHAR16 *EFI_STRING;\r
d1f95000 32typedef UINT16 EFI_IMAGE_ID;\r
33typedef UINT16 EFI_QUESTION_ID;\r
34typedef UINT16 EFI_STRING_ID;\r
35typedef UINT16 EFI_FORM_ID;\r
36typedef UINT16 EFI_VARSTORE_ID;\r
37\r
38//\r
39// BugBug in UEFI2.1 \r
40// \r
41typedef VOID *EFI_FONT_HANDLE;\r
42\r
959ccb23 43\r
44//\r
45// IFR Op codes\r
46//\r
47#define EFI_IFR_FORM_OP 0x01\r
48#define EFI_IFR_SUBTITLE_OP 0x02\r
49#define EFI_IFR_TEXT_OP 0x03\r
50#define EFI_IFR_GRAPHIC_OP 0x04\r
51#define EFI_IFR_ONE_OF_OP 0x05\r
52#define EFI_IFR_CHECKBOX_OP 0x06\r
53#define EFI_IFR_NUMERIC_OP 0x07\r
54#define EFI_IFR_PASSWORD_OP 0x08\r
55#define EFI_IFR_ONE_OF_OPTION_OP 0x09 // ONEOF OPTION field\r
56#define EFI_IFR_SUPPRESS_IF_OP 0x0A\r
57#define EFI_IFR_END_FORM_OP 0x0B\r
58#define EFI_IFR_HIDDEN_OP 0x0C\r
59#define EFI_IFR_END_FORM_SET_OP 0x0D\r
60#define EFI_IFR_FORM_SET_OP 0x0E\r
61#define EFI_IFR_REF_OP 0x0F\r
62#define EFI_IFR_END_ONE_OF_OP 0x10\r
63#define EFI_IFR_END_OP EFI_IFR_END_ONE_OF_OP\r
64#define EFI_IFR_INCONSISTENT_IF_OP 0x11\r
65#define EFI_IFR_EQ_ID_VAL_OP 0x12\r
66#define EFI_IFR_EQ_ID_ID_OP 0x13\r
67#define EFI_IFR_EQ_ID_LIST_OP 0x14\r
68#define EFI_IFR_AND_OP 0x15\r
69#define EFI_IFR_OR_OP 0x16\r
70#define EFI_IFR_NOT_OP 0x17\r
71#define EFI_IFR_END_IF_OP 0x18 // for endif of inconsistentif, suppressif, grayoutif\r
72#define EFI_IFR_GRAYOUT_IF_OP 0x19\r
73#define EFI_IFR_DATE_OP 0x1A\r
74#define EFI_IFR_TIME_OP 0x1B\r
75#define EFI_IFR_STRING_OP 0x1C\r
76#define EFI_IFR_LABEL_OP 0x1D\r
77#define EFI_IFR_SAVE_DEFAULTS_OP 0x1E\r
78#define EFI_IFR_RESTORE_DEFAULTS_OP 0x1F\r
79#define EFI_IFR_BANNER_OP 0x20\r
80#define EFI_IFR_INVENTORY_OP 0x21\r
81#define EFI_IFR_EQ_VAR_VAL_OP 0x22\r
82#define EFI_IFR_ORDERED_LIST_OP 0x23\r
83#define EFI_IFR_VARSTORE_OP 0x24\r
84#define EFI_IFR_VARSTORE_SELECT_OP 0x25\r
85#define EFI_IFR_VARSTORE_SELECT_PAIR_OP 0x26\r
86#define EFI_IFR_TRUE_OP 0x27\r
87#define EFI_IFR_FALSE_OP 0x28\r
88#define EFI_IFR_GT_OP 0x29\r
89#define EFI_IFR_GE_OP 0x2A\r
90#define EFI_IFR_OEM_DEFINED_OP 0x2B\r
91#define EFI_IFR_LAST_OPCODE EFI_IFR_OEM_DEFINED_OP\r
92#define EFI_IFR_OEM_OP 0xFE\r
93#define EFI_IFR_NV_ACCESS_COMMAND 0xFF\r
94\r
95//\r
96// Define values for the flags fields in some VFR opcodes. These are\r
97// bitmasks.\r
98//\r
99#define EFI_IFR_FLAG_DEFAULT 0x01\r
100#define EFI_IFR_FLAG_MANUFACTURING 0x02\r
101#define EFI_IFR_FLAG_INTERACTIVE 0x04\r
102#define EFI_IFR_FLAG_NV_ACCESS 0x08\r
103#define EFI_IFR_FLAG_RESET_REQUIRED 0x10\r
104#define EFI_IFR_FLAG_LATE_CHECK 0x20\r
105\r
106#define EFI_NON_DEVICE_CLASS 0x00 // Useful when you do not want something in the Device Manager\r
107#define EFI_DISK_DEVICE_CLASS 0x01\r
108#define EFI_VIDEO_DEVICE_CLASS 0x02\r
109#define EFI_NETWORK_DEVICE_CLASS 0x04\r
110#define EFI_INPUT_DEVICE_CLASS 0x08\r
111#define EFI_ON_BOARD_DEVICE_CLASS 0x10\r
112#define EFI_OTHER_DEVICE_CLASS 0x20\r
113\r
114#define EFI_SETUP_APPLICATION_SUBCLASS 0x00\r
115#define EFI_GENERAL_APPLICATION_SUBCLASS 0x01\r
116#define EFI_FRONT_PAGE_SUBCLASS 0x02\r
117#define EFI_SINGLE_USE_SUBCLASS 0x03 // Used to display a single entity and then exit\r
118\r
119//\r
120// Used to flag dynamically created op-codes. This is meaningful to the IFR Library set\r
121// and the browser since we need to distinguish between compiled NV map data and created data.\r
122// We do not allow new entries to be created in the NV map dynamically however we still need\r
123// to display this information correctly. To dynamically create op-codes and assume that their\r
124// data will be saved, ensure that the NV starting location they refer to is pre-defined in the\r
125// NV map.\r
126//\r
127#define EFI_IFR_FLAG_CREATED 128\r
128\r
129#pragma pack(1)\r
130//\r
131// IFR Structure definitions\r
132//\r
133typedef struct {\r
134 UINT8 OpCode;\r
135 UINT8 Length;\r
136} EFI_IFR_OP_HEADER;\r
137\r
138typedef struct {\r
139 EFI_IFR_OP_HEADER Header;\r
140 EFI_GUID Guid;\r
141 STRING_REF FormSetTitle;\r
142 STRING_REF Help;\r
143 EFI_PHYSICAL_ADDRESS CallbackHandle;\r
144 UINT16 Class;\r
145 UINT16 SubClass;\r
146 UINT16 NvDataSize; // set once, size of the NV data as defined in the script\r
147} EFI_IFR_FORM_SET;\r
148\r
149typedef struct {\r
150 EFI_IFR_OP_HEADER Header;\r
151 UINT16 FormId;\r
152 STRING_REF FormTitle;\r
153} EFI_IFR_FORM;\r
154\r
155typedef struct {\r
156 EFI_IFR_OP_HEADER Header;\r
157 UINT16 LabelId;\r
158} EFI_IFR_LABEL;\r
159\r
160typedef struct {\r
161 EFI_IFR_OP_HEADER Header;\r
162 STRING_REF SubTitle;\r
163} EFI_IFR_SUBTITLE;\r
164\r
165typedef struct {\r
166 EFI_IFR_OP_HEADER Header;\r
167 STRING_REF Help;\r
168 STRING_REF Text;\r
169 STRING_REF TextTwo;\r
170 UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.\r
171 UINT16 Key; // Value to be passed to caller to identify this particular op-code\r
172} EFI_IFR_TEXT;\r
173\r
174//\r
175// goto\r
176//\r
177typedef struct {\r
178 EFI_IFR_OP_HEADER Header;\r
179 UINT16 FormId;\r
180 STRING_REF Prompt;\r
181 STRING_REF Help; // The string Token for the context-help\r
182 UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.\r
183 UINT16 Key; // Value to be passed to caller to identify this particular op-code\r
184} EFI_IFR_REF;\r
185\r
186typedef struct {\r
187 EFI_IFR_OP_HEADER Header;\r
188} EFI_IFR_END_FORM;\r
189\r
190typedef struct {\r
191 EFI_IFR_OP_HEADER Header;\r
192} EFI_IFR_END_FORM_SET;\r
193\r
194//\r
195// 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
196// changes we need to revisit the InitializeTagStructures code\r
197//\r
198typedef struct {\r
199 EFI_IFR_OP_HEADER Header;\r
200 UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name\r
201 UINT8 Width; // The Size of the Data being saved\r
202 STRING_REF Prompt; // The String Token for the Prompt\r
203 STRING_REF Help; // The string Token for the context-help\r
204} EFI_IFR_ONE_OF;\r
205\r
206typedef struct {\r
207 EFI_IFR_OP_HEADER Header;\r
208 UINT16 QuestionId; // The offset in NV for storage of the data\r
209 UINT8 MaxEntries; // The maximum number of options in the ordered list (=size of NVStore)\r
210 STRING_REF Prompt; // The string token for the prompt\r
211 STRING_REF Help; // The string token for the context-help\r
212} EFI_IFR_ORDERED_LIST;\r
213\r
214typedef struct {\r
215 EFI_IFR_OP_HEADER Header;\r
216 UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name\r
217 UINT8 Width; // The Size of the Data being saved\r
218 STRING_REF Prompt; // The String Token for the Prompt\r
219 STRING_REF Help; // The string Token for the context-help\r
220 UINT8 Flags; // For now, if non-zero, means that it is the default option, - further definition likely\r
221 UINT16 Key; // Value to be passed to caller to identify this particular op-code\r
222} EFI_IFR_CHECKBOX, EFI_IFR_CHECK_BOX;\r
223\r
224typedef struct {\r
225 EFI_IFR_OP_HEADER Header;\r
226 STRING_REF Option; // The string token describing the option\r
227 UINT16 Value; // The value associated with this option that is stored in the NVRAM if chosen\r
228 UINT8 Flags; // For now, if non-zero, means that it is the default option, - further definition likely above\r
229 UINT16 Key; // Value to be passed to caller to identify this particular op-code\r
230} EFI_IFR_ONE_OF_OPTION;\r
231\r
232typedef struct {\r
233 EFI_IFR_OP_HEADER Header;\r
234 UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name\r
235 UINT8 Width; // The Size of the Data being saved\r
236 STRING_REF Prompt; // The String Token for the Prompt\r
237 STRING_REF Help; // The string Token for the context-help\r
238 UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.\r
239 UINT16 Key; // Value to be passed to caller to identify this particular op-code\r
240 UINT16 Minimum;\r
241 UINT16 Maximum;\r
242 UINT16 Step; // If step is 0, then manual input is specified, otherwise, left/right arrow selection is called for\r
243 UINT16 Default;\r
244} EFI_IFR_NUMERIC;\r
245\r
246//\r
247// There is an interesting twist with regards to Time and Date. This is one of the few items which can accept input from\r
248// a user, however may or may not need to use storage in the NVRAM space. The decided method for determining if NVRAM space\r
249// will be used (only for a TimeOp or DateOp) is: If .QuestionId == 0 && .Width == 0 (normally an impossibility) then use system\r
250// resources to store the data away and not NV resources. In other words, the setup engine will call gRT->SetTime, and gRT->SetDate\r
251// for the saving of data, and the values displayed will be from the gRT->GetXXXX series of calls.\r
252//\r
253typedef struct {\r
254 EFI_IFR_NUMERIC Hour;\r
255 EFI_IFR_NUMERIC Minute;\r
256 EFI_IFR_NUMERIC Second;\r
257} EFI_IFR_TIME;\r
258\r
259typedef struct {\r
260 EFI_IFR_NUMERIC Year;\r
261 EFI_IFR_NUMERIC Month;\r
262 EFI_IFR_NUMERIC Day;\r
263} EFI_IFR_DATE;\r
264\r
265typedef struct {\r
266 EFI_IFR_OP_HEADER Header;\r
267 UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name\r
268 UINT8 Width; // The Size of the Data being saved -- BUGBUG -- remove someday\r
269 STRING_REF Prompt; // The String Token for the Prompt\r
270 STRING_REF Help; // The string Token for the context-help\r
271 UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.\r
272 UINT16 Key; // Value to be passed to caller to identify this particular op-code\r
273 UINT8 MinSize; // Minimum allowable sized password\r
274 UINT8 MaxSize; // Maximum allowable sized password\r
275 UINT16 Encoding;\r
276} EFI_IFR_PASSWORD;\r
277\r
278typedef struct {\r
279 EFI_IFR_OP_HEADER Header;\r
280 UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name\r
281 UINT8 Width; // The Size of the Data being saved -- BUGBUG -- remove someday\r
282 STRING_REF Prompt; // The String Token for the Prompt\r
283 STRING_REF Help; // The string Token for the context-help\r
284 UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.\r
285 UINT16 Key; // Value to be passed to caller to identify this particular op-code\r
286 UINT8 MinSize; // Minimum allowable sized password\r
287 UINT8 MaxSize; // Maximum allowable sized password\r
288} EFI_IFR_STRING;\r
289\r
290typedef struct {\r
291 EFI_IFR_OP_HEADER Header;\r
292} EFI_IFR_END_ONE_OF;\r
293\r
294typedef struct {\r
295 EFI_IFR_OP_HEADER Header;\r
296 UINT16 Value;\r
297 UINT16 Key;\r
298} EFI_IFR_HIDDEN;\r
299\r
300typedef struct {\r
301 EFI_IFR_OP_HEADER Header;\r
302 UINT8 Flags;\r
303} EFI_IFR_SUPPRESS;\r
304\r
305typedef struct {\r
306 EFI_IFR_OP_HEADER Header;\r
307 UINT8 Flags;\r
308} EFI_IFR_GRAY_OUT;\r
309\r
310typedef struct {\r
311 EFI_IFR_OP_HEADER Header;\r
312 STRING_REF Popup;\r
313 UINT8 Flags;\r
314} EFI_IFR_INCONSISTENT;\r
315\r
316typedef struct {\r
317 EFI_IFR_OP_HEADER Header;\r
318 UINT16 QuestionId; // offset into variable storage\r
319 UINT8 Width; // size of variable storage\r
320 UINT16 Value; // value to compare against\r
321} EFI_IFR_EQ_ID_VAL;\r
322\r
323typedef struct {\r
324 EFI_IFR_OP_HEADER Header;\r
325 UINT16 QuestionId; // offset into variable storage\r
326 UINT8 Width; // size of variable storage\r
327 UINT16 ListLength;\r
328 UINT16 ValueList[1];\r
329} EFI_IFR_EQ_ID_LIST;\r
330\r
331typedef struct {\r
332 EFI_IFR_OP_HEADER Header;\r
333 UINT16 QuestionId1; // offset into variable storage for first value to compare\r
334 UINT8 Width; // size of variable storage (must be same for both)\r
335 UINT16 QuestionId2; // offset into variable storage for second value to compare\r
336} EFI_IFR_EQ_ID_ID;\r
337\r
338typedef struct {\r
339 EFI_IFR_OP_HEADER Header;\r
340 UINT16 VariableId; // offset into variable storage\r
341 UINT16 Value; // value to compare against\r
342} EFI_IFR_EQ_VAR_VAL;\r
343\r
344typedef struct {\r
345 EFI_IFR_OP_HEADER Header;\r
346} EFI_IFR_AND;\r
347\r
348typedef struct {\r
349 EFI_IFR_OP_HEADER Header;\r
350} EFI_IFR_OR;\r
351\r
352typedef struct {\r
353 EFI_IFR_OP_HEADER Header;\r
354} EFI_IFR_NOT;\r
355\r
356typedef struct {\r
357 EFI_IFR_OP_HEADER Header;\r
358} EFI_IFR_END_EXPR, EFI_IFR_END_IF;\r
359\r
360typedef struct {\r
361 EFI_IFR_OP_HEADER Header;\r
362 UINT16 FormId;\r
363 STRING_REF Prompt;\r
364 STRING_REF Help;\r
365 UINT8 Flags;\r
366 UINT16 Key;\r
367} EFI_IFR_SAVE_DEFAULTS;\r
368\r
369typedef struct {\r
370 EFI_IFR_OP_HEADER Header;\r
371 STRING_REF Help;\r
372 STRING_REF Text;\r
373 STRING_REF TextTwo; // optional text\r
374} EFI_IFR_INVENTORY;\r
375\r
376typedef struct {\r
377 EFI_IFR_OP_HEADER Header;\r
378 EFI_GUID Guid; // GUID for the variable\r
379 UINT16 VarId; // variable store ID, as referenced elsewhere in the form\r
380 UINT16 Size; // size of the variable storage\r
381} EFI_IFR_VARSTORE;\r
382\r
383typedef struct {\r
384 EFI_IFR_OP_HEADER Header;\r
385 UINT16 VarId; // variable store ID, as referenced elsewhere in the form\r
386} EFI_IFR_VARSTORE_SELECT;\r
387\r
388//\r
389// Used for the ideqid VFR statement where two variable stores may be referenced in the\r
390// same VFR statement.\r
391// A browser should treat this as an EFI_IFR_VARSTORE_SELECT statement and assume that all following\r
392// IFR opcodes use the VarId as defined here.\r
393//\r
394typedef struct {\r
395 EFI_IFR_OP_HEADER Header;\r
396 UINT16 VarId; // variable store ID, as referenced elsewhere in the form\r
397 UINT16 SecondaryVarId; // variable store ID, as referenced elsewhere in the form\r
398} EFI_IFR_VARSTORE_SELECT_PAIR;\r
399\r
400typedef struct {\r
401 EFI_IFR_OP_HEADER Header;\r
402} EFI_IFR_TRUE;\r
403\r
404typedef struct {\r
405 EFI_IFR_OP_HEADER Header;\r
406} EFI_IFR_FALSE;\r
407\r
408typedef struct {\r
409 EFI_IFR_OP_HEADER Header;\r
410} EFI_IFR_GT;\r
411\r
412typedef struct {\r
413 EFI_IFR_OP_HEADER Header;\r
414} EFI_IFR_GE;\r
415\r
416//\r
417// Save defaults and restore defaults have same structure\r
418//\r
419#define EFI_IFR_RESTORE_DEFAULTS EFI_IFR_SAVE_DEFAULTS\r
420\r
421typedef struct {\r
422 EFI_IFR_OP_HEADER Header;\r
423 STRING_REF Title; // The string token for the banner title\r
424 UINT16 LineNumber; // 1-based line number\r
425 UINT8 Alignment; // left, center, or right-aligned\r
426} EFI_IFR_BANNER;\r
427\r
428#define EFI_IFR_BANNER_ALIGN_LEFT 0\r
429#define EFI_IFR_BANNER_ALIGN_CENTER 1\r
430#define EFI_IFR_BANNER_ALIGN_RIGHT 2\r
431#define EFI_IFR_BANNER_TIMEOUT 0xFF\r
432\r
433#pragma pack()\r
434\r
435\r
436\r
437#endif\r