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