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