MdeModulePkg and SecurityPkg Variable: Enhance code to use the new variable data instead of old variable data when variable reclaim.

It can fix the potential failure to return EFI_OUT_OF_RESOURCES of the second variable set of large variable.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14822 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Star Zeng
2013-11-04 03:13:54 +00:00
committed by lzeng14
parent d1226e25d1
commit 7baf3c69c5
4 changed files with 191 additions and 195 deletions

View File

@@ -402,11 +402,12 @@ VariableCommonInitialize (
@param[in] IsVolatile The variable store is volatile or not;
if it is non-volatile, need FTW.
@param[in, out] UpdatingPtrTrack Pointer to updating variable pointer track structure.
@param[in] NewVariable Pointer to new variable.
@param[in] NewVariableSize New variable size.
@param[in] ReclaimPubKeyStore Reclaim for public key database or not.
@param[in] ReclaimAnyway If TRUE, do reclaim anyway.
@return EFI_SUCCESS Reclaim operation has finished successfully.
@return EFI_OUT_OF_RESOURCES No enough memory resources.
@return EFI_OUT_OF_RESOURCES No enough memory resources or variable space.
@return EFI_DEVICE_ERROR The public key database doesn't exist.
@return Others Unexpect error happened during reclaim operation.
@@ -417,8 +418,9 @@ Reclaim (
OUT UINTN *LastVariableOffset,
IN BOOLEAN IsVolatile,
IN OUT VARIABLE_POINTER_TRACK *UpdatingPtrTrack,
IN BOOLEAN ReclaimPubKeyStore,
IN BOOLEAN ReclaimAnyway
IN VARIABLE_HEADER *NewVariable,
IN UINTN NewVariableSize,
IN BOOLEAN ReclaimPubKeyStore
);
/**