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
# @Prompt Boottime reserved NV variable space size.\r
gEfiMdeModulePkgTokenSpaceGuid.PcdBoottimeReservedNvVariableSpaceSize|0x00|UINT32|0x30000007\r
\r
+ ## Reclaim variable space at EndOfDxe.<BR><BR>\r
+ # The value is FALSE as default for compatibility that variable driver tries to reclaim variable space at ReadyToBoot event.<BR>\r
+ # If the value is set to TRUE, variable driver tries to reclaim variable space at EndOfDxe event.<BR>\r
+ # @Prompt Reclaim variable space at EndOfDxe.\r
+ gEfiMdeModulePkgTokenSpaceGuid.PcdReclaimVariableSpaceAtEndOfDxe|FALSE|BOOLEAN|0x30000008\r
+\r
## The size of volatile buffer. This buffer is used to store VOLATILE attribute variables.\r
# @Prompt Variable storage size.\r
gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0x10000|UINT32|0x30000005\r
EFI_STATUS Status;\r
UINTN RemainingCommonRuntimeVariableSpace;\r
UINTN RemainingHwErrVariableSpace;\r
+ STATIC BOOLEAN Reclaimed;\r
+\r
+ //\r
+ // This function will be called only once at EndOfDxe or ReadyToBoot event.\r
+ //\r
+ if (Reclaimed) {\r
+ return;\r
+ }\r
+ Reclaimed = TRUE;\r
\r
Status = EFI_SUCCESS;\r
\r
// The initialization for variable quota.\r
//\r
InitializeVariableQuota ();\r
+ if (PcdGetBool (PcdReclaimVariableSpaceAtEndOfDxe)) {\r
+ ReclaimForOS ();\r
+ }\r
}\r
\r
/**\r
gEfiMdeModulePkgTokenSpaceGuid.PcdHwErrStorageSize ## CONSUMES\r
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxUserNvVariableSpaceSize ## CONSUMES\r
gEfiMdeModulePkgTokenSpaceGuid.PcdBoottimeReservedNvVariableSpaceSize ## CONSUMES\r
- \r
+ gEfiMdeModulePkgTokenSpaceGuid.PcdReclaimVariableSpaceAtEndOfDxe ## CONSUMES\r
+\r
[FeaturePcd]\r
gEfiMdeModulePkgTokenSpaceGuid.PcdVariableCollectStatistics ## CONSUMES # statistic the information of variable.\r
gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangDeprecate ## CONSUMES\r
// The initialization for variable quota.\r
//\r
InitializeVariableQuota ();\r
+ if (PcdGetBool (PcdReclaimVariableSpaceAtEndOfDxe)) {\r
+ ReclaimForOS ();\r
+ }\r
return EFI_SUCCESS;\r
}\r
\r
gEfiMdeModulePkgTokenSpaceGuid.PcdHwErrStorageSize ## CONSUMES\r
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxUserNvVariableSpaceSize ## CONSUMES\r
gEfiMdeModulePkgTokenSpaceGuid.PcdBoottimeReservedNvVariableSpaceSize ## CONSUMES\r
- \r
+ gEfiMdeModulePkgTokenSpaceGuid.PcdReclaimVariableSpaceAtEndOfDxe ## CONSUMES\r
+\r
[FeaturePcd]\r
gEfiMdeModulePkgTokenSpaceGuid.PcdVariableCollectStatistics ## CONSUMES # statistic the information of variable.\r
gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangDeprecate ## CONSUMES\r