]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr
Patch includes:
[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 #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
263 endoneof;
264
265 oneof varid = MyIfrNVData.TestLateCheck2,
266 prompt = STRING_TOKEN(STR_TEST_OPCODE2),
267 help = STRING_TOKEN(STR_ONE_OF_HELP),
268 option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = DEFAULT | RESET_REQUIRED;
269 option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = RESET_REQUIRED;
270
271 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
272 ideqid MyIfrNVData.TestLateCheck == MyIfrNVData.TestLateCheck2
273 endif
274
275 endoneof;
276
277 oneof varid = MyIfrNVData.QuestionAboutTreeHugging,
278 prompt = STRING_TOKEN(STR_ONE_OF_PROMPT),
279 help = STRING_TOKEN(STR_ONE_OF_HELP),
280 option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = RESET_REQUIRED;
281 option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = DEFAULT | RESET_REQUIRED;
282 option text = STRING_TOKEN(STR_ONE_OF_TEXT3), value = 0x03, flags = RESET_REQUIRED;
283
284 endoneof;
285
286 //
287 // Define a string (EFI_IFR_STRING)
288 //
289 string varid = MyIfrNVData.MyStringData,
290 prompt = STRING_TOKEN(STR_MY_STRING_PROMPT2),
291 help = STRING_TOKEN(STR_MY_STRING_HELP2),
292 flags = INTERACTIVE,
293 key = 0x1236,
294 minsize = 6,
295 maxsize = 40,
296 inconsistentif prompt = STRING_TOKEN(STR_STRING_CHECK_ERROR_POPUP),
297 pushthis != stringref(STRING_TOKEN(STR_STRING_CHECK))
298 endif
299 endstring;
300
301 //
302 // Define a numeric (EFI_IFR_NUMERIC)
303 //
304 numeric varid = MyIfrNVData.HowOldAreYouInYearsManual,
305 prompt = STRING_TOKEN(STR_NUMERIC_READONLY_PROMPT),
306 help = STRING_TOKEN(STR_NUMERIC_HELP0),
307 flags = READ_ONLY, // READ_ONLY indicate it's marked with EFI_IFR_FLAG_READ_ONLY
308 minimum = 0,
309 maximum = 0xf0,
310 step = 0, // Stepping of 0 equates to a manual entering
311 // of a value, otherwise it will be adjusted by "+"/"-"
312 default = 21, // defaultstore could be used to specify the default type
313 // If no defaultstore is specified, it implies Standard Default
314
315 endnumeric;
316
317 numeric varid = MyIfrNVData.HowOldAreYouInYearsManual,
318 prompt = STRING_TOKEN(STR_NUMERIC_MANUAL_PROMPT),
319 help = STRING_TOKEN(STR_NUMERIC_HELP0),
320 minimum = 0,
321 maximum = 0xf0,
322 step = 0,
323 default = 21,
324
325 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
326 ideqval MyIfrNVData.HowOldAreYouInYearsManual == 99
327 OR
328 ideqid MyIfrNVData.HowOldAreYouInYearsManual == MyEfiVar.Field8
329 OR
330 ideqvallist MyIfrNVData.HowOldAreYouInYearsManual == 1 3 5 7
331 endif
332
333 endnumeric;
334
335 numeric varid = MyEfiVar.Field8, // Reference of EFI variable storage
336 questionid = 0x1111,
337 prompt = STRING_TOKEN(STR_TALL_HEX_PROMPT),
338 help = STRING_TOKEN(STR_NUMERIC_HELP1),
339 flags = DISPLAY_UINT_HEX | INTERACTIVE, // Display in HEX format (if not specified, default is in decimal format)
340 minimum = 0,
341 maximum = 250,
342 default = 18, defaultstore = MyStandardDefault, // This is standard default value
343 default = 19, defaultstore = MyManufactureDefault, // This is manufacture default value
344
345 endnumeric;
346
347 //
348 // Define numeric using Name/Value Storage
349 //
350 numeric varid = MyNameValueVar[0], // This numeric take NameValueVar0 as storage
351 prompt = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME0),
352 help = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME0_HELP),
353 //
354 // Size should be defined for numeric when use Name/Value storage
355 // Valid value for numerice size are: NUMERIC_SIZE_1, NUMERIC_SIZE_2, NUMERIC_SIZE_4 and NUMERIC_SIZE_8
356 //
357 flags = NUMERIC_SIZE_1, // Size of this numeric is 1 byte
358 minimum = 0,
359 maximum = 0xff,
360 step = 0,
361 locked,
362 endnumeric;
363
364 numeric varid = MyNameValueVar[1], // This numeric take NameValueVar1 as storage
365 prompt = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME1),
366 help = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME1_HELP),
367 flags = NUMERIC_SIZE_2, // Size of this numeric is 2 bytes
368 minimum = 0,
369 maximum = 0xffff,
370 step = 0,
371 endnumeric;
372
373 //
374 // Define string using Name/Value Storage
375 //
376 string varid = MyNameValueVar[2], // This string take NameValueVar2 as storage
377 prompt = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME2),
378 help = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME2_HELP),
379 minsize = 2,
380 maxsize = 0x14,
381 endstring;
382
383 oneof varid = MyEfiVar.Field16,
384 prompt = STRING_TOKEN(STR_ONE_OF_PROMPT),
385 help = STRING_TOKEN(STR_NUMERIC_NUM_HELP),
386 option text = STRING_TOKEN(STR_BOOT_ORDER1), value = 0x0, flags = 0;
387 option text = STRING_TOKEN(STR_BOOT_ORDER2), value = 0x1, flags = DEFAULT;
388 endoneof;
389
390 label LABEL_1_VALUE;
391 label LABEL_2_VALUE;
392
393 grayoutif ideqval MyIfrNVData.HowOldAreYouInYearsManual == 23 AND ideqval MyIfrNVData.SuppressGrayOutSomething == 0x1;
394 numeric varid = MyIfrNVData.HowOldAreYouInYears,
395 prompt = STRING_TOKEN(STR_NUMERIC_STEP_PROMPT),
396 help = STRING_TOKEN(STR_NUMERIC_HELP2),
397 minimum = 0,
398 maximum = 243,
399 step = 1,
400 default = 18, defaultstore = MyStandardDefault, // This is standard default value
401 default = 19, defaultstore = MyManufactureDefault, // This is manufacture default value
402
403 endnumeric;
404 endif;
405
406 numeric varid = MyIfrNVData.GetDefaultValueFromAccess,
407 questionid = 0x1239,
408 prompt = STRING_TOKEN(STR_DEFAULT_VALUE_FROM_ACCESS_PROMPT),
409 help = STRING_TOKEN(STR_DEFAULT_VALUE_FROM_ACCESS_HELP),
410 flags = DISPLAY_UINT_HEX | INTERACTIVE,
411 minimum = 0,
412 maximum = 255,
413 step = 1,
414 default = 18,
415 endnumeric;
416
417 numeric varid = MyIfrNVData.GetDefaultValueFromCallBack,
418 questionid = 0x1240,
419 prompt = STRING_TOKEN(STR_DEFAULT_VALUE_FROM_CALLBACK_PROMPT),
420 help = STRING_TOKEN(STR_DEFAULT_VALUE_FROM_CALLBACK_HELP),
421 flags = DISPLAY_UINT_HEX | INTERACTIVE,
422 minimum = 0,
423 maximum = 255,
424 step = 1,
425 default = 18,
426 endnumeric;
427
428 resetbutton
429 defaultstore = MyStandardDefault,
430 prompt = STRING_TOKEN(STR_STANDARD_DEFAULT_PROMPT),
431 help = STRING_TOKEN(STR_STANDARD_DEFAULT_HELP),
432 endresetbutton;
433
434 resetbutton
435 defaultstore = MyManufactureDefault,
436 prompt = STRING_TOKEN(STR_MANUFACTURE_DEFAULT_PROMPT),
437 help = STRING_TOKEN(STR_MANUFACTURE_DEFAULT_HELP),
438 endresetbutton;
439
440 //
441 // Non-interactive password, validate by Setup Browser
442 //
443 password varid = MyIfrNVData.WhatIsThePassword,
444 prompt = STRING_TOKEN(STR_PASSWORD_PROMPT),
445 help = STRING_TOKEN(STR_PASSWORD_HELP),
446 minsize = 6,
447 maxsize = 20,
448 endpassword;
449
450 string varid = MyIfrNVData.PasswordClearText,
451 prompt = STRING_TOKEN(STR_MY_STRING_PROMPT),
452 help = STRING_TOKEN(STR_MY_STRING_HELP),
453 minsize = 6,
454 maxsize = 0x14,
455 endstring;
456
457 //
458 // Interactive password, validate via ConfigAccess.Callback()
459 //
460 password varid = MyIfrNVData.WhatIsThePassword2,
461 prompt = STRING_TOKEN(STR_PASSWORD_CALLBACK_PROMPT),
462 help = STRING_TOKEN(STR_PASSWORD_HELP),
463 flags = INTERACTIVE,
464 key = 0x2000,
465 minsize = 6,
466 maxsize = 20,
467 endpassword;
468
469 //
470 // Sample use case for IFR Security op-code
471 //
472 grayoutif NOT security (EFI_USER_INFO_ACCESS_SETUP_ADMIN_GUID);
473 text
474 help = STRING_TOKEN(STR_TEXT_SECRUITY_TEST_HELP),
475 text = STRING_TOKEN(STR_TEXT_SECRUITY_TEST_TEXT);
476 endif;
477
478 goto 2,
479 prompt = STRING_TOKEN(STR_GOTO_FORM2), //SecondSetupPage // 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 3,
483 prompt = STRING_TOKEN(STR_GOTO_FORM3), //ThirdSetupPage // 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 4,
487 prompt = STRING_TOKEN(STR_GOTO_FORM4), //FourthSetupPage // this too has no end-op and basically it's a jump to a form ONLY
488 help = STRING_TOKEN(STR_GOTO_HELP);
489
490 goto 5,
491 prompt = STRING_TOKEN(STR_GOTO_FORM5), //FifthSetupPage // this too has no end-op and basically it's a jump to a form ONLY
492 help = STRING_TOKEN(STR_GOTO_FORM5_HELP);
493
494 goto 6,
495 prompt = STRING_TOKEN(STR_GOTO_FORM6), //SixthSetupPage // this too has no end-op and basically it's a jump to a form ONLY
496 help = STRING_TOKEN(STR_GOTO_HELP);
497
498 goto
499 formsetguid = DRIVER_SAMPLE_INVENTORY_GUID,
500 formid = 0x1,
501 question = 0x1,
502 prompt = STRING_TOKEN(STR_GOTO_ANOTHER_FORMSET),
503 help = STRING_TOKEN(STR_GOTO_ANOTHER_FORMSET_HELP);
504
505 guidop
506 guid = DRIVER_SAMPLE_FORMSET_GUID,
507 datatype = MY_EFI_VARSTORE_DATA,
508 data.Field8 = 0x21,
509 data.Field16 = 0x2121,
510 data.OrderedList[0] = 0x21,
511 endguidop;
512
513
514 endform;
515
516 suppressif ideqval MyIfrNVData.BootOrderLarge == 0;
517 form formid = 2, // SecondSetupPage,
518 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
519
520
521 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
522 prompt = STRING_TOKEN(STR_DATE_PROMPT),
523 help = STRING_TOKEN(STR_DATE_HELP),
524 minimum = 1998,
525 maximum = 2099,
526 step = 1,
527 default = 2004,
528
529 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
530 prompt = STRING_TOKEN(STR_DATE_PROMPT),
531 help = STRING_TOKEN(STR_DATE_HELP),
532 minimum = 1,
533 maximum = 12,
534 step = 1,
535 default = 1,
536
537 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
538 prompt = STRING_TOKEN(STR_DATE_PROMPT),
539 help = STRING_TOKEN(STR_DATE_HELP),
540 minimum = 1,
541 maximum = 31,
542 step = 0x1,
543 default = 1,
544
545 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
546 ideqval Date.Day == 31
547 AND
548 ideqvallist Date.Month == 2 4 6 9 11
549 endif
550
551 //
552 // If the day is 30 AND month is 2
553 //
554 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
555 ideqval Date.Day == 30
556 AND
557 ideqval Date.Month == 2
558 endif
559
560 //
561 // If the day is 29 AND month is 2 AND it year is NOT a leapyear
562 //
563 inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
564 ideqval Date.Day == 0x1D
565 AND
566 ideqval Date.Month == 2
567 AND
568 NOT
569 ideqvallist Date.Year == 2004 2008 20012 20016 2020 2024 2028 2032 2036
570 endif
571
572 enddate;
573
574 text
575 help = STRING_TOKEN(STR_SAVE_CURRENT_AND_EXIT),
576 text = STRING_TOKEN(STR_SAVE_CURRENT_AND_EXIT),
577 text = STRING_TOKEN(STR_SAVE_CURRENT_AND_EXIT),
578 flags = INTERACTIVE,
579 key = 0x1241;
580
581 text
582 help = STRING_TOKEN(STR_DISCARD_CURRENT),
583 text = STRING_TOKEN(STR_DISCARD_CURRENT),
584 text = STRING_TOKEN(STR_DISCARD_CURRENT),
585 flags = INTERACTIVE,
586 key = 0x1242;
587
588 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
589 prompt = STRING_TOKEN(STR_TIME_PROMPT),
590 help = STRING_TOKEN(STR_TIME_HELP),
591 minimum = 0,
592 maximum = 23,
593 step = 1,
594 default = 0,
595
596 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
597 prompt = STRING_TOKEN(STR_TIME_PROMPT),
598 help = STRING_TOKEN(STR_TIME_HELP),
599 minimum = 0,
600 maximum = 59,
601 step = 1,
602 default = 0,
603
604 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
605 prompt = STRING_TOKEN(STR_TIME_PROMPT),
606 help = STRING_TOKEN(STR_TIME_HELP),
607 minimum = 0,
608 maximum = 59,
609 step = 1,
610 default = 0,
611
612 endtime;
613
614 time
615 name = MyTime,
616 varid = MyIfrNVData.Time,
617 prompt = STRING_TOKEN(STR_TIME_PROMPT),
618 help = STRING_TOKEN(STR_TIME_PROMPT),
619 flags = STORAGE_NORMAL | SECOND_SUPPRESS,
620 default = 15:33:33,
621 endtime;
622
623 checkbox varid = MyIfrNVData.ChooseToActivateNuclearWeaponry,
624 prompt = STRING_TOKEN(STR_CHECK_BOX_PROMPT),
625 help = STRING_TOKEN(STR_CHECK_BOX_HELP),
626 flags = CHECKBOX_DEFAULT,
627 key = 0,
628 endcheckbox;
629
630 text
631 help = STRING_TOKEN(STR_TEXT_HELP),
632 text = STRING_TOKEN(STR_TEXT_TEXT_1);
633
634 text
635 help = STRING_TOKEN(STR_TEXT_HELP),
636 text = STRING_TOKEN(STR_TEXT_TEXT_1),
637 text = STRING_TOKEN(STR_TEXT_TEXT_2);
638
639 goto 1,
640 prompt = STRING_TOKEN(STR_GOTO_FORM1), //MainSetupPage // this too has no end-op and basically it's a jump to a form ONLY
641 help = STRING_TOKEN(STR_GOTO_HELP);
642
643 goto
644 varid = MyIfrNVData.RefData,
645 prompt = STRING_TOKEN(STR_GOTO_DYNAMIC3),
646 help = STRING_TOKEN(STR_GOTO_DYNAMIC3_HELP),
647 flags = INTERACTIVE,
648 key = 0x1248,
649 //
650 // Set the defult value, format is QuestionId; FormId; FormsetGuid; Device Path String Token
651 //
652 default = 0;0;ZERO_GUID;STRING_TOKEN(STR_NULL_STRING),
653 ; // goto opcode end flag.
654
655 goto
656 prompt = STRING_TOKEN(STR_GOTO_DYNAMIC4),
657 help = STRING_TOKEN(STR_GOTO_DYNAMIC4_HELP),
658 flags = INTERACTIVE,
659 key = 0x1249;
660
661 endform;
662 endif;
663
664 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
665
666 suppressif ideqval MyEfiVar.Field8 == 111;
667 text
668 help = STRING_TOKEN(STR_TEXT_HELP),
669 text = STRING_TOKEN(STR_TEXT_TEXT_1);
670 endif;
671
672 goto 1,
673 prompt = STRING_TOKEN(STR_GOTO_FORM1), //MainSetupPage
674 help = STRING_TOKEN(STR_GOTO_HELP);
675
676 numeric varid = MyIfrNVData.DynamicRefresh,
677 prompt = STRING_TOKEN(STR_NUMERIC_MANUAL_PROMPT),
678 help = STRING_TOKEN(STR_NUMERIC_HELP0),
679 flags = INTERACTIVE,
680 key = 0x5678,
681 minimum = 0,
682 maximum = 0xff,
683 step = 0,
684 default = 0,
685 refresh interval = 3 // Refresh interval in seconds
686 endnumeric;
687
688 label LABEL_UPDATE2;
689 label LABEL_END;
690
691 endform;
692
693 formmap formid = 4,
694 maptitle = STRING_TOKEN(STR_SAMPL_MAP_METHOD);
695 mapguid = DRIVER_SAMPLE_FORMSET_GUID;
696 maptitle = STRING_TOKEN(STR_STANDARD_MAP_METHOD);
697 mapguid = EFI_HII_STANDARD_FORM_GUID;
698
699 oneof varid = MyIfrNVData.SerialPortNo,
700 prompt = STRING_TOKEN(STR_SERIAL_PORT),
701 help = STRING_TOKEN(STR_ONE_OF_HELP),
702
703 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;)));
704 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;));
705
706 option text = STRING_TOKEN(STR_SERIAL_PORT_DISABLE), value = 0x0, flags = DEFAULT;
707 option text = STRING_TOKEN(STR_SERIAL_PORT1), value = 0x1, flags = 0;
708 option text = STRING_TOKEN(STR_SERIAL_PORT2), value = 0x2, flags = 0;
709 option text = STRING_TOKEN(STR_SERIAL_PORT3), value = 0x3, flags = 0;
710 option text = STRING_TOKEN(STR_SERIAL_PORT4), value = 0x4, flags = 0;
711 endoneof;
712
713 grayoutif TRUE;
714 checkbox varid = MyIfrNVData.SerialPortStatus,
715 prompt = STRING_TOKEN(STR_SERIAL_PORT_STATUS),
716 help = STRING_TOKEN(STR_CHECK_BOX_HELP),
717 endcheckbox;
718 endif;
719
720 grayoutif TRUE;
721 suppressif ideqval MyIfrNVData.SerialPortStatus == 0;
722 oneof varid = MyIfrNVData.SerialPortIo,
723 prompt = STRING_TOKEN(STR_SERIAL_PORT_IO_ADDRESS),
724 help = STRING_TOKEN(STR_ONE_OF_HELP),
725
726 option text = STRING_TOKEN(STR_SERIAL_PORT1_IOADDR), value = 0x3F8, flags = DEFAULT;
727 option text = STRING_TOKEN(STR_SERIAL_PORT2_IOADDR), value = 0x2F8, flags = 0;
728 option text = STRING_TOKEN(STR_SERIAL_PORT3_IOADDR), value = 0x3E8, flags = 0;
729 option text = STRING_TOKEN(STR_SERIAL_PORT4_IOADDR), value = 0x2E8, flags = 0;
730 endoneof;
731 endif;
732 endif;
733
734 grayoutif TRUE;
735 suppressif ideqval MyIfrNVData.SerialPortStatus == 0;
736 oneof varid = MyIfrNVData.SerialPortIrq,
737 prompt = STRING_TOKEN(STR_SERIAL_PORT_IRQ),
738 help = STRING_TOKEN(STR_ONE_OF_HELP),
739
740 option text = STRING_TOKEN(STR_SERIAL_PORT13_IRQ), value = 0x4, flags = DEFAULT;
741 option text = STRING_TOKEN(STR_SERIAL_PORT24_IRQ), value = 0x3, flags = 0;
742 endoneof;
743 endif;
744 endif;
745
746 goto 1,
747 prompt = STRING_TOKEN(STR_GOTO_FORM1), //MainSetupPage
748 help = STRING_TOKEN(STR_GOTO_HELP);
749
750 endform;
751
752 form formid = 5, // Modal form
753 title = STRING_TOKEN(STR_MODAL_FORM_TITLE);
754 //
755 // This form is a modal form.
756 //
757 modal;
758 text
759 help = STRING_TOKEN(STR_EXIT_TEXT),
760 text = STRING_TOKEN(STR_EXIT_TEXT),
761 text = STRING_TOKEN(STR_EXIT_TEXT),
762 flags = INTERACTIVE, // VfrCompiler will generate opcode EFI_IFR_ACTION for Text marked as INTERACTIVE
763 key = 0x1245;
764
765 text
766 help = STRING_TOKEN(STR_SAVE_TEXT),
767 text = STRING_TOKEN(STR_SAVE_TEXT),
768 text = STRING_TOKEN(STR_SAVE_TEXT),
769 flags = INTERACTIVE, // VfrCompiler will generate opcode EFI_IFR_ACTION for Text marked as INTERACTIVE
770 key = 0x1246;
771 endform;
772
773 form formid = 6, // Form to show the refresh guid group op-code
774 title = STRING_TOKEN(STR_FORM6_TITLE);
775
776 text
777 help = STRING_TOKEN(STR_TEXT_REFRESH_GUID),
778 text = STRING_TOKEN(STR_TEXT_REFRESH_GUID);
779
780 numeric varid = MyIfrNVData.RefreshGuidCount,
781 prompt = STRING_TOKEN(STR_TEXT_REFRESH_GUID_COUNT),
782 help = STRING_TOKEN(STR_NUMERIC_HELP0),
783 flags = INTERACTIVE,
784 key = 0x1247,
785 minimum = 0,
786 maximum = 0xff,
787 step = 0,
788 default = 0,
789 refreshguid = EFI_IFR_REFRESH_ID_OP_GUID,
790 endnumeric;
791
792 label LABEL_UPDATE3;
793 label LABEL_END;
794
795 endform;
796
797 form formid = 0x1234, // Dynamically created page,
798 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
799
800 label LABEL_UPDATE1;
801 //
802 // This is where we will insert dynamic created opcodes
803 //
804 label LABEL_END;
805
806 endform;
807
808 endformset;