From nobody Fri Dec 27 02:19:19 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1504509446111183.8310557985276; Mon, 4 Sep 2017 00:17:26 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id B911821E3EA9E; Mon, 4 Sep 2017 00:14:20 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 75BE921E3EA8A for ; Mon, 4 Sep 2017 00:14:19 -0700 (PDT) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP; 04 Sep 2017 00:17:06 -0700 Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by orsmga005.jf.intel.com with ESMTP; 04 Sep 2017 00:17:05 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,473,1498546800"; d="scan'208";a="145191016" From: Dandan Bi To: edk2-devel@lists.01.org Date: Mon, 4 Sep 2017 15:16:28 +0800 Message-Id: <1504509388-369768-7-git-send-email-dandan.bi@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1504509388-369768-1-git-send-email-dandan.bi@intel.com> References: <1504509388-369768-1-git-send-email-dandan.bi@intel.com> Subject: [edk2] [patch 6/6] MdeModulePkg/DriverSample: Add sample questions with bit/union VarStore X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eric Dong , Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" https://bugzilla.tianocore.org/show_bug.cgi?id=3D545 Cc: Eric Dong Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi --- .../Universal/DriverSampleDxe/DriverSample.c | 120 +++++++++++++ .../Universal/DriverSampleDxe/DriverSample.h | 2 + .../Universal/DriverSampleDxe/NVDataStruc.h | 51 +++++- MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr | 187 +++++++++++++++++= ++++ .../Universal/DriverSampleDxe/VfrStrings.uni | 61 +++++++ 5 files changed, 420 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c b/MdeMod= ulePkg/Universal/DriverSampleDxe/DriverSample.c index bbd9713..af31615 100644 --- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c +++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c @@ -18,10 +18,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITH= ER EXPRESS OR IMPLIED. =20 #define DISPLAY_ONLY_MY_ITEM 0x0002 =20 CHAR16 VariableName[] =3D L"MyIfrNVData"; CHAR16 MyEfiVar[] =3D L"MyEfiVar"; +CHAR16 MyEfiBitVar[] =3D L"MyEfiBitVar"; +CHAR16 MyEfiUnionVar[] =3D L"MyEfiUnionVar"; + EFI_HANDLE DriverHandle[2] =3D {NULL, NULL}; DRIVER_SAMPLE_PRIVATE_DATA *mPrivateData =3D NULL; EFI_EVENT mEvent; =20 HII_VENDOR_DEVICE_PATH mHiiVendorDevicePath0 =3D { @@ -662,10 +665,17 @@ ExtractConfig ( // through hii database, not support in this path. // if (HiiIsConfigHdrMatch(Request, &gDriverSampleFormSetGuid, MyEfiVar))= { return EFI_UNSUPPORTED; } + if (HiiIsConfigHdrMatch(Request, &gDriverSampleFormSetGuid, MyEfiBitVa= r)) { + return EFI_UNSUPPORTED; + } + if (HiiIsConfigHdrMatch(Request, &gDriverSampleFormSetGuid, MyEfiUnion= Var)) { + return EFI_UNSUPPORTED; + } + // // Set Request to the unified request string. // ConfigRequest =3D Request; // @@ -883,10 +893,16 @@ RouteConfig ( // through hii database, not support in this path. // if (HiiIsConfigHdrMatch(Configuration, &gDriverSampleFormSetGuid, MyEfiV= ar)) { return EFI_UNSUPPORTED; } + if (HiiIsConfigHdrMatch(Configuration, &gDriverSampleFormSetGuid, MyEfiB= itVar)) { + return EFI_UNSUPPORTED; + } + if (HiiIsConfigHdrMatch(Configuration, &gDriverSampleFormSetGuid, MyEfiU= nionVar)) { + return EFI_UNSUPPORTED; + } =20 // // Get Buffer Storage data from EFI variable // BufferSize =3D sizeof (DRIVER_SAMPLE_CONFIGURATION); @@ -1295,10 +1311,14 @@ DriverCallback ( for (Index =3D 0; Index < 3; Index ++) { SetArrayData (Value, EFI_IFR_TYPE_NUM_SIZE_8, Index, BufferValue= --); } break; =20 + case 0x6666: + Value->u8 =3D 12; + break; + default: Status =3D EFI_UNSUPPORTED; break; } } @@ -1309,10 +1329,14 @@ DriverCallback ( switch (QuestionId) { case 0x1240: Value->u8 =3D DEFAULT_CLASS_MANUFACTURING_VALUE; break; =20 + case 0x6666: + Value->u8 =3D 13; + break; + default: Status =3D EFI_UNSUPPORTED; =20 break; } } @@ -1703,10 +1727,12 @@ DriverSampleInit ( DRIVER_SAMPLE_CONFIGURATION *Configuration; BOOLEAN ActionFlag; EFI_STRING ConfigRequestHdr; EFI_STRING NameRequestHdr; MY_EFI_VARSTORE_DATA *VarStoreConfig; + MY_EFI_BITS_VARSTORE_DATA *BitsVarStoreConfig; + MY_EFI_UNION_DATA *UnionConfig; EFI_INPUT_KEY HotKey; EDKII_FORM_BROWSER_EXTENSION_PROTOCOL *FormBrowserEx; =20 // // Initialize the local variables. @@ -1991,10 +2017,104 @@ DriverSampleInit ( return EFI_INVALID_PARAMETER; } } FreePool (ConfigRequestHdr); =20 + // + // Initialize Bits efi varstore configuration data + // + BitsVarStoreConfig =3D &mPrivateData->BitsVarStoreConfig; + ZeroMem (BitsVarStoreConfig, sizeof (MY_EFI_BITS_VARSTORE_DATA)); + + ConfigRequestHdr =3D HiiConstructConfigHdr (&gDriverSampleFormSetGuid, M= yEfiBitVar, DriverHandle[0]); + ASSERT (ConfigRequestHdr !=3D NULL); + + BufferSize =3D sizeof (MY_EFI_BITS_VARSTORE_DATA); + Status =3D gRT->GetVariable (MyEfiBitVar, &gDriverSampleFormSetGuid, NUL= L, &BufferSize, BitsVarStoreConfig); + if (EFI_ERROR (Status)) { + // + // Store zero data to EFI variable Storage. + // + Status =3D gRT->SetVariable( + MyEfiBitVar, + &gDriverSampleFormSetGuid, + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_A= CCESS, + sizeof (MY_EFI_BITS_VARSTORE_DATA), + BitsVarStoreConfig + ); + if (EFI_ERROR (Status)) { + DriverSampleUnload (ImageHandle); + return Status; + } + // + // EFI variable for NV config doesn't exit, we should build this varia= ble + // based on default values stored in IFR + // + ActionFlag =3D HiiSetToDefaults (ConfigRequestHdr, EFI_HII_DEFAULT_CLA= SS_STANDARD); + if (!ActionFlag) { + DriverSampleUnload (ImageHandle); + return EFI_INVALID_PARAMETER; + } + } else { + // + // EFI variable does exist and Validate Current Setting + // + ActionFlag =3D HiiValidateSettings (ConfigRequestHdr); + if (!ActionFlag) { + DriverSampleUnload (ImageHandle); + return EFI_INVALID_PARAMETER; + } + } + FreePool (ConfigRequestHdr); + + // + // Initialize Union efi varstore configuration data + // + UnionConfig =3D &mPrivateData->UnionConfig; + ZeroMem (UnionConfig, sizeof (MY_EFI_UNION_DATA)); + + ConfigRequestHdr =3D HiiConstructConfigHdr (&gDriverSampleFormSetGuid, M= yEfiUnionVar, DriverHandle[0]); + ASSERT (ConfigRequestHdr !=3D NULL); + + BufferSize =3D sizeof (MY_EFI_UNION_DATA); + Status =3D gRT->GetVariable (MyEfiUnionVar, &gDriverSampleFormSetGuid, N= ULL, &BufferSize, UnionConfig); + if (EFI_ERROR (Status)) { + // + // Store zero data to EFI variable Storage. + // + Status =3D gRT->SetVariable( + MyEfiUnionVar, + &gDriverSampleFormSetGuid, + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_A= CCESS, + sizeof (MY_EFI_UNION_DATA), + UnionConfig + ); + if (EFI_ERROR (Status)) { + DriverSampleUnload (ImageHandle); + return Status; + } + // + // EFI variable for NV config doesn't exit, we should build this varia= ble + // based on default values stored in IFR + // + ActionFlag =3D HiiSetToDefaults (ConfigRequestHdr, EFI_HII_DEFAULT_CLA= SS_STANDARD); + if (!ActionFlag) { + DriverSampleUnload (ImageHandle); + return EFI_INVALID_PARAMETER; + } + } else { + // + // EFI variable does exist and Validate Current Setting + // + ActionFlag =3D HiiValidateSettings (ConfigRequestHdr); + if (!ActionFlag) { + DriverSampleUnload (ImageHandle); + return EFI_INVALID_PARAMETER; + } + } + FreePool (ConfigRequestHdr); + Status =3D gBS->CreateEventEx ( EVT_NOTIFY_SIGNAL,=20 TPL_NOTIFY, EfiEventEmptyFunction, NULL, diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.h b/MdeMod= ulePkg/Universal/DriverSampleDxe/DriverSample.h index 507cff6..00752bf 100644 --- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.h +++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.h @@ -83,10 +83,12 @@ typedef struct { =20 EFI_HANDLE DriverHandle[2]; EFI_HII_HANDLE HiiHandle[2]; DRIVER_SAMPLE_CONFIGURATION Configuration; MY_EFI_VARSTORE_DATA VarStoreConfig; + MY_EFI_BITS_VARSTORE_DATA BitsVarStoreConfig; + MY_EFI_UNION_DATA UnionConfig; =20 // // Name/Value storage Name list // EFI_STRING_ID NameStringId[NAME_VALUE_NAME_NUMBER]; diff --git a/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h b/MdeModu= lePkg/Universal/DriverSampleDxe/NVDataStruc.h index 195cc8a..d018ba5 100644 --- a/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h +++ b/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h @@ -1,8 +1,8 @@ /** @file =20 -Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2007 - 2017, 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 =20 @@ -29,13 +29,43 @@ Revision History: #include #include #include =20 #define CONFIGURATION_VARSTORE_ID 0x1234 +#define BITS_VARSTORE_ID 0x2345 =20 #pragma pack(1) + +typedef struct { + UINT16 Field16; + UINT8 MyBits4 : 1; + UINT16 : 1; // unnamed field can be used for padding + UINT8 MyBits3 : 3; + UINT8 : 0; // Special width 0 can be used to force alignment= at the next word boundary + UINT8 MyBits5 : 3; + UINT16 MyBits6 : 4; + UINT8 Field8; +} MY_BITS_DATA; + +typedef union { + UINT16 MyBits7 : 10; + UINT16 MyBits9 : 12; +} MY_UNION_DATA1; + +typedef union { + UINT16 Field16; + UINT8 Field8; +} MY_UNION_DATA2; + +typedef union { + MY_UNION_DATA1 Data1; + MY_UNION_DATA2 Data2; + MY_BITS_DATA Data3; +} MY_EFI_UNION_DATA; + typedef struct { + UINT16 Test; UINT16 MyStringData[40]; UINT16 SomethingHiddenForHtml; UINT8 HowOldAreYouInYearsManual; UINT16 HowTallAreYouManual; UINT8 HowOldAreYouInYears; @@ -65,10 +95,17 @@ typedef struct { UINT8 GetDefaultValueFromAccess; EFI_HII_TIME Time; UINT8 RefreshGuidCount; UINT8 Match2; UINT8 GetDefaultValueFromCallBackForOrderedList[3]; + UINT8 Bits1 : 5; + UINT8 Bits2 : 6; + UINT8 Bits3 : 1; + UINT16 Bits4 : 6; + UINT16 Bits5 : 12; + MY_BITS_DATA MyBitData; + MY_EFI_UNION_DATA MyUnionData; } DRIVER_SAMPLE_CONFIGURATION; =20 // // 2nd NV data structure definition // @@ -78,10 +115,22 @@ typedef struct { UINT8 OrderedList[3]; UINT16 SubmittedCallback; } MY_EFI_VARSTORE_DATA; =20 // +// 3rd NV data structure definition +// +typedef struct { + UINT16 Field16; + MY_BITS_DATA BitsData; + UINT8 Field8; + UINT16 MyBits7 : 3; + UINT16 MyBits8 : 3; + UINT16 MyBits9 : 1; +} MY_EFI_BITS_VARSTORE_DATA; + +// // Labels definition // #define LABEL_UPDATE1 0x1234 #define LABEL_UPDATE2 0x2234 #define LABEL_UPDATE3 0x3234 diff --git a/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr b/MdeModulePkg/= Universal/DriverSampleDxe/Vfr.vfr index d547ec8..bc6f645 100644 --- a/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr +++ b/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr @@ -86,10 +86,23 @@ formset attribute =3D EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLAT= ILE, // EFI variable attribures =20 name =3D MyEfiVar, guid =3D DRIVER_SAMPLE_FORMSET_GUID; =20 // + // Define a Buffer Storage (EFI_IFR_VARSTORE) + // + efivarstore MY_EFI_BITS_VARSTORE_DATA, // This is the data structu= re type + attribute =3D EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLAT= ILE, // EFI variable attribures + name =3D MyEfiBitVar, // Define referenced name= in vfr + guid =3D DRIVER_SAMPLE_FORMSET_GUID; // GUID of this buffer stora= ge + + efivarstore MY_EFI_UNION_DATA, + attribute =3D EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLAT= ILE, // EFI variable attribures + name =3D MyEfiUnionVar, + guid =3D DRIVER_SAMPLE_FORMSET_GUID; + + // // Define a Name/Value Storage (EFI_IFR_VARSTORE_NAME_VALUE) // namevaluevarstore MyNameValueVar, // Define storage refer= ence name in vfr name =3D STRING_TOKEN(STR_NAME_VALUE_VAR_NAME0), // Define Name list o= f this storage, refer it by MyNameValueVar[0] name =3D STRING_TOKEN(STR_NAME_VALUE_VAR_NAME1), // Define Name list o= f this storage, refer it by MyNameValueVar[1] @@ -516,10 +529,13 @@ formset data.Field8 =3D 0x21,=20 data.Field16 =3D 0x2121, data.OrderedList[0] =3D 0x21, =20 endguidop; =20 + goto 7, + prompt =3D STRING_TOKEN(STR_GOTO_FORM7), + help =3D STRING_TOKEN(STR_GOTO_FORM7_HELP); =20 endform; =20 suppressif ideqval MyIfrNVData.BootOrderLarge =3D=3D 0; form formid =3D 2, // SecondSetupPage, @@ -778,6 +794,177 @@ formset // label LABEL_END; =20 endform; =20 + + form formid =3D 7, // Form to show the question refer to unio= n and bit Varstore + title =3D STRING_TOKEN(STR_FORM7_TITLE); + + subtitle text =3D STRING_TOKEN(STR_NEST_BIT_EFI_VARSTORE); + + checkbox varid =3D MyEfiBitVar.BitsData.MyBits4, + prompt =3D STRING_TOKEN(STR_BIT_NEST_CHECK_BOX_PROMPT), + help =3D STRING_TOKEN(STR_BIT_NEST_CHECK_BOX_HELP), + flags =3D CHECKBOX_DEFAULT, + endcheckbox; + + oneof varid =3D MyEfiBitVar.BitsData.MyBits3, + prompt =3D STRING_TOKEN(STR_ONE_OF_BIT_NEST_PROMPT), + help =3D STRING_TOKEN(STR_ONE_OF_BIT_NEST_HELP), + option text =3D STRING_TOKEN(STR_BOOT_ORDER1), value =3D 0, flags = =3D MANUFACTURING; + option text =3D STRING_TOKEN(STR_BOOT_ORDER2), value =3D 1, flags = =3D DEFAULT; + endoneof; + + numeric varid =3D MyEfiBitVar.BitsData.MyBits5, + prompt =3D STRING_TOKEN(STR_BIT_NEST_NUMERIC_PROMPT), + help =3D STRING_TOKEN(STR_BIT_NEST_NUMERIC_HELP), + minimum =3D 0, + maximum =3D 7, + step =3D 1, + default =3D 2, defaultstore =3D MyStandardDefault, // This= is standard default value + default =3D 3, defaultstore =3D MyManufactureDefault, // This= is manufacture default value + endnumeric; + + numeric varid =3D MyEfiBitVar.BitsData.MyBits6, + questionid =3D 0x6666, + prompt =3D STRING_TOKEN(STR_BIT_NEST_NUMERIC_PROMPT), + help =3D STRING_TOKEN(STR_BIT_NEST_NUMERIC_DEFAULT_HELP), + flags =3D DISPLAY_UINT_HEX | INTERACTIVE, + minimum =3D 0, + maximum =3D 15, + endnumeric; + + oneof varid =3D MyEfiBitVar.BitsData.Field16, + prompt =3D STRING_TOKEN(BYTE_QUESTION_NEST_BIT_PROMPT), + help =3D STRING_TOKEN(BYTE_QUESTION_NEST_BIT_HELP), + option text =3D STRING_TOKEN(STR_BOOT_ORDER1), value =3D 0, flags = =3D MANUFACTURING; + option text =3D STRING_TOKEN(STR_BOOT_ORDER2), value =3D 1, flags = =3D DEFAULT; + endoneof; + + subtitle text =3D STRING_TOKEN(STR_SUBTITLE_TEXT2); + subtitle text =3D STRING_TOKEN(STR_BIT_EFI_VARSTORE); + + checkbox varid =3D MyEfiBitVar.MyBits9, + prompt =3D STRING_TOKEN(STR_BIT_CHECK_BOX_PROMPT), + help =3D STRING_TOKEN(STR_BIT_CHECK_BOX_HELP), + flags =3D CHECKBOX_DEFAULT, + endcheckbox; + + oneof varid =3D MyEfiBitVar.MyBits8, + prompt =3D STRING_TOKEN(STR_ONE_OF_BIT_PROMPT), + help =3D STRING_TOKEN(STR_ONE_OF_BIT_HELP), + option text =3D STRING_TOKEN(STR_BOOT_ORDER1), value =3D 0, flags = =3D MANUFACTURING; + option text =3D STRING_TOKEN(STR_BOOT_ORDER2), value =3D 1, flags = =3D DEFAULT; + endoneof; + + numeric varid =3D MyEfiBitVar.MyBits7, + prompt =3D STRING_TOKEN(STR_BIT_NUMERIC_PROMPT), + help =3D STRING_TOKEN(STR_BIT_NUMERIC_HELP), + minimum =3D 0, + maximum =3D 7, + step =3D 0, + default =3D 4, defaultstore =3D MyStandardDefault, // This= is standard default value + default =3D 5, defaultstore =3D MyManufactureDefault, // This= is manufacture default value + endnumeric; + + oneof varid =3D MyEfiBitVar.Field16, + prompt =3D STRING_TOKEN(BYTE_QUESTION_BIT_PROMPT), + help =3D STRING_TOKEN(BYTE_QUESTION_BIT_HELP), + option text =3D STRING_TOKEN(STR_BOOT_ORDER1), value =3D 0, flags = =3D MANUFACTURING; + option text =3D STRING_TOKEN(STR_BOOT_ORDER2), value =3D 1, flags = =3D DEFAULT; + endoneof; + + subtitle text =3D STRING_TOKEN(STR_SUBTITLE_TEXT2); + subtitle text =3D STRING_TOKEN(STR_NEST_BIT_VARSTORE); + checkbox varid =3D MyIfrNVData.MyBitData.MyBits4, + prompt =3D STRING_TOKEN(STR_BIT_NEST_CHECK_BOX_PROMPT), + help =3D STRING_TOKEN(STR_BIT_NEST_CHECK_BOX_HELP), + flags =3D CHECKBOX_DEFAULT, + endcheckbox; + + oneof varid =3D MyIfrNVData.MyBitData.MyBits3, + prompt =3D STRING_TOKEN(STR_ONE_OF_BIT_NEST_PROMPT), + help =3D STRING_TOKEN(STR_ONE_OF_BIT_NEST_HELP), + option text =3D STRING_TOKEN(STR_BOOT_ORDER1), value =3D 0, flags = =3D MANUFACTURING; + option text =3D STRING_TOKEN(STR_BOOT_ORDER2), value =3D 1, flags = =3D DEFAULT; + endoneof; + + numeric varid =3D MyIfrNVData.MyBitData.MyBits5, + prompt =3D STRING_TOKEN(STR_BIT_NEST_NUMERIC_PROMPT), + help =3D STRING_TOKEN(STR_BIT_NEST_NUMERIC_HELP), + minimum =3D 0, + maximum =3D 7, + step =3D 0, + default =3D 6, defaultstore =3D MyStandardDefault, // This= is standard default value + default =3D 7, defaultstore =3D MyManufactureDefault, // This= is manufacture default value + endnumeric; + + numeric varid =3D MyIfrNVData.MyBitData.MyBits6, + prompt =3D STRING_TOKEN(STR_BIT_NEST_NUMERIC_PROMPT), + help =3D STRING_TOKEN(STR_BIT_NEST_NUMERIC_HELP), + minimum =3D 0, + maximum =3D 15, + step =3D 0, + default =3D 10, defaultstore =3D MyStandardDefault, // Thi= s is standard default value + default =3D 11, defaultstore =3D MyManufactureDefault, // Thi= s is manufacture default value + endnumeric; + + oneof varid =3D MyIfrNVData.MyBitData.Field16, + prompt =3D STRING_TOKEN(BYTE_QUESTION_NEST_BIT_PROMPT), + help =3D STRING_TOKEN(BYTE_QUESTION_NEST_BIT_HELP), + option text =3D STRING_TOKEN(STR_BOOT_ORDER1), value =3D 0, flags = =3D MANUFACTURING; + option text =3D STRING_TOKEN(STR_BOOT_ORDER2), value =3D 1, flags = =3D DEFAULT; + endoneof; + + subtitle text =3D STRING_TOKEN(STR_SUBTITLE_TEXT2); + subtitle text =3D STRING_TOKEN(STR_BIT_VARSTORE); + + checkbox varid =3D MyIfrNVData.Bits3, + prompt =3D STRING_TOKEN(STR_BIT_CHECK_BOX_PROMPT), + help =3D STRING_TOKEN(STR_BIT_CHECK_BOX_HELP), + flags =3D CHECKBOX_DEFAULT, + endcheckbox; + + oneof varid =3D MyIfrNVData.Bits2, + prompt =3D STRING_TOKEN(STR_ONE_OF_BIT_PROMPT), + help =3D STRING_TOKEN(STR_ONE_OF_BIT_HELP), + option text =3D STRING_TOKEN(STR_BOOT_ORDER1), value =3D 0, flags = =3D MANUFACTURING; + option text =3D STRING_TOKEN(STR_BOOT_ORDER2), value =3D 1, flags = =3D DEFAULT; + endoneof; + + numeric varid =3D MyIfrNVData.Bits5, + prompt =3D STRING_TOKEN(STR_BIT_NUMERIC_PROMPT), + help =3D STRING_TOKEN(STR_BIT_NUMERIC_HELP), + minimum =3D 0, + maximum =3D 20, + step =3D 0, + default =3D 16, defaultstore =3D MyStandardDefault, // Thi= s is standard default value + default =3D 17, defaultstore =3D MyManufactureDefault, // Thi= s is manufacture default value + endnumeric; + + subtitle text =3D STRING_TOKEN(STR_SUBTITLE_TEXT2); + subtitle text =3D STRING_TOKEN(STR_UNION_EFI_VARSTORE); + + numeric varid =3D MyEfiUnionVar.Data2.Field8, + prompt =3D STRING_TOKEN(STR_EFI_UNION_NUMERIC_PROMPT), + help =3D STRING_TOKEN(STR_EFI_UNION_NUMERIC_HELP), + minimum =3D 0, + maximum =3D 20, + step =3D 0, + default =3D 7, defaultstore =3D MyStandardDefault, // This= is standard default value + default =3D 8, defaultstore =3D MyManufactureDefault, // This= is manufacture default value + endnumeric; + + numeric varid =3D MyIfrNVData.MyUnionData.Data1.MyBits7, + prompt =3D STRING_TOKEN(STR_BUF_UNION_NUMERIC_PROMPT), + help =3D STRING_TOKEN(STR_BUF_UNION_NUMERIC_HELP), + minimum =3D 0, + maximum =3D 20, + step =3D 0, + default =3D 7, defaultstore =3D MyStandardDefault, // This= is standard default value + default =3D 8, defaultstore =3D MyManufactureDefault, // This= is manufacture default value + endnumeric; + + endform; + endformset; diff --git a/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni b/MdeMod= ulePkg/Universal/DriverSampleDxe/VfrStrings.uni index 6a268d1..67134f6 100644 --- a/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni +++ b/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni @@ -271,10 +271,71 @@ #language fr-FR "Sele= ct it to invoke Hii Popup Protocol" #string STR_POPUP_TEST_HELP #language en-US "Sele= ct this question will pop up a message box, then user can decide whether ex= it curret form or not" #language fr-FR "Sele= ct this question will pop up a message box, then user can decide whether ex= it curret form or not" #string STR_POPUP_STRING #language en-US "Are = you sure to exit current form?" #language fr-FR "Are = you sure to exit current form?" +// +// Form 7 to show Questions which refer to Union Bit varstore +// +#string STR_FORM7_TITLE #language en-US "Form to Show Quest= ions with union/bit VarStore" + #language fr-FR "Form to Show Quest= ions with union/bit VarStore" +#string STR_GOTO_FORM7 #language en-US "Go to Form 7" + #language fr-FR "Go to Form 7" +#string STR_GOTO_FORM7_HELP #language en-US "This Form is to Sh= ow Questions with union/bit VarStore" + #language fr-FR "This Form is to Sh= ow Questions with union/bit VarStore" +#string STR_BIT_NEST_CHECK_BOX_PROMPT #language en-US "NEST_BIT check box" + #language fr-FR "NEST_BIT check box" +#string STR_BIT_NEST_CHECK_BOX_HELP #language en-US "The check box refe= r to nested bit field" + #language fr-FR "The check box refe= r to nested bit field" +#string STR_ONE_OF_BIT_NEST_PROMPT #language en-US "NEST_BIT one-of" + #language fr-FR "NEST_BIT one-of" +#string STR_ONE_OF_BIT_NEST_HELP #language en-US "The oneof refer to= nested bit field" + #language fr-FR "The oneof refer to= nested bit field" +#string STR_BIT_NEST_NUMERIC_PROMPT #language en-US "NEST_BIT numeric" + #language fr-FR "NEST_BIT numeric" +#string STR_BIT_NEST_NUMERIC_HELP #language en-US "The numeric refer = to nested bit field" + #language fr-FR "The numeric refer = to nested bit field" +#string BYTE_QUESTION_NEST_BIT_PROMPT #language en-US "Use byte field in = NEST_BIT structure" + #language fr-FR "Use byte field in = NEST_BIT structure" +#string BYTE_QUESTION_NEST_BIT_HELP #language en-US "The Question refer= to byte field in NEST_BIT structure" + #language fr-FR "The Question refer= to byte field in NEST_BIT structure" +#string STR_BIT_NEST_NUMERIC_DEFAULT_HELP #language en-US "NEST_BIT nume= ric, default value form callback function" + #language fr-FR "NEST_BIT nume= ric, default value form callback function" +#string STR_NEST_BIT_EFI_VARSTORE #language en-US "Nested BIT fields = in efivarstore" + #language fr-FR "Nested BIT fields = in efivarstore" +#string STR_BIT_EFI_VARSTORE #language en-US "BIT fields in efiv= arstore" + #language fr-FR "BIT fields in efiv= arstore" +#string STR_NEST_BIT_VARSTORE #language en-US "Nested BIT fields = in bufferstore" + #language fr-FR "Nested BIT fields = in bufferstore" +#string STR_BIT_VARSTORE #language en-US "BIT fields in vars= tore" + #language fr-FR "BIT fields in vars= tore" +#string STR_UNION_EFI_VARSTORE #language en-US "Union efivarstore" + #language fr-FR "Union efivarstore" +#string STR_BIT_CHECK_BOX_PROMPT #language en-US "BIT check box" + #language fr-FR "BIT check box" +#string STR_BIT_CHECK_BOX_HELP #language en-US "The check box refe= r to bit field" + #language fr-FR "The check box refe= r to bit field" +#string STR_ONE_OF_BIT_PROMPT #language en-US "BIT one-of" + #language fr-FR "BIT one-of" +#string STR_ONE_OF_BIT_HELP #language en-US "The one-of refer t= o bit field" + #language fr-FR "The one-of refer t= o bit field" +#string STR_BIT_NUMERIC_PROMPT #language en-US "BIT numeric" + #language fr-FR "BIT numeric" +#string STR_BIT_NUMERIC_HELP #language en-US "The numeric refer = to bit field" + #language fr-FR "The numeric refer = to bit field" +#string BYTE_QUESTION_BIT_PROMPT #language en-US "Use byte field in = BIT structure" + #language fr-FR "Use byte field in = BIT structure" +#string BYTE_QUESTION_BIT_HELP #language en-US "The question refer= to byte field in BIT structure" + #language fr-FR "The question refer= to byte field in BIT structure" +#string STR_EFI_UNION_NUMERIC_PROMPT #language en-US "UNION EfiVarStore = numeric" + #language fr-FR "UNION EfiVarStore = numeric" +#string STR_EFI_UNION_NUMERIC_HELP #language en-US "Question refer to = UNION type efivastore" + #language fr-FR "Question refer to = UNION type efivastore" +#string STR_BUF_UNION_NUMERIC_PROMPT #language en-US "UNION field numeri= c" + #language fr-FR "UNION field numeri= c" +#string STR_BUF_UNION_NUMERIC_HELP #language en-US "Question refer to = UNION field in buffervastore" + #language fr-FR "Question refer to = UNION field in buffervastore" // Boot Order #string STR_BOOT_TITLE #language en-US "Boot" #string STR_BOOT_OPTIONS #language en-US "Boot Order" #string STR_BOOT_OPTION1 #language en-US "IDE HDD" #string STR_BOOT_OPTION2 #language en-US "ATAPI CD" --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel