]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr
Add new call back return value; also add some sample code to use it.
[mirror_edk2.git] / MdeModulePkg / Universal / DriverSampleDxe / Vfr.vfr
1 ///** @file
2 //
3 // Sample Setup formset.
4 //
5 // Copyright (c) 2004 - 2011, 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 //
47 // Labels definition
48 //
49 #define LABEL_1_VALUE 0x01
50 #define LABEL_2_VALUE 0x1000
51 #define LABEL_UPDATE_BBS 0x2222
52
53 formset
54 guid = FORMSET_GUID,
55 title = STRING_TOKEN(STR_FORM_SET_TITLE),
56 help = STRING_TOKEN(STR_FORM_SET_TITLE_HELP),
57 classguid = EFI_HII_PLATFORM_SETUP_FORMSET_GUID,
58
59 //
60 // Notes: VfrCompiler will insert a Standard Default Storage declaration
61 // after the formset declaration. >00000040: 5C 06 00 00 00 00.
62 // So we don't need to declare the Standard Default.
63 // Please check the vfr.lst file for details.
64 // To enable list file for VFR, add "-l" to VfrCompile <Command> in [Build.Visual-Form-Representation-File] as follows:
65 // VfrCompile -l --no-pre-processing --output-directory ${d_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
66 //
67
68 //
69 // Define a Buffer Storage (EFI_IFR_VARSTORE)
70 //
71 varstore DRIVER_SAMPLE_CONFIGURATION, // This is the data structure type
72 varid = CONFIGURATION_VARSTORE_ID, // Optional VarStore ID
73 name = MyIfrNVData, // Define referenced name in vfr
74 guid = FORMSET_GUID; // GUID of this buffer storage
75
76 //
77 // Define another Buffer Storage
78 //
79 varstore MY_DATA2,
80 name = MyIfrNVData2,
81 guid = FORMSET_GUID;
82
83 //
84 // Define a EFI variable Storage (EFI_IFR_VARSTORE_EFI)
85 //
86 efivarstore MyEfiVar, // Define referenced name in vfr
87 attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE, // EFI variable attribures
88 name = STRING_TOKEN(STR_VAR_NAME), // EFI variable name
89 varsize = 1, // Size of the EFI variable
90 guid = FORMSET_GUID; // EFI variable GUID
91
92 //
93 // Define a Name/Value Storage (EFI_IFR_VARSTORE_NAME_VALUE)
94 //
95 namevaluevarstore MyNameValueVar, // Define storage reference name in vfr
96 name = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME0), // Define Name list of this storage, refer it by MyNameValueVar[0]
97 name = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME1), // Define Name list of this storage, refer it by MyNameValueVar[1]
98 name = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME2), // Define Name list of this storage, refer it by MyNameValueVar[2]
99 guid = FORMSET_GUID; // GUID of this Name/Value storage
100
101 defaultstore MyStandardDefault,
102 prompt = STRING_TOKEN(STR_STANDARD_DEFAULT_PROMPT),
103 attribute = 0x0000; // Default ID: 0000 standard default
104
105 defaultstore MyManufactureDefault,
106 prompt = STRING_TOKEN(STR_MANUFACTURE_DEFAULT_PROMPT),
107 attribute = 0x0001; // Default ID: 0001 manufacture default
108
109 //
110 // Define a Form (EFI_IFR_FORM)
111 //
112 form formid = 1, // Form ID
113 title = STRING_TOKEN(STR_FORM1_TITLE); // Form title
114
115 subtitle text = STRING_TOKEN(STR_SUBTITLE_TEXT);
116
117 subtitle text = STRING_TOKEN(STR_SUBTITLE_TEXT2);
118
119 //
120 // Define a display only text (EFI_IFR_TEXT)
121 //
122 text
123 help = STRING_TOKEN(STR_TEXT_HELP), // Help string
124 text = STRING_TOKEN(STR_CPU_STRING), // Prompt string
125 text = STRING_TOKEN(STR_CPU_STRING2); // TextTwo
126
127 //
128 // Define action button (EFI_IFR_ACTION)
129 //
130 text
131 help = STRING_TOKEN(STR_EXIT_TEXT),
132 text = STRING_TOKEN(STR_EXIT_TEXT),
133 text = STRING_TOKEN(STR_EXIT_TEXT),
134 flags = INTERACTIVE, // VfrCompiler will generate opcode EFI_IFR_ACTION for Text marked as INTERACTIVE
135 key = 0x1237;
136
137 text
138 help = STRING_TOKEN(STR_SAVE_TEXT),
139 text = STRING_TOKEN(STR_SAVE_TEXT),
140 text = STRING_TOKEN(STR_SAVE_TEXT),
141 flags = INTERACTIVE,
142 key = 0x1238;
143
144 text
145 help = STRING_TOKEN(STR_SAVE_CURRENT),
146 text = STRING_TOKEN(STR_SAVE_CURRENT),
147 text = STRING_TOKEN(STR_SAVE_CURRENT),
148 flags = INTERACTIVE,
149 key = 0x1243;
150
151 text
152 help = STRING_TOKEN(STR_DISCARD_CURRENT_AND_EXIT),
153 text = STRING_TOKEN(STR_DISCARD_CURRENT_AND_EXIT),
154 text = STRING_TOKEN(STR_DISCARD_CURRENT_AND_EXIT),
155 flags = INTERACTIVE,
156 key = 0x1244;
157 //
158 // Define oneof (EFI_IFR_ONE_OF)
159 //
160 oneof name = MyOneOf, // Define reference name for Question
161 varid = MyIfrNVData.SuppressGrayOutSomething, // Use "DataStructure.Member" to reference Buffer Storage
162 prompt = STRING_TOKEN(STR_ONE_OF_PROMPT),
163 help = STRING_TOKEN(STR_ONE_OF_HELP),
164 //
165 // Define an option (EFI_IFR_ONE_OF_OPTION)
166 //
167 option text = STRING_TOKEN(STR_ONE_OF_TEXT4), value = 0x0, flags = 0;
168 option text = STRING_TOKEN(STR_ONE_OF_TEXT5), value = 0x1, flags = 0;
169 //
170 // DEFAULT indicate this option will be marked with EFI_IFR_OPTION_DEFAULT
171 //
172 option text = STRING_TOKEN(STR_ONE_OF_TEXT6), value = 0x2, flags = DEFAULT;
173 endoneof;
174
175 oneof varid = MyIfrNVData.BootOrderLarge,
176 prompt = STRING_TOKEN(STR_ONE_OF_PROMPT),
177 help = STRING_TOKEN(STR_ONE_OF_HELP),
178 default value = cond (pushthis == 0 ? 0 : cond ((questionref(MyOneOf) >> 0x4 & 0xF00) == 0x0 + 0x2 ? 0 : 1)),
179 option text = STRING_TOKEN(STR_BOOT_ORDER1), value = 0x0, flags = 0;
180 option text = STRING_TOKEN(STR_BOOT_ORDER2), value = 0x1, flags = 0;
181 endoneof;
182
183 grayoutif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x1;
184 suppressif questionref(MyOneOf) == 0x0;
185
186 checkbox varid = MyIfrNVData.ChooseToActivateNuclearWeaponry,
187 prompt = STRING_TOKEN(STR_CHECK_BOX_PROMPT),
188 help = STRING_TOKEN(STR_CHECK_BOX_HELP),
189 //
190 // CHECKBOX_DEFAULT indicate this checkbox is marked with EFI_IFR_CHECKBOX_DEFAULT
191 // CHECKBOX_DEFAULT_MFG indicate EFI_IFR_CHECKBOX_DEFAULT_MFG.
192 //
193 flags = CHECKBOX_DEFAULT | CHECKBOX_DEFAULT_MFG,
194 key = 0,
195 default = 1,
196 endcheckbox;
197 endif;
198 endif;
199
200 //
201 // Ordered list:
202 // sizeof(MyIfrNVData) storage must be UINT8 array, and
203 // size written for the variable must be size of the entire
204 // variable.
205 //
206 //
207 suppressif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x0;
208
209 //
210 // label is defined as an anchor where you want to insert some dynamic
211 // opcodes created on-the-fly
212 //
213 label LABEL_UPDATE_BBS;
214
215 orderedlist
216 varid = MyIfrNVData.BootOrder,
217 prompt = STRING_TOKEN(STR_BOOT_OPTIONS),
218 help = STRING_TOKEN(STR_NULL_STRING),
219 option text = STRING_TOKEN(STR_BOOT_OPTION2), value = 2, flags = RESET_REQUIRED;
220 option text = STRING_TOKEN(STR_BOOT_OPTION1), value = 1, flags = RESET_REQUIRED;
221 option text = STRING_TOKEN(STR_BOOT_OPTION3), value = 3, flags = RESET_REQUIRED;
222 suppressif ideqval MyIfrNVData.BootOrderLarge == 0;
223 option text = STRING_TOKEN(STR_BOOT_OPTION4), value = 4, flags = RESET_REQUIRED;
224 endif
225 endlist;
226
227 //
228 // label should be paired with each other
229 //
230 label LABEL_END;
231
232 endif; // end suppressif
233
234 disableif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x2;
235 orderedlist
236 varid = MyIfrNVData.OrderedList,
237 prompt = STRING_TOKEN(STR_TEST_OPCODE),
238 help = STRING_TOKEN(STR_TEXT_HELP),
239 option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 3, flags = RESET_REQUIRED;
240 option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 2, flags = RESET_REQUIRED;
241 option text = STRING_TOKEN(STR_ONE_OF_TEXT3), value = 1, flags = RESET_REQUIRED;
242 endlist;
243 endif;
244
245 label 100;
246
247 //
248 // Define a hyperlink (EFI_IFR_REF)
249 //
250 goto 0x1234, // Destination Form ID
251 prompt = STRING_TOKEN(STR_GOTO_DYNAMIC), // Prompt string
252 help = STRING_TOKEN(STR_GOTO_HELP), // Help string
253 flags = INTERACTIVE, // INTERACTIVE indicate it's marked with EFI_IFR_FLAG_CALLBACK
254 key = 0x1234; // Question ID which will be passed-in in COnfigAccess.Callback()
255
256 goto 0x1234,
257 prompt = STRING_TOKEN(STR_GOTO_DYNAMIC2),
258 help = STRING_TOKEN(STR_GOTO_HELP),
259 flags = INTERACTIVE,
260 key = 0x1235;
261
262 oneof varid = MyIfrNVData.TestLateCheck,
263 prompt = STRING_TOKEN(STR_TEST_OPCODE),
264 help = STRING_TOKEN(STR_ONE_OF_HELP),
265 option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = RESET_REQUIRED;
266 option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = DEFAULT | RESET_REQUIRED;
267
268 endoneof;
269
270 oneof varid = MyIfrNVData.TestLateCheck2,
271 prompt = STRING_TOKEN(STR_TEST_OPCODE2),
272 help = STRING_TOKEN(STR_ONE_OF_HELP),
273 option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = DEFAULT | RESET_REQUIRED;
274 option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = RESET_REQUIRED;
275
276 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
277 ideqid MyIfrNVData.TestLateCheck == MyIfrNVData.TestLateCheck2
278 endif
279
280 endoneof;
281
282 oneof varid = MyIfrNVData.QuestionAboutTreeHugging,
283 prompt = STRING_TOKEN(STR_ONE_OF_PROMPT),
284 help = STRING_TOKEN(STR_ONE_OF_HELP),
285 option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = RESET_REQUIRED;
286 option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = DEFAULT | RESET_REQUIRED;
287 option text = STRING_TOKEN(STR_ONE_OF_TEXT3), value = 0x03, flags = RESET_REQUIRED;
288
289 endoneof;
290
291 //
292 // Define a string (EFI_IFR_STRING)
293 //
294 string varid = MyIfrNVData.MyStringData,
295 prompt = STRING_TOKEN(STR_MY_STRING_PROMPT2),
296 help = STRING_TOKEN(STR_MY_STRING_HELP2),
297 flags = INTERACTIVE,
298 key = 0x1236,
299 minsize = 6,
300 maxsize = 40,
301 inconsistentif prompt = STRING_TOKEN(STR_STRING_CHECK_ERROR_POPUP),
302 pushthis != stringref(STRING_TOKEN(STR_STRING_CHECK))
303 endif
304 endstring;
305
306 //
307 // Define a numeric (EFI_IFR_NUMERIC)
308 //
309 numeric varid = MyIfrNVData.HowOldAreYouInYearsManual,
310 prompt = STRING_TOKEN(STR_NUMERIC_READONLY_PROMPT),
311 help = STRING_TOKEN(STR_NUMERIC_HELP0),
312 flags = READ_ONLY, // READ_ONLY indicate it's marked with EFI_IFR_FLAG_READ_ONLY
313 minimum = 0,
314 maximum = 0xf0,
315 step = 0, // Stepping of 0 equates to a manual entering
316 // of a value, otherwise it will be adjusted by "+"/"-"
317 default = 21, // defaultstore could be used to specify the default type
318 // If no defaultstore is specified, it implies Standard Default
319
320 endnumeric;
321
322 numeric varid = MyIfrNVData.HowOldAreYouInYearsManual,
323 prompt = STRING_TOKEN(STR_NUMERIC_MANUAL_PROMPT),
324 help = STRING_TOKEN(STR_NUMERIC_HELP0),
325 minimum = 0,
326 maximum = 0xf0,
327 step = 0,
328 default = 21,
329
330 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
331 ideqval MyIfrNVData.HowOldAreYouInYearsManual == 99
332 OR
333 ideqid MyIfrNVData.HowOldAreYouInYearsManual == MyEfiVar
334 OR
335 ideqvallist MyIfrNVData.HowOldAreYouInYearsManual == 1 3 5 7
336 endif
337
338 endnumeric;
339
340 numeric varid = MyEfiVar, // Reference of EFI variable storage
341 questionid = 0x1111,
342 prompt = STRING_TOKEN(STR_TALL_HEX_PROMPT),
343 help = STRING_TOKEN(STR_NUMERIC_HELP1),
344 flags = DISPLAY_UINT_HEX | INTERACTIVE, // Display in HEX format (if not specified, default is in decimal format)
345 minimum = 0,
346 maximum = 250,
347 default = 175,
348
349 endnumeric;
350
351 //
352 // Define numeric using Name/Value Storage
353 //
354 numeric varid = MyNameValueVar[0], // This numeric take NameValueVar0 as storage
355 prompt = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME0),
356 help = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME0_HELP),
357 //
358 // Size should be defined for numeric when use Name/Value storage
359 // Valid value for numerice size are: NUMERIC_SIZE_1, NUMERIC_SIZE_2, NUMERIC_SIZE_4 and NUMERIC_SIZE_8
360 //
361 flags = NUMERIC_SIZE_1, // Size of this numeric is 1 byte
362 minimum = 0,
363 maximum = 0xff,
364 step = 0,
365 endnumeric;
366
367 numeric varid = MyNameValueVar[1], // This numeric take NameValueVar1 as storage
368 prompt = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME1),
369 help = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME1_HELP),
370 flags = NUMERIC_SIZE_2, // Size of this numeric is 2 bytes
371 minimum = 0,
372 maximum = 0xffff,
373 step = 0,
374 endnumeric;
375
376 //
377 // Define string using Name/Value Storage
378 //
379 string varid = MyNameValueVar[2], // This string take NameValueVar2 as storage
380 prompt = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME2),
381 help = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME2_HELP),
382 minsize = 2,
383 maxsize = 0x14,
384 endstring;
385
386 label LABEL_1_VALUE;
387 label LABEL_2_VALUE;
388
389 grayoutif ideqval MyIfrNVData.HowOldAreYouInYearsManual == 23 AND ideqval MyIfrNVData.SuppressGrayOutSomething == 0x1;
390 numeric varid = MyIfrNVData.HowOldAreYouInYears,
391 prompt = STRING_TOKEN(STR_NUMERIC_STEP_PROMPT),
392 help = STRING_TOKEN(STR_NUMERIC_HELP2),
393 minimum = 0,
394 maximum = 243,
395 step = 1,
396 default = 18, defaultstore = MyStandardDefault, // This is standard default value
397 default = 19, defaultstore = MyManufactureDefault, // This is manufacture default value
398
399 endnumeric;
400 endif;
401
402 numeric varid = MyIfrNVData.GetDefaultValueFromAccess,
403 questionid = 0x1239,
404 prompt = STRING_TOKEN(STR_DEFAULT_VALUE_FROM_ACCESS_PROMPT),
405 help = STRING_TOKEN(STR_DEFAULT_VALUE_FROM_ACCESS_HELP),
406 flags = DISPLAY_UINT_HEX | INTERACTIVE,
407 minimum = 0,
408 maximum = 255,
409 step = 1,
410 default = 18,
411 endnumeric;
412
413 numeric varid = MyIfrNVData.GetDefaultValueFromCallBack,
414 questionid = 0x1240,
415 prompt = STRING_TOKEN(STR_DEFAULT_VALUE_FROM_CALLBACK_PROMPT),
416 help = STRING_TOKEN(STR_DEFAULT_VALUE_FROM_CALLBACK_HELP),
417 flags = DISPLAY_UINT_HEX | INTERACTIVE,
418 minimum = 0,
419 maximum = 255,
420 step = 1,
421 default = 18,
422 endnumeric;
423
424 resetbutton
425 defaultstore = MyStandardDefault,
426 prompt = STRING_TOKEN(STR_STANDARD_DEFAULT_PROMPT),
427 help = STRING_TOKEN(STR_STANDARD_DEFAULT_HELP),
428 endresetbutton;
429
430 resetbutton
431 defaultstore = MyManufactureDefault,
432 prompt = STRING_TOKEN(STR_MANUFACTURE_DEFAULT_PROMPT),
433 help = STRING_TOKEN(STR_MANUFACTURE_DEFAULT_HELP),
434 endresetbutton;
435
436 //
437 // Non-interactive password, validate by Setup Browser
438 //
439 password varid = MyIfrNVData.WhatIsThePassword,
440 prompt = STRING_TOKEN(STR_PASSWORD_PROMPT),
441 help = STRING_TOKEN(STR_PASSWORD_HELP),
442 minsize = 6,
443 maxsize = 20,
444 endpassword;
445
446 string varid = MyIfrNVData.PasswordClearText,
447 prompt = STRING_TOKEN(STR_MY_STRING_PROMPT),
448 help = STRING_TOKEN(STR_MY_STRING_HELP),
449 minsize = 6,
450 maxsize = 0x14,
451 endstring;
452
453 //
454 // Interactive password, validate via ConfigAccess.Callback()
455 //
456 password varid = MyIfrNVData.WhatIsThePassword2,
457 prompt = STRING_TOKEN(STR_PASSWORD_CALLBACK_PROMPT),
458 help = STRING_TOKEN(STR_PASSWORD_HELP),
459 flags = INTERACTIVE,
460 key = 0x2000,
461 minsize = 6,
462 maxsize = 20,
463 endpassword;
464
465 //
466 // Sample use case for IFR Security op-code
467 //
468 grayoutif NOT security (EFI_USER_INFO_ACCESS_SETUP_ADMIN_GUID);
469 text
470 help = STRING_TOKEN(STR_TEXT_SECRUITY_TEST_HELP),
471 text = STRING_TOKEN(STR_TEXT_SECRUITY_TEST_TEXT);
472 endif;
473
474 goto 2,
475 prompt = STRING_TOKEN(STR_GOTO_FORM2), //SecondSetupPage // this too has no end-op and basically it's a jump to a form ONLY
476 help = STRING_TOKEN(STR_GOTO_HELP);
477
478 goto 3,
479 prompt = STRING_TOKEN(STR_GOTO_FORM3), //ThirdSetupPage // this too has no end-op and basically it's a jump to a form ONLY
480 help = STRING_TOKEN(STR_GOTO_HELP);
481
482 goto 4,
483 prompt = STRING_TOKEN(STR_GOTO_FORM4), //FourthSetupPage // this too has no end-op and basically it's a jump to a form ONLY
484 help = STRING_TOKEN(STR_GOTO_HELP);
485
486 endform;
487
488 suppressif ideqval MyIfrNVData.BootOrderLarge == 0;
489 form formid = 2, // SecondSetupPage,
490 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
491
492
493 date year varid = Date.Year, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
494 prompt = STRING_TOKEN(STR_DATE_PROMPT),
495 help = STRING_TOKEN(STR_DATE_HELP),
496 minimum = 1998,
497 maximum = 2099,
498 step = 1,
499 default = 2004,
500
501 month varid = Date.Month, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
502 prompt = STRING_TOKEN(STR_DATE_PROMPT),
503 help = STRING_TOKEN(STR_DATE_HELP),
504 minimum = 1,
505 maximum = 12,
506 step = 1,
507 default = 1,
508
509 day varid = Date.Day, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
510 prompt = STRING_TOKEN(STR_DATE_PROMPT),
511 help = STRING_TOKEN(STR_DATE_HELP),
512 minimum = 1,
513 maximum = 31,
514 step = 0x1,
515 default = 1,
516
517 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
518 ideqval Date.Day == 31
519 AND
520 ideqvallist Date.Month == 2 4 6 9 11
521 endif
522
523 //
524 // If the day is 30 AND month is 2
525 //
526 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
527 ideqval Date.Day == 30
528 AND
529 ideqval Date.Month == 2
530 endif
531
532 //
533 // If the day is 29 AND month is 2 AND it year is NOT a leapyear
534 //
535 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
536 ideqval Date.Day == 0x1D
537 AND
538 ideqval Date.Month == 2
539 AND
540 NOT
541 ideqvallist Date.Year == 2004 2008 20012 20016 2020 2024 2028 2032 2036
542 endif
543
544 enddate;
545
546 text
547 help = STRING_TOKEN(STR_SAVE_CURRENT_AND_EXIT),
548 text = STRING_TOKEN(STR_SAVE_CURRENT_AND_EXIT),
549 text = STRING_TOKEN(STR_SAVE_CURRENT_AND_EXIT),
550 flags = INTERACTIVE,
551 key = 0x1241;
552
553 text
554 help = STRING_TOKEN(STR_DISCARD_CURRENT),
555 text = STRING_TOKEN(STR_DISCARD_CURRENT),
556 text = STRING_TOKEN(STR_DISCARD_CURRENT),
557 flags = INTERACTIVE,
558 key = 0x1242;
559
560 time hour varid = Time.Hours, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
561 prompt = STRING_TOKEN(STR_TIME_PROMPT),
562 help = STRING_TOKEN(STR_TIME_HELP),
563 minimum = 0,
564 maximum = 23,
565 step = 1,
566 default = 0,
567
568 minute varid = Time.Minutes, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
569 prompt = STRING_TOKEN(STR_TIME_PROMPT),
570 help = STRING_TOKEN(STR_TIME_HELP),
571 minimum = 0,
572 maximum = 59,
573 step = 1,
574 default = 0,
575
576 second varid = Time.Seconds, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
577 prompt = STRING_TOKEN(STR_TIME_PROMPT),
578 help = STRING_TOKEN(STR_TIME_HELP),
579 minimum = 0,
580 maximum = 59,
581 step = 1,
582 default = 0,
583
584 endtime;
585
586 time
587 name = MyTime,
588 varid = MyIfrNVData.Time,
589 prompt = STRING_TOKEN(STR_TIME_PROMPT),
590 help = STRING_TOKEN(STR_TIME_PROMPT),
591 flags = STORAGE_NORMAL,
592 default = 15:33:33,
593 endtime;
594
595 checkbox varid = MyIfrNVData.ChooseToActivateNuclearWeaponry,
596 prompt = STRING_TOKEN(STR_CHECK_BOX_PROMPT),
597 help = STRING_TOKEN(STR_CHECK_BOX_HELP),
598 flags = CHECKBOX_DEFAULT,
599 key = 0,
600 endcheckbox;
601
602 text
603 help = STRING_TOKEN(STR_TEXT_HELP),
604 text = STRING_TOKEN(STR_TEXT_TEXT_1);
605
606 text
607 help = STRING_TOKEN(STR_TEXT_HELP),
608 text = STRING_TOKEN(STR_TEXT_TEXT_1),
609 text = STRING_TOKEN(STR_TEXT_TEXT_2);
610
611 goto 1,
612 prompt = STRING_TOKEN(STR_GOTO_FORM1), //MainSetupPage // this too has no end-op and basically it's a jump to a form ONLY
613 help = STRING_TOKEN(STR_GOTO_HELP);
614
615 endform;
616 endif;
617
618 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
619
620 suppressif ideqval MyEfiVar == 111;
621 text
622 help = STRING_TOKEN(STR_TEXT_HELP),
623 text = STRING_TOKEN(STR_TEXT_TEXT_1);
624 endif;
625
626 goto 1,
627 prompt = STRING_TOKEN(STR_GOTO_FORM1), //MainSetupPage
628 help = STRING_TOKEN(STR_GOTO_HELP);
629
630 numeric varid = MyIfrNVData.DynamicRefresh,
631 prompt = STRING_TOKEN(STR_NUMERIC_MANUAL_PROMPT),
632 help = STRING_TOKEN(STR_NUMERIC_HELP0),
633 flags = INTERACTIVE,
634 key = 0x5678,
635 minimum = 0,
636 maximum = 0xff,
637 step = 0,
638 default = 0,
639 refresh interval = 3 // Refresh interval in seconds
640 endnumeric;
641
642 label LABEL_UPDATE2;
643 label LABEL_END;
644
645 endform;
646
647 formmap formid = 4,
648 maptitle = STRING_TOKEN(STR_SAMPL_MAP_METHOD);
649 mapguid = FORMSET_GUID;
650 maptitle = STRING_TOKEN(STR_STANDARD_MAP_METHOD);
651 mapguid = EFI_HII_STANDARD_FORM_GUID;
652
653 oneof varid = MyIfrNVData.SerialPortNo,
654 prompt = STRING_TOKEN(STR_SERIAL_PORT),
655 help = STRING_TOKEN(STR_ONE_OF_HELP),
656
657 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;)));
658 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;));
659
660 option text = STRING_TOKEN(STR_SERIAL_PORT_DISABLE), value = 0x0, flags = DEFAULT;
661 option text = STRING_TOKEN(STR_SERIAL_PORT1), value = 0x1, flags = 0;
662 option text = STRING_TOKEN(STR_SERIAL_PORT2), value = 0x2, flags = 0;
663 option text = STRING_TOKEN(STR_SERIAL_PORT3), value = 0x3, flags = 0;
664 option text = STRING_TOKEN(STR_SERIAL_PORT4), value = 0x4, flags = 0;
665 endoneof;
666
667 grayoutif TRUE;
668 checkbox varid = MyIfrNVData.SerialPortStatus,
669 prompt = STRING_TOKEN(STR_SERIAL_PORT_STATUS),
670 help = STRING_TOKEN(STR_CHECK_BOX_HELP),
671 endcheckbox;
672 endif;
673
674 grayoutif TRUE;
675 suppressif ideqval MyIfrNVData.SerialPortStatus == 0;
676 oneof varid = MyIfrNVData.SerialPortIo,
677 prompt = STRING_TOKEN(STR_SERIAL_PORT_IO_ADDRESS),
678 help = STRING_TOKEN(STR_ONE_OF_HELP),
679
680 option text = STRING_TOKEN(STR_SERIAL_PORT1_IOADDR), value = 0x3F8, flags = DEFAULT;
681 option text = STRING_TOKEN(STR_SERIAL_PORT2_IOADDR), value = 0x2F8, flags = 0;
682 option text = STRING_TOKEN(STR_SERIAL_PORT3_IOADDR), value = 0x3E8, flags = 0;
683 option text = STRING_TOKEN(STR_SERIAL_PORT4_IOADDR), value = 0x2E8, flags = 0;
684 endoneof;
685 endif;
686 endif;
687
688 grayoutif TRUE;
689 suppressif ideqval MyIfrNVData.SerialPortStatus == 0;
690 oneof varid = MyIfrNVData.SerialPortIrq,
691 prompt = STRING_TOKEN(STR_SERIAL_PORT_IRQ),
692 help = STRING_TOKEN(STR_ONE_OF_HELP),
693
694 option text = STRING_TOKEN(STR_SERIAL_PORT13_IRQ), value = 0x4, flags = DEFAULT;
695 option text = STRING_TOKEN(STR_SERIAL_PORT24_IRQ), value = 0x3, flags = 0;
696 endoneof;
697 endif;
698 endif;
699
700 goto 1,
701 prompt = STRING_TOKEN(STR_GOTO_FORM1), //MainSetupPage
702 help = STRING_TOKEN(STR_GOTO_HELP);
703
704 endform;
705
706 form formid = 0x1234, // Dynamically created page,
707 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
708
709 label LABEL_UPDATE1;
710 //
711 // This is where we will insert dynamic created opcodes
712 //
713 label LABEL_END;
714
715 endform;
716
717 endformset;