diff options
author | Eric Dong <eric.dong@intel.com> | 2013-12-17 05:00:17 +0000 |
---|---|---|
committer | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-12-17 05:00:17 +0000 |
commit | 98c4caa1e9504f87bda712f4df03c6817f869658 (patch) | |
tree | 60e87ea8a8d7162be4fd3ab3b0793684078cf829 /MdeModulePkg | |
parent | 4636295f460da20b7c1e5db1283262167193bf77 (diff) | |
download | edk2-platforms-98c4caa1e9504f87bda712f4df03c6817f869658.tar.xz |
Get entire variable data for efi varstore at first time.
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@14992 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c index 66238e055f..c7c7f9ae43 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c @@ -4085,6 +4085,10 @@ LoadStorage ( EFI_STRING Progress;
EFI_STRING Result;
CHAR16 *StrPtr;
+ EFI_STRING ConfigRequest;
+ UINTN StrLen;
+
+ ConfigRequest = NULL;
switch (Storage->BrowserStorage->Type) {
case EFI_HII_VARSTORE_EFI_VARIABLE:
@@ -4095,6 +4099,21 @@ LoadStorage ( ConfigRequestAdjust(Storage);
return;
}
+
+ //
+ // Create the config request string to get all fields for this storage.
+ // Allocate and fill a buffer large enough to hold the <ConfigHdr> template
+ // followed by "&OFFSET=0&WIDTH=WWWW"followed by a Null-terminator
+ //
+ StrLen = StrSize (Storage->BrowserStorage->ConfigHdr) + 20 * sizeof (CHAR16);
+ ConfigRequest = AllocateZeroPool (StrLen);
+ ASSERT (ConfigRequest != NULL);
+ UnicodeSPrint (
+ ConfigRequest,
+ StrLen,
+ L"%s&OFFSET=0&WIDTH=%04x",
+ Storage->BrowserStorage->ConfigHdr,
+ Storage->BrowserStorage->Size);
break;
case EFI_HII_VARSTORE_BUFFER:
@@ -4106,6 +4125,7 @@ LoadStorage ( return;
}
Storage->BrowserStorage->Initialized = TRUE;
+ ConfigRequest = Storage->ConfigRequest;
break;
default:
@@ -4117,7 +4137,7 @@ LoadStorage ( //
Status = mHiiConfigRouting->ExtractConfig (
mHiiConfigRouting,
- Storage->ConfigRequest,
+ ConfigRequest,
&Progress,
&Result
);
@@ -4146,6 +4166,12 @@ LoadStorage ( // Input NULL for ConfigRequest field means sync all fields from editbuffer to buffer.
//
SynchronizeStorage(FormSet, Storage->BrowserStorage, NULL, TRUE);
+
+ if (Storage->BrowserStorage->Type == EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER) {
+ if (ConfigRequest != NULL) {
+ FreePool (ConfigRequest);
+ }
+ }
}
/**
|