mirror of https://github.com/acidanthera/audk.git
Fix a bug. FindVariable now search volatile variable first (previously NV variable first) for performance reason. Therefore, RuntimeServiceGetNextVariableName is updated based on this change.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4056 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
f8580e260c
commit
36873a6195
|
@ -737,6 +737,8 @@ Returns:
|
||||||
|
|
||||||
//
|
//
|
||||||
// 0: Volatile, 1: Non-Volatile
|
// 0: Volatile, 1: Non-Volatile
|
||||||
|
// The index and attributes mapping must be kept in this order as RuntimeServiceGetNextVariableName
|
||||||
|
// make use of this mapping to implement search algorithme.
|
||||||
//
|
//
|
||||||
VariableStoreHeader[0] = (VARIABLE_STORE_HEADER *) ((UINTN) mVariableModuleGlobal->VariableGlobal.VolatileVariableBase);
|
VariableStoreHeader[0] = (VARIABLE_STORE_HEADER *) ((UINTN) mVariableModuleGlobal->VariableGlobal.VolatileVariableBase);
|
||||||
VariableStoreHeader[1] = (VARIABLE_STORE_HEADER *) ((UINTN) mVariableModuleGlobal->VariableGlobal.NonVolatileVariableBase);
|
VariableStoreHeader[1] = (VARIABLE_STORE_HEADER *) ((UINTN) mVariableModuleGlobal->VariableGlobal.NonVolatileVariableBase);
|
||||||
|
@ -933,9 +935,9 @@ RuntimeServiceGetNextVariableName (
|
||||||
//
|
//
|
||||||
if (Variable.CurrPtr >= Variable.EndPtr || Variable.CurrPtr == NULL) {
|
if (Variable.CurrPtr >= Variable.EndPtr || Variable.CurrPtr == NULL) {
|
||||||
Variable.Volatile = (BOOLEAN) (Variable.Volatile ^ ((BOOLEAN) 0x1));
|
Variable.Volatile = (BOOLEAN) (Variable.Volatile ^ ((BOOLEAN) 0x1));
|
||||||
if (Variable.Volatile) {
|
if (!Variable.Volatile) {
|
||||||
Variable.StartPtr = (VARIABLE_HEADER *) ((UINTN) (mVariableModuleGlobal->VariableGlobal.VolatileVariableBase + sizeof (VARIABLE_STORE_HEADER)));
|
Variable.StartPtr = (VARIABLE_HEADER *) ((UINTN) (mVariableModuleGlobal->VariableGlobal.NonVolatileVariableBase + sizeof (VARIABLE_STORE_HEADER)));
|
||||||
Variable.EndPtr = (VARIABLE_HEADER *) GetEndPointer ((VARIABLE_STORE_HEADER *) ((UINTN) mVariableModuleGlobal->VariableGlobal.VolatileVariableBase));
|
Variable.EndPtr = (VARIABLE_HEADER *) GetEndPointer ((VARIABLE_STORE_HEADER *) ((UINTN) mVariableModuleGlobal->VariableGlobal.NonVolatileVariableBase));
|
||||||
} else {
|
} else {
|
||||||
Status = EFI_NOT_FOUND;
|
Status = EFI_NOT_FOUND;
|
||||||
goto Done;
|
goto Done;
|
||||||
|
|
Loading…
Reference in New Issue