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