X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FDriverSampleDxe%2FVfr.vfr;h=d5f906b93c98abf80a646d6365a6fae07dae7556;hb=824e8a5233fe6f0b213a741cd38cbbc3ffa639a8;hp=0c8c109c4e1ad423a072a99ea59c841dffd23fb2;hpb=d29270810c282aa3b7938b42a3e6efbc08014a91;p=mirror_edk2.git diff --git a/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr b/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr index 0c8c109c4e..d5f906b93c 100644 --- a/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr +++ b/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr @@ -43,29 +43,18 @@ #define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004 #define EFI_VARIABLE_READ_ONLY 0x00000008 -// -// NV data structure definition -// -typedef struct { - UINT8 Field8; - UINT16 Field16; - UINT8 OrderedList[3]; -} MY_DATA2; - // // Labels definition // #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 @@ -76,23 +65,11 @@ formset // VfrCompile -l --no-pre-processing --output-directory ${d_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii // - // - // Define a Default Storage for Manufacturing Defauls. Attribut = 1 (EFI_HII_DEFAULT_CLASS_MANUFACTURING). - // Only if this Default Storage is defined, CHECKBOX_DEFAULT_MFG can be used for CheckBox. - // - defaultstore MfgDefault, prompt = STRING_TOKEN (STR_DEFAULTSTORE_MFG), attribute = 1; - - // - // Define a Safe Deafult Storage. Attribute = 2 (EFI_HII_DEFAULT_CLASS_SAFE) as an example. - // It is not referenced. - // - defaultstore SafeDefault, prompt = STRING_TOKEN (STR_DEFAULTSTORE_SAFE), attribute = 2; - - // + // // Define a Buffer Storage (EFI_IFR_VARSTORE) // varstore DRIVER_SAMPLE_CONFIGURATION, // This is the data structure type - varid = 0x1234, // Optional VarStore ID + varid = CONFIGURATION_VARSTORE_ID, // Optional VarStore ID name = MyIfrNVData, // Define referenced name in vfr guid = FORMSET_GUID; // GUID of this buffer storage @@ -107,11 +84,19 @@ 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 + 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 + // // Define a Form (EFI_IFR_FORM) // @@ -130,11 +115,14 @@ formset text = STRING_TOKEN(STR_CPU_STRING), // Prompt string text = STRING_TOKEN(STR_CPU_STRING2); // TextTwo + // + // Define action button (EFI_IFR_ACTION) + // text help = STRING_TOKEN(STR_EXIT_TEXT), text = STRING_TOKEN(STR_EXIT_TEXT), text = STRING_TOKEN(STR_EXIT_TEXT), - flags = INTERACTIVE, + flags = INTERACTIVE, // VfrCompiler will generate opcode EFI_IFR_ACTION for Text marked as INTERACTIVE key = 0x1237; text @@ -147,9 +135,10 @@ formset // // Define oneof (EFI_IFR_ONE_OF) // - oneof varid = MyIfrNVData.SuppressGrayOutSomething, // Use "DataStructure.Member" to reference Buffer Storage - prompt = STRING_TOKEN(STR_ONE_OF_PROMPT), - help = STRING_TOKEN(STR_ONE_OF_HELP), + 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), // // Define an option (EFI_IFR_ONE_OF_OPTION) // @@ -164,12 +153,13 @@ 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; - suppressif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x0; + suppressif questionref(MyOneOf) == 0x0; checkbox varid = MyIfrNVData.ChooseToActivateNuclearWeaponry, prompt = STRING_TOKEN(STR_CHECK_BOX_PROMPT), @@ -208,7 +198,7 @@ formset 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; - option text = STRING_TOKEN(STR_BOOT_OPTION4), value = 4, flags = 0; + option text = STRING_TOKEN(STR_BOOT_OPTION4), value = 4, flags = RESET_REQUIRED; endif endlist; @@ -285,7 +275,7 @@ formset flags = INTERACTIVE, key = 0x1236, minsize = 6, - maxsize = 20, + maxsize = 40, endstring; // @@ -299,7 +289,8 @@ formset maximum = 0xf0, step = 0, // Stepping of 0 equates to a manual entering // of a value, otherwise it will be adjusted by "+"/"-" - default = 20, + default = 21, // defaultstore could be used to specify the default type + // If no defaultstore is specified, it implies Standard Default endnumeric; @@ -322,9 +313,10 @@ 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, @@ -341,10 +333,23 @@ formset minimum = 0, maximum = 243, step = 1, - default = 18, - + default = 18, defaultstore = MyStandardDefault, // This is standard default value + default = 19, defaultstore = MyManufactureDefault, // This is manufacture default value + endnumeric; endif; + + 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; // // Non-interactive password, validate by Setup Browser @@ -353,7 +358,7 @@ formset prompt = STRING_TOKEN(STR_PASSWORD_PROMPT), help = STRING_TOKEN(STR_PASSWORD_HELP), minsize = 6, - maxsize = 20, // new opcode + maxsize = 20, endpassword; string varid = MyIfrNVData.PasswordClearText, @@ -372,7 +377,7 @@ formset flags = INTERACTIVE, key = 0x2000, minsize = 6, - maxsize = 20, // new opcode + maxsize = 20, endpassword; goto 2, @@ -391,7 +396,7 @@ formset 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_YEAR_HELP), + help = STRING_TOKEN(STR_DATE_HELP), minimum = 1998, maximum = 2099, step = 1, @@ -399,7 +404,7 @@ formset 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_MONTH_HELP), + help = STRING_TOKEN(STR_DATE_HELP), minimum = 1, maximum = 12, step = 1, @@ -407,7 +412,7 @@ formset 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_DAY_HELP), + help = STRING_TOKEN(STR_DATE_HELP), minimum = 1, maximum = 31, step = 0x1, @@ -444,7 +449,7 @@ formset 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_HOUR_HELP), + help = STRING_TOKEN(STR_TIME_HELP), minimum = 0, maximum = 23, step = 1, @@ -452,7 +457,7 @@ formset 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_MINUTE_HELP), + help = STRING_TOKEN(STR_TIME_HELP), minimum = 0, maximum = 59, step = 1, @@ -460,7 +465,7 @@ formset 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_SECOND_HELP), + help = STRING_TOKEN(STR_TIME_HELP), minimum = 0, maximum = 59, step = 1, @@ -492,12 +497,31 @@ formset 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 - grayoutif ideqval MyIfrNVData.SuppressGrayOutSomething == 0x1; + suppressif ideqval MyEfiVar == 111; text help = STRING_TOKEN(STR_TEXT_HELP), text = STRING_TOKEN(STR_TEXT_TEXT_1); endif; + 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; + + label LABEL_UPDATE2; + label LABEL_END; + endform; form formid = 4, title = STRING_TOKEN(STR_FORM3_TITLE); @@ -507,7 +531,7 @@ formset 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 //