X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FDriverSampleDxe%2FVfr.vfr;h=e82cccc9db5a9d2be08251ad83583c8ecf410394;hp=01c76345b47d0e02858ebe28978a36de94a8e3f8;hb=e5eed7d3641d71d7ea539e5379ea9c6a5cd97004;hpb=8d00a0f1955de7aa4b658009a36df5165d0a75be diff --git a/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr b/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr index 01c76345b4..e82cccc9db 100644 --- a/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr +++ b/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr @@ -2,8 +2,8 @@ // // Sample Setup formset. // -// Copyright (c) 2004 - 2008, Intel Corporation.
-// All rights reserved. This program and the accompanying materials +// Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.
+// This program and the accompanying materials // 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 @@ -49,14 +49,12 @@ #define LABEL_1_VALUE 0x01 #define LABEL_2_VALUE 0x1000 #define LABEL_UPDATE_BBS 0x2222 -#define LABEL_END 0x2223 formset - guid = FORMSET_GUID, - title = STRING_TOKEN(STR_FORM_SET_TITLE), - help = STRING_TOKEN(STR_FORM_SET_TITLE_HELP), - class = EFI_ON_BOARD_DEVICE_CLASS, - subclass = EFI_SETUP_APPLICATION_SUBCLASS, + guid = FORMSET_GUID, + title = STRING_TOKEN(STR_FORM_SET_TITLE), + help = STRING_TOKEN(STR_FORM_SET_TITLE_HELP), + classguid = EFI_HII_PLATFORM_SETUP_FORMSET_GUID, // // Notes: VfrCompiler will insert a Standard Default Storage declaration @@ -86,11 +84,20 @@ formset // Define a EFI variable Storage (EFI_IFR_VARSTORE_EFI) // efivarstore MyEfiVar, // Define referenced name in vfr - attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS, // EFI variable attribures + attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE, // EFI variable attribures name = STRING_TOKEN(STR_VAR_NAME), // EFI variable name varsize = 1, // Size of the EFI variable guid = FORMSET_GUID; // EFI variable GUID + // + // 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] + guid = FORMSET_GUID; // GUID of this Name/Value storage + defaultstore MyStandardDefault, prompt = STRING_TOKEN(STR_STANDARD_DEFAULT_PROMPT), attribute = 0x0000; // Default ID: 0000 standard default @@ -155,8 +162,9 @@ formset oneof varid = MyIfrNVData.BootOrderLarge, prompt = STRING_TOKEN(STR_ONE_OF_PROMPT), help = STRING_TOKEN(STR_ONE_OF_HELP), + default value = cond (pushthis == 0 ? 0 : cond ((questionref(MyOneOf) >> 0x4 & 0xF00) == 0x0 + 0x2 ? 0 : 1)), option text = STRING_TOKEN(STR_BOOT_ORDER1), value = 0x0, flags = 0; - option text = STRING_TOKEN(STR_BOOT_ORDER2), value = 0x1, flags = DEFAULT; + option text = STRING_TOKEN(STR_BOOT_ORDER2), value = 0x1, flags = 0; endoneof; grayoutif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x1; @@ -210,7 +218,7 @@ formset endif; // end suppressif - suppressif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x2; + disableif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x2; orderedlist varid = MyIfrNVData.OrderedList, prompt = STRING_TOKEN(STR_TEST_OPCODE), @@ -314,15 +322,51 @@ formset endnumeric; numeric varid = MyEfiVar, // Reference of EFI variable storage + questionid = 0x1111, prompt = STRING_TOKEN(STR_TALL_HEX_PROMPT), help = STRING_TOKEN(STR_NUMERIC_HELP1), - flags = DISPLAY_UINT_HEX, // Display in HEX format (if not specified, default is in decimal format) + flags = DISPLAY_UINT_HEX | INTERACTIVE, // Display in HEX format (if not specified, default is in decimal format) minimum = 0, maximum = 250, default = 175, endnumeric; + // + // 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; + label LABEL_1_VALUE; label LABEL_2_VALUE; @@ -380,6 +424,15 @@ formset maxsize = 20, endpassword; + // + // 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; + 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); @@ -388,112 +441,118 @@ formset 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); - endform; - - 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 + 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); - // - // 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 + endform; - enddate; - - time hour varid = Time.Hours, // 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_TIME_PROMPT), - help = STRING_TOKEN(STR_TIME_HELP), - minimum = 0, - maximum = 23, - step = 1, - default = 0, - - minute varid = Time.Minutes, // 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_TIME_PROMPT), - help = STRING_TOKEN(STR_TIME_HELP), - minimum = 0, - maximum = 59, - step = 1, - default = 0, - - second varid = Time.Seconds, // 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_TIME_PROMPT), - help = STRING_TOKEN(STR_TIME_HELP), - minimum = 0, - maximum = 59, - step = 1, - default = 0, - - endtime; - - checkbox varid = MyIfrNVData.ChooseToActivateNuclearWeaponry, - prompt = STRING_TOKEN(STR_CHECK_BOX_PROMPT), - help = STRING_TOKEN(STR_CHECK_BOX_HELP), - flags = CHECKBOX_DEFAULT, - key = 0, - endcheckbox; + 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; + + time hour varid = Time.Hours, // 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_TIME_PROMPT), + help = STRING_TOKEN(STR_TIME_HELP), + minimum = 0, + maximum = 23, + step = 1, + default = 0, + + minute varid = Time.Minutes, // 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_TIME_PROMPT), + help = STRING_TOKEN(STR_TIME_HELP), + minimum = 0, + maximum = 59, + step = 1, + default = 0, + + second varid = Time.Seconds, // 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_TIME_PROMPT), + help = STRING_TOKEN(STR_TIME_HELP), + minimum = 0, + maximum = 59, + step = 1, + default = 0, + + endtime; + + checkbox varid = MyIfrNVData.ChooseToActivateNuclearWeaponry, + prompt = STRING_TOKEN(STR_CHECK_BOX_PROMPT), + help = STRING_TOKEN(STR_CHECK_BOX_HELP), + flags = CHECKBOX_DEFAULT, + key = 0, + endcheckbox; - text - help = STRING_TOKEN(STR_TEXT_HELP), - text = STRING_TOKEN(STR_TEXT_TEXT_1); + text + help = STRING_TOKEN(STR_TEXT_HELP), + text = STRING_TOKEN(STR_TEXT_TEXT_1); - text - help = STRING_TOKEN(STR_TEXT_HELP), - text = STRING_TOKEN(STR_TEXT_TEXT_1), - text = STRING_TOKEN(STR_TEXT_TEXT_2); + text + help = STRING_TOKEN(STR_TEXT_HELP), + text = STRING_TOKEN(STR_TEXT_TEXT_1), + text = STRING_TOKEN(STR_TEXT_TEXT_2); - 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); + 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); - endform; + endform; + endif; 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 @@ -519,19 +578,74 @@ formset refresh interval = 3 // Refresh interval in seconds endnumeric; - label 0x2234; + label LABEL_UPDATE2; label LABEL_END; endform; - form formid = 4, title = STRING_TOKEN(STR_FORM3_TITLE); + formmap formid = 4, + maptitle = STRING_TOKEN(STR_SAMPL_MAP_METHOD); + mapguid = FORMSET_GUID; + 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); endform; 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 - label 0x1234; + label LABEL_UPDATE1; // // This is where we will insert dynamic created opcodes //