diff options
author | qwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-10-09 05:42:37 +0000 |
---|---|---|
committer | qwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-10-09 05:42:37 +0000 |
commit | 36873a61950d71596206567e58a0319e0813d05d (patch) | |
tree | 4223cd454829d93715aba6f0136011fc3c55970b /MdeModulePkg/Universal | |
parent | f8580e260c206d9299aec8c15cf411c6ceb0c6d0 (diff) | |
download | edk2-platforms-36873a61950d71596206567e58a0319e0813d05d.tar.xz |
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
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r-- | MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c index 11a36ba826..34bc4a8e15 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c @@ -737,6 +737,8 @@ Returns: //
// 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[1] = (VARIABLE_STORE_HEADER *) ((UINTN) mVariableModuleGlobal->VariableGlobal.NonVolatileVariableBase);
@@ -933,9 +935,9 @@ RuntimeServiceGetNextVariableName ( //
if (Variable.CurrPtr >= Variable.EndPtr || Variable.CurrPtr == NULL) {
Variable.Volatile = (BOOLEAN) (Variable.Volatile ^ ((BOOLEAN) 0x1));
- if (Variable.Volatile) {
- Variable.StartPtr = (VARIABLE_HEADER *) ((UINTN) (mVariableModuleGlobal->VariableGlobal.VolatileVariableBase + sizeof (VARIABLE_STORE_HEADER)));
- Variable.EndPtr = (VARIABLE_HEADER *) GetEndPointer ((VARIABLE_STORE_HEADER *) ((UINTN) mVariableModuleGlobal->VariableGlobal.VolatileVariableBase));
+ if (!Variable.Volatile) {
+ Variable.StartPtr = (VARIABLE_HEADER *) ((UINTN) (mVariableModuleGlobal->VariableGlobal.NonVolatileVariableBase + sizeof (VARIABLE_STORE_HEADER)));
+ Variable.EndPtr = (VARIABLE_HEADER *) GetEndPointer ((VARIABLE_STORE_HEADER *) ((UINTN) mVariableModuleGlobal->VariableGlobal.NonVolatileVariableBase));
} else {
Status = EFI_NOT_FOUND;
goto Done;
|