2008-04-11 05:36:07 +02:00
///** @file
2008-01-21 15:39:56 +01:00
//
2008-04-11 05:36:07 +02:00
// Sample Setup formset.
2008-01-21 15:39:56 +01:00
//
2011-05-31 02:59:15 +02:00
// Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
2010-04-24 11:33:45 +02:00
// This program and the accompanying materials
2008-04-11 05:36:07 +02:00
// are licensed and made available under the terms and conditions of the BSD License
// which accompanies this distribution. The full text of the license may be found at
// http://opensource.org/licenses/bsd-license.php
2008-01-21 15:39:56 +01:00
//
2008-04-11 05:36:07 +02:00
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
2008-01-21 15:39:56 +01:00
//
2008-04-11 05:36:07 +02:00
//**/
2008-01-21 15:39:56 +01:00
#include "NVDataStruc.h"
//
// Formset class used by Device Manager
//
#define EFI_NON_DEVICE_CLASS 0x00
#define EFI_DISK_DEVICE_CLASS 0x01
#define EFI_VIDEO_DEVICE_CLASS 0x02
#define EFI_NETWORK_DEVICE_CLASS 0x04
#define EFI_INPUT_DEVICE_CLASS 0x08
#define EFI_ON_BOARD_DEVICE_CLASS 0x10
#define EFI_OTHER_DEVICE_CLASS 0x20
//
// Formset subclass
//
#define EFI_SETUP_APPLICATION_SUBCLASS 0x00
#define EFI_GENERAL_APPLICATION_SUBCLASS 0x01
#define EFI_FRONT_PAGE_SUBCLASS 0x02
#define EFI_SINGLE_USE_SUBCLASS 0x03
//
// EFI Variable attributes
//
#define EFI_VARIABLE_NON_VOLATILE 0x00000001
#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002
#define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004
#define EFI_VARIABLE_READ_ONLY 0x00000008
2011-09-21 04:50:24 +02:00
#define EFI_USER_INFO_ACCESS_SETUP_ADMIN_GUID \
{ 0x85b75607, 0xf7ce, 0x471e, { 0xb7, 0xe4, 0x2a, 0xea, 0x5f, 0x72, 0x32, 0xee } }
2008-01-21 15:39:56 +01:00
//
// Labels definition
//
#define LABEL_1_VALUE 0x01
#define LABEL_2_VALUE 0x1000
#define LABEL_UPDATE_BBS 0x2222
formset
2011-09-18 14:21:01 +02:00
guid = DRIVER_SAMPLE_FORMSET_GUID,
2009-04-17 07:28:31 +02:00
title = STRING_TOKEN(STR_FORM_SET_TITLE),
help = STRING_TOKEN(STR_FORM_SET_TITLE_HELP),
classguid = EFI_HII_PLATFORM_SETUP_FORMSET_GUID,
2008-05-14 04:20:02 +02:00
//
// Notes: VfrCompiler will insert a Standard Default Storage declaration
// after the formset declaration. >00000040: 5C 06 00 00 00 00.
// So we don't need to declare the Standard Default.
// Please check the vfr.lst file for details.
// To enable list file for VFR, add "-l" to VfrCompile <Command> in [Build.Visual-Form-Representation-File] as follows:
// VfrCompile -l --no-pre-processing --output-directory ${d_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
//
2008-11-04 15:28:08 +01:00
//
2008-01-21 15:39:56 +01:00
// Define a Buffer Storage (EFI_IFR_VARSTORE)
//
varstore DRIVER_SAMPLE_CONFIGURATION, // This is the data structure type
2008-11-04 15:28:08 +01:00
varid = CONFIGURATION_VARSTORE_ID, // Optional VarStore ID
2008-01-21 15:39:56 +01:00
name = MyIfrNVData, // Define referenced name in vfr
2011-09-18 14:21:01 +02:00
guid = DRIVER_SAMPLE_FORMSET_GUID; // GUID of this buffer storage
2008-01-21 15:39:56 +01:00
//
// Define a EFI variable Storage (EFI_IFR_VARSTORE_EFI)
//
2011-08-30 14:39:53 +02:00
efivarstore MY_EFI_VARSTORE_DATA,
attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE, // EFI variable attribures
name = MyEfiVar,
2011-09-18 14:21:01 +02:00
guid = DRIVER_SAMPLE_FORMSET_GUID;
2008-01-21 15:39:56 +01:00
2010-02-11 02:59:35 +01:00
//
// Define a Name/Value Storage (EFI_IFR_VARSTORE_NAME_VALUE)
//
namevaluevarstore MyNameValueVar, // Define storage reference name in vfr
name = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME0), // Define Name list of this storage, refer it by MyNameValueVar[0]
name = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME1), // Define Name list of this storage, refer it by MyNameValueVar[1]
name = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME2), // Define Name list of this storage, refer it by MyNameValueVar[2]
2011-09-18 14:21:01 +02:00
guid = DRIVER_SAMPLE_FORMSET_GUID; // GUID of this Name/Value storage
2010-02-11 02:59:35 +01:00
2008-11-04 15:28:08 +01:00
defaultstore MyStandardDefault,
prompt = STRING_TOKEN(STR_STANDARD_DEFAULT_PROMPT),
attribute = 0x0000; // Default ID: 0000 standard default
defaultstore MyManufactureDefault,
prompt = STRING_TOKEN(STR_MANUFACTURE_DEFAULT_PROMPT),
attribute = 0x0001; // Default ID: 0001 manufacture default
2008-01-21 15:39:56 +01:00
//
// Define a Form (EFI_IFR_FORM)
//
form formid = 1, // Form ID
title = STRING_TOKEN(STR_FORM1_TITLE); // Form title
subtitle text = STRING_TOKEN(STR_SUBTITLE_TEXT);
subtitle text = STRING_TOKEN(STR_SUBTITLE_TEXT2);
//
// Define a display only text (EFI_IFR_TEXT)
//
text
help = STRING_TOKEN(STR_TEXT_HELP), // Help string
text = STRING_TOKEN(STR_CPU_STRING), // Prompt string
text = STRING_TOKEN(STR_CPU_STRING2); // TextTwo
2008-11-04 15:28:08 +01:00
//
// Define action button (EFI_IFR_ACTION)
//
2008-01-21 15:39:56 +01:00
text
help = STRING_TOKEN(STR_EXIT_TEXT),
text = STRING_TOKEN(STR_EXIT_TEXT),
text = STRING_TOKEN(STR_EXIT_TEXT),
2008-11-04 15:28:08 +01:00
flags = INTERACTIVE, // VfrCompiler will generate opcode EFI_IFR_ACTION for Text marked as INTERACTIVE
2008-01-21 15:39:56 +01:00
key = 0x1237;
text
help = STRING_TOKEN(STR_SAVE_TEXT),
text = STRING_TOKEN(STR_SAVE_TEXT),
text = STRING_TOKEN(STR_SAVE_TEXT),
flags = INTERACTIVE,
key = 0x1238;
2011-05-31 02:59:15 +02:00
text
help = STRING_TOKEN(STR_SAVE_CURRENT),
text = STRING_TOKEN(STR_SAVE_CURRENT),
text = STRING_TOKEN(STR_SAVE_CURRENT),
flags = INTERACTIVE,
key = 0x1243;
text
help = STRING_TOKEN(STR_DISCARD_CURRENT_AND_EXIT),
text = STRING_TOKEN(STR_DISCARD_CURRENT_AND_EXIT),
text = STRING_TOKEN(STR_DISCARD_CURRENT_AND_EXIT),
flags = INTERACTIVE,
key = 0x1244;
2008-01-21 15:39:56 +01:00
//
// Define oneof (EFI_IFR_ONE_OF)
//
2008-11-04 15:28:08 +01:00
oneof name = MyOneOf, // Define reference name for Question
varid = MyIfrNVData.SuppressGrayOutSomething, // Use "DataStructure.Member" to reference Buffer Storage
prompt = STRING_TOKEN(STR_ONE_OF_PROMPT),
help = STRING_TOKEN(STR_ONE_OF_HELP),
2008-01-21 15:39:56 +01:00
//
// Define an option (EFI_IFR_ONE_OF_OPTION)
//
option text = STRING_TOKEN(STR_ONE_OF_TEXT4), value = 0x0, flags = 0;
option text = STRING_TOKEN(STR_ONE_OF_TEXT5), value = 0x1, flags = 0;
//
// DEFAULT indicate this option will be marked with EFI_IFR_OPTION_DEFAULT
//
option text = STRING_TOKEN(STR_ONE_OF_TEXT6), value = 0x2, flags = DEFAULT;
endoneof;
oneof varid = MyIfrNVData.BootOrderLarge,
prompt = STRING_TOKEN(STR_ONE_OF_PROMPT),
help = STRING_TOKEN(STR_ONE_OF_HELP),
2009-11-13 08:13:11 +01:00
default value = cond (pushthis == 0 ? 0 : cond ((questionref(MyOneOf) >> 0x4 & 0xF00) == 0x0 + 0x2 ? 0 : 1)),
2008-01-21 15:39:56 +01:00
option text = STRING_TOKEN(STR_BOOT_ORDER1), value = 0x0, flags = 0;
2009-11-13 08:13:11 +01:00
option text = STRING_TOKEN(STR_BOOT_ORDER2), value = 0x1, flags = 0;
2008-01-21 15:39:56 +01:00
endoneof;
grayoutif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x1;
2008-11-04 15:28:08 +01:00
suppressif questionref(MyOneOf) == 0x0;
2008-01-21 15:39:56 +01:00
checkbox varid = MyIfrNVData.ChooseToActivateNuclearWeaponry,
prompt = STRING_TOKEN(STR_CHECK_BOX_PROMPT),
help = STRING_TOKEN(STR_CHECK_BOX_HELP),
//
// CHECKBOX_DEFAULT indicate this checkbox is marked with EFI_IFR_CHECKBOX_DEFAULT
2008-05-14 04:20:02 +02:00
// CHECKBOX_DEFAULT_MFG indicate EFI_IFR_CHECKBOX_DEFAULT_MFG.
2008-01-21 15:39:56 +01:00
//
2008-05-14 04:20:02 +02:00
flags = CHECKBOX_DEFAULT | CHECKBOX_DEFAULT_MFG,
2008-01-21 15:39:56 +01:00
key = 0,
2008-05-14 04:20:02 +02:00
default = 1,
2008-01-21 15:39:56 +01:00
endcheckbox;
endif;
endif;
//
// Ordered list:
// sizeof(MyIfrNVData) storage must be UINT8 array, and
// size written for the variable must be size of the entire
// variable.
//
//
suppressif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x0;
//
// label is defined as an anchor where you want to insert some dynamic
// opcodes created on-the-fly
//
label LABEL_UPDATE_BBS;
orderedlist
varid = MyIfrNVData.BootOrder,
prompt = STRING_TOKEN(STR_BOOT_OPTIONS),
help = STRING_TOKEN(STR_NULL_STRING),
option text = STRING_TOKEN(STR_BOOT_OPTION2), value = 2, flags = RESET_REQUIRED;
option text = STRING_TOKEN(STR_BOOT_OPTION1), value = 1, flags = RESET_REQUIRED;
option text = STRING_TOKEN(STR_BOOT_OPTION3), value = 3, flags = RESET_REQUIRED;
suppressif ideqval MyIfrNVData.BootOrderLarge == 0;
2008-11-04 15:28:08 +01:00
option text = STRING_TOKEN(STR_BOOT_OPTION4), value = 4, flags = RESET_REQUIRED;
2008-01-21 15:39:56 +01:00
endif
endlist;
//
// label should be paired with each other
//
label LABEL_END;
endif; // end suppressif
2009-12-31 05:53:36 +01:00
disableif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x2;
2008-01-21 15:39:56 +01:00
orderedlist
varid = MyIfrNVData.OrderedList,
prompt = STRING_TOKEN(STR_TEST_OPCODE),
help = STRING_TOKEN(STR_TEXT_HELP),
option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 3, flags = RESET_REQUIRED;
option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 2, flags = RESET_REQUIRED;
option text = STRING_TOKEN(STR_ONE_OF_TEXT3), value = 1, flags = RESET_REQUIRED;
endlist;
endif;
label 100;
//
// Define a hyperlink (EFI_IFR_REF)
//
goto 0x1234, // Destination Form ID
prompt = STRING_TOKEN(STR_GOTO_DYNAMIC), // Prompt string
help = STRING_TOKEN(STR_GOTO_HELP), // Help string
flags = INTERACTIVE, // INTERACTIVE indicate it's marked with EFI_IFR_FLAG_CALLBACK
key = 0x1234; // Question ID which will be passed-in in COnfigAccess.Callback()
goto 0x1234,
prompt = STRING_TOKEN(STR_GOTO_DYNAMIC2),
help = STRING_TOKEN(STR_GOTO_HELP),
flags = INTERACTIVE,
key = 0x1235;
oneof varid = MyIfrNVData.TestLateCheck,
prompt = STRING_TOKEN(STR_TEST_OPCODE),
help = STRING_TOKEN(STR_ONE_OF_HELP),
option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = RESET_REQUIRED;
option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = DEFAULT | RESET_REQUIRED;
endoneof;
oneof varid = MyIfrNVData.TestLateCheck2,
prompt = STRING_TOKEN(STR_TEST_OPCODE2),
help = STRING_TOKEN(STR_ONE_OF_HELP),
option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = DEFAULT | RESET_REQUIRED;
option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = RESET_REQUIRED;
inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
ideqid MyIfrNVData.TestLateCheck == MyIfrNVData.TestLateCheck2
endif
endoneof;
oneof varid = MyIfrNVData.QuestionAboutTreeHugging,
prompt = STRING_TOKEN(STR_ONE_OF_PROMPT),
help = STRING_TOKEN(STR_ONE_OF_HELP),
option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = RESET_REQUIRED;
option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = DEFAULT | RESET_REQUIRED;
option text = STRING_TOKEN(STR_ONE_OF_TEXT3), value = 0x03, flags = RESET_REQUIRED;
endoneof;
//
// Define a string (EFI_IFR_STRING)
//
string varid = MyIfrNVData.MyStringData,
prompt = STRING_TOKEN(STR_MY_STRING_PROMPT2),
help = STRING_TOKEN(STR_MY_STRING_HELP2),
flags = INTERACTIVE,
key = 0x1236,
minsize = 6,
2008-09-02 03:28:17 +02:00
maxsize = 40,
2010-12-23 07:47:50 +01:00
inconsistentif prompt = STRING_TOKEN(STR_STRING_CHECK_ERROR_POPUP),
pushthis != stringref(STRING_TOKEN(STR_STRING_CHECK))
endif
2008-01-21 15:39:56 +01:00
endstring;
//
// Define a numeric (EFI_IFR_NUMERIC)
//
numeric varid = MyIfrNVData.HowOldAreYouInYearsManual,
prompt = STRING_TOKEN(STR_NUMERIC_READONLY_PROMPT),
help = STRING_TOKEN(STR_NUMERIC_HELP0),
flags = READ_ONLY, // READ_ONLY indicate it's marked with EFI_IFR_FLAG_READ_ONLY
minimum = 0,
maximum = 0xf0,
step = 0, // Stepping of 0 equates to a manual entering
// of a value, otherwise it will be adjusted by "+"/"-"
2008-11-04 15:28:08 +01:00
default = 21, // defaultstore could be used to specify the default type
// If no defaultstore is specified, it implies Standard Default
2008-01-21 15:39:56 +01:00
endnumeric;
numeric varid = MyIfrNVData.HowOldAreYouInYearsManual,
prompt = STRING_TOKEN(STR_NUMERIC_MANUAL_PROMPT),
help = STRING_TOKEN(STR_NUMERIC_HELP0),
minimum = 0,
maximum = 0xf0,
step = 0,
2008-11-04 15:28:08 +01:00
default = 21,
2008-01-21 15:39:56 +01:00
inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
ideqval MyIfrNVData.HowOldAreYouInYearsManual == 99
OR
2011-08-30 14:39:53 +02:00
ideqid MyIfrNVData.HowOldAreYouInYearsManual == MyEfiVar.Field8
2008-01-21 15:39:56 +01:00
OR
ideqvallist MyIfrNVData.HowOldAreYouInYearsManual == 1 3 5 7
endif
endnumeric;
2011-08-30 14:39:53 +02:00
numeric varid = MyEfiVar.Field8, // Reference of EFI variable storage
2009-11-13 08:13:11 +01:00
questionid = 0x1111,
2008-01-21 15:39:56 +01:00
prompt = STRING_TOKEN(STR_TALL_HEX_PROMPT),
help = STRING_TOKEN(STR_NUMERIC_HELP1),
2009-11-13 08:13:11 +01:00
flags = DISPLAY_UINT_HEX | INTERACTIVE, // Display in HEX format (if not specified, default is in decimal format)
2008-01-21 15:39:56 +01:00
minimum = 0,
maximum = 250,
2011-08-30 14:39:53 +02:00
default = 18, defaultstore = MyStandardDefault, // This is standard default value
default = 19, defaultstore = MyManufactureDefault, // This is manufacture default value
2008-01-21 15:39:56 +01:00
endnumeric;
2010-02-11 02:59:35 +01:00
//
// Define numeric using Name/Value Storage
//
numeric varid = MyNameValueVar[0], // This numeric take NameValueVar0 as storage
prompt = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME0),
help = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME0_HELP),
//
// Size should be defined for numeric when use Name/Value storage
// Valid value for numerice size are: NUMERIC_SIZE_1, NUMERIC_SIZE_2, NUMERIC_SIZE_4 and NUMERIC_SIZE_8
//
flags = NUMERIC_SIZE_1, // Size of this numeric is 1 byte
minimum = 0,
maximum = 0xff,
step = 0,
endnumeric;
numeric varid = MyNameValueVar[1], // This numeric take NameValueVar1 as storage
prompt = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME1),
help = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME1_HELP),
flags = NUMERIC_SIZE_2, // Size of this numeric is 2 bytes
minimum = 0,
maximum = 0xffff,
step = 0,
endnumeric;
//
// Define string using Name/Value Storage
//
string varid = MyNameValueVar[2], // This string take NameValueVar2 as storage
prompt = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME2),
help = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME2_HELP),
minsize = 2,
maxsize = 0x14,
endstring;
2011-08-30 14:39:53 +02:00
oneof varid = MyEfiVar.Field16,
prompt = STRING_TOKEN(STR_ONE_OF_PROMPT),
help = STRING_TOKEN(STR_NUMERIC_NUM_HELP),
option text = STRING_TOKEN(STR_BOOT_ORDER1), value = 0x0, flags = 0;
option text = STRING_TOKEN(STR_BOOT_ORDER2), value = 0x1, flags = DEFAULT;
endoneof;
2008-01-21 15:39:56 +01:00
label LABEL_1_VALUE;
label LABEL_2_VALUE;
grayoutif ideqval MyIfrNVData.HowOldAreYouInYearsManual == 23 AND ideqval MyIfrNVData.SuppressGrayOutSomething == 0x1;
numeric varid = MyIfrNVData.HowOldAreYouInYears,
prompt = STRING_TOKEN(STR_NUMERIC_STEP_PROMPT),
help = STRING_TOKEN(STR_NUMERIC_HELP2),
minimum = 0,
maximum = 243,
step = 1,
2008-11-04 15:28:08 +01:00
default = 18, defaultstore = MyStandardDefault, // This is standard default value
default = 19, defaultstore = MyManufactureDefault, // This is manufacture default value
2008-01-21 15:39:56 +01:00
endnumeric;
endif;
2011-05-20 04:58:35 +02:00
numeric varid = MyIfrNVData.GetDefaultValueFromAccess,
questionid = 0x1239,
prompt = STRING_TOKEN(STR_DEFAULT_VALUE_FROM_ACCESS_PROMPT),
help = STRING_TOKEN(STR_DEFAULT_VALUE_FROM_ACCESS_HELP),
flags = DISPLAY_UINT_HEX | INTERACTIVE,
minimum = 0,
maximum = 255,
step = 1,
default = 18,
endnumeric;
numeric varid = MyIfrNVData.GetDefaultValueFromCallBack,
questionid = 0x1240,
prompt = STRING_TOKEN(STR_DEFAULT_VALUE_FROM_CALLBACK_PROMPT),
help = STRING_TOKEN(STR_DEFAULT_VALUE_FROM_CALLBACK_HELP),
flags = DISPLAY_UINT_HEX | INTERACTIVE,
minimum = 0,
maximum = 255,
step = 1,
default = 18,
endnumeric;
2008-11-04 15:28:08 +01:00
resetbutton
defaultstore = MyStandardDefault,
prompt = STRING_TOKEN(STR_STANDARD_DEFAULT_PROMPT),
help = STRING_TOKEN(STR_STANDARD_DEFAULT_HELP),
endresetbutton;
resetbutton
defaultstore = MyManufactureDefault,
prompt = STRING_TOKEN(STR_MANUFACTURE_DEFAULT_PROMPT),
help = STRING_TOKEN(STR_MANUFACTURE_DEFAULT_HELP),
endresetbutton;
2008-01-21 15:39:56 +01:00
//
// Non-interactive password, validate by Setup Browser
//
password varid = MyIfrNVData.WhatIsThePassword,
prompt = STRING_TOKEN(STR_PASSWORD_PROMPT),
help = STRING_TOKEN(STR_PASSWORD_HELP),
minsize = 6,
2008-11-04 15:28:08 +01:00
maxsize = 20,
2008-01-21 15:39:56 +01:00
endpassword;
string varid = MyIfrNVData.PasswordClearText,
prompt = STRING_TOKEN(STR_MY_STRING_PROMPT),
help = STRING_TOKEN(STR_MY_STRING_HELP),
minsize = 6,
maxsize = 0x14,
endstring;
//
// Interactive password, validate via ConfigAccess.Callback()
//
password varid = MyIfrNVData.WhatIsThePassword2,
prompt = STRING_TOKEN(STR_PASSWORD_CALLBACK_PROMPT),
help = STRING_TOKEN(STR_PASSWORD_HELP),
flags = INTERACTIVE,
key = 0x2000,
minsize = 6,
2008-11-04 15:28:08 +01:00
maxsize = 20,
2008-01-21 15:39:56 +01:00
endpassword;
2010-03-16 07:25:10 +01:00
//
// Sample use case for IFR Security op-code
//
grayoutif NOT security (EFI_USER_INFO_ACCESS_SETUP_ADMIN_GUID);
text
help = STRING_TOKEN(STR_TEXT_SECRUITY_TEST_HELP),
text = STRING_TOKEN(STR_TEXT_SECRUITY_TEST_TEXT);
endif;
2008-01-21 15:39:56 +01:00
goto 2,
prompt = STRING_TOKEN(STR_GOTO_FORM2), //SecondSetupPage // this too has no end-op and basically it's a jump to a form ONLY
help = STRING_TOKEN(STR_GOTO_HELP);
goto 3,
prompt = STRING_TOKEN(STR_GOTO_FORM3), //ThirdSetupPage // this too has no end-op and basically it's a jump to a form ONLY
help = STRING_TOKEN(STR_GOTO_HELP);
2010-03-01 00:56:57 +01:00
goto 4,
prompt = STRING_TOKEN(STR_GOTO_FORM4), //FourthSetupPage // this too has no end-op and basically it's a jump to a form ONLY
help = STRING_TOKEN(STR_GOTO_HELP);
2011-08-30 14:39:53 +02:00
goto 5,
prompt = STRING_TOKEN(STR_GOTO_FORM5), //FifthSetupPage // this too has no end-op and basically it's a jump to a form ONLY
help = STRING_TOKEN(STR_GOTO_FORM5_HELP);
goto 6,
prompt = STRING_TOKEN(STR_GOTO_FORM6), //SixthSetupPage // this too has no end-op and basically it's a jump to a form ONLY
help = STRING_TOKEN(STR_GOTO_HELP);
2011-06-21 04:43:14 +02:00
guidop
2011-09-18 14:21:01 +02:00
guid = DRIVER_SAMPLE_FORMSET_GUID,
2011-08-30 14:39:53 +02:00
datatype = MY_EFI_VARSTORE_DATA,
2011-06-21 04:43:14 +02:00
data.Field8 = 0x21,
data.Field16 = 0x2121,
data.OrderedList[0] = 0x21,
endguidop;
2008-01-21 15:39:56 +01:00
endform;
2009-12-31 05:53:36 +01:00
suppressif ideqval MyIfrNVData.BootOrderLarge == 0;
form formid = 2, // SecondSetupPage,
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
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
prompt = STRING_TOKEN(STR_DATE_PROMPT),
help = STRING_TOKEN(STR_DATE_HELP),
minimum = 1998,
maximum = 2099,
step = 1,
default = 2004,
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
prompt = STRING_TOKEN(STR_DATE_PROMPT),
help = STRING_TOKEN(STR_DATE_HELP),
minimum = 1,
maximum = 12,
step = 1,
default = 1,
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
prompt = STRING_TOKEN(STR_DATE_PROMPT),
help = STRING_TOKEN(STR_DATE_HELP),
minimum = 1,
maximum = 31,
step = 0x1,
default = 1,
inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
ideqval Date.Day == 31
AND
ideqvallist Date.Month == 2 4 6 9 11
endif
//
// If the day is 30 AND month is 2
//
inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
ideqval Date.Day == 30
AND
ideqval Date.Month == 2
endif
//
// If the day is 29 AND month is 2 AND it year is NOT a leapyear
//
inconsistentif prompt = STRING_TOKEN(STR_ERROR_POPUP),
ideqval Date.Day == 0x1D
AND
ideqval Date.Month == 2
AND
NOT
ideqvallist Date.Year == 2004 2008 20012 20016 2020 2024 2028 2032 2036
endif
enddate;
2011-05-31 02:59:15 +02:00
text
help = STRING_TOKEN(STR_SAVE_CURRENT_AND_EXIT),
text = STRING_TOKEN(STR_SAVE_CURRENT_AND_EXIT),
text = STRING_TOKEN(STR_SAVE_CURRENT_AND_EXIT),
flags = INTERACTIVE,
key = 0x1241;
text
help = STRING_TOKEN(STR_DISCARD_CURRENT),
text = STRING_TOKEN(STR_DISCARD_CURRENT),
text = STRING_TOKEN(STR_DISCARD_CURRENT),
flags = INTERACTIVE,
key = 0x1242;
2011-07-05 10:49:55 +02:00
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
2009-12-31 05:53:36 +01:00
prompt = STRING_TOKEN(STR_TIME_PROMPT),
help = STRING_TOKEN(STR_TIME_HELP),
minimum = 0,
maximum = 23,
step = 1,
default = 0,
2011-07-05 10:49:55 +02:00
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
2009-12-31 05:53:36 +01:00
prompt = STRING_TOKEN(STR_TIME_PROMPT),
help = STRING_TOKEN(STR_TIME_HELP),
minimum = 0,
maximum = 59,
step = 1,
default = 0,
2011-07-05 10:49:55 +02:00
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
2009-12-31 05:53:36 +01:00
prompt = STRING_TOKEN(STR_TIME_PROMPT),
help = STRING_TOKEN(STR_TIME_HELP),
minimum = 0,
maximum = 59,
step = 1,
default = 0,
endtime;
2011-05-20 04:58:35 +02:00
time
name = MyTime,
varid = MyIfrNVData.Time,
prompt = STRING_TOKEN(STR_TIME_PROMPT),
help = STRING_TOKEN(STR_TIME_PROMPT),
flags = STORAGE_NORMAL,
default = 15:33:33,
endtime;
2009-12-31 05:53:36 +01:00
checkbox varid = MyIfrNVData.ChooseToActivateNuclearWeaponry,
prompt = STRING_TOKEN(STR_CHECK_BOX_PROMPT),
help = STRING_TOKEN(STR_CHECK_BOX_HELP),
flags = CHECKBOX_DEFAULT,
key = 0,
endcheckbox;
2008-01-21 15:39:56 +01:00
2009-12-31 05:53:36 +01:00
text
help = STRING_TOKEN(STR_TEXT_HELP),
text = STRING_TOKEN(STR_TEXT_TEXT_1);
2008-01-21 15:39:56 +01:00
2009-12-31 05:53:36 +01:00
text
help = STRING_TOKEN(STR_TEXT_HELP),
text = STRING_TOKEN(STR_TEXT_TEXT_1),
text = STRING_TOKEN(STR_TEXT_TEXT_2);
2008-01-21 15:39:56 +01:00
2009-12-31 05:53:36 +01:00
goto 1,
prompt = STRING_TOKEN(STR_GOTO_FORM1), //MainSetupPage // this too has no end-op and basically it's a jump to a form ONLY
help = STRING_TOKEN(STR_GOTO_HELP);
2008-01-21 15:39:56 +01:00
2011-08-30 14:39:53 +02:00
goto
varid = MyIfrNVData.RefData,
prompt = STRING_TOKEN(STR_GOTO_DYNAMIC3),
help = STRING_TOKEN(STR_GOTO_DYNAMIC3_HELP),
flags = INTERACTIVE,
key = 0x1248;
//
// Set the defult value, format is QuestionId; FormId; FormsetGuid; Device Path String Token
//
default = 0;0;ZERO_GUID;STRING_TOKEN(STR_NULL_STRING),
goto
prompt = STRING_TOKEN(STR_GOTO_DYNAMIC4),
help = STRING_TOKEN(STR_GOTO_DYNAMIC4_HELP),
flags = INTERACTIVE,
key = 0x1249;
2009-12-31 05:53:36 +01:00
endform;
endif;
2008-01-21 15:39:56 +01:00
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
2011-08-30 14:39:53 +02:00
suppressif ideqval MyEfiVar.Field8 == 111;
2008-01-21 15:39:56 +01:00
text
help = STRING_TOKEN(STR_TEXT_HELP),
text = STRING_TOKEN(STR_TEXT_TEXT_1);
endif;
2008-11-04 15:28:08 +01:00
goto 1,
prompt = STRING_TOKEN(STR_GOTO_FORM1), //MainSetupPage
help = STRING_TOKEN(STR_GOTO_HELP);
numeric varid = MyIfrNVData.DynamicRefresh,
prompt = STRING_TOKEN(STR_NUMERIC_MANUAL_PROMPT),
help = STRING_TOKEN(STR_NUMERIC_HELP0),
flags = INTERACTIVE,
key = 0x5678,
minimum = 0,
maximum = 0xff,
step = 0,
default = 0,
refresh interval = 3 // Refresh interval in seconds
endnumeric;
2009-04-13 08:05:15 +02:00
label LABEL_UPDATE2;
2008-11-04 15:28:08 +01:00
label LABEL_END;
2008-01-21 15:39:56 +01:00
endform;
2010-03-01 00:56:57 +01:00
formmap formid = 4,
maptitle = STRING_TOKEN(STR_SAMPL_MAP_METHOD);
2011-09-18 14:21:01 +02:00
mapguid = DRIVER_SAMPLE_FORMSET_GUID;
2010-03-01 00:56:57 +01:00
maptitle = STRING_TOKEN(STR_STANDARD_MAP_METHOD);
mapguid = EFI_HII_STANDARD_FORM_GUID;
oneof varid = MyIfrNVData.SerialPortNo,
prompt = STRING_TOKEN(STR_SERIAL_PORT),
help = STRING_TOKEN(STR_ONE_OF_HELP),
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;)));
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;));
option text = STRING_TOKEN(STR_SERIAL_PORT_DISABLE), value = 0x0, flags = DEFAULT;
option text = STRING_TOKEN(STR_SERIAL_PORT1), value = 0x1, flags = 0;
option text = STRING_TOKEN(STR_SERIAL_PORT2), value = 0x2, flags = 0;
option text = STRING_TOKEN(STR_SERIAL_PORT3), value = 0x3, flags = 0;
option text = STRING_TOKEN(STR_SERIAL_PORT4), value = 0x4, flags = 0;
endoneof;
grayoutif TRUE;
checkbox varid = MyIfrNVData.SerialPortStatus,
prompt = STRING_TOKEN(STR_SERIAL_PORT_STATUS),
help = STRING_TOKEN(STR_CHECK_BOX_HELP),
endcheckbox;
endif;
grayoutif TRUE;
suppressif ideqval MyIfrNVData.SerialPortStatus == 0;
oneof varid = MyIfrNVData.SerialPortIo,
prompt = STRING_TOKEN(STR_SERIAL_PORT_IO_ADDRESS),
help = STRING_TOKEN(STR_ONE_OF_HELP),
option text = STRING_TOKEN(STR_SERIAL_PORT1_IOADDR), value = 0x3F8, flags = DEFAULT;
option text = STRING_TOKEN(STR_SERIAL_PORT2_IOADDR), value = 0x2F8, flags = 0;
option text = STRING_TOKEN(STR_SERIAL_PORT3_IOADDR), value = 0x3E8, flags = 0;
option text = STRING_TOKEN(STR_SERIAL_PORT4_IOADDR), value = 0x2E8, flags = 0;
endoneof;
endif;
endif;
grayoutif TRUE;
suppressif ideqval MyIfrNVData.SerialPortStatus == 0;
oneof varid = MyIfrNVData.SerialPortIrq,
prompt = STRING_TOKEN(STR_SERIAL_PORT_IRQ),
help = STRING_TOKEN(STR_ONE_OF_HELP),
option text = STRING_TOKEN(STR_SERIAL_PORT13_IRQ), value = 0x4, flags = DEFAULT;
option text = STRING_TOKEN(STR_SERIAL_PORT24_IRQ), value = 0x3, flags = 0;
endoneof;
endif;
endif;
goto 1,
prompt = STRING_TOKEN(STR_GOTO_FORM1), //MainSetupPage
help = STRING_TOKEN(STR_GOTO_HELP);
2008-01-21 15:39:56 +01:00
endform;
2011-08-30 14:39:53 +02:00
form formid = 5, // Modal form
title = STRING_TOKEN(STR_MODAL_FORM_TITLE);
//
// This form is a modal form.
//
modal;
text
help = STRING_TOKEN(STR_EXIT_TEXT),
text = STRING_TOKEN(STR_EXIT_TEXT),
text = STRING_TOKEN(STR_EXIT_TEXT),
flags = INTERACTIVE, // VfrCompiler will generate opcode EFI_IFR_ACTION for Text marked as INTERACTIVE
key = 0x1245;
text
help = STRING_TOKEN(STR_SAVE_TEXT),
text = STRING_TOKEN(STR_SAVE_TEXT),
text = STRING_TOKEN(STR_SAVE_TEXT),
flags = INTERACTIVE, // VfrCompiler will generate opcode EFI_IFR_ACTION for Text marked as INTERACTIVE
key = 0x1246;
endform;
form formid = 6, // Form to show the refresh guid group op-code
title = STRING_TOKEN(STR_FORM6_TITLE);
text
help = STRING_TOKEN(STR_TEXT_REFRESH_GUID),
text = STRING_TOKEN(STR_TEXT_REFRESH_GUID);
numeric varid = MyIfrNVData.RefreshGuidCount,
prompt = STRING_TOKEN(STR_TEXT_REFRESH_GUID_COUNT),
help = STRING_TOKEN(STR_NUMERIC_HELP0),
flags = INTERACTIVE,
key = 0x1247,
minimum = 0,
maximum = 0xff,
step = 0,
default = 0,
refreshguid = EFI_IFR_REFRESH_ID_OP_GUID,
endnumeric;
label LABEL_UPDATE3;
label LABEL_END;
endform;
2008-01-21 15:39:56 +01:00
form formid = 0x1234, // Dynamically created page,
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
2009-04-13 08:05:15 +02:00
label LABEL_UPDATE1;
2008-01-21 15:39:56 +01:00
//
// This is where we will insert dynamic created opcodes
//
label LABEL_END;
endform;
endformset;