1 | ///** @file
|
---|
2 | //
|
---|
3 | // Sample Setup formset.
|
---|
4 | //
|
---|
5 | // Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
|
---|
6 | // (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
|
---|
7 | // SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
8 | //
|
---|
9 | //**/
|
---|
10 |
|
---|
11 |
|
---|
12 | #include <Uefi/UefiMultiPhase.h>
|
---|
13 | #include "NVDataStruc.h"
|
---|
14 |
|
---|
15 | //
|
---|
16 | // Formset class used by Device Manager
|
---|
17 | //
|
---|
18 | #define EFI_NON_DEVICE_CLASS 0x00
|
---|
19 | #define EFI_DISK_DEVICE_CLASS 0x01
|
---|
20 | #define EFI_VIDEO_DEVICE_CLASS 0x02
|
---|
21 | #define EFI_NETWORK_DEVICE_CLASS 0x04
|
---|
22 | #define EFI_INPUT_DEVICE_CLASS 0x08
|
---|
23 | #define EFI_ON_BOARD_DEVICE_CLASS 0x10
|
---|
24 | #define EFI_OTHER_DEVICE_CLASS 0x20
|
---|
25 |
|
---|
26 | //
|
---|
27 | // Formset subclass
|
---|
28 | //
|
---|
29 | #define EFI_SETUP_APPLICATION_SUBCLASS 0x00
|
---|
30 | #define EFI_GENERAL_APPLICATION_SUBCLASS 0x01
|
---|
31 | #define EFI_FRONT_PAGE_SUBCLASS 0x02
|
---|
32 | #define EFI_SINGLE_USE_SUBCLASS 0x03
|
---|
33 |
|
---|
34 | #define EFI_USER_INFO_ACCESS_SETUP_ADMIN_GUID \
|
---|
35 | { 0x85b75607, 0xf7ce, 0x471e, { 0xb7, 0xe4, 0x2a, 0xea, 0x5f, 0x72, 0x32, 0xee } }
|
---|
36 |
|
---|
37 | #define PERL_GUID \
|
---|
38 | { 0x63E60A51, 0x497D, 0xD427, {0xC4, 0xA5, 0xB8, 0xAB, 0xDC, 0x3A, 0xAE, 0xB6 }}
|
---|
39 |
|
---|
40 | //
|
---|
41 | // Labels definition
|
---|
42 | //
|
---|
43 | #define LABEL_1_VALUE 0x01
|
---|
44 | #define LABEL_2_VALUE 0x1000
|
---|
45 | #define LABEL_UPDATE_BBS 0x2222
|
---|
46 |
|
---|
47 | formset
|
---|
48 | guid = DRIVER_SAMPLE_FORMSET_GUID,
|
---|
49 | title = STRING_TOKEN(STR_FORM_SET_TITLE),
|
---|
50 | help = STRING_TOKEN(STR_FORM_SET_TITLE_HELP),
|
---|
51 | classguid = EFI_HII_PLATFORM_SETUP_FORMSET_GUID,
|
---|
52 |
|
---|
53 | //
|
---|
54 | // Notes: VfrCompiler will insert a Standard Default Storage declaration
|
---|
55 | // after the formset declaration. >00000040: 5C 06 00 00 00 00.
|
---|
56 | // So we don't need to declare the Standard Default.
|
---|
57 | // Please check the vfr.lst file for details.
|
---|
58 | // To enable list file for VFR, add "-l" to VfrCompile <Command> in [Build.Visual-Form-Representation-File] as follows:
|
---|
59 | // VfrCompile -l --no-pre-processing --output-directory ${d_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
|
---|
60 | //
|
---|
61 |
|
---|
62 | //
|
---|
63 | // Define a Buffer Storage (EFI_IFR_VARSTORE)
|
---|
64 | //
|
---|
65 | varstore DRIVER_SAMPLE_CONFIGURATION, // This is the data structure type
|
---|
66 | varid = CONFIGURATION_VARSTORE_ID, // Optional VarStore ID
|
---|
67 | name = MyIfrNVData, // Define referenced name in vfr
|
---|
68 | guid = DRIVER_SAMPLE_FORMSET_GUID; // GUID of this buffer storage
|
---|
69 |
|
---|
70 | //
|
---|
71 | // Define a EFI variable Storage (EFI_IFR_VARSTORE_EFI)
|
---|
72 | //
|
---|
73 | efivarstore MY_EFI_VARSTORE_DATA,
|
---|
74 | attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE, // EFI variable attribures
|
---|
75 | name = MyEfiVar,
|
---|
76 | guid = DRIVER_SAMPLE_FORMSET_GUID;
|
---|
77 |
|
---|
78 | //
|
---|
79 | // Define a Buffer Storage (EFI_IFR_VARSTORE)
|
---|
80 | //
|
---|
81 | efivarstore MY_EFI_BITS_VARSTORE_DATA, // This is the data structure type
|
---|
82 | attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE, // EFI variable attribures
|
---|
83 | name = MyEfiBitVar, // Define referenced name in vfr
|
---|
84 | guid = DRIVER_SAMPLE_FORMSET_GUID; // GUID of this buffer storage
|
---|
85 |
|
---|
86 | efivarstore MY_EFI_UNION_DATA,
|
---|
87 | attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE, // EFI variable attribures
|
---|
88 | name = MyEfiUnionVar,
|
---|
89 | guid = DRIVER_SAMPLE_FORMSET_GUID;
|
---|
90 |
|
---|
91 | //
|
---|
92 | // Define a Name/Value Storage (EFI_IFR_VARSTORE_NAME_VALUE)
|
---|
93 | //
|
---|
94 | namevaluevarstore MyNameValueVar, // Define storage reference name in vfr
|
---|
95 | name = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME0), // Define Name list of this storage, refer it by MyNameValueVar[0]
|
---|
96 | name = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME1), // Define Name list of this storage, refer it by MyNameValueVar[1]
|
---|
97 | name = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME2), // Define Name list of this storage, refer it by MyNameValueVar[2]
|
---|
98 | guid = DRIVER_SAMPLE_FORMSET_GUID; // GUID of this Name/Value storage
|
---|
99 |
|
---|
100 | defaultstore MyStandardDefault,
|
---|
101 | prompt = STRING_TOKEN(STR_STANDARD_DEFAULT_PROMPT),
|
---|
102 | attribute = 0x0000; // Default ID: 0000 standard default
|
---|
103 |
|
---|
104 | defaultstore MyManufactureDefault,
|
---|
105 | prompt = STRING_TOKEN(STR_MANUFACTURE_DEFAULT_PROMPT),
|
---|
106 | attribute = 0x0001; // Default ID: 0001 manufacture default
|
---|
107 |
|
---|
108 | //
|
---|
109 | // Define a Form (EFI_IFR_FORM)
|
---|
110 | //
|
---|
111 | form formid = 1, // Form ID
|
---|
112 | title = STRING_TOKEN(STR_FORM1_TITLE); // Form title
|
---|
113 |
|
---|
114 | subtitle text = STRING_TOKEN(STR_SUBTITLE_TEXT);
|
---|
115 |
|
---|
116 | subtitle text = STRING_TOKEN(STR_SUBTITLE_TEXT2);
|
---|
117 |
|
---|
118 | //
|
---|
119 | // Define a display only text (EFI_IFR_TEXT)
|
---|
120 | //
|
---|
121 | text
|
---|
122 | help = STRING_TOKEN(STR_TEXT_HELP), // Help string
|
---|
123 | text = STRING_TOKEN(STR_CPU_STRING), // Prompt string
|
---|
124 | text = STRING_TOKEN(STR_CPU_STRING2); // TextTwo
|
---|
125 |
|
---|
126 | //
|
---|
127 | // Define action button (EFI_IFR_ACTION)
|
---|
128 | //
|
---|
129 | text
|
---|
130 | help = STRING_TOKEN(STR_EXIT_TEXT),
|
---|
131 | text = STRING_TOKEN(STR_EXIT_TEXT),
|
---|
132 | flags = INTERACTIVE, // VfrCompiler will generate opcode EFI_IFR_ACTION for Text marked as INTERACTIVE
|
---|
133 | key = 0x1237;
|
---|
134 |
|
---|
135 | text
|
---|
136 | help = STRING_TOKEN(STR_SAVE_TEXT),
|
---|
137 | text = STRING_TOKEN(STR_SAVE_TEXT),
|
---|
138 | flags = INTERACTIVE,
|
---|
139 | key = 0x1238;
|
---|
140 |
|
---|
141 | text
|
---|
142 | help = STRING_TOKEN(STR_SAVE_CURRENT),
|
---|
143 | text = STRING_TOKEN(STR_SAVE_CURRENT),
|
---|
144 | flags = INTERACTIVE,
|
---|
145 | key = 0x1243;
|
---|
146 |
|
---|
147 | text
|
---|
148 | help = 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 | default = TRUE,
|
---|
190 | endcheckbox;
|
---|
191 | endif;
|
---|
192 | endif;
|
---|
193 |
|
---|
194 | //
|
---|
195 | // Ordered list:
|
---|
196 | // sizeof(MyIfrNVData) storage must be UINT8 array, and
|
---|
197 | // size written for the variable must be size of the entire
|
---|
198 | // variable.
|
---|
199 | //
|
---|
200 | //
|
---|
201 | suppressif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x0;
|
---|
202 |
|
---|
203 | //
|
---|
204 | // label is defined as an anchor where you want to insert some dynamic
|
---|
205 | // opcodes created on-the-fly
|
---|
206 | //
|
---|
207 | label LABEL_UPDATE_BBS;
|
---|
208 |
|
---|
209 | orderedlist
|
---|
210 | varid = MyIfrNVData.BootOrder,
|
---|
211 | prompt = STRING_TOKEN(STR_BOOT_OPTIONS),
|
---|
212 | help = STRING_TOKEN(STR_NULL_STRING),
|
---|
213 | flags = RESET_REQUIRED,
|
---|
214 | option text = STRING_TOKEN(STR_BOOT_OPTION2), value = 2, flags = 0;
|
---|
215 | option text = STRING_TOKEN(STR_BOOT_OPTION1), value = 1, flags = 0;
|
---|
216 | option text = STRING_TOKEN(STR_BOOT_OPTION3), value = 3, flags = 0;
|
---|
217 | suppressif ideqval MyIfrNVData.BootOrderLarge == 0;
|
---|
218 | option text = STRING_TOKEN(STR_BOOT_OPTION4), value = 4, flags = 0;
|
---|
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 | flags = RESET_REQUIRED,
|
---|
235 | option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 3, flags = 0;
|
---|
236 | option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 2, flags = 0;
|
---|
237 | option text = STRING_TOKEN(STR_ONE_OF_TEXT3), value = 1, flags = 0;
|
---|
238 | default = {1,2,3},
|
---|
239 | endlist;
|
---|
240 | endif;
|
---|
241 |
|
---|
242 | label 100;
|
---|
243 |
|
---|
244 | //
|
---|
245 | // Define a hyperlink (EFI_IFR_REF)
|
---|
246 | //
|
---|
247 | goto 0x1234, // Destination Form ID
|
---|
248 | prompt = STRING_TOKEN(STR_GOTO_DYNAMIC), // Prompt string
|
---|
249 | help = STRING_TOKEN(STR_GOTO_HELP), // Help string
|
---|
250 | flags = INTERACTIVE, // INTERACTIVE indicate it's marked with EFI_IFR_FLAG_CALLBACK
|
---|
251 | key = 0x1234; // Question ID which will be passed-in in COnfigAccess.Callback()
|
---|
252 |
|
---|
253 | goto 0x1234,
|
---|
254 | prompt = STRING_TOKEN(STR_GOTO_DYNAMIC2),
|
---|
255 | help = STRING_TOKEN(STR_GOTO_HELP),
|
---|
256 | flags = INTERACTIVE,
|
---|
257 | key = 0x1235;
|
---|
258 |
|
---|
259 | oneof varid = MyIfrNVData.TestLateCheck,
|
---|
260 | prompt = STRING_TOKEN(STR_TEST_OPCODE),
|
---|
261 | help = STRING_TOKEN(STR_ONE_OF_HELP),
|
---|
262 | flags = RESET_REQUIRED,
|
---|
263 | option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = 0;
|
---|
264 | option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = DEFAULT;
|
---|
265 | warningif prompt = STRING_TOKEN(STR_WARNING_POPUP), timeout = 5,
|
---|
266 | ideqval MyIfrNVData.TestLateCheck == 0
|
---|
267 | endif;
|
---|
268 |
|
---|
269 | endoneof;
|
---|
270 |
|
---|
271 | oneof varid = MyIfrNVData.TestLateCheck2,
|
---|
272 | prompt = STRING_TOKEN(STR_TEST_OPCODE2),
|
---|
273 | help = STRING_TOKEN(STR_ONE_OF_HELP),
|
---|
274 | flags = RESET_REQUIRED,
|
---|
275 | option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = DEFAULT;
|
---|
276 | option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = 0;
|
---|
277 |
|
---|
278 | inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
|
---|
279 | ideqid MyIfrNVData.TestLateCheck == MyIfrNVData.TestLateCheck2
|
---|
280 | endif;
|
---|
281 |
|
---|
282 | endoneof;
|
---|
283 |
|
---|
284 | oneof varid = MyIfrNVData.QuestionAboutTreeHugging,
|
---|
285 | prompt = STRING_TOKEN(STR_ONE_OF_PROMPT_KEYWORD),
|
---|
286 | help = STRING_TOKEN(STR_ONE_OF_HELP),
|
---|
287 | flags = RESET_REQUIRED,
|
---|
288 | option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = 0;
|
---|
289 | option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = DEFAULT;
|
---|
290 | option text = STRING_TOKEN(STR_ONE_OF_TEXT3), value = 3, flags = 0;
|
---|
291 | endoneof;
|
---|
292 |
|
---|
293 | //
|
---|
294 | // This is an HII option which has REST_STYLE flag and x-UEFI namespace
|
---|
295 | // UNI string associated. This HII option could be configured by either in-band
|
---|
296 | // edk2 setup browser or the remote management in out-of-band such as Redfish
|
---|
297 | // service. This HII option is configured through EFI_KEYWORD_HANDLER_PROTOCOL.
|
---|
298 | //
|
---|
299 | oneof varid = MyIfrNVData.QuestionXUefiKeywordRestStyle,
|
---|
300 | prompt = STRING_TOKEN(STR_ONE_OF_PROMPT_X_UEFI),
|
---|
301 | help = STRING_TOKEN(STR_ONE_OF_PROMPT_X_UEFI_HELP),
|
---|
302 | flags = RESET_REQUIRED | REST_STYLE,
|
---|
303 | option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = 0;
|
---|
304 | option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = DEFAULT;
|
---|
305 | option text = STRING_TOKEN(STR_ONE_OF_TEXT3), value = 3, flags = 0;
|
---|
306 | endoneof;
|
---|
307 |
|
---|
308 |
|
---|
309 | //
|
---|
310 | // This is a HII option which has REST_STYLE flag but without the x-UEFI namespace
|
---|
311 | // UNI string associated. This HII option could be configured by either
|
---|
312 | // setup browser or the remote management in out-of-band such as Redfish
|
---|
313 | // service. This HII option is configured through EFI HII Configuration Routing
|
---|
314 | // Protocol becasue it doesn't have x-UEFI namespace UNI string.
|
---|
315 | //
|
---|
316 | numeric varid = MyIfrNVData.QuestionNonXUefiKeywordRestStyle,
|
---|
317 | prompt = STRING_TOKEN(STR_ONE_OF_PROMPT_NON_X_UEFI),
|
---|
318 | help = STRING_TOKEN(STR_ONE_OF_PROMPT_NON_X_UEFI_HELP),
|
---|
319 | flags = RESET_REQUIRED | REST_STYLE,
|
---|
320 | minimum = 0,
|
---|
321 | maximum = 0xf0,
|
---|
322 | step = 0, // Stepping of 0 equates to a manual entering
|
---|
323 | // of a value, otherwise it will be adjusted by "+"/"-"
|
---|
324 | default = 0, // defaultstore could be used to specify the default type
|
---|
325 | // If no defaultstore is specified, it implies Standard Default
|
---|
326 | endnumeric;
|
---|
327 |
|
---|
328 | //
|
---|
329 | // Define a string (EFI_IFR_STRING)
|
---|
330 | //
|
---|
331 | string varid = MyIfrNVData.MyStringData,
|
---|
332 | prompt = STRING_TOKEN(STR_MY_STRING_PROMPT2),
|
---|
333 | help = STRING_TOKEN(STR_MY_STRING_HELP2),
|
---|
334 | flags = INTERACTIVE,
|
---|
335 | key = 0x1236,
|
---|
336 | minsize = 6,
|
---|
337 | maxsize = 40,
|
---|
338 | inconsistentif prompt = STRING_TOKEN(STR_STRING_CHECK_ERROR_POPUP),
|
---|
339 | pushthis != stringref(STRING_TOKEN(STR_STRING_CHECK))
|
---|
340 | endif;
|
---|
341 | endstring;
|
---|
342 |
|
---|
343 | //
|
---|
344 | // Define a numeric (EFI_IFR_NUMERIC)
|
---|
345 | //
|
---|
346 | numeric varid = MyIfrNVData.HowOldAreYouInYearsManual,
|
---|
347 | prompt = STRING_TOKEN(STR_NUMERIC_READONLY_PROMPT),
|
---|
348 | help = STRING_TOKEN(STR_NUMERIC_HELP0),
|
---|
349 | flags = READ_ONLY, // READ_ONLY indicate it's marked with EFI_IFR_FLAG_READ_ONLY
|
---|
350 | minimum = 0,
|
---|
351 | maximum = 0xf0,
|
---|
352 | step = 0, // Stepping of 0 equates to a manual entering
|
---|
353 | // of a value, otherwise it will be adjusted by "+"/"-"
|
---|
354 | default = 21, // defaultstore could be used to specify the default type
|
---|
355 | // If no defaultstore is specified, it implies Standard Default
|
---|
356 |
|
---|
357 | endnumeric;
|
---|
358 |
|
---|
359 | numeric varid = MyIfrNVData.HowOldAreYouInYearsManual,
|
---|
360 | prompt = STRING_TOKEN(STR_NUMERIC_MANUAL_PROMPT),
|
---|
361 | help = STRING_TOKEN(STR_NUMERIC_HELP0),
|
---|
362 | minimum = 0,
|
---|
363 | maximum = 0xf0,
|
---|
364 | step = 0,
|
---|
365 | default value = questionrefval(devicepath = STRING_TOKEN (STR_DEVICE_PATH), guid = DRIVER_SAMPLE_FORMSET_GUID, 0x1111),
|
---|
366 |
|
---|
367 | inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
|
---|
368 | ideqval MyIfrNVData.HowOldAreYouInYearsManual == 99
|
---|
369 | OR
|
---|
370 | ideqid MyIfrNVData.HowOldAreYouInYearsManual == MyEfiVar.Field8
|
---|
371 | OR
|
---|
372 | ideqvallist MyIfrNVData.HowOldAreYouInYearsManual == 1 3 5 7
|
---|
373 | endif;
|
---|
374 |
|
---|
375 | endnumeric;
|
---|
376 |
|
---|
377 | numeric varid = MyEfiVar.Field8, // Reference of EFI variable storage
|
---|
378 | questionid = 0x1111,
|
---|
379 | prompt = STRING_TOKEN(STR_TALL_HEX_PROMPT),
|
---|
380 | help = STRING_TOKEN(STR_NUMERIC_HELP1),
|
---|
381 | flags = DISPLAY_UINT_HEX | INTERACTIVE, // Display in HEX format (if not specified, default is in decimal format)
|
---|
382 | minimum = 0,
|
---|
383 | maximum = 250,
|
---|
384 | default = 18, defaultstore = MyStandardDefault, // This is standard default value
|
---|
385 | default = 19, defaultstore = MyManufactureDefault, // This is manufacture default value
|
---|
386 |
|
---|
387 | endnumeric;
|
---|
388 |
|
---|
389 | //
|
---|
390 | // Define numeric using Name/Value Storage
|
---|
391 | //
|
---|
392 | numeric varid = MyNameValueVar[0], // This numeric take NameValueVar0 as storage
|
---|
393 | prompt = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME0),
|
---|
394 | help = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME0_HELP),
|
---|
395 | //
|
---|
396 | // Size should be defined for numeric when use Name/Value storage
|
---|
397 | // Valid value for numerice size are: NUMERIC_SIZE_1, NUMERIC_SIZE_2, NUMERIC_SIZE_4 and NUMERIC_SIZE_8
|
---|
398 | //
|
---|
399 | flags = NUMERIC_SIZE_1, // Size of this numeric is 1 byte
|
---|
400 | minimum = 0,
|
---|
401 | maximum = 0xff,
|
---|
402 | step = 0,
|
---|
403 | locked,
|
---|
404 | default = 16, defaultstore = MyStandardDefault, // This is standard default value
|
---|
405 | default = 17, defaultstore = MyManufactureDefault, // This is manufacture default value
|
---|
406 | endnumeric;
|
---|
407 |
|
---|
408 | numeric varid = MyNameValueVar[1], // This numeric take NameValueVar1 as storage
|
---|
409 | prompt = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME1),
|
---|
410 | help = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME1_HELP),
|
---|
411 | flags = NUMERIC_SIZE_2, // Size of this numeric is 2 bytes
|
---|
412 | minimum = 0,
|
---|
413 | maximum = 0xffff,
|
---|
414 | step = 0,
|
---|
415 | default = 18, defaultstore = MyStandardDefault, // This is standard default value
|
---|
416 | default = 19, defaultstore = MyManufactureDefault, // This is manufacture default value
|
---|
417 | endnumeric;
|
---|
418 |
|
---|
419 | //
|
---|
420 | // Define string using Name/Value Storage
|
---|
421 | //
|
---|
422 | string varid = MyNameValueVar[2], // This string take NameValueVar2 as storage
|
---|
423 | prompt = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME2),
|
---|
424 | help = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME2_HELP),
|
---|
425 | minsize = 2,
|
---|
426 | maxsize = 0x14,
|
---|
427 | endstring;
|
---|
428 |
|
---|
429 | oneof varid = MyEfiVar.Field16,
|
---|
430 | prompt = STRING_TOKEN(STR_ONE_OF_PROMPT),
|
---|
431 | help = STRING_TOKEN(STR_NUMERIC_NUM_HELP),
|
---|
432 | option text = STRING_TOKEN(STR_BOOT_ORDER1), value = 0x0, flags = 0;
|
---|
433 | option text = STRING_TOKEN(STR_BOOT_ORDER2), value = 0x1, flags = DEFAULT;
|
---|
434 | endoneof;
|
---|
435 |
|
---|
436 | label LABEL_1_VALUE;
|
---|
437 | label LABEL_2_VALUE;
|
---|
438 |
|
---|
439 | grayoutif ideqval MyIfrNVData.HowOldAreYouInYearsManual == 23 AND ideqval MyIfrNVData.SuppressGrayOutSomething == 0x1;
|
---|
440 | numeric varid = MyIfrNVData.HowOldAreYouInYears,
|
---|
441 | prompt = STRING_TOKEN(STR_NUMERIC_STEP_PROMPT),
|
---|
442 | help = STRING_TOKEN(STR_NUMERIC_HELP2),
|
---|
443 | minimum = 0,
|
---|
444 | maximum = 243,
|
---|
445 | step = 1,
|
---|
446 | default = 18, defaultstore = MyStandardDefault, // This is standard default value
|
---|
447 | default = 19, defaultstore = MyManufactureDefault, // This is manufacture default value
|
---|
448 |
|
---|
449 | endnumeric;
|
---|
450 | endif;
|
---|
451 |
|
---|
452 | numeric varid = MyIfrNVData.GetDefaultValueFromAccess,
|
---|
453 | questionid = 0x1239,
|
---|
454 | prompt = STRING_TOKEN(STR_DEFAULT_VALUE_FROM_ACCESS_PROMPT),
|
---|
455 | help = STRING_TOKEN(STR_DEFAULT_VALUE_FROM_ACCESS_HELP),
|
---|
456 | flags = DISPLAY_UINT_HEX | INTERACTIVE,
|
---|
457 | minimum = 0,
|
---|
458 | maximum = 255,
|
---|
459 | step = 1,
|
---|
460 | default = 18,
|
---|
461 | endnumeric;
|
---|
462 |
|
---|
463 | numeric varid = MyIfrNVData.GetDefaultValueFromCallBack,
|
---|
464 | questionid = 0x1240,
|
---|
465 | prompt = STRING_TOKEN(STR_DEFAULT_VALUE_FROM_CALLBACK_PROMPT),
|
---|
466 | help = STRING_TOKEN(STR_DEFAULT_VALUE_FROM_CALLBACK_HELP),
|
---|
467 | flags = DISPLAY_UINT_HEX | INTERACTIVE,
|
---|
468 | minimum = 0,
|
---|
469 | maximum = 255,
|
---|
470 | step = 1,
|
---|
471 | default = 18,
|
---|
472 | endnumeric;
|
---|
473 |
|
---|
474 | orderedlist
|
---|
475 | varid = MyIfrNVData.GetDefaultValueFromCallBackForOrderedList,
|
---|
476 | questionid = 0x1252,
|
---|
477 | prompt = STRING_TOKEN(STR_DEFAULT_VALUE_FROM_CALLBACK_PROMPT),
|
---|
478 | help = STRING_TOKEN(STR_DEFAULT_VALUE_FROM_CALLBACK_HELP),
|
---|
479 | flags = INTERACTIVE,
|
---|
480 | option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 1, flags = 0;
|
---|
481 | option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 2, flags = 0;
|
---|
482 | option text = STRING_TOKEN(STR_ONE_OF_TEXT3), value = 3, flags = 0;
|
---|
483 | endlist;
|
---|
484 |
|
---|
485 | resetbutton
|
---|
486 | defaultstore = MyStandardDefault,
|
---|
487 | prompt = STRING_TOKEN(STR_STANDARD_DEFAULT_PROMPT),
|
---|
488 | help = STRING_TOKEN(STR_STANDARD_DEFAULT_HELP),
|
---|
489 | endresetbutton;
|
---|
490 |
|
---|
491 | resetbutton
|
---|
492 | defaultstore = MyManufactureDefault,
|
---|
493 | prompt = STRING_TOKEN(STR_MANUFACTURE_DEFAULT_PROMPT),
|
---|
494 | help = STRING_TOKEN(STR_MANUFACTURE_DEFAULT_HELP),
|
---|
495 | endresetbutton;
|
---|
496 |
|
---|
497 | //
|
---|
498 | // Sample use case for IFR Security op-code
|
---|
499 | //
|
---|
500 | grayoutif NOT security (EFI_USER_INFO_ACCESS_SETUP_ADMIN_GUID);
|
---|
501 | text
|
---|
502 | help = STRING_TOKEN(STR_TEXT_SECRUITY_TEST_HELP),
|
---|
503 | text = STRING_TOKEN(STR_TEXT_SECRUITY_TEST_TEXT);
|
---|
504 | endif;
|
---|
505 |
|
---|
506 | numeric varid = MyEfiVar.SubmittedCallback,
|
---|
507 | questionid = 0x1250,
|
---|
508 | prompt = STRING_TOKEN(STR_SUBMITTED_CALLBACK_TEST_PROMPT),
|
---|
509 | help = STRING_TOKEN(STR_SUBMITTED_CALLBACK_TEST_HELP),
|
---|
510 | flags = INTERACTIVE,
|
---|
511 | minimum = 0,
|
---|
512 | maximum = 255,
|
---|
513 | default = 18,
|
---|
514 | endnumeric;
|
---|
515 |
|
---|
516 | text
|
---|
517 | help = STRING_TOKEN(STR_POPUP_TEST_HELP),
|
---|
518 | text = STRING_TOKEN(STR_POPUP_TEST_PROMPT),
|
---|
519 | flags = INTERACTIVE,
|
---|
520 | key = 0x1330;
|
---|
521 |
|
---|
522 | goto 2,
|
---|
523 | prompt = STRING_TOKEN(STR_GOTO_FORM2), //SecondSetupPage // this too has no end-op and basically it's a jump to a form ONLY
|
---|
524 | help = STRING_TOKEN(STR_GOTO_HELP);
|
---|
525 |
|
---|
526 | goto 3,
|
---|
527 | prompt = STRING_TOKEN(STR_GOTO_FORM3), //ThirdSetupPage // this too has no end-op and basically it's a jump to a form ONLY
|
---|
528 | help = STRING_TOKEN(STR_GOTO_HELP);
|
---|
529 |
|
---|
530 | goto 4,
|
---|
531 | prompt = STRING_TOKEN(STR_GOTO_FORM4), //FourthSetupPage // this too has no end-op and basically it's a jump to a form ONLY
|
---|
532 | help = STRING_TOKEN(STR_GOTO_HELP);
|
---|
533 |
|
---|
534 | goto 5,
|
---|
535 | prompt = STRING_TOKEN(STR_GOTO_FORM5), //FifthSetupPage // this too has no end-op and basically it's a jump to a form ONLY
|
---|
536 | help = STRING_TOKEN(STR_GOTO_FORM5_HELP);
|
---|
537 |
|
---|
538 | goto 6,
|
---|
539 | prompt = STRING_TOKEN(STR_GOTO_FORM6), //SixthSetupPage // this too has no end-op and basically it's a jump to a form ONLY
|
---|
540 | help = STRING_TOKEN(STR_GOTO_HELP);
|
---|
541 |
|
---|
542 | goto
|
---|
543 | formsetguid = DRIVER_SAMPLE_INVENTORY_GUID,
|
---|
544 | formid = 0x1,
|
---|
545 | question = 0x1,
|
---|
546 | prompt = STRING_TOKEN(STR_GOTO_ANOTHER_FORMSET),
|
---|
547 | help = STRING_TOKEN(STR_GOTO_ANOTHER_FORMSET_HELP);
|
---|
548 |
|
---|
549 | guidop
|
---|
550 | guid = DRIVER_SAMPLE_FORMSET_GUID,
|
---|
551 | datatype = MY_EFI_VARSTORE_DATA,
|
---|
552 | data.Field8 = 0x21,
|
---|
553 | data.Field16 = 0x2121,
|
---|
554 | data.OrderedList[0] = 0x21,
|
---|
555 | endguidop;
|
---|
556 |
|
---|
557 | goto 7,
|
---|
558 | prompt = STRING_TOKEN(STR_GOTO_FORM7),
|
---|
559 | help = STRING_TOKEN(STR_GOTO_FORM7_HELP);
|
---|
560 |
|
---|
561 | endform;
|
---|
562 |
|
---|
563 | suppressif ideqval MyIfrNVData.BootOrderLarge == 0;
|
---|
564 | form formid = 2, // SecondSetupPage,
|
---|
565 | 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
|
---|
566 |
|
---|
567 | date
|
---|
568 | name = Date,
|
---|
569 | prompt = STRING_TOKEN(STR_DATE_PROMPT),
|
---|
570 | help = STRING_TOKEN(STR_DATE_HELP),
|
---|
571 | flags = STORAGE_TIME,
|
---|
572 | default = 2004/1/1,
|
---|
573 |
|
---|
574 | inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
|
---|
575 | ideqval Date.Day == 31
|
---|
576 | AND
|
---|
577 | ideqvallist Date.Month == 2 4 6 9 11
|
---|
578 | endif;
|
---|
579 |
|
---|
580 | //
|
---|
581 | // If the day is 30 AND month is 2
|
---|
582 | //
|
---|
583 | inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
|
---|
584 | ideqval Date.Day == 30
|
---|
585 | AND
|
---|
586 | ideqval Date.Month == 2
|
---|
587 | endif;
|
---|
588 |
|
---|
589 | //
|
---|
590 | // If the day is 29 AND month is 2 AND it year is NOT a leapyear
|
---|
591 | //
|
---|
592 | inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
|
---|
593 | ideqval Date.Day == 0x1D
|
---|
594 | AND
|
---|
595 | ideqval Date.Month == 2
|
---|
596 | AND
|
---|
597 | NOT
|
---|
598 | ideqvallist Date.Year == 2004 2008 20012 20016 2020 2024 2028 2032 2036
|
---|
599 | endif;
|
---|
600 |
|
---|
601 | enddate;
|
---|
602 |
|
---|
603 | text
|
---|
604 | help = STRING_TOKEN(STR_SAVE_CURRENT_AND_EXIT),
|
---|
605 | text = STRING_TOKEN(STR_SAVE_CURRENT_AND_EXIT),
|
---|
606 | flags = INTERACTIVE,
|
---|
607 | key = 0x1241;
|
---|
608 |
|
---|
609 | text
|
---|
610 | help = STRING_TOKEN(STR_DISCARD_CURRENT),
|
---|
611 | text = STRING_TOKEN(STR_DISCARD_CURRENT),
|
---|
612 | flags = INTERACTIVE,
|
---|
613 | key = 0x1242;
|
---|
614 |
|
---|
615 | time
|
---|
616 | prompt = STRING_TOKEN(STR_TIME_PROMPT),
|
---|
617 | help = STRING_TOKEN(STR_TIME_HELP),
|
---|
618 | flags = STORAGE_TIME,
|
---|
619 | endtime;
|
---|
620 |
|
---|
621 | time
|
---|
622 | name = MyTime,
|
---|
623 | varid = MyIfrNVData.Time,
|
---|
624 | prompt = STRING_TOKEN(STR_TIME_PROMPT),
|
---|
625 | help = STRING_TOKEN(STR_TIME_PROMPT),
|
---|
626 | flags = STORAGE_NORMAL | SECOND_SUPPRESS,
|
---|
627 | default = 15:33:33,
|
---|
628 | endtime;
|
---|
629 |
|
---|
630 | checkbox varid = MyIfrNVData.ChooseToActivateNuclearWeaponry,
|
---|
631 | prompt = STRING_TOKEN(STR_CHECK_BOX_PROMPT),
|
---|
632 | help = STRING_TOKEN(STR_CHECK_BOX_HELP),
|
---|
633 | flags = CHECKBOX_DEFAULT,
|
---|
634 | endcheckbox;
|
---|
635 |
|
---|
636 | text
|
---|
637 | help = STRING_TOKEN(STR_TEXT_HELP),
|
---|
638 | text = STRING_TOKEN(STR_TEXT_TEXT_1);
|
---|
639 |
|
---|
640 | text
|
---|
641 | help = STRING_TOKEN(STR_TEXT_HELP),
|
---|
642 | text = STRING_TOKEN(STR_TEXT_TEXT_1),
|
---|
643 | text = STRING_TOKEN(STR_TEXT_TEXT_2);
|
---|
644 |
|
---|
645 | goto 1,
|
---|
646 | prompt = STRING_TOKEN(STR_GOTO_FORM1), //MainSetupPage // this too has no end-op and basically it's a jump to a form ONLY
|
---|
647 | help = STRING_TOKEN(STR_GOTO_HELP);
|
---|
648 |
|
---|
649 | goto
|
---|
650 | varid = MyIfrNVData.RefData,
|
---|
651 | prompt = STRING_TOKEN(STR_GOTO_DYNAMIC3),
|
---|
652 | help = STRING_TOKEN(STR_GOTO_DYNAMIC3_HELP),
|
---|
653 | flags = INTERACTIVE,
|
---|
654 | key = 0x1248,
|
---|
655 | //
|
---|
656 | // Set the defult value, format is QuestionId; FormId; FormsetGuid; Device Path String Token
|
---|
657 | //
|
---|
658 | default = 0;0;ZERO_GUID;STRING_TOKEN(STR_NULL_STRING),
|
---|
659 | ; // goto opcode end flag.
|
---|
660 |
|
---|
661 | goto
|
---|
662 | prompt = STRING_TOKEN(STR_GOTO_DYNAMIC4),
|
---|
663 | help = STRING_TOKEN(STR_GOTO_DYNAMIC4_HELP),
|
---|
664 | flags = INTERACTIVE,
|
---|
665 | key = 0x1249;
|
---|
666 |
|
---|
667 | endform;
|
---|
668 | endif;
|
---|
669 |
|
---|
670 | 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
|
---|
671 |
|
---|
672 | suppressif ideqval MyEfiVar.Field8 == 111;
|
---|
673 | text
|
---|
674 | help = STRING_TOKEN(STR_TEXT_HELP),
|
---|
675 | text = STRING_TOKEN(STR_TEXT_TEXT_1);
|
---|
676 | endif;
|
---|
677 |
|
---|
678 | goto 1,
|
---|
679 | prompt = STRING_TOKEN(STR_GOTO_FORM1), //MainSetupPage
|
---|
680 | help = STRING_TOKEN(STR_GOTO_HELP);
|
---|
681 |
|
---|
682 | numeric varid = MyIfrNVData.DynamicRefresh,
|
---|
683 | prompt = STRING_TOKEN(STR_NUMERIC_MANUAL_PROMPT),
|
---|
684 | help = STRING_TOKEN(STR_NUMERIC_HELP0),
|
---|
685 | flags = INTERACTIVE,
|
---|
686 | key = 0x5678,
|
---|
687 | minimum = 0,
|
---|
688 | maximum = 0xff,
|
---|
689 | step = 0,
|
---|
690 | default = 0,
|
---|
691 | refresh interval = 3 // Refresh interval in seconds
|
---|
692 | endnumeric;
|
---|
693 |
|
---|
694 | grayoutif match2 (stringref(STRING_TOKEN(STR_PATTERN)), stringref(STRING_TOKEN(STR_STRING)), PERL_GUID);
|
---|
695 | numeric
|
---|
696 | varid = MyIfrNVData.Match2,
|
---|
697 | prompt = STRING_TOKEN(STR_MATCH2_PROMPT),
|
---|
698 | help = STRING_TOKEN(STR_MATCH2_HELP),
|
---|
699 | minimum = 0,
|
---|
700 | maximum = 243,
|
---|
701 | endnumeric;
|
---|
702 | endif;
|
---|
703 |
|
---|
704 | label LABEL_UPDATE2;
|
---|
705 | label LABEL_END;
|
---|
706 |
|
---|
707 | endform;
|
---|
708 |
|
---|
709 | formmap formid = 4,
|
---|
710 | maptitle = STRING_TOKEN(STR_SAMPL_MAP_METHOD);
|
---|
711 | mapguid = DRIVER_SAMPLE_FORMSET_GUID;
|
---|
712 | maptitle = STRING_TOKEN(STR_STANDARD_MAP_METHOD);
|
---|
713 | mapguid = EFI_HII_STANDARD_FORM_GUID;
|
---|
714 |
|
---|
715 | oneof varid = MyIfrNVData.SerialPortNo,
|
---|
716 | prompt = STRING_TOKEN(STR_SERIAL_PORT),
|
---|
717 | help = STRING_TOKEN(STR_ONE_OF_HELP),
|
---|
718 |
|
---|
719 | 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;)));
|
---|
720 | 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;));
|
---|
721 |
|
---|
722 | option text = STRING_TOKEN(STR_SERIAL_PORT_DISABLE), value = 0x0, flags = DEFAULT;
|
---|
723 | option text = STRING_TOKEN(STR_SERIAL_PORT1), value = 0x1, flags = 0;
|
---|
724 | option text = STRING_TOKEN(STR_SERIAL_PORT2), value = 0x2, flags = 0;
|
---|
725 | option text = STRING_TOKEN(STR_SERIAL_PORT3), value = 0x3, flags = 0;
|
---|
726 | option text = STRING_TOKEN(STR_SERIAL_PORT4), value = 0x4, flags = 0;
|
---|
727 | endoneof;
|
---|
728 |
|
---|
729 | grayoutif TRUE;
|
---|
730 | checkbox varid = MyIfrNVData.SerialPortStatus,
|
---|
731 | prompt = STRING_TOKEN(STR_SERIAL_PORT_STATUS),
|
---|
732 | help = STRING_TOKEN(STR_CHECK_BOX_HELP),
|
---|
733 | endcheckbox;
|
---|
734 | endif;
|
---|
735 |
|
---|
736 | grayoutif TRUE;
|
---|
737 | suppressif ideqval MyIfrNVData.SerialPortStatus == 0;
|
---|
738 | oneof varid = MyIfrNVData.SerialPortIo,
|
---|
739 | prompt = STRING_TOKEN(STR_SERIAL_PORT_IO_ADDRESS),
|
---|
740 | help = STRING_TOKEN(STR_ONE_OF_HELP),
|
---|
741 |
|
---|
742 | option text = STRING_TOKEN(STR_SERIAL_PORT1_IOADDR), value = 0x3F8, flags = DEFAULT;
|
---|
743 | option text = STRING_TOKEN(STR_SERIAL_PORT2_IOADDR), value = 0x2F8, flags = 0;
|
---|
744 | option text = STRING_TOKEN(STR_SERIAL_PORT3_IOADDR), value = 0x3E8, flags = 0;
|
---|
745 | option text = STRING_TOKEN(STR_SERIAL_PORT4_IOADDR), value = 0x2E8, flags = 0;
|
---|
746 | endoneof;
|
---|
747 | endif;
|
---|
748 | endif;
|
---|
749 |
|
---|
750 | grayoutif TRUE;
|
---|
751 | suppressif ideqval MyIfrNVData.SerialPortStatus == 0;
|
---|
752 | oneof varid = MyIfrNVData.SerialPortIrq,
|
---|
753 | prompt = STRING_TOKEN(STR_SERIAL_PORT_IRQ),
|
---|
754 | help = STRING_TOKEN(STR_ONE_OF_HELP),
|
---|
755 |
|
---|
756 | option text = STRING_TOKEN(STR_SERIAL_PORT13_IRQ), value = 0x4, flags = DEFAULT;
|
---|
757 | option text = STRING_TOKEN(STR_SERIAL_PORT24_IRQ), value = 0x3, flags = 0;
|
---|
758 | endoneof;
|
---|
759 | endif;
|
---|
760 | endif;
|
---|
761 |
|
---|
762 | goto 1,
|
---|
763 | prompt = STRING_TOKEN(STR_GOTO_FORM1), //MainSetupPage
|
---|
764 | help = STRING_TOKEN(STR_GOTO_HELP);
|
---|
765 |
|
---|
766 | endform;
|
---|
767 |
|
---|
768 | form formid = 5, // Modal form
|
---|
769 | title = STRING_TOKEN(STR_MODAL_FORM_TITLE);
|
---|
770 | //
|
---|
771 | // This form is a modal form.
|
---|
772 | //
|
---|
773 | modal;
|
---|
774 | text
|
---|
775 | help = STRING_TOKEN(STR_EXIT_TEXT),
|
---|
776 | text = STRING_TOKEN(STR_EXIT_TEXT),
|
---|
777 | flags = INTERACTIVE, // VfrCompiler will generate opcode EFI_IFR_ACTION for Text marked as INTERACTIVE
|
---|
778 | key = 0x1245;
|
---|
779 |
|
---|
780 | text
|
---|
781 | help = STRING_TOKEN(STR_SAVE_TEXT),
|
---|
782 | text = STRING_TOKEN(STR_SAVE_TEXT),
|
---|
783 | flags = INTERACTIVE, // VfrCompiler will generate opcode EFI_IFR_ACTION for Text marked as INTERACTIVE
|
---|
784 | key = 0x1246;
|
---|
785 | endform;
|
---|
786 |
|
---|
787 | form formid = 6, // Form to show the refresh guid group op-code
|
---|
788 | title = STRING_TOKEN(STR_FORM6_TITLE);
|
---|
789 |
|
---|
790 | text
|
---|
791 | help = STRING_TOKEN(STR_TEXT_REFRESH_GUID),
|
---|
792 | text = STRING_TOKEN(STR_TEXT_REFRESH_GUID);
|
---|
793 |
|
---|
794 | numeric varid = MyIfrNVData.RefreshGuidCount,
|
---|
795 | prompt = STRING_TOKEN(STR_TEXT_REFRESH_GUID_COUNT),
|
---|
796 | help = STRING_TOKEN(STR_NUMERIC_HELP0),
|
---|
797 | flags = INTERACTIVE,
|
---|
798 | key = 0x1247,
|
---|
799 | minimum = 0,
|
---|
800 | maximum = 0xff,
|
---|
801 | step = 0,
|
---|
802 | default = 0,
|
---|
803 | refreshguid = EFI_IFR_REFRESH_ID_OP_GUID,
|
---|
804 | endnumeric;
|
---|
805 |
|
---|
806 | label LABEL_UPDATE3;
|
---|
807 | label LABEL_END;
|
---|
808 |
|
---|
809 | endform;
|
---|
810 |
|
---|
811 | form formid = 0x1234, // Dynamically created page,
|
---|
812 | 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
|
---|
813 |
|
---|
814 | label LABEL_UPDATE1;
|
---|
815 | //
|
---|
816 | // This is where we will insert dynamic created opcodes
|
---|
817 | //
|
---|
818 | label LABEL_END;
|
---|
819 |
|
---|
820 | endform;
|
---|
821 |
|
---|
822 |
|
---|
823 | form formid = 7, // Form to show the question refer to union and bit Varstore
|
---|
824 | title = STRING_TOKEN(STR_FORM7_TITLE);
|
---|
825 |
|
---|
826 | subtitle text = STRING_TOKEN(STR_NEST_BIT_EFI_VARSTORE);
|
---|
827 |
|
---|
828 | checkbox varid = MyEfiBitVar.BitsData.NestBitCheckbox,
|
---|
829 | prompt = STRING_TOKEN(STR_BIT_NEST_CHECK_BOX_PROMPT),
|
---|
830 | help = STRING_TOKEN(STR_BIT_NEST_CHECK_BOX_HELP),
|
---|
831 | flags = CHECKBOX_DEFAULT,
|
---|
832 | endcheckbox;
|
---|
833 |
|
---|
834 | oneof varid = MyEfiBitVar.BitsData.NestBitOneof,
|
---|
835 | prompt = STRING_TOKEN(STR_ONE_OF_BIT_NEST_PROMPT),
|
---|
836 | help = STRING_TOKEN(STR_ONE_OF_BIT_NEST_HELP),
|
---|
837 | option text = STRING_TOKEN(STR_BOOT_ORDER1), value = 0, flags = MANUFACTURING;
|
---|
838 | option text = STRING_TOKEN(STR_BOOT_ORDER2), value = 1, flags = DEFAULT;
|
---|
839 | endoneof;
|
---|
840 |
|
---|
841 | numeric varid = MyEfiBitVar.BitsData.NestBitNumeric,
|
---|
842 | questionid = 0x6666,
|
---|
843 | prompt = STRING_TOKEN(STR_BIT_NEST_NUMERIC_PROMPT),
|
---|
844 | help = STRING_TOKEN(STR_BIT_NEST_NUMERIC_DEFAULT_HELP),
|
---|
845 | flags = DISPLAY_UINT_HEX | INTERACTIVE,
|
---|
846 | minimum = 2,
|
---|
847 | maximum = 15,
|
---|
848 | step = 1,
|
---|
849 | endnumeric;
|
---|
850 |
|
---|
851 | oneof varid = MyEfiBitVar.BitsData.NestByteField,
|
---|
852 | prompt = STRING_TOKEN(BYTE_QUESTION_NEST_BIT_PROMPT),
|
---|
853 | help = STRING_TOKEN(BYTE_QUESTION_NEST_BIT_HELP),
|
---|
854 | option text = STRING_TOKEN(STR_BOOT_ORDER1), value = 0, flags = MANUFACTURING;
|
---|
855 | option text = STRING_TOKEN(STR_BOOT_ORDER2), value = 1, flags = DEFAULT;
|
---|
856 | endoneof;
|
---|
857 |
|
---|
858 | subtitle text = STRING_TOKEN(STR_SUBTITLE_TEXT2);
|
---|
859 | subtitle text = STRING_TOKEN(STR_BIT_EFI_VARSTORE);
|
---|
860 |
|
---|
861 | checkbox varid = MyEfiBitVar.EfiBitCheckbox,
|
---|
862 | prompt = STRING_TOKEN(STR_BIT_CHECK_BOX_PROMPT),
|
---|
863 | help = STRING_TOKEN(STR_BIT_CHECK_BOX_HELP),
|
---|
864 | flags = CHECKBOX_DEFAULT,
|
---|
865 | endcheckbox;
|
---|
866 |
|
---|
867 | grayoutif ideqval MyEfiBitVar.EfiBitGrayoutTest == 0;
|
---|
868 | numeric varid = MyEfiBitVar.EfiBitNumeric,
|
---|
869 | prompt = STRING_TOKEN(STR_BIT_NUMERIC_PROMPT),
|
---|
870 | help = STRING_TOKEN(STR_BIT_NUMERIC_HELP),
|
---|
871 | minimum = 0,
|
---|
872 | maximum = 7,
|
---|
873 | step = 0,
|
---|
874 | default = 4, defaultstore = MyStandardDefault,
|
---|
875 | default = 5, defaultstore = MyManufactureDefault,
|
---|
876 | endnumeric;
|
---|
877 | endif;
|
---|
878 |
|
---|
879 | oneof varid = MyEfiBitVar.EfiBitOneof,
|
---|
880 | questionid = 0x9999,
|
---|
881 | prompt = STRING_TOKEN(STR_ONE_OF_BIT_PROMPT),
|
---|
882 | help = STRING_TOKEN(STR_ONE_OF_BIT_HELP),
|
---|
883 | option text = STRING_TOKEN(STR_BOOT_ORDER1), value = 0x0, flags = MANUFACTURING;
|
---|
884 | option text = STRING_TOKEN(STR_BOOT_ORDER2), value = 0x1, flags = DEFAULT;
|
---|
885 | endoneof;
|
---|
886 |
|
---|
887 | subtitle text = STRING_TOKEN(STR_SUBTITLE_TEXT2);
|
---|
888 | subtitle text = STRING_TOKEN(STR_NEST_BIT_VARSTORE);
|
---|
889 | checkbox varid = MyIfrNVData.MyBitData.NestBitCheckbox,
|
---|
890 | prompt = STRING_TOKEN(STR_BIT_NEST_CHECK_BOX_PROMPT),
|
---|
891 | help = STRING_TOKEN(STR_BIT_NEST_CHECK_BOX_HELP),
|
---|
892 | flags = CHECKBOX_DEFAULT,
|
---|
893 | endcheckbox;
|
---|
894 |
|
---|
895 | oneof varid = MyIfrNVData.MyBitData.NestBitOneof,
|
---|
896 | prompt = STRING_TOKEN(STR_ONE_OF_BIT_NEST_PROMPT),
|
---|
897 | help = STRING_TOKEN(STR_ONE_OF_BIT_NEST_HELP),
|
---|
898 | option text = STRING_TOKEN(STR_BOOT_ORDER1), value = 0, flags = MANUFACTURING;
|
---|
899 | option text = STRING_TOKEN(STR_BOOT_ORDER2), value = 1, flags = DEFAULT;
|
---|
900 | endoneof;
|
---|
901 |
|
---|
902 | numeric varid = MyIfrNVData.MyBitData.NestBitNumeric,
|
---|
903 | prompt = STRING_TOKEN(STR_BIT_NEST_NUMERIC_PROMPT),
|
---|
904 | help = STRING_TOKEN(STR_BIT_NEST_NUMERIC_HELP),
|
---|
905 | minimum = 0,
|
---|
906 | maximum = 7,
|
---|
907 | step = 0,
|
---|
908 | default = 6, defaultstore = MyStandardDefault,
|
---|
909 | default = 7, defaultstore = MyManufactureDefault,
|
---|
910 | endnumeric;
|
---|
911 |
|
---|
912 | oneof varid = MyIfrNVData.MyBitData.NestByteField,
|
---|
913 | prompt = STRING_TOKEN(BYTE_QUESTION_NEST_BIT_PROMPT),
|
---|
914 | help = STRING_TOKEN(BYTE_QUESTION_NEST_BIT_HELP),
|
---|
915 | option text = STRING_TOKEN(STR_BOOT_ORDER1), value = 0, flags = MANUFACTURING;
|
---|
916 | option text = STRING_TOKEN(STR_BOOT_ORDER2), value = 1, flags = DEFAULT;
|
---|
917 | endoneof;
|
---|
918 |
|
---|
919 | subtitle text = STRING_TOKEN(STR_SUBTITLE_TEXT2);
|
---|
920 | subtitle text = STRING_TOKEN(STR_BIT_VARSTORE);
|
---|
921 |
|
---|
922 | oneof varid = MyIfrNVData.BitOneof,
|
---|
923 | prompt = STRING_TOKEN(STR_ONE_OF_BIT_PROMPT),
|
---|
924 | help = STRING_TOKEN(STR_ONE_OF_BIT_HELP),
|
---|
925 | option text = STRING_TOKEN(STR_BOOT_ORDER1), value = 0, flags = MANUFACTURING;
|
---|
926 | option text = STRING_TOKEN(STR_BOOT_ORDER2), value = 1, flags = DEFAULT;
|
---|
927 | endoneof;
|
---|
928 |
|
---|
929 | checkbox varid = MyIfrNVData.BitCheckbox,
|
---|
930 | prompt = STRING_TOKEN(STR_BIT_CHECK_BOX_PROMPT),
|
---|
931 | help = STRING_TOKEN(STR_BIT_CHECK_BOX_HELP),
|
---|
932 | flags = CHECKBOX_DEFAULT,
|
---|
933 | endcheckbox;
|
---|
934 |
|
---|
935 | numeric varid = MyIfrNVData.BitNumeric,
|
---|
936 | prompt = STRING_TOKEN(STR_BIT_NUMERIC_PROMPT),
|
---|
937 | help = STRING_TOKEN(STR_BUFFER_BIT_NUMERIC_HELP),
|
---|
938 | minimum = 0,
|
---|
939 | maximum = 20,
|
---|
940 | step = 0,
|
---|
941 | default = 16, defaultstore = MyStandardDefault,
|
---|
942 | default = 17, defaultstore = MyManufactureDefault,
|
---|
943 | endnumeric;
|
---|
944 |
|
---|
945 | subtitle text = STRING_TOKEN(STR_SUBTITLE_TEXT2);
|
---|
946 | subtitle text = STRING_TOKEN(STR_UNION_EFI_VARSTORE);
|
---|
947 |
|
---|
948 | numeric varid = MyEfiUnionVar.UnionNumeric,
|
---|
949 | prompt = STRING_TOKEN(STR_UNION_BYTE_NUMERIC_PROMPT),
|
---|
950 | help = STRING_TOKEN(STR_UNION_BYTE_NUMERIC_HELP),
|
---|
951 | minimum = 0,
|
---|
952 | maximum = 20,
|
---|
953 | step = 0,
|
---|
954 | default = 7, defaultstore = MyStandardDefault,
|
---|
955 | default = 8, defaultstore = MyManufactureDefault,
|
---|
956 | endnumeric;
|
---|
957 |
|
---|
958 | guidop
|
---|
959 | guid = DRIVER_SAMPLE_FORMSET_GUID,
|
---|
960 | datatype = MY_EFI_BITS_VARSTORE_DATA,
|
---|
961 | data.EfiBitNumeric = 1,
|
---|
962 | data.EfiBitOneof = 1,
|
---|
963 | data.EfiBitCheckbox = 1,
|
---|
964 | endguidop;
|
---|
965 |
|
---|
966 | endform;
|
---|
967 |
|
---|
968 | endformset;
|
---|