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
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
@@ -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;
|
||||
|
||||
//
|
||||
|
Reference in New Issue
Block a user