MdeModulePkg:Remove the usage of PcdEnableVariableRuntimeCache
Remove the usage of PcdEnableVariableRuntimeCache. We can use the existence of gEdkiiVariableRuntimeCacheInfoHobGuid to indicate if variable runtime cache is enabled or not. Signed-off-by: Dun Tan <dun.tan@intel.com>
This commit is contained in:
parent
689f415a49
commit
92974e3d18
|
@ -63,6 +63,7 @@ BOOLEAN *mHobFlushComplete;
|
||||||
EFI_LOCK mVariableServicesLock;
|
EFI_LOCK mVariableServicesLock;
|
||||||
EDKII_VARIABLE_LOCK_PROTOCOL mVariableLock;
|
EDKII_VARIABLE_LOCK_PROTOCOL mVariableLock;
|
||||||
EDKII_VAR_CHECK_PROTOCOL mVarCheck;
|
EDKII_VAR_CHECK_PROTOCOL mVarCheck;
|
||||||
|
BOOLEAN mIsRuntimeCacheEnabled = FALSE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The logic to initialize the VariablePolicy engine is in its own file.
|
The logic to initialize the VariablePolicy engine is in its own file.
|
||||||
|
@ -840,7 +841,7 @@ RuntimeServiceGetVariable (
|
||||||
}
|
}
|
||||||
|
|
||||||
AcquireLockOnlyAtBootTime (&mVariableServicesLock);
|
AcquireLockOnlyAtBootTime (&mVariableServicesLock);
|
||||||
if (FeaturePcdGet (PcdEnableVariableRuntimeCache)) {
|
if (mIsRuntimeCacheEnabled) {
|
||||||
Status = FindVariableInRuntimeCache (VariableName, VendorGuid, Attributes, DataSize, Data);
|
Status = FindVariableInRuntimeCache (VariableName, VendorGuid, Attributes, DataSize, Data);
|
||||||
} else {
|
} else {
|
||||||
Status = FindVariableInSmm (VariableName, VendorGuid, Attributes, DataSize, Data);
|
Status = FindVariableInSmm (VariableName, VendorGuid, Attributes, DataSize, Data);
|
||||||
|
@ -1106,7 +1107,7 @@ RuntimeServiceGetNextVariableName (
|
||||||
}
|
}
|
||||||
|
|
||||||
AcquireLockOnlyAtBootTime (&mVariableServicesLock);
|
AcquireLockOnlyAtBootTime (&mVariableServicesLock);
|
||||||
if (FeaturePcdGet (PcdEnableVariableRuntimeCache)) {
|
if (mIsRuntimeCacheEnabled) {
|
||||||
Status = GetNextVariableNameInRuntimeCache (VariableNameSize, VariableName, VendorGuid);
|
Status = GetNextVariableNameInRuntimeCache (VariableNameSize, VariableName, VendorGuid);
|
||||||
} else {
|
} else {
|
||||||
Status = GetNextVariableNameInSmm (VariableNameSize, VariableName, VendorGuid);
|
Status = GetNextVariableNameInSmm (VariableNameSize, VariableName, VendorGuid);
|
||||||
|
@ -1358,7 +1359,7 @@ OnReadyToBoot (
|
||||||
//
|
//
|
||||||
// Install the system configuration table for variable info data captured
|
// Install the system configuration table for variable info data captured
|
||||||
//
|
//
|
||||||
if (FeaturePcdGet (PcdEnableVariableRuntimeCache) && FeaturePcdGet (PcdVariableCollectStatistics)) {
|
if (mIsRuntimeCacheEnabled && FeaturePcdGet (PcdVariableCollectStatistics)) {
|
||||||
if (mVariableAuthFormat) {
|
if (mVariableAuthFormat) {
|
||||||
gBS->InstallConfigurationTable (&gEfiAuthenticatedVariableGuid, mVariableInfo);
|
gBS->InstallConfigurationTable (&gEfiAuthenticatedVariableGuid, mVariableInfo);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1670,7 +1671,9 @@ SmmVariableReady (
|
||||||
//
|
//
|
||||||
mVariableBufferPhysical = mVariableBuffer;
|
mVariableBufferPhysical = mVariableBuffer;
|
||||||
|
|
||||||
if (FeaturePcdGet (PcdEnableVariableRuntimeCache)) {
|
GuidHob = GetFirstGuidHob (&gEdkiiVariableRuntimeCacheInfoHobGuid);
|
||||||
|
if (GuidHob != NULL) {
|
||||||
|
mIsRuntimeCacheEnabled = TRUE;
|
||||||
DEBUG ((DEBUG_INFO, "Variable driver runtime cache is enabled.\n"));
|
DEBUG ((DEBUG_INFO, "Variable driver runtime cache is enabled.\n"));
|
||||||
//
|
//
|
||||||
// Get needed runtime cache buffer size and check if auth variables are to be used from SMM
|
// Get needed runtime cache buffer size and check if auth variables are to be used from SMM
|
||||||
|
@ -1682,8 +1685,6 @@ SmmVariableReady (
|
||||||
&mVariableAuthFormat
|
&mVariableAuthFormat
|
||||||
);
|
);
|
||||||
if (!EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
GuidHob = GetFirstGuidHob (&gEdkiiVariableRuntimeCacheInfoHobGuid);
|
|
||||||
ASSERT (GuidHob != NULL);
|
|
||||||
VariableRuntimeCacheInfo = GET_GUID_HOB_DATA (GuidHob);
|
VariableRuntimeCacheInfo = GET_GUID_HOB_DATA (GuidHob);
|
||||||
AllocatedHobCacheSize = EFI_PAGES_TO_SIZE ((UINTN)VariableRuntimeCacheInfo->RuntimeHobCachePages);
|
AllocatedHobCacheSize = EFI_PAGES_TO_SIZE ((UINTN)VariableRuntimeCacheInfo->RuntimeHobCachePages);
|
||||||
AllocatedNvCacheSize = EFI_PAGES_TO_SIZE ((UINTN)VariableRuntimeCacheInfo->RuntimeNvCachePages);
|
AllocatedNvCacheSize = EFI_PAGES_TO_SIZE ((UINTN)VariableRuntimeCacheInfo->RuntimeNvCachePages);
|
||||||
|
|
|
@ -75,7 +75,6 @@
|
||||||
gEdkiiVariablePolicyProtocolGuid ## PRODUCES
|
gEdkiiVariablePolicyProtocolGuid ## PRODUCES
|
||||||
|
|
||||||
[FeaturePcd]
|
[FeaturePcd]
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdEnableVariableRuntimeCache ## CONSUMES
|
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdVariableCollectStatistics ## CONSUMES
|
gEfiMdeModulePkgTokenSpaceGuid.PcdVariableCollectStatistics ## CONSUMES
|
||||||
|
|
||||||
[Pcd]
|
[Pcd]
|
||||||
|
|
Loading…
Reference in New Issue