MdeModulePkg/SetupBrowser: Load storage via GetVariable for EfiVarStore
For EfiVarStore (EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER), it will call ExtractConfig-GetVariable-HiiBlockToConfig-ConfigToBlock when load storage value in LoadStorage function. It's not necessary and costs lots of time to do the conversion between config and block. So now enhance it to call GetVariable directly. Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Eric Dong <eric.dong@intel.com> Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Eric Dong <eric.dong@intel.com>
This commit is contained in:
@@ -5634,6 +5634,15 @@ LoadStorage (
|
|||||||
ConfigRequest = Storage->ConfigRequest;
|
ConfigRequest = Storage->ConfigRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Storage->BrowserStorage->Type == EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER) {
|
||||||
|
//
|
||||||
|
// Call GetVariable directly for EfiVarStore
|
||||||
|
//
|
||||||
|
Status = gRT->GetVariable (Storage->BrowserStorage->Name, &(Storage->BrowserStorage->Guid), NULL, (UINTN *)(&(Storage->BrowserStorage->Size)), Storage->BrowserStorage->EditBuffer);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
ExtractDefault (FormSet, NULL, EFI_HII_DEFAULT_CLASS_STANDARD, FormSetLevel, GetDefaultForStorage, Storage->BrowserStorage, TRUE, TRUE);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
//
|
//
|
||||||
// Request current settings from Configuration Driver
|
// Request current settings from Configuration Driver
|
||||||
//
|
//
|
||||||
@@ -5661,6 +5670,7 @@ LoadStorage (
|
|||||||
Status = ConfigRespToStorage (Storage->BrowserStorage, Result);
|
Status = ConfigRespToStorage (Storage->BrowserStorage, Result);
|
||||||
FreePool (Result);
|
FreePool (Result);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Storage->BrowserStorage->ConfigRequest = AllocateCopyPool (StrSize (Storage->ConfigRequest), Storage->ConfigRequest);
|
Storage->BrowserStorage->ConfigRequest = AllocateCopyPool (StrSize (Storage->ConfigRequest), Storage->ConfigRequest);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user