MdeModulePkg/Variable: Parameterize GetNextVariableInternal () stores
The majority of logic related to GetNextVariableName () is currently implemented in VariableServiceGetNextVariableInternal (). The list of variable stores to search for the given variable name and variable GUID is defined in the function body. This change adds a new parameter so that the caller must pass in the list of variable stores to be used in the variable search. Cc: Dandan Bi <dandan.bi@intel.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Eric Dong <eric.dong@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
This commit is contained in:
@@ -2358,6 +2358,7 @@ VariableServiceGetNextVariableName (
|
||||
UINTN MaxLen;
|
||||
UINTN VarNameSize;
|
||||
VARIABLE_HEADER *VariablePtr;
|
||||
VARIABLE_STORE_HEADER *VariableStoreHeader[VariableStoreTypeMax];
|
||||
|
||||
if (VariableNameSize == NULL || VariableName == NULL || VendorGuid == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
@@ -2377,7 +2378,16 @@ VariableServiceGetNextVariableName (
|
||||
|
||||
AcquireLockOnlyAtBootTime(&mVariableModuleGlobal->VariableGlobal.VariableServicesLock);
|
||||
|
||||
Status = VariableServiceGetNextVariableInternal (VariableName, VendorGuid, &VariablePtr);
|
||||
//
|
||||
// 0: Volatile, 1: HOB, 2: Non-Volatile.
|
||||
// The index and attributes mapping must be kept in this order as FindVariable
|
||||
// makes use of this mapping to implement search algorithm.
|
||||
//
|
||||
VariableStoreHeader[VariableStoreTypeVolatile] = (VARIABLE_STORE_HEADER *) (UINTN) mVariableModuleGlobal->VariableGlobal.VolatileVariableBase;
|
||||
VariableStoreHeader[VariableStoreTypeHob] = (VARIABLE_STORE_HEADER *) (UINTN) mVariableModuleGlobal->VariableGlobal.HobVariableBase;
|
||||
VariableStoreHeader[VariableStoreTypeNv] = mNvVariableCache;
|
||||
|
||||
Status = VariableServiceGetNextVariableInternal (VariableName, VendorGuid, VariableStoreHeader, &VariablePtr);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
VarNameSize = NameSizeOfVariable (VariablePtr);
|
||||
ASSERT (VarNameSize != 0);
|
||||
|
Reference in New Issue
Block a user