VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr@ 105670

Last change on this file since 105670 was 105670, checked in by vboxsync, 4 months ago

Devices/EFI/FirmwareNew: Merge edk2-stable-202405 and make it build on aarch64, bugref:4643

  • Property svn:eol-style set to native
File size: 37.4 KB
Line 
1///** @file
2//
3// Sample Setup formset.
4//
5// Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
6// (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
7// SPDX-License-Identifier: BSD-2-Clause-Patent
8//
9//**/
10
11
12#include <Uefi/UefiMultiPhase.h>
13#include "NVDataStruc.h"
14
15//
16// Formset class used by Device Manager
17//
18#define EFI_NON_DEVICE_CLASS 0x00
19#define EFI_DISK_DEVICE_CLASS 0x01
20#define EFI_VIDEO_DEVICE_CLASS 0x02
21#define EFI_NETWORK_DEVICE_CLASS 0x04
22#define EFI_INPUT_DEVICE_CLASS 0x08
23#define EFI_ON_BOARD_DEVICE_CLASS 0x10
24#define EFI_OTHER_DEVICE_CLASS 0x20
25
26//
27// Formset subclass
28//
29#define EFI_SETUP_APPLICATION_SUBCLASS 0x00
30#define EFI_GENERAL_APPLICATION_SUBCLASS 0x01
31#define EFI_FRONT_PAGE_SUBCLASS 0x02
32#define EFI_SINGLE_USE_SUBCLASS 0x03
33
34#define EFI_USER_INFO_ACCESS_SETUP_ADMIN_GUID \
35 { 0x85b75607, 0xf7ce, 0x471e, { 0xb7, 0xe4, 0x2a, 0xea, 0x5f, 0x72, 0x32, 0xee } }
36
37#define PERL_GUID \
38 { 0x63E60A51, 0x497D, 0xD427, {0xC4, 0xA5, 0xB8, 0xAB, 0xDC, 0x3A, 0xAE, 0xB6 }}
39
40//
41// Labels definition
42//
43#define LABEL_1_VALUE 0x01
44#define LABEL_2_VALUE 0x1000
45#define LABEL_UPDATE_BBS 0x2222
46
47formset
48 guid = DRIVER_SAMPLE_FORMSET_GUID,
49 title = STRING_TOKEN(STR_FORM_SET_TITLE),
50 help = STRING_TOKEN(STR_FORM_SET_TITLE_HELP),
51 classguid = EFI_HII_PLATFORM_SETUP_FORMSET_GUID,
52
53 //
54 // Notes: VfrCompiler will insert a Standard Default Storage declaration
55 // after the formset declaration. >00000040: 5C 06 00 00 00 00.
56 // So we don't need to declare the Standard Default.
57 // Please check the vfr.lst file for details.
58 // To enable list file for VFR, add "-l" to VfrCompile <Command> in [Build.Visual-Form-Representation-File] as follows:
59 // VfrCompile -l --no-pre-processing --output-directory ${d_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
60 //
61
62 //
63 // Define a Buffer Storage (EFI_IFR_VARSTORE)
64 //
65 varstore DRIVER_SAMPLE_CONFIGURATION, // This is the data structure type
66 varid = CONFIGURATION_VARSTORE_ID, // Optional VarStore ID
67 name = MyIfrNVData, // Define referenced name in vfr
68 guid = DRIVER_SAMPLE_FORMSET_GUID; // GUID of this buffer storage
69
70 //
71 // Define a EFI variable Storage (EFI_IFR_VARSTORE_EFI)
72 //
73 efivarstore MY_EFI_VARSTORE_DATA,
74 attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE, // EFI variable attribures
75 name = MyEfiVar,
76 guid = DRIVER_SAMPLE_FORMSET_GUID;
77
78 //
79 // Define a Buffer Storage (EFI_IFR_VARSTORE)
80 //
81 efivarstore MY_EFI_BITS_VARSTORE_DATA, // This is the data structure type
82 attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE, // EFI variable attribures
83 name = MyEfiBitVar, // Define referenced name in vfr
84 guid = DRIVER_SAMPLE_FORMSET_GUID; // GUID of this buffer storage
85
86 efivarstore MY_EFI_UNION_DATA,
87 attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE, // EFI variable attribures
88 name = MyEfiUnionVar,
89 guid = DRIVER_SAMPLE_FORMSET_GUID;
90
91 //
92 // Define a Name/Value Storage (EFI_IFR_VARSTORE_NAME_VALUE)
93 //
94 namevaluevarstore MyNameValueVar, // Define storage reference name in vfr
95 name = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME0), // Define Name list of this storage, refer it by MyNameValueVar[0]
96 name = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME1), // Define Name list of this storage, refer it by MyNameValueVar[1]
97 name = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME2), // Define Name list of this storage, refer it by MyNameValueVar[2]
98 guid = DRIVER_SAMPLE_FORMSET_GUID; // GUID of this Name/Value storage
99
100 defaultstore MyStandardDefault,
101 prompt = STRING_TOKEN(STR_STANDARD_DEFAULT_PROMPT),
102 attribute = 0x0000; // Default ID: 0000 standard default
103
104 defaultstore MyManufactureDefault,
105 prompt = STRING_TOKEN(STR_MANUFACTURE_DEFAULT_PROMPT),
106 attribute = 0x0001; // Default ID: 0001 manufacture default
107
108 //
109 // Define a Form (EFI_IFR_FORM)
110 //
111 form formid = 1, // Form ID
112 title = STRING_TOKEN(STR_FORM1_TITLE); // Form title
113
114 subtitle text = STRING_TOKEN(STR_SUBTITLE_TEXT);
115
116 subtitle text = STRING_TOKEN(STR_SUBTITLE_TEXT2);
117
118 //
119 // Define a display only text (EFI_IFR_TEXT)
120 //
121 text
122 help = STRING_TOKEN(STR_TEXT_HELP), // Help string
123 text = STRING_TOKEN(STR_CPU_STRING), // Prompt string
124 text = STRING_TOKEN(STR_CPU_STRING2); // TextTwo
125
126 //
127 // Define action button (EFI_IFR_ACTION)
128 //
129 text
130 help = STRING_TOKEN(STR_EXIT_TEXT),
131 text = STRING_TOKEN(STR_EXIT_TEXT),
132 flags = INTERACTIVE, // VfrCompiler will generate opcode EFI_IFR_ACTION for Text marked as INTERACTIVE
133 key = 0x1237;
134
135 text
136 help = STRING_TOKEN(STR_SAVE_TEXT),
137 text = STRING_TOKEN(STR_SAVE_TEXT),
138 flags = INTERACTIVE,
139 key = 0x1238;
140
141 text
142 help = STRING_TOKEN(STR_SAVE_CURRENT),
143 text = STRING_TOKEN(STR_SAVE_CURRENT),
144 flags = INTERACTIVE,
145 key = 0x1243;
146
147 text
148 help = STRING_TOKEN(STR_DISCARD_CURRENT_AND_EXIT),
149 text = STRING_TOKEN(STR_DISCARD_CURRENT_AND_EXIT),
150 flags = INTERACTIVE,
151 key = 0x1244;
152 //
153 // Define oneof (EFI_IFR_ONE_OF)
154 //
155 oneof name = MyOneOf, // Define reference name for Question
156 varid = MyIfrNVData.SuppressGrayOutSomething, // Use "DataStructure.Member" to reference Buffer Storage
157 prompt = STRING_TOKEN(STR_ONE_OF_PROMPT),
158 help = STRING_TOKEN(STR_ONE_OF_HELP),
159 //
160 // Define an option (EFI_IFR_ONE_OF_OPTION)
161 //
162 option text = STRING_TOKEN(STR_ONE_OF_TEXT4), value = 0x0, flags = 0;
163 option text = STRING_TOKEN(STR_ONE_OF_TEXT5), value = 0x1, flags = 0;
164 //
165 // DEFAULT indicate this option will be marked with EFI_IFR_OPTION_DEFAULT
166 //
167 option text = STRING_TOKEN(STR_ONE_OF_TEXT6), value = 0x2, flags = DEFAULT;
168 endoneof;
169
170 oneof varid = MyIfrNVData.BootOrderLarge,
171 prompt = STRING_TOKEN(STR_ONE_OF_PROMPT),
172 help = STRING_TOKEN(STR_ONE_OF_HELP),
173 default value = cond (pushthis == 0 ? 0 : cond ((questionref(MyOneOf) >> 0x4 & 0xF00) == 0x0 + 0x2 ? 0 : 1)),
174 option text = STRING_TOKEN(STR_BOOT_ORDER1), value = 0x0, flags = 0;
175 option text = STRING_TOKEN(STR_BOOT_ORDER2), value = 0x1, flags = 0;
176 endoneof;
177
178 grayoutif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x1;
179 suppressif questionref(MyOneOf) == 0x0;
180
181 checkbox varid = MyIfrNVData.ChooseToActivateNuclearWeaponry,
182 prompt = STRING_TOKEN(STR_CHECK_BOX_PROMPT),
183 help = STRING_TOKEN(STR_CHECK_BOX_HELP),
184 //
185 // CHECKBOX_DEFAULT indicate this checkbox is marked with EFI_IFR_CHECKBOX_DEFAULT
186 // CHECKBOX_DEFAULT_MFG indicate EFI_IFR_CHECKBOX_DEFAULT_MFG.
187 //
188 flags = CHECKBOX_DEFAULT | CHECKBOX_DEFAULT_MFG,
189 default = TRUE,
190 endcheckbox;
191 endif;
192 endif;
193
194 //
195 // Ordered list:
196 // sizeof(MyIfrNVData) storage must be UINT8 array, and
197 // size written for the variable must be size of the entire
198 // variable.
199 //
200 //
201 suppressif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x0;
202
203 //
204 // label is defined as an anchor where you want to insert some dynamic
205 // opcodes created on-the-fly
206 //
207 label LABEL_UPDATE_BBS;
208
209 orderedlist
210 varid = MyIfrNVData.BootOrder,
211 prompt = STRING_TOKEN(STR_BOOT_OPTIONS),
212 help = STRING_TOKEN(STR_NULL_STRING),
213 flags = RESET_REQUIRED,
214 option text = STRING_TOKEN(STR_BOOT_OPTION2), value = 2, flags = 0;
215 option text = STRING_TOKEN(STR_BOOT_OPTION1), value = 1, flags = 0;
216 option text = STRING_TOKEN(STR_BOOT_OPTION3), value = 3, flags = 0;
217 suppressif ideqval MyIfrNVData.BootOrderLarge == 0;
218 option text = STRING_TOKEN(STR_BOOT_OPTION4), value = 4, flags = 0;
219 endif;
220 endlist;
221
222 //
223 // label should be paired with each other
224 //
225 label LABEL_END;
226
227 endif; // end suppressif
228
229 disableif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x2;
230 orderedlist
231 varid = MyIfrNVData.OrderedList,
232 prompt = STRING_TOKEN(STR_TEST_OPCODE),
233 help = STRING_TOKEN(STR_TEXT_HELP),
234 flags = RESET_REQUIRED,
235 option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 3, flags = 0;
236 option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 2, flags = 0;
237 option text = STRING_TOKEN(STR_ONE_OF_TEXT3), value = 1, flags = 0;
238 default = {1,2,3},
239 endlist;
240 endif;
241
242 label 100;
243
244 //
245 // Define a hyperlink (EFI_IFR_REF)
246 //
247 goto 0x1234, // Destination Form ID
248 prompt = STRING_TOKEN(STR_GOTO_DYNAMIC), // Prompt string
249 help = STRING_TOKEN(STR_GOTO_HELP), // Help string
250 flags = INTERACTIVE, // INTERACTIVE indicate it's marked with EFI_IFR_FLAG_CALLBACK
251 key = 0x1234; // Question ID which will be passed-in in COnfigAccess.Callback()
252
253 goto 0x1234,
254 prompt = STRING_TOKEN(STR_GOTO_DYNAMIC2),
255 help = STRING_TOKEN(STR_GOTO_HELP),
256 flags = INTERACTIVE,
257 key = 0x1235;
258
259 oneof varid = MyIfrNVData.TestLateCheck,
260 prompt = STRING_TOKEN(STR_TEST_OPCODE),
261 help = STRING_TOKEN(STR_ONE_OF_HELP),
262 flags = RESET_REQUIRED,
263 option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = 0;
264 option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = DEFAULT;
265 warningif prompt = STRING_TOKEN(STR_WARNING_POPUP), timeout = 5,
266 ideqval MyIfrNVData.TestLateCheck == 0
267 endif;
268
269 endoneof;
270
271 oneof varid = MyIfrNVData.TestLateCheck2,
272 prompt = STRING_TOKEN(STR_TEST_OPCODE2),
273 help = STRING_TOKEN(STR_ONE_OF_HELP),
274 flags = RESET_REQUIRED,
275 option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = DEFAULT;
276 option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = 0;
277
278 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
279 ideqid MyIfrNVData.TestLateCheck == MyIfrNVData.TestLateCheck2
280 endif;
281
282 endoneof;
283
284 oneof varid = MyIfrNVData.QuestionAboutTreeHugging,
285 prompt = STRING_TOKEN(STR_ONE_OF_PROMPT_KEYWORD),
286 help = STRING_TOKEN(STR_ONE_OF_HELP),
287 flags = RESET_REQUIRED,
288 option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = 0;
289 option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = DEFAULT;
290 option text = STRING_TOKEN(STR_ONE_OF_TEXT3), value = 3, flags = 0;
291 endoneof;
292
293 //
294 // This is an HII option which has REST_STYLE flag and x-UEFI namespace
295 // UNI string associated. This HII option could be configured by either in-band
296 // edk2 setup browser or the remote management in out-of-band such as Redfish
297 // service. This HII option is configured through EFI_KEYWORD_HANDLER_PROTOCOL.
298 //
299 oneof varid = MyIfrNVData.QuestionXUefiKeywordRestStyle,
300 prompt = STRING_TOKEN(STR_ONE_OF_PROMPT_X_UEFI),
301 help = STRING_TOKEN(STR_ONE_OF_PROMPT_X_UEFI_HELP),
302 flags = RESET_REQUIRED | REST_STYLE,
303 option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = 0;
304 option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = DEFAULT;
305 option text = STRING_TOKEN(STR_ONE_OF_TEXT3), value = 3, flags = 0;
306 endoneof;
307
308
309 //
310 // This is a HII option which has REST_STYLE flag but without the x-UEFI namespace
311 // UNI string associated. This HII option could be configured by either
312 // setup browser or the remote management in out-of-band such as Redfish
313 // service. This HII option is configured through EFI HII Configuration Routing
314 // Protocol becasue it doesn't have x-UEFI namespace UNI string.
315 //
316 numeric varid = MyIfrNVData.QuestionNonXUefiKeywordRestStyle,
317 prompt = STRING_TOKEN(STR_ONE_OF_PROMPT_NON_X_UEFI),
318 help = STRING_TOKEN(STR_ONE_OF_PROMPT_NON_X_UEFI_HELP),
319 flags = RESET_REQUIRED | REST_STYLE,
320 minimum = 0,
321 maximum = 0xf0,
322 step = 0, // Stepping of 0 equates to a manual entering
323 // of a value, otherwise it will be adjusted by "+"/"-"
324 default = 0, // defaultstore could be used to specify the default type
325 // If no defaultstore is specified, it implies Standard Default
326 endnumeric;
327
328 //
329 // Define a string (EFI_IFR_STRING)
330 //
331 string varid = MyIfrNVData.MyStringData,
332 prompt = STRING_TOKEN(STR_MY_STRING_PROMPT2),
333 help = STRING_TOKEN(STR_MY_STRING_HELP2),
334 flags = INTERACTIVE,
335 key = 0x1236,
336 minsize = 6,
337 maxsize = 40,
338 inconsistentif prompt = STRING_TOKEN(STR_STRING_CHECK_ERROR_POPUP),
339 pushthis != stringref(STRING_TOKEN(STR_STRING_CHECK))
340 endif;
341 endstring;
342
343 //
344 // Define a numeric (EFI_IFR_NUMERIC)
345 //
346 numeric varid = MyIfrNVData.HowOldAreYouInYearsManual,
347 prompt = STRING_TOKEN(STR_NUMERIC_READONLY_PROMPT),
348 help = STRING_TOKEN(STR_NUMERIC_HELP0),
349 flags = READ_ONLY, // READ_ONLY indicate it's marked with EFI_IFR_FLAG_READ_ONLY
350 minimum = 0,
351 maximum = 0xf0,
352 step = 0, // Stepping of 0 equates to a manual entering
353 // of a value, otherwise it will be adjusted by "+"/"-"
354 default = 21, // defaultstore could be used to specify the default type
355 // If no defaultstore is specified, it implies Standard Default
356
357 endnumeric;
358
359 numeric varid = MyIfrNVData.HowOldAreYouInYearsManual,
360 prompt = STRING_TOKEN(STR_NUMERIC_MANUAL_PROMPT),
361 help = STRING_TOKEN(STR_NUMERIC_HELP0),
362 minimum = 0,
363 maximum = 0xf0,
364 step = 0,
365 default value = questionrefval(devicepath = STRING_TOKEN (STR_DEVICE_PATH), guid = DRIVER_SAMPLE_FORMSET_GUID, 0x1111),
366
367 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
368 ideqval MyIfrNVData.HowOldAreYouInYearsManual == 99
369 OR
370 ideqid MyIfrNVData.HowOldAreYouInYearsManual == MyEfiVar.Field8
371 OR
372 ideqvallist MyIfrNVData.HowOldAreYouInYearsManual == 1 3 5 7
373 endif;
374
375 endnumeric;
376
377 numeric varid = MyEfiVar.Field8, // Reference of EFI variable storage
378 questionid = 0x1111,
379 prompt = STRING_TOKEN(STR_TALL_HEX_PROMPT),
380 help = STRING_TOKEN(STR_NUMERIC_HELP1),
381 flags = DISPLAY_UINT_HEX | INTERACTIVE, // Display in HEX format (if not specified, default is in decimal format)
382 minimum = 0,
383 maximum = 250,
384 default = 18, defaultstore = MyStandardDefault, // This is standard default value
385 default = 19, defaultstore = MyManufactureDefault, // This is manufacture default value
386
387 endnumeric;
388
389 //
390 // Define numeric using Name/Value Storage
391 //
392 numeric varid = MyNameValueVar[0], // This numeric take NameValueVar0 as storage
393 prompt = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME0),
394 help = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME0_HELP),
395 //
396 // Size should be defined for numeric when use Name/Value storage
397 // Valid value for numerice size are: NUMERIC_SIZE_1, NUMERIC_SIZE_2, NUMERIC_SIZE_4 and NUMERIC_SIZE_8
398 //
399 flags = NUMERIC_SIZE_1, // Size of this numeric is 1 byte
400 minimum = 0,
401 maximum = 0xff,
402 step = 0,
403 locked,
404 default = 16, defaultstore = MyStandardDefault, // This is standard default value
405 default = 17, defaultstore = MyManufactureDefault, // This is manufacture default value
406 endnumeric;
407
408 numeric varid = MyNameValueVar[1], // This numeric take NameValueVar1 as storage
409 prompt = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME1),
410 help = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME1_HELP),
411 flags = NUMERIC_SIZE_2, // Size of this numeric is 2 bytes
412 minimum = 0,
413 maximum = 0xffff,
414 step = 0,
415 default = 18, defaultstore = MyStandardDefault, // This is standard default value
416 default = 19, defaultstore = MyManufactureDefault, // This is manufacture default value
417 endnumeric;
418
419 //
420 // Define string using Name/Value Storage
421 //
422 string varid = MyNameValueVar[2], // This string take NameValueVar2 as storage
423 prompt = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME2),
424 help = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME2_HELP),
425 minsize = 2,
426 maxsize = 0x14,
427 endstring;
428
429 oneof varid = MyEfiVar.Field16,
430 prompt = STRING_TOKEN(STR_ONE_OF_PROMPT),
431 help = STRING_TOKEN(STR_NUMERIC_NUM_HELP),
432 option text = STRING_TOKEN(STR_BOOT_ORDER1), value = 0x0, flags = 0;
433 option text = STRING_TOKEN(STR_BOOT_ORDER2), value = 0x1, flags = DEFAULT;
434 endoneof;
435
436 label LABEL_1_VALUE;
437 label LABEL_2_VALUE;
438
439 grayoutif ideqval MyIfrNVData.HowOldAreYouInYearsManual == 23 AND ideqval MyIfrNVData.SuppressGrayOutSomething == 0x1;
440 numeric varid = MyIfrNVData.HowOldAreYouInYears,
441 prompt = STRING_TOKEN(STR_NUMERIC_STEP_PROMPT),
442 help = STRING_TOKEN(STR_NUMERIC_HELP2),
443 minimum = 0,
444 maximum = 243,
445 step = 1,
446 default = 18, defaultstore = MyStandardDefault, // This is standard default value
447 default = 19, defaultstore = MyManufactureDefault, // This is manufacture default value
448
449 endnumeric;
450 endif;
451
452 numeric varid = MyIfrNVData.GetDefaultValueFromAccess,
453 questionid = 0x1239,
454 prompt = STRING_TOKEN(STR_DEFAULT_VALUE_FROM_ACCESS_PROMPT),
455 help = STRING_TOKEN(STR_DEFAULT_VALUE_FROM_ACCESS_HELP),
456 flags = DISPLAY_UINT_HEX | INTERACTIVE,
457 minimum = 0,
458 maximum = 255,
459 step = 1,
460 default = 18,
461 endnumeric;
462
463 numeric varid = MyIfrNVData.GetDefaultValueFromCallBack,
464 questionid = 0x1240,
465 prompt = STRING_TOKEN(STR_DEFAULT_VALUE_FROM_CALLBACK_PROMPT),
466 help = STRING_TOKEN(STR_DEFAULT_VALUE_FROM_CALLBACK_HELP),
467 flags = DISPLAY_UINT_HEX | INTERACTIVE,
468 minimum = 0,
469 maximum = 255,
470 step = 1,
471 default = 18,
472 endnumeric;
473
474 orderedlist
475 varid = MyIfrNVData.GetDefaultValueFromCallBackForOrderedList,
476 questionid = 0x1252,
477 prompt = STRING_TOKEN(STR_DEFAULT_VALUE_FROM_CALLBACK_PROMPT),
478 help = STRING_TOKEN(STR_DEFAULT_VALUE_FROM_CALLBACK_HELP),
479 flags = INTERACTIVE,
480 option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 1, flags = 0;
481 option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 2, flags = 0;
482 option text = STRING_TOKEN(STR_ONE_OF_TEXT3), value = 3, flags = 0;
483 endlist;
484
485 resetbutton
486 defaultstore = MyStandardDefault,
487 prompt = STRING_TOKEN(STR_STANDARD_DEFAULT_PROMPT),
488 help = STRING_TOKEN(STR_STANDARD_DEFAULT_HELP),
489 endresetbutton;
490
491 resetbutton
492 defaultstore = MyManufactureDefault,
493 prompt = STRING_TOKEN(STR_MANUFACTURE_DEFAULT_PROMPT),
494 help = STRING_TOKEN(STR_MANUFACTURE_DEFAULT_HELP),
495 endresetbutton;
496
497 //
498 // Sample use case for IFR Security op-code
499 //
500 grayoutif NOT security (EFI_USER_INFO_ACCESS_SETUP_ADMIN_GUID);
501 text
502 help = STRING_TOKEN(STR_TEXT_SECRUITY_TEST_HELP),
503 text = STRING_TOKEN(STR_TEXT_SECRUITY_TEST_TEXT);
504 endif;
505
506 numeric varid = MyEfiVar.SubmittedCallback,
507 questionid = 0x1250,
508 prompt = STRING_TOKEN(STR_SUBMITTED_CALLBACK_TEST_PROMPT),
509 help = STRING_TOKEN(STR_SUBMITTED_CALLBACK_TEST_HELP),
510 flags = INTERACTIVE,
511 minimum = 0,
512 maximum = 255,
513 default = 18,
514 endnumeric;
515
516 numeric varid = MyIfrNVData.QuestionApply,
517 questionid = 0x1253,
518 prompt = STRING_TOKEN(STR_QUESTION_APPLY_TEST_PROMPT),
519 help = STRING_TOKEN(STR_QUESTION_APPLY_TEST_HELP),
520 flags = INTERACTIVE,
521 minimum = 0,
522 maximum = 255,
523 default = 19,
524 endnumeric;
525
526 text
527 help = STRING_TOKEN(STR_POPUP_TEST_HELP),
528 text = STRING_TOKEN(STR_POPUP_TEST_PROMPT),
529 flags = INTERACTIVE,
530 key = 0x1330;
531
532 goto 2,
533 prompt = STRING_TOKEN(STR_GOTO_FORM2), //SecondSetupPage // this too has no end-op and basically it's a jump to a form ONLY
534 help = STRING_TOKEN(STR_GOTO_HELP);
535
536 goto 3,
537 prompt = STRING_TOKEN(STR_GOTO_FORM3), //ThirdSetupPage // this too has no end-op and basically it's a jump to a form ONLY
538 help = STRING_TOKEN(STR_GOTO_HELP);
539
540 goto 4,
541 prompt = STRING_TOKEN(STR_GOTO_FORM4), //FourthSetupPage // this too has no end-op and basically it's a jump to a form ONLY
542 help = STRING_TOKEN(STR_GOTO_HELP);
543
544 goto 5,
545 prompt = STRING_TOKEN(STR_GOTO_FORM5), //FifthSetupPage // this too has no end-op and basically it's a jump to a form ONLY
546 help = STRING_TOKEN(STR_GOTO_FORM5_HELP);
547
548 goto 6,
549 prompt = STRING_TOKEN(STR_GOTO_FORM6), //SixthSetupPage // this too has no end-op and basically it's a jump to a form ONLY
550 help = STRING_TOKEN(STR_GOTO_HELP);
551
552 goto
553 formsetguid = DRIVER_SAMPLE_INVENTORY_GUID,
554 formid = 0x1,
555 question = 0x1,
556 prompt = STRING_TOKEN(STR_GOTO_ANOTHER_FORMSET),
557 help = STRING_TOKEN(STR_GOTO_ANOTHER_FORMSET_HELP);
558
559 guidop
560 guid = DRIVER_SAMPLE_FORMSET_GUID,
561 datatype = MY_EFI_VARSTORE_DATA,
562 data.Field8 = 0x21,
563 data.Field16 = 0x2121,
564 data.OrderedList[0] = 0x21,
565 endguidop;
566
567 goto 7,
568 prompt = STRING_TOKEN(STR_GOTO_FORM7),
569 help = STRING_TOKEN(STR_GOTO_FORM7_HELP);
570
571 endform;
572
573 suppressif ideqval MyIfrNVData.BootOrderLarge == 0;
574 form formid = 2, // SecondSetupPage,
575 title = STRING_TOKEN(STR_FORM2_TITLE); // note formid is a variable (for readability) (UINT16) - also added Form to the line to signify the Op-Code
576
577 date
578 name = Date,
579 prompt = STRING_TOKEN(STR_DATE_PROMPT),
580 help = STRING_TOKEN(STR_DATE_HELP),
581 flags = STORAGE_TIME,
582 default = 2004/1/1,
583
584 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
585 ideqval Date.Day == 31
586 AND
587 ideqvallist Date.Month == 2 4 6 9 11
588 endif;
589
590 //
591 // If the day is 30 AND month is 2
592 //
593 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
594 ideqval Date.Day == 30
595 AND
596 ideqval Date.Month == 2
597 endif;
598
599 //
600 // If the day is 29 AND month is 2 AND it year is NOT a leapyear
601 //
602 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
603 ideqval Date.Day == 0x1D
604 AND
605 ideqval Date.Month == 2
606 AND
607 NOT
608 ideqvallist Date.Year == 2004 2008 20012 20016 2020 2024 2028 2032 2036
609 endif;
610
611 enddate;
612
613 text
614 help = STRING_TOKEN(STR_SAVE_CURRENT_AND_EXIT),
615 text = STRING_TOKEN(STR_SAVE_CURRENT_AND_EXIT),
616 flags = INTERACTIVE,
617 key = 0x1241;
618
619 text
620 help = STRING_TOKEN(STR_DISCARD_CURRENT),
621 text = STRING_TOKEN(STR_DISCARD_CURRENT),
622 flags = INTERACTIVE,
623 key = 0x1242;
624
625 time
626 prompt = STRING_TOKEN(STR_TIME_PROMPT),
627 help = STRING_TOKEN(STR_TIME_HELP),
628 flags = STORAGE_TIME,
629 endtime;
630
631 time
632 name = MyTime,
633 varid = MyIfrNVData.Time,
634 prompt = STRING_TOKEN(STR_TIME_PROMPT),
635 help = STRING_TOKEN(STR_TIME_PROMPT),
636 flags = STORAGE_NORMAL | SECOND_SUPPRESS,
637 default = 15:33:33,
638 endtime;
639
640 checkbox varid = MyIfrNVData.ChooseToActivateNuclearWeaponry,
641 prompt = STRING_TOKEN(STR_CHECK_BOX_PROMPT),
642 help = STRING_TOKEN(STR_CHECK_BOX_HELP),
643 flags = CHECKBOX_DEFAULT,
644 endcheckbox;
645
646 text
647 help = STRING_TOKEN(STR_TEXT_HELP),
648 text = STRING_TOKEN(STR_TEXT_TEXT_1);
649
650 text
651 help = STRING_TOKEN(STR_TEXT_HELP),
652 text = STRING_TOKEN(STR_TEXT_TEXT_1),
653 text = STRING_TOKEN(STR_TEXT_TEXT_2);
654
655 goto 1,
656 prompt = STRING_TOKEN(STR_GOTO_FORM1), //MainSetupPage // this too has no end-op and basically it's a jump to a form ONLY
657 help = STRING_TOKEN(STR_GOTO_HELP);
658
659 goto
660 varid = MyIfrNVData.RefData,
661 prompt = STRING_TOKEN(STR_GOTO_DYNAMIC3),
662 help = STRING_TOKEN(STR_GOTO_DYNAMIC3_HELP),
663 flags = INTERACTIVE,
664 key = 0x1248,
665 //
666 // Set the defult value, format is QuestionId; FormId; FormsetGuid; Device Path String Token
667 //
668 default = 0;0;ZERO_GUID;STRING_TOKEN(STR_NULL_STRING),
669 ; // goto opcode end flag.
670
671 goto
672 prompt = STRING_TOKEN(STR_GOTO_DYNAMIC4),
673 help = STRING_TOKEN(STR_GOTO_DYNAMIC4_HELP),
674 flags = INTERACTIVE,
675 key = 0x1249;
676
677 endform;
678 endif;
679
680 form formid = 3, title = STRING_TOKEN(STR_FORM3_TITLE); // note formid is a variable (for readability) (UINT16) - also added Form to the line to signify the Op-Code
681
682 suppressif ideqval MyEfiVar.Field8 == 111;
683 text
684 help = STRING_TOKEN(STR_TEXT_HELP),
685 text = STRING_TOKEN(STR_TEXT_TEXT_1);
686 endif;
687
688 goto 1,
689 prompt = STRING_TOKEN(STR_GOTO_FORM1), //MainSetupPage
690 help = STRING_TOKEN(STR_GOTO_HELP);
691
692 numeric varid = MyIfrNVData.DynamicRefresh,
693 prompt = STRING_TOKEN(STR_NUMERIC_MANUAL_PROMPT),
694 help = STRING_TOKEN(STR_NUMERIC_HELP0),
695 flags = INTERACTIVE,
696 key = 0x5678,
697 minimum = 0,
698 maximum = 0xff,
699 step = 0,
700 default = 0,
701 refresh interval = 3 // Refresh interval in seconds
702 endnumeric;
703
704 grayoutif match2 (stringref(STRING_TOKEN(STR_PATTERN)), stringref(STRING_TOKEN(STR_STRING)), PERL_GUID);
705 numeric
706 varid = MyIfrNVData.Match2,
707 prompt = STRING_TOKEN(STR_MATCH2_PROMPT),
708 help = STRING_TOKEN(STR_MATCH2_HELP),
709 minimum = 0,
710 maximum = 243,
711 endnumeric;
712 endif;
713
714 label LABEL_UPDATE2;
715 label LABEL_END;
716
717 endform;
718
719 formmap formid = 4,
720 maptitle = STRING_TOKEN(STR_SAMPL_MAP_METHOD);
721 mapguid = DRIVER_SAMPLE_FORMSET_GUID;
722 maptitle = STRING_TOKEN(STR_STANDARD_MAP_METHOD);
723 mapguid = EFI_HII_STANDARD_FORM_GUID;
724
725 oneof varid = MyIfrNVData.SerialPortNo,
726 prompt = STRING_TOKEN(STR_SERIAL_PORT),
727 help = STRING_TOKEN(STR_ONE_OF_HELP),
728
729 read cond (get(MyIfrNVData.SerialPortStatus) != 0 ? 0 : cond ((get(MyIfrNVData.SerialPortIo) & 0xF00) >> 0x8 == get(MyIfrNVData.SerialPortIrq) - 1 ? UNDEFINED : map (get(MyIfrNVData.SerialPortIo) : 0x3f8,1; 0x2F8,2; 0x3E8,3; 0x2E8,4;)));
730 write set(MyIfrNVData.SerialPortStatus, pushthis != 0) AND set(MyIfrNVData.SerialPortIo, map (pushthis : 1,0x3F8; 2,0x2F8; 3,0x3E8; 4,0x2E8;)) AND set (MyIfrNVData.SerialPortIrq, map (pushthis: 1,4; 2,3; 3,4; 4,3;));
731
732 option text = STRING_TOKEN(STR_SERIAL_PORT_DISABLE), value = 0x0, flags = DEFAULT;
733 option text = STRING_TOKEN(STR_SERIAL_PORT1), value = 0x1, flags = 0;
734 option text = STRING_TOKEN(STR_SERIAL_PORT2), value = 0x2, flags = 0;
735 option text = STRING_TOKEN(STR_SERIAL_PORT3), value = 0x3, flags = 0;
736 option text = STRING_TOKEN(STR_SERIAL_PORT4), value = 0x4, flags = 0;
737 endoneof;
738
739 grayoutif TRUE;
740 checkbox varid = MyIfrNVData.SerialPortStatus,
741 prompt = STRING_TOKEN(STR_SERIAL_PORT_STATUS),
742 help = STRING_TOKEN(STR_CHECK_BOX_HELP),
743 endcheckbox;
744 endif;
745
746 grayoutif TRUE;
747 suppressif ideqval MyIfrNVData.SerialPortStatus == 0;
748 oneof varid = MyIfrNVData.SerialPortIo,
749 prompt = STRING_TOKEN(STR_SERIAL_PORT_IO_ADDRESS),
750 help = STRING_TOKEN(STR_ONE_OF_HELP),
751
752 option text = STRING_TOKEN(STR_SERIAL_PORT1_IOADDR), value = 0x3F8, flags = DEFAULT;
753 option text = STRING_TOKEN(STR_SERIAL_PORT2_IOADDR), value = 0x2F8, flags = 0;
754 option text = STRING_TOKEN(STR_SERIAL_PORT3_IOADDR), value = 0x3E8, flags = 0;
755 option text = STRING_TOKEN(STR_SERIAL_PORT4_IOADDR), value = 0x2E8, flags = 0;
756 endoneof;
757 endif;
758 endif;
759
760 grayoutif TRUE;
761 suppressif ideqval MyIfrNVData.SerialPortStatus == 0;
762 oneof varid = MyIfrNVData.SerialPortIrq,
763 prompt = STRING_TOKEN(STR_SERIAL_PORT_IRQ),
764 help = STRING_TOKEN(STR_ONE_OF_HELP),
765
766 option text = STRING_TOKEN(STR_SERIAL_PORT13_IRQ), value = 0x4, flags = DEFAULT;
767 option text = STRING_TOKEN(STR_SERIAL_PORT24_IRQ), value = 0x3, flags = 0;
768 endoneof;
769 endif;
770 endif;
771
772 goto 1,
773 prompt = STRING_TOKEN(STR_GOTO_FORM1), //MainSetupPage
774 help = STRING_TOKEN(STR_GOTO_HELP);
775
776 endform;
777
778 form formid = 5, // Modal form
779 title = STRING_TOKEN(STR_MODAL_FORM_TITLE);
780 //
781 // This form is a modal form.
782 //
783 modal;
784 text
785 help = STRING_TOKEN(STR_EXIT_TEXT),
786 text = STRING_TOKEN(STR_EXIT_TEXT),
787 flags = INTERACTIVE, // VfrCompiler will generate opcode EFI_IFR_ACTION for Text marked as INTERACTIVE
788 key = 0x1245;
789
790 text
791 help = STRING_TOKEN(STR_SAVE_TEXT),
792 text = STRING_TOKEN(STR_SAVE_TEXT),
793 flags = INTERACTIVE, // VfrCompiler will generate opcode EFI_IFR_ACTION for Text marked as INTERACTIVE
794 key = 0x1246;
795 endform;
796
797 form formid = 6, // Form to show the refresh guid group op-code
798 title = STRING_TOKEN(STR_FORM6_TITLE);
799
800 text
801 help = STRING_TOKEN(STR_TEXT_REFRESH_GUID),
802 text = STRING_TOKEN(STR_TEXT_REFRESH_GUID);
803
804 numeric varid = MyIfrNVData.RefreshGuidCount,
805 prompt = STRING_TOKEN(STR_TEXT_REFRESH_GUID_COUNT),
806 help = STRING_TOKEN(STR_NUMERIC_HELP0),
807 flags = INTERACTIVE,
808 key = 0x1247,
809 minimum = 0,
810 maximum = 0xff,
811 step = 0,
812 default = 0,
813 refreshguid = EFI_IFR_REFRESH_ID_OP_GUID,
814 endnumeric;
815
816 label LABEL_UPDATE3;
817 label LABEL_END;
818
819 endform;
820
821 form formid = 0x1234, // Dynamically created page,
822 title = STRING_TOKEN(STR_DYNAMIC_TITLE); // note formid is a variable (for readability) (UINT16) - also added Form to the line to signify the Op-Code
823
824 label LABEL_UPDATE1;
825 //
826 // This is where we will insert dynamic created opcodes
827 //
828 label LABEL_END;
829
830 endform;
831
832
833 form formid = 7, // Form to show the question refer to union and bit Varstore
834 title = STRING_TOKEN(STR_FORM7_TITLE);
835
836 subtitle text = STRING_TOKEN(STR_NEST_BIT_EFI_VARSTORE);
837
838 checkbox varid = MyEfiBitVar.BitsData.NestBitCheckbox,
839 prompt = STRING_TOKEN(STR_BIT_NEST_CHECK_BOX_PROMPT),
840 help = STRING_TOKEN(STR_BIT_NEST_CHECK_BOX_HELP),
841 flags = CHECKBOX_DEFAULT,
842 endcheckbox;
843
844 oneof varid = MyEfiBitVar.BitsData.NestBitOneof,
845 prompt = STRING_TOKEN(STR_ONE_OF_BIT_NEST_PROMPT),
846 help = STRING_TOKEN(STR_ONE_OF_BIT_NEST_HELP),
847 option text = STRING_TOKEN(STR_BOOT_ORDER1), value = 0, flags = MANUFACTURING;
848 option text = STRING_TOKEN(STR_BOOT_ORDER2), value = 1, flags = DEFAULT;
849 endoneof;
850
851 numeric varid = MyEfiBitVar.BitsData.NestBitNumeric,
852 questionid = 0x6666,
853 prompt = STRING_TOKEN(STR_BIT_NEST_NUMERIC_PROMPT),
854 help = STRING_TOKEN(STR_BIT_NEST_NUMERIC_DEFAULT_HELP),
855 flags = DISPLAY_UINT_HEX | INTERACTIVE,
856 minimum = 2,
857 maximum = 15,
858 step = 1,
859 endnumeric;
860
861 oneof varid = MyEfiBitVar.BitsData.NestByteField,
862 prompt = STRING_TOKEN(BYTE_QUESTION_NEST_BIT_PROMPT),
863 help = STRING_TOKEN(BYTE_QUESTION_NEST_BIT_HELP),
864 option text = STRING_TOKEN(STR_BOOT_ORDER1), value = 0, flags = MANUFACTURING;
865 option text = STRING_TOKEN(STR_BOOT_ORDER2), value = 1, flags = DEFAULT;
866 endoneof;
867
868 subtitle text = STRING_TOKEN(STR_SUBTITLE_TEXT2);
869 subtitle text = STRING_TOKEN(STR_BIT_EFI_VARSTORE);
870
871 checkbox varid = MyEfiBitVar.EfiBitCheckbox,
872 prompt = STRING_TOKEN(STR_BIT_CHECK_BOX_PROMPT),
873 help = STRING_TOKEN(STR_BIT_CHECK_BOX_HELP),
874 flags = CHECKBOX_DEFAULT,
875 endcheckbox;
876
877 grayoutif ideqval MyEfiBitVar.EfiBitGrayoutTest == 0;
878 numeric varid = MyEfiBitVar.EfiBitNumeric,
879 prompt = STRING_TOKEN(STR_BIT_NUMERIC_PROMPT),
880 help = STRING_TOKEN(STR_BIT_NUMERIC_HELP),
881 minimum = 0,
882 maximum = 7,
883 step = 0,
884 default = 4, defaultstore = MyStandardDefault,
885 default = 5, defaultstore = MyManufactureDefault,
886 endnumeric;
887 endif;
888
889 oneof varid = MyEfiBitVar.EfiBitOneof,
890 questionid = 0x9999,
891 prompt = STRING_TOKEN(STR_ONE_OF_BIT_PROMPT),
892 help = STRING_TOKEN(STR_ONE_OF_BIT_HELP),
893 option text = STRING_TOKEN(STR_BOOT_ORDER1), value = 0x0, flags = MANUFACTURING;
894 option text = STRING_TOKEN(STR_BOOT_ORDER2), value = 0x1, flags = DEFAULT;
895 endoneof;
896
897 subtitle text = STRING_TOKEN(STR_SUBTITLE_TEXT2);
898 subtitle text = STRING_TOKEN(STR_NEST_BIT_VARSTORE);
899 checkbox varid = MyIfrNVData.MyBitData.NestBitCheckbox,
900 prompt = STRING_TOKEN(STR_BIT_NEST_CHECK_BOX_PROMPT),
901 help = STRING_TOKEN(STR_BIT_NEST_CHECK_BOX_HELP),
902 flags = CHECKBOX_DEFAULT,
903 endcheckbox;
904
905 oneof varid = MyIfrNVData.MyBitData.NestBitOneof,
906 prompt = STRING_TOKEN(STR_ONE_OF_BIT_NEST_PROMPT),
907 help = STRING_TOKEN(STR_ONE_OF_BIT_NEST_HELP),
908 option text = STRING_TOKEN(STR_BOOT_ORDER1), value = 0, flags = MANUFACTURING;
909 option text = STRING_TOKEN(STR_BOOT_ORDER2), value = 1, flags = DEFAULT;
910 endoneof;
911
912 numeric varid = MyIfrNVData.MyBitData.NestBitNumeric,
913 prompt = STRING_TOKEN(STR_BIT_NEST_NUMERIC_PROMPT),
914 help = STRING_TOKEN(STR_BIT_NEST_NUMERIC_HELP),
915 minimum = 0,
916 maximum = 7,
917 step = 0,
918 default = 6, defaultstore = MyStandardDefault,
919 default = 7, defaultstore = MyManufactureDefault,
920 endnumeric;
921
922 oneof varid = MyIfrNVData.MyBitData.NestByteField,
923 prompt = STRING_TOKEN(BYTE_QUESTION_NEST_BIT_PROMPT),
924 help = STRING_TOKEN(BYTE_QUESTION_NEST_BIT_HELP),
925 option text = STRING_TOKEN(STR_BOOT_ORDER1), value = 0, flags = MANUFACTURING;
926 option text = STRING_TOKEN(STR_BOOT_ORDER2), value = 1, flags = DEFAULT;
927 endoneof;
928
929 subtitle text = STRING_TOKEN(STR_SUBTITLE_TEXT2);
930 subtitle text = STRING_TOKEN(STR_BIT_VARSTORE);
931
932 oneof varid = MyIfrNVData.BitOneof,
933 prompt = STRING_TOKEN(STR_ONE_OF_BIT_PROMPT),
934 help = STRING_TOKEN(STR_ONE_OF_BIT_HELP),
935 option text = STRING_TOKEN(STR_BOOT_ORDER1), value = 0, flags = MANUFACTURING;
936 option text = STRING_TOKEN(STR_BOOT_ORDER2), value = 1, flags = DEFAULT;
937 endoneof;
938
939 checkbox varid = MyIfrNVData.BitCheckbox,
940 prompt = STRING_TOKEN(STR_BIT_CHECK_BOX_PROMPT),
941 help = STRING_TOKEN(STR_BIT_CHECK_BOX_HELP),
942 flags = CHECKBOX_DEFAULT,
943 endcheckbox;
944
945 numeric varid = MyIfrNVData.BitNumeric,
946 prompt = STRING_TOKEN(STR_BIT_NUMERIC_PROMPT),
947 help = STRING_TOKEN(STR_BUFFER_BIT_NUMERIC_HELP),
948 minimum = 0,
949 maximum = 20,
950 step = 0,
951 default = 16, defaultstore = MyStandardDefault,
952 default = 17, defaultstore = MyManufactureDefault,
953 endnumeric;
954
955 subtitle text = STRING_TOKEN(STR_SUBTITLE_TEXT2);
956 subtitle text = STRING_TOKEN(STR_UNION_EFI_VARSTORE);
957
958 numeric varid = MyEfiUnionVar.UnionNumeric,
959 prompt = STRING_TOKEN(STR_UNION_BYTE_NUMERIC_PROMPT),
960 help = STRING_TOKEN(STR_UNION_BYTE_NUMERIC_HELP),
961 minimum = 0,
962 maximum = 20,
963 step = 0,
964 default = 7, defaultstore = MyStandardDefault,
965 default = 8, defaultstore = MyManufactureDefault,
966 endnumeric;
967
968 guidop
969 guid = DRIVER_SAMPLE_FORMSET_GUID,
970 datatype = MY_EFI_BITS_VARSTORE_DATA,
971 data.EfiBitNumeric = 1,
972 data.EfiBitOneof = 1,
973 data.EfiBitCheckbox = 1,
974 endguidop;
975
976 endform;
977
978endformset;
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette