]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr
Correct the default value for date opcode.
[mirror_edk2.git] / MdeModulePkg / Universal / DriverSampleDxe / Vfr.vfr
1 ///** @file
2 //
3 // Sample Setup formset.
4 //
5 // Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
6 // This program and the accompanying materials
7 // are licensed and made available under the terms and conditions of the BSD License
8 // which accompanies this distribution. The full text of the license may be found at
9 // http://opensource.org/licenses/bsd-license.php
10 //
11 // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 //
14 //**/
15
16
17 #include "NVDataStruc.h"
18
19 //
20 // Formset class used by Device Manager
21 //
22 #define EFI_NON_DEVICE_CLASS 0x00
23 #define EFI_DISK_DEVICE_CLASS 0x01
24 #define EFI_VIDEO_DEVICE_CLASS 0x02
25 #define EFI_NETWORK_DEVICE_CLASS 0x04
26 #define EFI_INPUT_DEVICE_CLASS 0x08
27 #define EFI_ON_BOARD_DEVICE_CLASS 0x10
28 #define EFI_OTHER_DEVICE_CLASS 0x20
29
30 //
31 // Formset subclass
32 //
33 #define EFI_SETUP_APPLICATION_SUBCLASS 0x00
34 #define EFI_GENERAL_APPLICATION_SUBCLASS 0x01
35 #define EFI_FRONT_PAGE_SUBCLASS 0x02
36 #define EFI_SINGLE_USE_SUBCLASS 0x03
37
38 //
39 // EFI Variable attributes
40 //
41 #define EFI_VARIABLE_NON_VOLATILE 0x00000001
42 #define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002
43 #define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004
44 #define EFI_VARIABLE_READ_ONLY 0x00000008
45
46 #define EFI_USER_INFO_ACCESS_SETUP_ADMIN_GUID \
47 { 0x85b75607, 0xf7ce, 0x471e, { 0xb7, 0xe4, 0x2a, 0xea, 0x5f, 0x72, 0x32, 0xee } }
48
49 //
50 // Labels definition
51 //
52 #define LABEL_1_VALUE 0x01
53 #define LABEL_2_VALUE 0x1000
54 #define LABEL_UPDATE_BBS 0x2222
55
56 formset
57 guid = DRIVER_SAMPLE_FORMSET_GUID,
58 title = STRING_TOKEN(STR_FORM_SET_TITLE),
59 help = STRING_TOKEN(STR_FORM_SET_TITLE_HELP),
60 classguid = EFI_HII_PLATFORM_SETUP_FORMSET_GUID,
61
62 //
63 // Notes: VfrCompiler will insert a Standard Default Storage declaration
64 // after the formset declaration. >00000040: 5C 06 00 00 00 00.
65 // So we don't need to declare the Standard Default.
66 // Please check the vfr.lst file for details.
67 // To enable list file for VFR, add "-l" to VfrCompile <Command> in [Build.Visual-Form-Representation-File] as follows:
68 // VfrCompile -l --no-pre-processing --output-directory ${d_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
69 //
70
71 //
72 // Define a Buffer Storage (EFI_IFR_VARSTORE)
73 //
74 varstore DRIVER_SAMPLE_CONFIGURATION, // This is the data structure type
75 varid = CONFIGURATION_VARSTORE_ID, // Optional VarStore ID
76 name = MyIfrNVData, // Define referenced name in vfr
77 guid = DRIVER_SAMPLE_FORMSET_GUID; // GUID of this buffer storage
78
79 //
80 // Define a EFI variable Storage (EFI_IFR_VARSTORE_EFI)
81 //
82 efivarstore MY_EFI_VARSTORE_DATA,
83 attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE, // EFI variable attribures
84 name = MyEfiVar,
85 guid = DRIVER_SAMPLE_FORMSET_GUID;
86
87 //
88 // Define a Name/Value Storage (EFI_IFR_VARSTORE_NAME_VALUE)
89 //
90 namevaluevarstore MyNameValueVar, // Define storage reference name in vfr
91 name = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME0), // Define Name list of this storage, refer it by MyNameValueVar[0]
92 name = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME1), // Define Name list of this storage, refer it by MyNameValueVar[1]
93 name = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME2), // Define Name list of this storage, refer it by MyNameValueVar[2]
94 guid = DRIVER_SAMPLE_FORMSET_GUID; // GUID of this Name/Value storage
95
96 defaultstore MyStandardDefault,
97 prompt = STRING_TOKEN(STR_STANDARD_DEFAULT_PROMPT),
98 attribute = 0x0000; // Default ID: 0000 standard default
99
100 defaultstore MyManufactureDefault,
101 prompt = STRING_TOKEN(STR_MANUFACTURE_DEFAULT_PROMPT),
102 attribute = 0x0001; // Default ID: 0001 manufacture default
103
104 //
105 // Define a Form (EFI_IFR_FORM)
106 //
107 form formid = 1, // Form ID
108 title = STRING_TOKEN(STR_FORM1_TITLE); // Form title
109
110 subtitle text = STRING_TOKEN(STR_SUBTITLE_TEXT);
111
112 subtitle text = STRING_TOKEN(STR_SUBTITLE_TEXT2);
113
114 //
115 // Define a display only text (EFI_IFR_TEXT)
116 //
117 text
118 help = STRING_TOKEN(STR_TEXT_HELP), // Help string
119 text = STRING_TOKEN(STR_CPU_STRING), // Prompt string
120 text = STRING_TOKEN(STR_CPU_STRING2); // TextTwo
121
122 //
123 // Define action button (EFI_IFR_ACTION)
124 //
125 text
126 help = STRING_TOKEN(STR_EXIT_TEXT),
127 text = STRING_TOKEN(STR_EXIT_TEXT),
128 text = STRING_TOKEN(STR_EXIT_TEXT),
129 flags = INTERACTIVE, // VfrCompiler will generate opcode EFI_IFR_ACTION for Text marked as INTERACTIVE
130 key = 0x1237;
131
132 text
133 help = STRING_TOKEN(STR_SAVE_TEXT),
134 text = STRING_TOKEN(STR_SAVE_TEXT),
135 text = STRING_TOKEN(STR_SAVE_TEXT),
136 flags = INTERACTIVE,
137 key = 0x1238;
138
139 text
140 help = STRING_TOKEN(STR_SAVE_CURRENT),
141 text = STRING_TOKEN(STR_SAVE_CURRENT),
142 text = STRING_TOKEN(STR_SAVE_CURRENT),
143 flags = INTERACTIVE,
144 key = 0x1243;
145
146 text
147 help = STRING_TOKEN(STR_DISCARD_CURRENT_AND_EXIT),
148 text = 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 key = 0,
190 default = 1,
191 endcheckbox;
192 endif;
193 endif;
194
195 //
196 // Ordered list:
197 // sizeof(MyIfrNVData) storage must be UINT8 array, and
198 // size written for the variable must be size of the entire
199 // variable.
200 //
201 //
202 suppressif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x0;
203
204 //
205 // label is defined as an anchor where you want to insert some dynamic
206 // opcodes created on-the-fly
207 //
208 label LABEL_UPDATE_BBS;
209
210 orderedlist
211 varid = MyIfrNVData.BootOrder,
212 prompt = STRING_TOKEN(STR_BOOT_OPTIONS),
213 help = STRING_TOKEN(STR_NULL_STRING),
214 option text = STRING_TOKEN(STR_BOOT_OPTION2), value = 2, flags = RESET_REQUIRED;
215 option text = STRING_TOKEN(STR_BOOT_OPTION1), value = 1, flags = RESET_REQUIRED;
216 option text = STRING_TOKEN(STR_BOOT_OPTION3), value = 3, flags = RESET_REQUIRED;
217 suppressif ideqval MyIfrNVData.BootOrderLarge == 0;
218 option text = STRING_TOKEN(STR_BOOT_OPTION4), value = 4, flags = RESET_REQUIRED;
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 option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 3, flags = RESET_REQUIRED;
235 option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 2, flags = RESET_REQUIRED;
236 option text = STRING_TOKEN(STR_ONE_OF_TEXT3), value = 1, flags = RESET_REQUIRED;
237 endlist;
238 endif;
239
240 label 100;
241
242 //
243 // Define a hyperlink (EFI_IFR_REF)
244 //
245 goto 0x1234, // Destination Form ID
246 prompt = STRING_TOKEN(STR_GOTO_DYNAMIC), // Prompt string
247 help = STRING_TOKEN(STR_GOTO_HELP), // Help string
248 flags = INTERACTIVE, // INTERACTIVE indicate it's marked with EFI_IFR_FLAG_CALLBACK
249 key = 0x1234; // Question ID which will be passed-in in COnfigAccess.Callback()
250
251 goto 0x1234,
252 prompt = STRING_TOKEN(STR_GOTO_DYNAMIC2),
253 help = STRING_TOKEN(STR_GOTO_HELP),
254 flags = INTERACTIVE,
255 key = 0x1235;
256
257 oneof varid = MyIfrNVData.TestLateCheck,
258 prompt = STRING_TOKEN(STR_TEST_OPCODE),
259 help = STRING_TOKEN(STR_ONE_OF_HELP),
260 option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = RESET_REQUIRED;
261 option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = DEFAULT | RESET_REQUIRED;
262 warningif prompt = STRING_TOKEN(STR_WARNING_POPUP), timeout = 5,
263 ideqval MyIfrNVData.TestLateCheck == 0
264 endif
265
266 endoneof;
267
268 oneof varid = MyIfrNVData.TestLateCheck2,
269 prompt = STRING_TOKEN(STR_TEST_OPCODE2),
270 help = STRING_TOKEN(STR_ONE_OF_HELP),
271 option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = DEFAULT | RESET_REQUIRED;
272 option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = RESET_REQUIRED;
273
274 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
275 ideqid MyIfrNVData.TestLateCheck == MyIfrNVData.TestLateCheck2
276 endif
277
278 endoneof;
279
280 oneof varid = MyIfrNVData.QuestionAboutTreeHugging,
281 prompt = STRING_TOKEN(STR_ONE_OF_PROMPT),
282 help = STRING_TOKEN(STR_ONE_OF_HELP),
283 option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = RESET_REQUIRED;
284 option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = DEFAULT | RESET_REQUIRED;
285 option text = STRING_TOKEN(STR_ONE_OF_TEXT3), value = 0x03, flags = RESET_REQUIRED;
286
287 endoneof;
288
289 //
290 // Define a string (EFI_IFR_STRING)
291 //
292 string varid = MyIfrNVData.MyStringData,
293 prompt = STRING_TOKEN(STR_MY_STRING_PROMPT2),
294 help = STRING_TOKEN(STR_MY_STRING_HELP2),
295 flags = INTERACTIVE,
296 key = 0x1236,
297 minsize = 6,
298 maxsize = 40,
299 inconsistentif prompt = STRING_TOKEN(STR_STRING_CHECK_ERROR_POPUP),
300 pushthis != stringref(STRING_TOKEN(STR_STRING_CHECK))
301 endif
302 endstring;
303
304 //
305 // Define a numeric (EFI_IFR_NUMERIC)
306 //
307 numeric varid = MyIfrNVData.HowOldAreYouInYearsManual,
308 prompt = STRING_TOKEN(STR_NUMERIC_READONLY_PROMPT),
309 help = STRING_TOKEN(STR_NUMERIC_HELP0),
310 flags = READ_ONLY, // READ_ONLY indicate it's marked with EFI_IFR_FLAG_READ_ONLY
311 minimum = 0,
312 maximum = 0xf0,
313 step = 0, // Stepping of 0 equates to a manual entering
314 // of a value, otherwise it will be adjusted by "+"/"-"
315 default = 21, // defaultstore could be used to specify the default type
316 // If no defaultstore is specified, it implies Standard Default
317
318 endnumeric;
319
320 numeric varid = MyIfrNVData.HowOldAreYouInYearsManual,
321 prompt = STRING_TOKEN(STR_NUMERIC_MANUAL_PROMPT),
322 help = STRING_TOKEN(STR_NUMERIC_HELP0),
323 minimum = 0,
324 maximum = 0xf0,
325 step = 0,
326 default value = questionrefval(devicepath = STRING_TOKEN (STR_DEVICE_PATH), guid = DRIVER_SAMPLE_FORMSET_GUID, 0x1111),
327
328 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
329 ideqval MyIfrNVData.HowOldAreYouInYearsManual == 99
330 OR
331 ideqid MyIfrNVData.HowOldAreYouInYearsManual == MyEfiVar.Field8
332 OR
333 ideqvallist MyIfrNVData.HowOldAreYouInYearsManual == 1 3 5 7
334 endif
335
336 endnumeric;
337
338 numeric varid = MyEfiVar.Field8, // Reference of EFI variable storage
339 questionid = 0x1111,
340 prompt = STRING_TOKEN(STR_TALL_HEX_PROMPT),
341 help = STRING_TOKEN(STR_NUMERIC_HELP1),
342 flags = DISPLAY_UINT_HEX | INTERACTIVE, // Display in HEX format (if not specified, default is in decimal format)
343 minimum = 0,
344 maximum = 250,
345 default = 18, defaultstore = MyStandardDefault, // This is standard default value
346 default = 19, defaultstore = MyManufactureDefault, // This is manufacture default value
347
348 endnumeric;
349
350 //
351 // Define numeric using Name/Value Storage
352 //
353 numeric varid = MyNameValueVar[0], // This numeric take NameValueVar0 as storage
354 prompt = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME0),
355 help = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME0_HELP),
356 //
357 // Size should be defined for numeric when use Name/Value storage
358 // Valid value for numerice size are: NUMERIC_SIZE_1, NUMERIC_SIZE_2, NUMERIC_SIZE_4 and NUMERIC_SIZE_8
359 //
360 flags = NUMERIC_SIZE_1, // Size of this numeric is 1 byte
361 minimum = 0,
362 maximum = 0xff,
363 step = 0,
364 locked,
365 default = 16, defaultstore = MyStandardDefault, // This is standard default value
366 default = 17, defaultstore = MyManufactureDefault, // This is manufacture default value
367 endnumeric;
368
369 numeric varid = MyNameValueVar[1], // This numeric take NameValueVar1 as storage
370 prompt = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME1),
371 help = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME1_HELP),
372 flags = NUMERIC_SIZE_2, // Size of this numeric is 2 bytes
373 minimum = 0,
374 maximum = 0xffff,
375 step = 0,
376 default = 18, defaultstore = MyStandardDefault, // This is standard default value
377 default = 19, defaultstore = MyManufactureDefault, // This is manufacture default value
378 endnumeric;
379
380 //
381 // Define string using Name/Value Storage
382 //
383 string varid = MyNameValueVar[2], // This string take NameValueVar2 as storage
384 prompt = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME2),
385 help = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME2_HELP),
386 minsize = 2,
387 maxsize = 0x14,
388 endstring;
389
390 oneof varid = MyEfiVar.Field16,
391 prompt = STRING_TOKEN(STR_ONE_OF_PROMPT),
392 help = STRING_TOKEN(STR_NUMERIC_NUM_HELP),
393 option text = STRING_TOKEN(STR_BOOT_ORDER1), value = 0x0, flags = 0;
394 option text = STRING_TOKEN(STR_BOOT_ORDER2), value = 0x1, flags = DEFAULT;
395 endoneof;
396
397 label LABEL_1_VALUE;
398 label LABEL_2_VALUE;
399
400 grayoutif ideqval MyIfrNVData.HowOldAreYouInYearsManual == 23 AND ideqval MyIfrNVData.SuppressGrayOutSomething == 0x1;
401 numeric varid = MyIfrNVData.HowOldAreYouInYears,
402 prompt = STRING_TOKEN(STR_NUMERIC_STEP_PROMPT),
403 help = STRING_TOKEN(STR_NUMERIC_HELP2),
404 minimum = 0,
405 maximum = 243,
406 step = 1,
407 default = 18, defaultstore = MyStandardDefault, // This is standard default value
408 default = 19, defaultstore = MyManufactureDefault, // This is manufacture default value
409
410 endnumeric;
411 endif;
412
413 numeric varid = MyIfrNVData.GetDefaultValueFromAccess,
414 questionid = 0x1239,
415 prompt = STRING_TOKEN(STR_DEFAULT_VALUE_FROM_ACCESS_PROMPT),
416 help = STRING_TOKEN(STR_DEFAULT_VALUE_FROM_ACCESS_HELP),
417 flags = DISPLAY_UINT_HEX | INTERACTIVE,
418 minimum = 0,
419 maximum = 255,
420 step = 1,
421 default = 18,
422 endnumeric;
423
424 numeric varid = MyIfrNVData.GetDefaultValueFromCallBack,
425 questionid = 0x1240,
426 prompt = STRING_TOKEN(STR_DEFAULT_VALUE_FROM_CALLBACK_PROMPT),
427 help = STRING_TOKEN(STR_DEFAULT_VALUE_FROM_CALLBACK_HELP),
428 flags = DISPLAY_UINT_HEX | INTERACTIVE,
429 minimum = 0,
430 maximum = 255,
431 step = 1,
432 default = 18,
433 endnumeric;
434
435 resetbutton
436 defaultstore = MyStandardDefault,
437 prompt = STRING_TOKEN(STR_STANDARD_DEFAULT_PROMPT),
438 help = STRING_TOKEN(STR_STANDARD_DEFAULT_HELP),
439 endresetbutton;
440
441 resetbutton
442 defaultstore = MyManufactureDefault,
443 prompt = STRING_TOKEN(STR_MANUFACTURE_DEFAULT_PROMPT),
444 help = STRING_TOKEN(STR_MANUFACTURE_DEFAULT_HELP),
445 endresetbutton;
446
447 //
448 // Non-interactive password, validate by Setup Browser
449 //
450 password varid = MyIfrNVData.WhatIsThePassword,
451 prompt = STRING_TOKEN(STR_PASSWORD_PROMPT),
452 help = STRING_TOKEN(STR_PASSWORD_HELP),
453 minsize = 6,
454 maxsize = 20,
455 endpassword;
456
457 string varid = MyIfrNVData.PasswordClearText,
458 prompt = STRING_TOKEN(STR_MY_STRING_PROMPT),
459 help = STRING_TOKEN(STR_MY_STRING_HELP),
460 minsize = 6,
461 maxsize = 0x14,
462 endstring;
463
464 //
465 // Interactive password, validate via ConfigAccess.Callback()
466 //
467 password varid = MyIfrNVData.WhatIsThePassword2,
468 prompt = STRING_TOKEN(STR_PASSWORD_CALLBACK_PROMPT),
469 help = STRING_TOKEN(STR_PASSWORD_HELP),
470 flags = INTERACTIVE,
471 key = 0x2000,
472 minsize = 6,
473 maxsize = 20,
474 endpassword;
475
476 //
477 // Sample use case for IFR Security op-code
478 //
479 grayoutif NOT security (EFI_USER_INFO_ACCESS_SETUP_ADMIN_GUID);
480 text
481 help = STRING_TOKEN(STR_TEXT_SECRUITY_TEST_HELP),
482 text = STRING_TOKEN(STR_TEXT_SECRUITY_TEST_TEXT);
483 endif;
484
485 goto 2,
486 prompt = STRING_TOKEN(STR_GOTO_FORM2), //SecondSetupPage // this too has no end-op and basically it's a jump to a form ONLY
487 help = STRING_TOKEN(STR_GOTO_HELP);
488
489 goto 3,
490 prompt = STRING_TOKEN(STR_GOTO_FORM3), //ThirdSetupPage // this too has no end-op and basically it's a jump to a form ONLY
491 help = STRING_TOKEN(STR_GOTO_HELP);
492
493 goto 4,
494 prompt = STRING_TOKEN(STR_GOTO_FORM4), //FourthSetupPage // this too has no end-op and basically it's a jump to a form ONLY
495 help = STRING_TOKEN(STR_GOTO_HELP);
496
497 goto 5,
498 prompt = STRING_TOKEN(STR_GOTO_FORM5), //FifthSetupPage // this too has no end-op and basically it's a jump to a form ONLY
499 help = STRING_TOKEN(STR_GOTO_FORM5_HELP);
500
501 goto 6,
502 prompt = STRING_TOKEN(STR_GOTO_FORM6), //SixthSetupPage // this too has no end-op and basically it's a jump to a form ONLY
503 help = STRING_TOKEN(STR_GOTO_HELP);
504
505 goto
506 formsetguid = DRIVER_SAMPLE_INVENTORY_GUID,
507 formid = 0x1,
508 question = 0x1,
509 prompt = STRING_TOKEN(STR_GOTO_ANOTHER_FORMSET),
510 help = STRING_TOKEN(STR_GOTO_ANOTHER_FORMSET_HELP);
511
512 guidop
513 guid = DRIVER_SAMPLE_FORMSET_GUID,
514 datatype = MY_EFI_VARSTORE_DATA,
515 data.Field8 = 0x21,
516 data.Field16 = 0x2121,
517 data.OrderedList[0] = 0x21,
518 endguidop;
519
520
521 endform;
522
523 suppressif ideqval MyIfrNVData.BootOrderLarge == 0;
524 form formid = 2, // SecondSetupPage,
525 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
526
527 date
528 name = Date,
529 prompt = STRING_TOKEN(STR_DATE_PROMPT),
530 help = STRING_TOKEN(STR_DATE_HELP),
531 flags = STORAGE_TIME,
532 default = 2004/1/1,
533
534 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
535 ideqval Date.Day == 31
536 AND
537 ideqvallist Date.Month == 2 4 6 9 11
538 endif
539
540 //
541 // If the day is 30 AND month is 2
542 //
543 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
544 ideqval Date.Day == 30
545 AND
546 ideqval Date.Month == 2
547 endif
548
549 //
550 // If the day is 29 AND month is 2 AND it year is NOT a leapyear
551 //
552 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
553 ideqval Date.Day == 0x1D
554 AND
555 ideqval Date.Month == 2
556 AND
557 NOT
558 ideqvallist Date.Year == 2004 2008 20012 20016 2020 2024 2028 2032 2036
559 endif
560
561 enddate;
562
563 text
564 help = STRING_TOKEN(STR_SAVE_CURRENT_AND_EXIT),
565 text = STRING_TOKEN(STR_SAVE_CURRENT_AND_EXIT),
566 text = STRING_TOKEN(STR_SAVE_CURRENT_AND_EXIT),
567 flags = INTERACTIVE,
568 key = 0x1241;
569
570 text
571 help = STRING_TOKEN(STR_DISCARD_CURRENT),
572 text = STRING_TOKEN(STR_DISCARD_CURRENT),
573 text = STRING_TOKEN(STR_DISCARD_CURRENT),
574 flags = INTERACTIVE,
575 key = 0x1242;
576
577 time
578 prompt = STRING_TOKEN(STR_TIME_PROMPT),
579 help = STRING_TOKEN(STR_TIME_HELP),
580 flags = STORAGE_TIME,
581 endtime;
582
583 time
584 name = MyTime,
585 varid = MyIfrNVData.Time,
586 prompt = STRING_TOKEN(STR_TIME_PROMPT),
587 help = STRING_TOKEN(STR_TIME_PROMPT),
588 flags = STORAGE_NORMAL | SECOND_SUPPRESS,
589 default = 15:33:33,
590 endtime;
591
592 checkbox varid = MyIfrNVData.ChooseToActivateNuclearWeaponry,
593 prompt = STRING_TOKEN(STR_CHECK_BOX_PROMPT),
594 help = STRING_TOKEN(STR_CHECK_BOX_HELP),
595 flags = CHECKBOX_DEFAULT,
596 key = 0,
597 endcheckbox;
598
599 text
600 help = STRING_TOKEN(STR_TEXT_HELP),
601 text = STRING_TOKEN(STR_TEXT_TEXT_1);
602
603 text
604 help = STRING_TOKEN(STR_TEXT_HELP),
605 text = STRING_TOKEN(STR_TEXT_TEXT_1),
606 text = STRING_TOKEN(STR_TEXT_TEXT_2);
607
608 goto 1,
609 prompt = STRING_TOKEN(STR_GOTO_FORM1), //MainSetupPage // this too has no end-op and basically it's a jump to a form ONLY
610 help = STRING_TOKEN(STR_GOTO_HELP);
611
612 goto
613 varid = MyIfrNVData.RefData,
614 prompt = STRING_TOKEN(STR_GOTO_DYNAMIC3),
615 help = STRING_TOKEN(STR_GOTO_DYNAMIC3_HELP),
616 flags = INTERACTIVE,
617 key = 0x1248,
618 //
619 // Set the defult value, format is QuestionId; FormId; FormsetGuid; Device Path String Token
620 //
621 default = 0;0;ZERO_GUID;STRING_TOKEN(STR_NULL_STRING),
622 ; // goto opcode end flag.
623
624 goto
625 prompt = STRING_TOKEN(STR_GOTO_DYNAMIC4),
626 help = STRING_TOKEN(STR_GOTO_DYNAMIC4_HELP),
627 flags = INTERACTIVE,
628 key = 0x1249;
629
630 endform;
631 endif;
632
633 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
634
635 suppressif ideqval MyEfiVar.Field8 == 111;
636 text
637 help = STRING_TOKEN(STR_TEXT_HELP),
638 text = STRING_TOKEN(STR_TEXT_TEXT_1);
639 endif;
640
641 goto 1,
642 prompt = STRING_TOKEN(STR_GOTO_FORM1), //MainSetupPage
643 help = STRING_TOKEN(STR_GOTO_HELP);
644
645 numeric varid = MyIfrNVData.DynamicRefresh,
646 prompt = STRING_TOKEN(STR_NUMERIC_MANUAL_PROMPT),
647 help = STRING_TOKEN(STR_NUMERIC_HELP0),
648 flags = INTERACTIVE,
649 key = 0x5678,
650 minimum = 0,
651 maximum = 0xff,
652 step = 0,
653 default = 0,
654 refresh interval = 3 // Refresh interval in seconds
655 endnumeric;
656
657 label LABEL_UPDATE2;
658 label LABEL_END;
659
660 endform;
661
662 formmap formid = 4,
663 maptitle = STRING_TOKEN(STR_SAMPL_MAP_METHOD);
664 mapguid = DRIVER_SAMPLE_FORMSET_GUID;
665 maptitle = STRING_TOKEN(STR_STANDARD_MAP_METHOD);
666 mapguid = EFI_HII_STANDARD_FORM_GUID;
667
668 oneof varid = MyIfrNVData.SerialPortNo,
669 prompt = STRING_TOKEN(STR_SERIAL_PORT),
670 help = STRING_TOKEN(STR_ONE_OF_HELP),
671
672 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;)));
673 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;));
674
675 option text = STRING_TOKEN(STR_SERIAL_PORT_DISABLE), value = 0x0, flags = DEFAULT;
676 option text = STRING_TOKEN(STR_SERIAL_PORT1), value = 0x1, flags = 0;
677 option text = STRING_TOKEN(STR_SERIAL_PORT2), value = 0x2, flags = 0;
678 option text = STRING_TOKEN(STR_SERIAL_PORT3), value = 0x3, flags = 0;
679 option text = STRING_TOKEN(STR_SERIAL_PORT4), value = 0x4, flags = 0;
680 endoneof;
681
682 grayoutif TRUE;
683 checkbox varid = MyIfrNVData.SerialPortStatus,
684 prompt = STRING_TOKEN(STR_SERIAL_PORT_STATUS),
685 help = STRING_TOKEN(STR_CHECK_BOX_HELP),
686 endcheckbox;
687 endif;
688
689 grayoutif TRUE;
690 suppressif ideqval MyIfrNVData.SerialPortStatus == 0;
691 oneof varid = MyIfrNVData.SerialPortIo,
692 prompt = STRING_TOKEN(STR_SERIAL_PORT_IO_ADDRESS),
693 help = STRING_TOKEN(STR_ONE_OF_HELP),
694
695 option text = STRING_TOKEN(STR_SERIAL_PORT1_IOADDR), value = 0x3F8, flags = DEFAULT;
696 option text = STRING_TOKEN(STR_SERIAL_PORT2_IOADDR), value = 0x2F8, flags = 0;
697 option text = STRING_TOKEN(STR_SERIAL_PORT3_IOADDR), value = 0x3E8, flags = 0;
698 option text = STRING_TOKEN(STR_SERIAL_PORT4_IOADDR), value = 0x2E8, flags = 0;
699 endoneof;
700 endif;
701 endif;
702
703 grayoutif TRUE;
704 suppressif ideqval MyIfrNVData.SerialPortStatus == 0;
705 oneof varid = MyIfrNVData.SerialPortIrq,
706 prompt = STRING_TOKEN(STR_SERIAL_PORT_IRQ),
707 help = STRING_TOKEN(STR_ONE_OF_HELP),
708
709 option text = STRING_TOKEN(STR_SERIAL_PORT13_IRQ), value = 0x4, flags = DEFAULT;
710 option text = STRING_TOKEN(STR_SERIAL_PORT24_IRQ), value = 0x3, flags = 0;
711 endoneof;
712 endif;
713 endif;
714
715 goto 1,
716 prompt = STRING_TOKEN(STR_GOTO_FORM1), //MainSetupPage
717 help = STRING_TOKEN(STR_GOTO_HELP);
718
719 endform;
720
721 form formid = 5, // Modal form
722 title = STRING_TOKEN(STR_MODAL_FORM_TITLE);
723 //
724 // This form is a modal form.
725 //
726 modal;
727 text
728 help = STRING_TOKEN(STR_EXIT_TEXT),
729 text = STRING_TOKEN(STR_EXIT_TEXT),
730 text = STRING_TOKEN(STR_EXIT_TEXT),
731 flags = INTERACTIVE, // VfrCompiler will generate opcode EFI_IFR_ACTION for Text marked as INTERACTIVE
732 key = 0x1245;
733
734 text
735 help = STRING_TOKEN(STR_SAVE_TEXT),
736 text = STRING_TOKEN(STR_SAVE_TEXT),
737 text = STRING_TOKEN(STR_SAVE_TEXT),
738 flags = INTERACTIVE, // VfrCompiler will generate opcode EFI_IFR_ACTION for Text marked as INTERACTIVE
739 key = 0x1246;
740 endform;
741
742 form formid = 6, // Form to show the refresh guid group op-code
743 title = STRING_TOKEN(STR_FORM6_TITLE);
744
745 text
746 help = STRING_TOKEN(STR_TEXT_REFRESH_GUID),
747 text = STRING_TOKEN(STR_TEXT_REFRESH_GUID);
748
749 numeric varid = MyIfrNVData.RefreshGuidCount,
750 prompt = STRING_TOKEN(STR_TEXT_REFRESH_GUID_COUNT),
751 help = STRING_TOKEN(STR_NUMERIC_HELP0),
752 flags = INTERACTIVE,
753 key = 0x1247,
754 minimum = 0,
755 maximum = 0xff,
756 step = 0,
757 default = 0,
758 refreshguid = EFI_IFR_REFRESH_ID_OP_GUID,
759 endnumeric;
760
761 label LABEL_UPDATE3;
762 label LABEL_END;
763
764 endform;
765
766 form formid = 0x1234, // Dynamically created page,
767 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
768
769 label LABEL_UPDATE1;
770 //
771 // This is where we will insert dynamic created opcodes
772 //
773 label LABEL_END;
774
775 endform;
776
777 endformset;