summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/DriverSampleDxe
diff options
context:
space:
mode:
authorEric Dong <eric.dong@intel.com>2013-07-02 07:53:35 +0000
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2013-07-02 07:53:35 +0000
commit82e8c1380fe8d9d94b7585242f1e159bdbbeb778 (patch)
treea870a96103ef2fb7647b6180d905233b1f3072c5 /MdeModulePkg/Universal/DriverSampleDxe
parent3aee9940c98cff4814c1ec9bddbcfd8528211c58 (diff)
downloadedk2-platforms-82e8c1380fe8d9d94b7585242f1e159bdbbeb778.tar.xz
Update HiiDataBase and UefiHiiLib to support Name/Value varstore.
Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14451 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/DriverSampleDxe')
-rw-r--r--MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c10
-rw-r--r--MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr4
2 files changed, 14 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
index 3ae55de2b0..cb2cbe7932 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
+++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
@@ -1794,6 +1794,7 @@ DriverSampleInit (
DRIVER_SAMPLE_CONFIGURATION *Configuration;
BOOLEAN ActionFlag;
EFI_STRING ConfigRequestHdr;
+ EFI_STRING NameRequestHdr;
MY_EFI_VARSTORE_DATA *VarStoreConfig;
EFI_INPUT_KEY HotKey;
EFI_FORM_BROWSER_EXTENSION_PROTOCOL *FormBrowserEx;
@@ -1973,6 +1974,9 @@ DriverSampleInit (
ConfigRequestHdr = HiiConstructConfigHdr (&gDriverSampleFormSetGuid, VariableName, DriverHandle[0]);
ASSERT (ConfigRequestHdr != NULL);
+ NameRequestHdr = HiiConstructConfigHdr (&gDriverSampleFormSetGuid, NULL, DriverHandle[0]);
+ ASSERT (NameRequestHdr != NULL);
+
BufferSize = sizeof (DRIVER_SAMPLE_CONFIGURATION);
Status = gRT->GetVariable (VariableName, &gDriverSampleFormSetGuid, NULL, &BufferSize, Configuration);
if (EFI_ERROR (Status)) {
@@ -1991,12 +1995,18 @@ DriverSampleInit (
// EFI variable for NV config doesn't exit, we should build this variable
// based on default values stored in IFR
//
+ ActionFlag = HiiSetToDefaults (NameRequestHdr, EFI_HII_DEFAULT_CLASS_STANDARD);
+ ASSERT (ActionFlag);
+
ActionFlag = HiiSetToDefaults (ConfigRequestHdr, EFI_HII_DEFAULT_CLASS_STANDARD);
ASSERT (ActionFlag);
} else {
//
// EFI variable does exist and Validate Current Setting
//
+ ActionFlag = HiiValidateSettings (NameRequestHdr);
+ ASSERT (ActionFlag);
+
ActionFlag = HiiValidateSettings (ConfigRequestHdr);
ASSERT (ActionFlag);
}
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr b/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr
index 60e9cf2a34..0a77e408fa 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr
+++ b/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr
@@ -359,6 +359,8 @@ formset
maximum = 0xff,
step = 0,
locked,
+ default = 16, defaultstore = MyStandardDefault, // This is standard default value
+ default = 17, defaultstore = MyManufactureDefault, // This is manufacture default value
endnumeric;
numeric varid = MyNameValueVar[1], // This numeric take NameValueVar1 as storage
@@ -368,6 +370,8 @@ formset
minimum = 0,
maximum = 0xffff,
step = 0,
+ default = 18, defaultstore = MyStandardDefault, // This is standard default value
+ default = 19, defaultstore = MyManufactureDefault, // This is manufacture default value
endnumeric;
//