]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr
Clean up the private GUID definition in module Level.
[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 = DRIVER_SAMPLE_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 = DRIVER_SAMPLE_FORMSET_GUID; // GUID of this buffer storage
75
76 //
77 // Define a EFI variable Storage (EFI_IFR_VARSTORE_EFI)
78 //
79 efivarstore MY_EFI_VARSTORE_DATA,
80 attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE, // EFI variable attribures
81 name = MyEfiVar,
82 guid = DRIVER_SAMPLE_FORMSET_GUID;
83
84 //
85 // Define a Name/Value Storage (EFI_IFR_VARSTORE_NAME_VALUE)
86 //
87 namevaluevarstore MyNameValueVar, // Define storage reference name in vfr
88 name = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME0), // Define Name list of this storage, refer it by MyNameValueVar[0]
89 name = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME1), // Define Name list of this storage, refer it by MyNameValueVar[1]
90 name = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME2), // Define Name list of this storage, refer it by MyNameValueVar[2]
91 guid = DRIVER_SAMPLE_FORMSET_GUID; // GUID of this Name/Value storage
92
93 defaultstore MyStandardDefault,
94 prompt = STRING_TOKEN(STR_STANDARD_DEFAULT_PROMPT),
95 attribute = 0x0000; // Default ID: 0000 standard default
96
97 defaultstore MyManufactureDefault,
98 prompt = STRING_TOKEN(STR_MANUFACTURE_DEFAULT_PROMPT),
99 attribute = 0x0001; // Default ID: 0001 manufacture default
100
101 //
102 // Define a Form (EFI_IFR_FORM)
103 //
104 form formid = 1, // Form ID
105 title = STRING_TOKEN(STR_FORM1_TITLE); // Form title
106
107 subtitle text = STRING_TOKEN(STR_SUBTITLE_TEXT);
108
109 subtitle text = STRING_TOKEN(STR_SUBTITLE_TEXT2);
110
111 //
112 // Define a display only text (EFI_IFR_TEXT)
113 //
114 text
115 help = STRING_TOKEN(STR_TEXT_HELP), // Help string
116 text = STRING_TOKEN(STR_CPU_STRING), // Prompt string
117 text = STRING_TOKEN(STR_CPU_STRING2); // TextTwo
118
119 //
120 // Define action button (EFI_IFR_ACTION)
121 //
122 text
123 help = STRING_TOKEN(STR_EXIT_TEXT),
124 text = STRING_TOKEN(STR_EXIT_TEXT),
125 text = STRING_TOKEN(STR_EXIT_TEXT),
126 flags = INTERACTIVE, // VfrCompiler will generate opcode EFI_IFR_ACTION for Text marked as INTERACTIVE
127 key = 0x1237;
128
129 text
130 help = STRING_TOKEN(STR_SAVE_TEXT),
131 text = STRING_TOKEN(STR_SAVE_TEXT),
132 text = STRING_TOKEN(STR_SAVE_TEXT),
133 flags = INTERACTIVE,
134 key = 0x1238;
135
136 text
137 help = STRING_TOKEN(STR_SAVE_CURRENT),
138 text = STRING_TOKEN(STR_SAVE_CURRENT),
139 text = STRING_TOKEN(STR_SAVE_CURRENT),
140 flags = INTERACTIVE,
141 key = 0x1243;
142
143 text
144 help = STRING_TOKEN(STR_DISCARD_CURRENT_AND_EXIT),
145 text = STRING_TOKEN(STR_DISCARD_CURRENT_AND_EXIT),
146 text = STRING_TOKEN(STR_DISCARD_CURRENT_AND_EXIT),
147 flags = INTERACTIVE,
148 key = 0x1244;
149 //
150 // Define oneof (EFI_IFR_ONE_OF)
151 //
152 oneof name = MyOneOf, // Define reference name for Question
153 varid = MyIfrNVData.SuppressGrayOutSomething, // Use "DataStructure.Member" to reference Buffer Storage
154 prompt = STRING_TOKEN(STR_ONE_OF_PROMPT),
155 help = STRING_TOKEN(STR_ONE_OF_HELP),
156 //
157 // Define an option (EFI_IFR_ONE_OF_OPTION)
158 //
159 option text = STRING_TOKEN(STR_ONE_OF_TEXT4), value = 0x0, flags = 0;
160 option text = STRING_TOKEN(STR_ONE_OF_TEXT5), value = 0x1, flags = 0;
161 //
162 // DEFAULT indicate this option will be marked with EFI_IFR_OPTION_DEFAULT
163 //
164 option text = STRING_TOKEN(STR_ONE_OF_TEXT6), value = 0x2, flags = DEFAULT;
165 endoneof;
166
167 oneof varid = MyIfrNVData.BootOrderLarge,
168 prompt = STRING_TOKEN(STR_ONE_OF_PROMPT),
169 help = STRING_TOKEN(STR_ONE_OF_HELP),
170 default value = cond (pushthis == 0 ? 0 : cond ((questionref(MyOneOf) >> 0x4 & 0xF00) == 0x0 + 0x2 ? 0 : 1)),
171 option text = STRING_TOKEN(STR_BOOT_ORDER1), value = 0x0, flags = 0;
172 option text = STRING_TOKEN(STR_BOOT_ORDER2), value = 0x1, flags = 0;
173 endoneof;
174
175 grayoutif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x1;
176 suppressif questionref(MyOneOf) == 0x0;
177
178 checkbox varid = MyIfrNVData.ChooseToActivateNuclearWeaponry,
179 prompt = STRING_TOKEN(STR_CHECK_BOX_PROMPT),
180 help = STRING_TOKEN(STR_CHECK_BOX_HELP),
181 //
182 // CHECKBOX_DEFAULT indicate this checkbox is marked with EFI_IFR_CHECKBOX_DEFAULT
183 // CHECKBOX_DEFAULT_MFG indicate EFI_IFR_CHECKBOX_DEFAULT_MFG.
184 //
185 flags = CHECKBOX_DEFAULT | CHECKBOX_DEFAULT_MFG,
186 key = 0,
187 default = 1,
188 endcheckbox;
189 endif;
190 endif;
191
192 //
193 // Ordered list:
194 // sizeof(MyIfrNVData) storage must be UINT8 array, and
195 // size written for the variable must be size of the entire
196 // variable.
197 //
198 //
199 suppressif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x0;
200
201 //
202 // label is defined as an anchor where you want to insert some dynamic
203 // opcodes created on-the-fly
204 //
205 label LABEL_UPDATE_BBS;
206
207 orderedlist
208 varid = MyIfrNVData.BootOrder,
209 prompt = STRING_TOKEN(STR_BOOT_OPTIONS),
210 help = STRING_TOKEN(STR_NULL_STRING),
211 option text = STRING_TOKEN(STR_BOOT_OPTION2), value = 2, flags = RESET_REQUIRED;
212 option text = STRING_TOKEN(STR_BOOT_OPTION1), value = 1, flags = RESET_REQUIRED;
213 option text = STRING_TOKEN(STR_BOOT_OPTION3), value = 3, flags = RESET_REQUIRED;
214 suppressif ideqval MyIfrNVData.BootOrderLarge == 0;
215 option text = STRING_TOKEN(STR_BOOT_OPTION4), value = 4, flags = RESET_REQUIRED;
216 endif
217 endlist;
218
219 //
220 // label should be paired with each other
221 //
222 label LABEL_END;
223
224 endif; // end suppressif
225
226 disableif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x2;
227 orderedlist
228 varid = MyIfrNVData.OrderedList,
229 prompt = STRING_TOKEN(STR_TEST_OPCODE),
230 help = STRING_TOKEN(STR_TEXT_HELP),
231 option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 3, flags = RESET_REQUIRED;
232 option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 2, flags = RESET_REQUIRED;
233 option text = STRING_TOKEN(STR_ONE_OF_TEXT3), value = 1, flags = RESET_REQUIRED;
234 endlist;
235 endif;
236
237 label 100;
238
239 //
240 // Define a hyperlink (EFI_IFR_REF)
241 //
242 goto 0x1234, // Destination Form ID
243 prompt = STRING_TOKEN(STR_GOTO_DYNAMIC), // Prompt string
244 help = STRING_TOKEN(STR_GOTO_HELP), // Help string
245 flags = INTERACTIVE, // INTERACTIVE indicate it's marked with EFI_IFR_FLAG_CALLBACK
246 key = 0x1234; // Question ID which will be passed-in in COnfigAccess.Callback()
247
248 goto 0x1234,
249 prompt = STRING_TOKEN(STR_GOTO_DYNAMIC2),
250 help = STRING_TOKEN(STR_GOTO_HELP),
251 flags = INTERACTIVE,
252 key = 0x1235;
253
254 oneof varid = MyIfrNVData.TestLateCheck,
255 prompt = STRING_TOKEN(STR_TEST_OPCODE),
256 help = STRING_TOKEN(STR_ONE_OF_HELP),
257 option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = RESET_REQUIRED;
258 option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = DEFAULT | RESET_REQUIRED;
259
260 endoneof;
261
262 oneof varid = MyIfrNVData.TestLateCheck2,
263 prompt = STRING_TOKEN(STR_TEST_OPCODE2),
264 help = STRING_TOKEN(STR_ONE_OF_HELP),
265 option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = DEFAULT | RESET_REQUIRED;
266 option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = RESET_REQUIRED;
267
268 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
269 ideqid MyIfrNVData.TestLateCheck == MyIfrNVData.TestLateCheck2
270 endif
271
272 endoneof;
273
274 oneof varid = MyIfrNVData.QuestionAboutTreeHugging,
275 prompt = STRING_TOKEN(STR_ONE_OF_PROMPT),
276 help = STRING_TOKEN(STR_ONE_OF_HELP),
277 option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = RESET_REQUIRED;
278 option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = DEFAULT | RESET_REQUIRED;
279 option text = STRING_TOKEN(STR_ONE_OF_TEXT3), value = 0x03, flags = RESET_REQUIRED;
280
281 endoneof;
282
283 //
284 // Define a string (EFI_IFR_STRING)
285 //
286 string varid = MyIfrNVData.MyStringData,
287 prompt = STRING_TOKEN(STR_MY_STRING_PROMPT2),
288 help = STRING_TOKEN(STR_MY_STRING_HELP2),
289 flags = INTERACTIVE,
290 key = 0x1236,
291 minsize = 6,
292 maxsize = 40,
293 inconsistentif prompt = STRING_TOKEN(STR_STRING_CHECK_ERROR_POPUP),
294 pushthis != stringref(STRING_TOKEN(STR_STRING_CHECK))
295 endif
296 endstring;
297
298 //
299 // Define a numeric (EFI_IFR_NUMERIC)
300 //
301 numeric varid = MyIfrNVData.HowOldAreYouInYearsManual,
302 prompt = STRING_TOKEN(STR_NUMERIC_READONLY_PROMPT),
303 help = STRING_TOKEN(STR_NUMERIC_HELP0),
304 flags = READ_ONLY, // READ_ONLY indicate it's marked with EFI_IFR_FLAG_READ_ONLY
305 minimum = 0,
306 maximum = 0xf0,
307 step = 0, // Stepping of 0 equates to a manual entering
308 // of a value, otherwise it will be adjusted by "+"/"-"
309 default = 21, // defaultstore could be used to specify the default type
310 // If no defaultstore is specified, it implies Standard Default
311
312 endnumeric;
313
314 numeric varid = MyIfrNVData.HowOldAreYouInYearsManual,
315 prompt = STRING_TOKEN(STR_NUMERIC_MANUAL_PROMPT),
316 help = STRING_TOKEN(STR_NUMERIC_HELP0),
317 minimum = 0,
318 maximum = 0xf0,
319 step = 0,
320 default = 21,
321
322 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
323 ideqval MyIfrNVData.HowOldAreYouInYearsManual == 99
324 OR
325 ideqid MyIfrNVData.HowOldAreYouInYearsManual == MyEfiVar.Field8
326 OR
327 ideqvallist MyIfrNVData.HowOldAreYouInYearsManual == 1 3 5 7
328 endif
329
330 endnumeric;
331
332 numeric varid = MyEfiVar.Field8, // Reference of EFI variable storage
333 questionid = 0x1111,
334 prompt = STRING_TOKEN(STR_TALL_HEX_PROMPT),
335 help = STRING_TOKEN(STR_NUMERIC_HELP1),
336 flags = DISPLAY_UINT_HEX | INTERACTIVE, // Display in HEX format (if not specified, default is in decimal format)
337 minimum = 0,
338 maximum = 250,
339 default = 18, defaultstore = MyStandardDefault, // This is standard default value
340 default = 19, defaultstore = MyManufactureDefault, // This is manufacture default value
341
342 endnumeric;
343
344 //
345 // Define numeric using Name/Value Storage
346 //
347 numeric varid = MyNameValueVar[0], // This numeric take NameValueVar0 as storage
348 prompt = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME0),
349 help = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME0_HELP),
350 //
351 // Size should be defined for numeric when use Name/Value storage
352 // Valid value for numerice size are: NUMERIC_SIZE_1, NUMERIC_SIZE_2, NUMERIC_SIZE_4 and NUMERIC_SIZE_8
353 //
354 flags = NUMERIC_SIZE_1, // Size of this numeric is 1 byte
355 minimum = 0,
356 maximum = 0xff,
357 step = 0,
358 endnumeric;
359
360 numeric varid = MyNameValueVar[1], // This numeric take NameValueVar1 as storage
361 prompt = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME1),
362 help = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME1_HELP),
363 flags = NUMERIC_SIZE_2, // Size of this numeric is 2 bytes
364 minimum = 0,
365 maximum = 0xffff,
366 step = 0,
367 endnumeric;
368
369 //
370 // Define string using Name/Value Storage
371 //
372 string varid = MyNameValueVar[2], // This string take NameValueVar2 as storage
373 prompt = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME2),
374 help = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME2_HELP),
375 minsize = 2,
376 maxsize = 0x14,
377 endstring;
378
379 oneof varid = MyEfiVar.Field16,
380 prompt = STRING_TOKEN(STR_ONE_OF_PROMPT),
381 help = STRING_TOKEN(STR_NUMERIC_NUM_HELP),
382 option text = STRING_TOKEN(STR_BOOT_ORDER1), value = 0x0, flags = 0;
383 option text = STRING_TOKEN(STR_BOOT_ORDER2), value = 0x1, flags = DEFAULT;
384 endoneof;
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 goto 5,
487 prompt = STRING_TOKEN(STR_GOTO_FORM5), //FifthSetupPage // this too has no end-op and basically it's a jump to a form ONLY
488 help = STRING_TOKEN(STR_GOTO_FORM5_HELP);
489
490 goto 6,
491 prompt = STRING_TOKEN(STR_GOTO_FORM6), //SixthSetupPage // this too has no end-op and basically it's a jump to a form ONLY
492 help = STRING_TOKEN(STR_GOTO_HELP);
493
494 guidop
495 guid = DRIVER_SAMPLE_FORMSET_GUID,
496 datatype = MY_EFI_VARSTORE_DATA,
497 data.Field8 = 0x21,
498 data.Field16 = 0x2121,
499 data.OrderedList[0] = 0x21,
500 endguidop;
501
502
503 endform;
504
505 suppressif ideqval MyIfrNVData.BootOrderLarge == 0;
506 form formid = 2, // SecondSetupPage,
507 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
508
509
510 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
511 prompt = STRING_TOKEN(STR_DATE_PROMPT),
512 help = STRING_TOKEN(STR_DATE_HELP),
513 minimum = 1998,
514 maximum = 2099,
515 step = 1,
516 default = 2004,
517
518 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
519 prompt = STRING_TOKEN(STR_DATE_PROMPT),
520 help = STRING_TOKEN(STR_DATE_HELP),
521 minimum = 1,
522 maximum = 12,
523 step = 1,
524 default = 1,
525
526 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
527 prompt = STRING_TOKEN(STR_DATE_PROMPT),
528 help = STRING_TOKEN(STR_DATE_HELP),
529 minimum = 1,
530 maximum = 31,
531 step = 0x1,
532 default = 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 hour varid = Time.Hour, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
578 prompt = STRING_TOKEN(STR_TIME_PROMPT),
579 help = STRING_TOKEN(STR_TIME_HELP),
580 minimum = 0,
581 maximum = 23,
582 step = 1,
583 default = 0,
584
585 minute varid = Time.Minute, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
586 prompt = STRING_TOKEN(STR_TIME_PROMPT),
587 help = STRING_TOKEN(STR_TIME_HELP),
588 minimum = 0,
589 maximum = 59,
590 step = 1,
591 default = 0,
592
593 second varid = Time.Second, // Note that it is a member of NULL, so the RTC will be the system resource to retrieve and save from
594 prompt = STRING_TOKEN(STR_TIME_PROMPT),
595 help = STRING_TOKEN(STR_TIME_HELP),
596 minimum = 0,
597 maximum = 59,
598 step = 1,
599 default = 0,
600
601 endtime;
602
603 time
604 name = MyTime,
605 varid = MyIfrNVData.Time,
606 prompt = STRING_TOKEN(STR_TIME_PROMPT),
607 help = STRING_TOKEN(STR_TIME_PROMPT),
608 flags = STORAGE_NORMAL,
609 default = 15:33:33,
610 endtime;
611
612 checkbox varid = MyIfrNVData.ChooseToActivateNuclearWeaponry,
613 prompt = STRING_TOKEN(STR_CHECK_BOX_PROMPT),
614 help = STRING_TOKEN(STR_CHECK_BOX_HELP),
615 flags = CHECKBOX_DEFAULT,
616 key = 0,
617 endcheckbox;
618
619 text
620 help = STRING_TOKEN(STR_TEXT_HELP),
621 text = STRING_TOKEN(STR_TEXT_TEXT_1);
622
623 text
624 help = STRING_TOKEN(STR_TEXT_HELP),
625 text = STRING_TOKEN(STR_TEXT_TEXT_1),
626 text = STRING_TOKEN(STR_TEXT_TEXT_2);
627
628 goto 1,
629 prompt = STRING_TOKEN(STR_GOTO_FORM1), //MainSetupPage // this too has no end-op and basically it's a jump to a form ONLY
630 help = STRING_TOKEN(STR_GOTO_HELP);
631
632 goto
633 varid = MyIfrNVData.RefData,
634 prompt = STRING_TOKEN(STR_GOTO_DYNAMIC3),
635 help = STRING_TOKEN(STR_GOTO_DYNAMIC3_HELP),
636 flags = INTERACTIVE,
637 key = 0x1248;
638 //
639 // Set the defult value, format is QuestionId; FormId; FormsetGuid; Device Path String Token
640 //
641 default = 0;0;ZERO_GUID;STRING_TOKEN(STR_NULL_STRING),
642
643 goto
644 prompt = STRING_TOKEN(STR_GOTO_DYNAMIC4),
645 help = STRING_TOKEN(STR_GOTO_DYNAMIC4_HELP),
646 flags = INTERACTIVE,
647 key = 0x1249;
648
649 endform;
650 endif;
651
652 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
653
654 suppressif ideqval MyEfiVar.Field8 == 111;
655 text
656 help = STRING_TOKEN(STR_TEXT_HELP),
657 text = STRING_TOKEN(STR_TEXT_TEXT_1);
658 endif;
659
660 goto 1,
661 prompt = STRING_TOKEN(STR_GOTO_FORM1), //MainSetupPage
662 help = STRING_TOKEN(STR_GOTO_HELP);
663
664 numeric varid = MyIfrNVData.DynamicRefresh,
665 prompt = STRING_TOKEN(STR_NUMERIC_MANUAL_PROMPT),
666 help = STRING_TOKEN(STR_NUMERIC_HELP0),
667 flags = INTERACTIVE,
668 key = 0x5678,
669 minimum = 0,
670 maximum = 0xff,
671 step = 0,
672 default = 0,
673 refresh interval = 3 // Refresh interval in seconds
674 endnumeric;
675
676 label LABEL_UPDATE2;
677 label LABEL_END;
678
679 endform;
680
681 formmap formid = 4,
682 maptitle = STRING_TOKEN(STR_SAMPL_MAP_METHOD);
683 mapguid = DRIVER_SAMPLE_FORMSET_GUID;
684 maptitle = STRING_TOKEN(STR_STANDARD_MAP_METHOD);
685 mapguid = EFI_HII_STANDARD_FORM_GUID;
686
687 oneof varid = MyIfrNVData.SerialPortNo,
688 prompt = STRING_TOKEN(STR_SERIAL_PORT),
689 help = STRING_TOKEN(STR_ONE_OF_HELP),
690
691 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;)));
692 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;));
693
694 option text = STRING_TOKEN(STR_SERIAL_PORT_DISABLE), value = 0x0, flags = DEFAULT;
695 option text = STRING_TOKEN(STR_SERIAL_PORT1), value = 0x1, flags = 0;
696 option text = STRING_TOKEN(STR_SERIAL_PORT2), value = 0x2, flags = 0;
697 option text = STRING_TOKEN(STR_SERIAL_PORT3), value = 0x3, flags = 0;
698 option text = STRING_TOKEN(STR_SERIAL_PORT4), value = 0x4, flags = 0;
699 endoneof;
700
701 grayoutif TRUE;
702 checkbox varid = MyIfrNVData.SerialPortStatus,
703 prompt = STRING_TOKEN(STR_SERIAL_PORT_STATUS),
704 help = STRING_TOKEN(STR_CHECK_BOX_HELP),
705 endcheckbox;
706 endif;
707
708 grayoutif TRUE;
709 suppressif ideqval MyIfrNVData.SerialPortStatus == 0;
710 oneof varid = MyIfrNVData.SerialPortIo,
711 prompt = STRING_TOKEN(STR_SERIAL_PORT_IO_ADDRESS),
712 help = STRING_TOKEN(STR_ONE_OF_HELP),
713
714 option text = STRING_TOKEN(STR_SERIAL_PORT1_IOADDR), value = 0x3F8, flags = DEFAULT;
715 option text = STRING_TOKEN(STR_SERIAL_PORT2_IOADDR), value = 0x2F8, flags = 0;
716 option text = STRING_TOKEN(STR_SERIAL_PORT3_IOADDR), value = 0x3E8, flags = 0;
717 option text = STRING_TOKEN(STR_SERIAL_PORT4_IOADDR), value = 0x2E8, flags = 0;
718 endoneof;
719 endif;
720 endif;
721
722 grayoutif TRUE;
723 suppressif ideqval MyIfrNVData.SerialPortStatus == 0;
724 oneof varid = MyIfrNVData.SerialPortIrq,
725 prompt = STRING_TOKEN(STR_SERIAL_PORT_IRQ),
726 help = STRING_TOKEN(STR_ONE_OF_HELP),
727
728 option text = STRING_TOKEN(STR_SERIAL_PORT13_IRQ), value = 0x4, flags = DEFAULT;
729 option text = STRING_TOKEN(STR_SERIAL_PORT24_IRQ), value = 0x3, flags = 0;
730 endoneof;
731 endif;
732 endif;
733
734 goto 1,
735 prompt = STRING_TOKEN(STR_GOTO_FORM1), //MainSetupPage
736 help = STRING_TOKEN(STR_GOTO_HELP);
737
738 endform;
739
740 form formid = 5, // Modal form
741 title = STRING_TOKEN(STR_MODAL_FORM_TITLE);
742 //
743 // This form is a modal form.
744 //
745 modal;
746 text
747 help = STRING_TOKEN(STR_EXIT_TEXT),
748 text = STRING_TOKEN(STR_EXIT_TEXT),
749 text = STRING_TOKEN(STR_EXIT_TEXT),
750 flags = INTERACTIVE, // VfrCompiler will generate opcode EFI_IFR_ACTION for Text marked as INTERACTIVE
751 key = 0x1245;
752
753 text
754 help = STRING_TOKEN(STR_SAVE_TEXT),
755 text = STRING_TOKEN(STR_SAVE_TEXT),
756 text = STRING_TOKEN(STR_SAVE_TEXT),
757 flags = INTERACTIVE, // VfrCompiler will generate opcode EFI_IFR_ACTION for Text marked as INTERACTIVE
758 key = 0x1246;
759 endform;
760
761 form formid = 6, // Form to show the refresh guid group op-code
762 title = STRING_TOKEN(STR_FORM6_TITLE);
763
764 text
765 help = STRING_TOKEN(STR_TEXT_REFRESH_GUID),
766 text = STRING_TOKEN(STR_TEXT_REFRESH_GUID);
767
768 numeric varid = MyIfrNVData.RefreshGuidCount,
769 prompt = STRING_TOKEN(STR_TEXT_REFRESH_GUID_COUNT),
770 help = STRING_TOKEN(STR_NUMERIC_HELP0),
771 flags = INTERACTIVE,
772 key = 0x1247,
773 minimum = 0,
774 maximum = 0xff,
775 step = 0,
776 default = 0,
777 refreshguid = EFI_IFR_REFRESH_ID_OP_GUID,
778 endnumeric;
779
780 label LABEL_UPDATE3;
781 label LABEL_END;
782
783 endform;
784
785 form formid = 0x1234, // Dynamically created page,
786 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
787
788 label LABEL_UPDATE1;
789 //
790 // This is where we will insert dynamic created opcodes
791 //
792 label LABEL_END;
793
794 endform;
795
796 endformset;