MdeModulePkg Variable: Introduce PcdReclaimVariableSpaceAtEndOfDxe

for trying to reclaim variable space at EndOfDxe.

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@16687 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Star Zeng 2015-02-02 09:30:34 +00:00 committed by lzeng14
parent db3c5441b1
commit 0fb5e515f2
7 changed files with 25 additions and 2 deletions

View File

@ -738,6 +738,12 @@
# @Prompt Boottime reserved NV variable space size.
gEfiMdeModulePkgTokenSpaceGuid.PcdBoottimeReservedNvVariableSpaceSize|0x00|UINT32|0x30000007
## Reclaim variable space at EndOfDxe.<BR><BR>
# The value is FALSE as default for compatibility that variable driver tries to reclaim variable space at ReadyToBoot event.<BR>
# If the value is set to TRUE, variable driver tries to reclaim variable space at EndOfDxe event.<BR>
# @Prompt Reclaim variable space at EndOfDxe.
gEfiMdeModulePkgTokenSpaceGuid.PcdReclaimVariableSpaceAtEndOfDxe|FALSE|BOOLEAN|0x30000008
## The size of volatile buffer. This buffer is used to store VOLATILE attribute variables.
# @Prompt Variable storage size.
gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0x10000|UINT32|0x30000005

Binary file not shown.

View File

@ -3124,6 +3124,15 @@ ReclaimForOS(
EFI_STATUS Status;
UINTN RemainingCommonRuntimeVariableSpace;
UINTN RemainingHwErrVariableSpace;
STATIC BOOLEAN Reclaimed;
//
// This function will be called only once at EndOfDxe or ReadyToBoot event.
//
if (Reclaimed) {
return;
}
Reclaimed = TRUE;
Status = EFI_SUCCESS;

View File

@ -313,6 +313,9 @@ OnEndOfDxe (
// The initialization for variable quota.
//
InitializeVariableQuota ();
if (PcdGetBool (PcdReclaimVariableSpaceAtEndOfDxe)) {
ReclaimForOS ();
}
}
/**

View File

@ -103,6 +103,7 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdHwErrStorageSize ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxUserNvVariableSpaceSize ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBoottimeReservedNvVariableSpaceSize ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdReclaimVariableSpaceAtEndOfDxe ## CONSUMES
[FeaturePcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdVariableCollectStatistics ## CONSUMES # statistic the information of variable.

View File

@ -832,6 +832,9 @@ SmmEndOfDxeCallback (
// The initialization for variable quota.
//
InitializeVariableQuota ();
if (PcdGetBool (PcdReclaimVariableSpaceAtEndOfDxe)) {
ReclaimForOS ();
}
return EFI_SUCCESS;
}

View File

@ -105,6 +105,7 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdHwErrStorageSize ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxUserNvVariableSpaceSize ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdBoottimeReservedNvVariableSpaceSize ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdReclaimVariableSpaceAtEndOfDxe ## CONSUMES
[FeaturePcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdVariableCollectStatistics ## CONSUMES # statistic the information of variable.