]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/Csm/Include/Framework/FrameworkInternalFormRepresentation.h
OvmfPkg: Copy the required CSM components from framework packages
[mirror_edk2.git] / OvmfPkg / Csm / Include / Framework / FrameworkInternalFormRepresentation.h
CommitLineData
b522c77b
HW
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
6Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
7SPDX-License-Identifier: BSD-2-Clause-Patent\r
8\r
9 @par Revision Reference:\r
10 These definitions are from the Framework Specification HII 0.92.\r
11\r
12**/\r
13\r
14#ifndef __FRAMEWORK_INTERNAL_FORMREPRESENTATION_H__\r
15#define __FRAMEWORK_INTERNAL_FORMREPRESENTATION_H__\r
16\r
17typedef UINT16 STRING_REF;\r
18\r
19//\r
20// IFR Op codes\r
21//\r
22#define FRAMEWORK_EFI_IFR_FORM_OP 0x01\r
23#define FRAMEWORK_EFI_IFR_SUBTITLE_OP 0x02\r
24#define FRAMEWORK_EFI_IFR_TEXT_OP 0x03\r
25#define EFI_IFR_GRAPHIC_OP 0x04\r
26#define FRAMEWORK_EFI_IFR_ONE_OF_OP 0x05\r
27#define FRAMEWORK_EFI_IFR_CHECKBOX_OP 0x06\r
28#define FRAMEWORK_EFI_IFR_NUMERIC_OP 0x07\r
29#define FRAMEWORK_EFI_IFR_PASSWORD_OP 0x08\r
30#define FRAMEWORK_EFI_IFR_ONE_OF_OPTION_OP 0x09 ///< ONEOF OPTION field.\r
31#define FRAMEWORK_EFI_IFR_SUPPRESS_IF_OP 0x0A\r
32#define EFI_IFR_END_FORM_OP 0x0B\r
33#define EFI_IFR_HIDDEN_OP 0x0C\r
34#define EFI_IFR_END_FORM_SET_OP 0x0D\r
35#define FRAMEWORK_EFI_IFR_FORM_SET_OP 0x0E\r
36#define FRAMEWORK_EFI_IFR_REF_OP 0x0F\r
37#define EFI_IFR_END_ONE_OF_OP 0x10\r
38#define FRAMEWORK_EFI_IFR_END_OP EFI_IFR_END_ONE_OF_OP\r
39#define FRAMEWORK_EFI_IFR_INCONSISTENT_IF_OP 0x11\r
40#define FRAMEWORK_EFI_IFR_EQ_ID_VAL_OP 0x12\r
41#define FRAMEWORK_EFI_IFR_EQ_ID_ID_OP 0x13\r
42#define FRAMEWORK_EFI_IFR_EQ_ID_LIST_OP 0x14\r
43#define FRAMEWORK_EFI_IFR_AND_OP 0x15\r
44#define FRAMEWORK_EFI_IFR_OR_OP 0x16\r
45#define FRAMEWORK_EFI_IFR_NOT_OP 0x17\r
46#define EFI_IFR_END_IF_OP 0x18 ///< For endif of inconsistentif, suppressif, grayoutif.\r
47#define EFI_IFR_GRAYOUT_IF_OP 0x19\r
48#define FRAMEWORK_EFI_IFR_DATE_OP 0x1A\r
49#define FRAMEWORK_EFI_IFR_TIME_OP 0x1B\r
50#define FRAMEWORK_EFI_IFR_STRING_OP 0x1C\r
51#define EFI_IFR_LABEL_OP 0x1D\r
52#define EFI_IFR_SAVE_DEFAULTS_OP 0x1E\r
53#define EFI_IFR_RESTORE_DEFAULTS_OP 0x1F\r
54#define EFI_IFR_BANNER_OP 0x20\r
55#define EFI_IFR_INVENTORY_OP 0x21\r
56#define EFI_IFR_EQ_VAR_VAL_OP 0x22\r
57#define FRAMEWORK_EFI_IFR_ORDERED_LIST_OP 0x23\r
58#define FRAMEWORK_EFI_IFR_VARSTORE_OP 0x24\r
59#define EFI_IFR_VARSTORE_SELECT_OP 0x25\r
60#define EFI_IFR_VARSTORE_SELECT_PAIR_OP 0x26\r
61#define EFI_IFR_LAST_OPCODE EFI_IFR_VARSTORE_SELECT_PAIR_OP\r
62#define EFI_IFR_OEM_OP 0xFE\r
63#define EFI_IFR_NV_ACCESS_COMMAND 0xFF\r
64\r
65//\r
66// Define values for the flags fields in some VFR opcodes. These are\r
67// bitmasks.\r
68//\r
69#define EFI_IFR_FLAG_DEFAULT 0x01\r
70#define EFI_IFR_FLAG_MANUFACTURING 0x02\r
71#define EFI_IFR_FLAG_INTERACTIVE 0x04\r
72#define EFI_IFR_FLAG_NV_ACCESS 0x08\r
73#define EFI_IFR_FLAG_RESET_REQUIRED 0x10\r
74#define EFI_IFR_FLAG_LATE_CHECK 0x20\r
75\r
76#define EFI_NON_DEVICE_CLASS 0x00 ///< Useful when you do not want something in the Device Manager.\r
77#define EFI_DISK_DEVICE_CLASS 0x01\r
78#define EFI_VIDEO_DEVICE_CLASS 0x02\r
79#define EFI_NETWORK_DEVICE_CLASS 0x04\r
80#define EFI_INPUT_DEVICE_CLASS 0x08\r
81#define EFI_ON_BOARD_DEVICE_CLASS 0x10\r
82#define EFI_OTHER_DEVICE_CLASS 0x20\r
83\r
84#define EFI_SETUP_APPLICATION_SUBCLASS 0x00\r
85#define EFI_GENERAL_APPLICATION_SUBCLASS 0x01\r
86#define EFI_FRONT_PAGE_SUBCLASS 0x02\r
87#define EFI_SINGLE_USE_SUBCLASS 0x03 ///< Used to display a single entity ,and then exit.\r
88\r
89///\r
90/// Used to flag dynamically created op-codes. This is meaningful to the IFR Library set\r
91/// and the browser because we need to distinguish between compiled NV map data and created data.\r
92/// We do not allow new entries to be created in the NV map dynamically, but we do need\r
93/// to display this information correctly. To dynamically create op-codes and assume that their\r
94/// data will be saved, ensure that the NV starting location they refer to is pre-defined in the\r
95/// NV map.\r
96///\r
97#define EFI_IFR_FLAG_CREATED 128\r
98\r
99\r
100#pragma pack(1)\r
101//\r
102// IFR Structure definitions\r
103//\r
104typedef struct {\r
105 UINT8 OpCode;\r
106 UINT8 Length;\r
107} FRAMEWORK_EFI_IFR_OP_HEADER;\r
108\r
109typedef struct {\r
110 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
111 EFI_GUID Guid;\r
112 STRING_REF FormSetTitle;\r
113 STRING_REF Help;\r
114 EFI_PHYSICAL_ADDRESS CallbackHandle;\r
115 UINT16 Class;\r
116 UINT16 SubClass;\r
117 UINT16 NvDataSize; ///< Set once; the size of the NV data as defined in the script.\r
118} FRAMEWORK_EFI_IFR_FORM_SET;\r
119\r
120typedef struct {\r
121 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
122 UINT16 FormId;\r
123 STRING_REF FormTitle;\r
124} FRAMEWORK_EFI_IFR_FORM;\r
125\r
126typedef struct {\r
127 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
128 UINT16 LabelId;\r
129} EFI_IFR_LABEL;\r
130\r
131typedef struct {\r
132 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
133 STRING_REF SubTitle;\r
134} FRAMEWORK_EFI_IFR_SUBTITLE;\r
135\r
136typedef struct {\r
137 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
138 STRING_REF Help;\r
139 STRING_REF Text;\r
140 STRING_REF TextTwo;\r
141 UINT8 Flags; ///< This is included solely for purposes of interactive/dynamic support.\r
142 UINT16 Key; ///< The value to be passed to the caller to identify this particular op-code.\r
143} FRAMEWORK_EFI_IFR_TEXT;\r
144\r
145//\r
146// goto\r
147//\r
148typedef struct {\r
149 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
150 UINT16 FormId;\r
151 STRING_REF Prompt;\r
152 STRING_REF Help; ///< The string Token for the context-help.\r
153 UINT8 Flags; ///< This is included solely for purposes of interactive/dynamic support.\r
154 UINT16 Key; ///< The value to be passed to the caller to identify this particular op-code.\r
155} FRAMEWORK_EFI_IFR_REF;\r
156\r
157typedef struct {\r
158 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
159} EFI_IFR_END_FORM;\r
160\r
161typedef struct {\r
162 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
163} EFI_IFR_END_FORM_SET;\r
164\r
165//\r
166// Also notice that the IFR_ONE_OF and IFR_CHECK_BOX are identical in structure......\r
167// code assumes this to be true, if this ever changes we need to revisit the InitializeTagStructures code\r
168//\r
169typedef struct {\r
170 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
171 UINT16 QuestionId; ///< The ID designating what the question is about...\r
172 UINT8 Width; ///< The Size of the Data being saved.\r
173 STRING_REF Prompt; ///< The String Token for the Prompt.\r
174 STRING_REF Help; ///< The string Token for the context-help.\r
175} FRAMEWORK_EFI_IFR_ONE_OF;\r
176\r
177typedef struct {\r
178 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
179 UINT16 QuestionId; ///< The offset in NV for storage of the data.\r
180 UINT8 MaxEntries; ///< The maximum number of options in the ordered list (=size of NVStore).\r
181 STRING_REF Prompt; ///< The string token for the prompt.\r
182 STRING_REF Help; ///< The string token for the context-help.\r
183} FRAMEWORK_EFI_IFR_ORDERED_LIST;\r
184\r
185typedef struct {\r
186 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
187 UINT16 QuestionId; ///< The ID designating what the question is about...\r
188 UINT8 Width; ///< The Size of the Data being saved.\r
189 STRING_REF Prompt; ///< The String Token for the Prompt.\r
190 STRING_REF Help; ///< The string Token for the context-help.\r
191 UINT8 Flags; ///< If non-zero, it means that it is the default option.\r
192 UINT16 Key; ///< Value to be passed to caller to identify this particular op-code.\r
193} FRAMEWORK_EFI_IFR_CHECKBOX, EFI_IFR_CHECK_BOX;\r
194\r
195typedef struct {\r
196 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
197 STRING_REF Option; ///< The string token describing the option.\r
198 UINT16 Value; ///< The value associated with this option that is stored in the NVRAM.\r
199 UINT8 Flags; ///< If non-zero, it means that it is the default option.\r
200 UINT16 Key; ///< Value to be passed to caller to identify this particular op-code.\r
201} FRAMEWORK_EFI_IFR_ONE_OF_OPTION;\r
202\r
203typedef struct {\r
204 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
205 UINT16 QuestionId; ///< The ID designating what the question is about...\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; ///< This is included solely for purposes of interactive/dynamic support.\r
210 UINT16 Key; ///< The value to be passed to caller to identify this particular op-code.\r
211 UINT16 Minimum;\r
212 UINT16 Maximum;\r
213 UINT16 Step; ///< Zero means manual input. Otherwise, arrow selection is called for.\r
214 UINT16 Default;\r
215} FRAMEWORK_EFI_IFR_NUMERIC;\r
216\r
217//\r
218// There is an interesting twist with regards to Time and Date. This is one of the few items which can accept input\r
219// from a user, and may or may not need to use storage in the NVRAM space. The decided method for determining\r
220// if NVRAM space will be used (only for a TimeOp or DateOp) is: If .QuestionId == 0 && .Width == 0 (normally an\r
221// impossibility) then use system resources to store the data away and not NV resources. In other words, the setup\r
222// engine will call gRT->SetTime, and gRT->SetDate for the saving of data, and the values displayed will be from the\r
223// gRT->GetXXXX series of calls.\r
224//\r
225typedef struct {\r
226 FRAMEWORK_EFI_IFR_NUMERIC Hour;\r
227 FRAMEWORK_EFI_IFR_NUMERIC Minute;\r
228 FRAMEWORK_EFI_IFR_NUMERIC Second;\r
229} FRAMEWORK_EFI_IFR_TIME;\r
230\r
231typedef struct {\r
232 FRAMEWORK_EFI_IFR_NUMERIC Year;\r
233 FRAMEWORK_EFI_IFR_NUMERIC Month;\r
234 FRAMEWORK_EFI_IFR_NUMERIC Day;\r
235} FRAMEWORK_EFI_IFR_DATE;\r
236\r
237typedef struct {\r
238 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
239 UINT16 QuestionId;///< The ID designating what the question is about...\r
240 UINT8 Width; ///< The Size of the Data being saved.\r
241 STRING_REF Prompt; ///< The String Token for the Prompt.\r
242 STRING_REF Help; ///< The string Token for the context-help.\r
243 UINT8 Flags; ///< This is included solely for purposes of interactive/dynamic support.\r
244 UINT16 Key; ///< The value to be passed to caller to identify this particular op-code.\r
245 UINT8 MinSize; ///< Minimum allowable sized password.\r
246 UINT8 MaxSize; ///< Maximum allowable sized password.\r
247 UINT16 Encoding;\r
248} FRAMEWORK_EFI_IFR_PASSWORD;\r
249\r
250typedef struct {\r
251 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
252 UINT16 QuestionId; ///< The ID designating what the question is about...\r
253 UINT8 Width; ///< The Size of the Data being saved.\r
254 STRING_REF Prompt; ///< The String Token for the Prompt.\r
255 STRING_REF Help; ///< The string Token for the context-help.\r
256 UINT8 Flags; ///< This is included solely for purposes of interactive/dynamic support.\r
257 UINT16 Key; ///< The value to be passed to caller to identify this particular op-code.\r
258 UINT8 MinSize; ///< Minimum allowable sized password.\r
259 UINT8 MaxSize; ///< Maximum allowable sized password.\r
260} FRAMEWORK_EFI_IFR_STRING;\r
261\r
262typedef struct {\r
263 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
264} EFI_IFR_END_ONE_OF;\r
265\r
266typedef struct {\r
267 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
268 UINT16 Value;\r
269 UINT16 Key;\r
270} EFI_IFR_HIDDEN;\r
271\r
272///\r
273/// Inconsistent with specification here:\r
274/// The following defintion may not comply with Framework Specification HII 0.92. To\r
275/// keep the inconsistant is for implementation needed.\r
276///@{\r
277typedef struct {\r
278 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
279 UINT8 Flags;\r
280} EFI_IFR_SUPPRESS;\r
281\r
282typedef struct {\r
283 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
284 UINT8 Flags;\r
285} EFI_IFR_GRAY_OUT;\r
286\r
287typedef struct {\r
288 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
289 STRING_REF Popup;\r
290 UINT8 Flags;\r
291} EFI_IFR_INCONSISTENT;\r
292\r
293typedef struct {\r
294 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
295 UINT16 QuestionId; ///< The offset into variable storage.\r
296 UINT8 Width; ///< The size of variable storage.\r
297 UINT16 Value; ///< The value to compare against.\r
298} FRAMEWORK_EFI_IFR_EQ_ID_VAL;\r
299\r
300typedef struct {\r
301 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
302 UINT16 QuestionId; ///< The offset into variable storage.\r
303 UINT8 Width; ///< The size of variable storage.\r
304 UINT16 ListLength;\r
305 UINT16 ValueList[1];\r
306} FRAMEWORK_EFI_IFR_EQ_ID_LIST;\r
307\r
308typedef struct {\r
309 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
310 UINT16 QuestionId1; ///< The offset into variable storage for first value to compare.\r
311 UINT8 Width; ///< The size of variable storage (must be same for both).\r
312 UINT16 QuestionId2; ///< The offset into variable storage for second value to compare.\r
313} FRAMEWORK_EFI_IFR_EQ_ID_ID;\r
314\r
315typedef struct {\r
316 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
317 UINT16 VariableId; ///< The offset into variable storage.\r
318 UINT16 Value; ///< The value to compare against.\r
319} EFI_IFR_EQ_VAR_VAL;\r
320///@}\r
321\r
322typedef struct {\r
323 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
324} FRAMEWORK_EFI_IFR_AND;\r
325\r
326typedef struct {\r
327 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
328} FRAMEWORK_EFI_IFR_OR;\r
329\r
330typedef struct {\r
331 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
332} FRAMEWORK_EFI_IFR_NOT;\r
333\r
334typedef struct {\r
335 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
336} EFI_IFR_END_EXPR, EFI_IFR_END_IF;\r
337\r
338typedef struct {\r
339 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
340 UINT16 FormId;\r
341 STRING_REF Prompt;\r
342 STRING_REF Help;\r
343 UINT8 Flags;\r
344 UINT16 Key;\r
345} EFI_IFR_SAVE_DEFAULTS;\r
346\r
347typedef struct {\r
348 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
349 STRING_REF Help;\r
350 STRING_REF Text;\r
351 STRING_REF TextTwo; ///< Optional text.\r
352} EFI_IFR_INVENTORY;\r
353\r
354typedef struct {\r
355 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
356 EFI_GUID Guid; ///< GUID for the variable.\r
357 UINT16 VarId; ///< The variable store ID, as referenced elsewhere in the form.\r
358 UINT16 Size; ///< The size of the variable storage.\r
359} FRAMEWORK_EFI_IFR_VARSTORE;\r
360\r
361typedef struct {\r
362 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
363 UINT16 VarId; ///< The variable store ID, as referenced elsewhere in the form.\r
364} EFI_IFR_VARSTORE_SELECT;\r
365\r
366///\r
367/// Used for the ideqid VFR statement where two variable stores may be referenced in the\r
368/// same VFR statement.\r
369/// A browser should treat this as an FRAMEWORK_EFI_IFR_VARSTORE_SELECT statement and assume that all following\r
370/// IFR opcodes use the VarId as defined here.\r
371///\r
372typedef struct {\r
373 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
374 UINT16 VarId; ///< The variable store ID, as referenced elsewhere in the form.\r
375 UINT16 SecondaryVarId; ///< The variable store ID, as referenced elsewhere in the form.\r
376} EFI_IFR_VARSTORE_SELECT_PAIR;\r
377\r
378///\r
379/// Save defaults and restore defaults have same structure.\r
380///\r
381#define EFI_IFR_RESTORE_DEFAULTS EFI_IFR_SAVE_DEFAULTS\r
382\r
383typedef struct {\r
384 FRAMEWORK_EFI_IFR_OP_HEADER Header;\r
385 STRING_REF Title; ///< The string token for the banner title.\r
386 UINT16 LineNumber; ///< 1-based line number.\r
387 UINT8 Alignment; ///< Left, center, or right-aligned.\r
388} EFI_IFR_BANNER;\r
389\r
390#define EFI_IFR_BANNER_ALIGN_LEFT 0\r
391#define EFI_IFR_BANNER_ALIGN_CENTER 1\r
392#define EFI_IFR_BANNER_ALIGN_RIGHT 2\r
393#define EFI_IFR_BANNER_TIMEOUT 0xFF\r
394\r
395#pragma pack()\r
396\r
397#endif\r