summaryrefslogtreecommitdiff
path: root/EdkModulePkg/Universal/PCD/Pei/Pcd.c
diff options
context:
space:
mode:
Diffstat (limited to 'EdkModulePkg/Universal/PCD/Pei/Pcd.c')
-rw-r--r--EdkModulePkg/Universal/PCD/Pei/Pcd.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/EdkModulePkg/Universal/PCD/Pei/Pcd.c b/EdkModulePkg/Universal/PCD/Pei/Pcd.c
index 40013cf8b5..33972d3c7f 100644
--- a/EdkModulePkg/Universal/PCD/Pei/Pcd.c
+++ b/EdkModulePkg/Universal/PCD/Pei/Pcd.c
@@ -174,6 +174,10 @@ PeiPcdGetSize (
UINTN Size;
UINTN MaxSize;
+ if (!FeaturePcdGet(PcdPeiPcdDatabaseGetSizeEnabled)) {
+ return EFI_UNSUPPORTED;
+ }
+
PeiPcdDb = GetPcdDatabase ();
//
// TokenNumber Zero is reserved as PCD_INVALID_TOKEN_NUMBER.
@@ -281,6 +285,10 @@ PeiPcdGetSizeEx (
IN UINTN ExTokenNumber
)
{
+ if ((!FeaturePcdGet (PcdPeiPcdDatabaseGetSizeEnabled)) || !FeaturePcdGet (PcdPeiPcdDatabaseExEnabled)) {
+ return EFI_UNSUPPORTED;
+ }
+
return PeiPcdGetSize (GetExPcdTokenNumber (Guid, ExTokenNumber));
}
@@ -446,6 +454,10 @@ PeiRegisterCallBackOnSet (
IN PCD_PPI_CALLBACK CallBackFunction
)
{
+ if (!FeaturePcdGet(PcdPeiPcdDatabaseCallbackOnSetEnabled)) {
+ return EFI_UNSUPPORTED;
+ }
+
ASSERT (CallBackFunction != NULL);
return PeiRegisterCallBackWorker (ExTokenNumber, Guid, CallBackFunction, TRUE);
@@ -461,6 +473,10 @@ PcdUnRegisterCallBackOnSet (
IN PCD_PPI_CALLBACK CallBackFunction
)
{
+ if (!FeaturePcdGet(PcdPeiPcdDatabaseCallbackOnSetEnabled)) {
+ return EFI_UNSUPPORTED;
+ }
+
ASSERT (CallBackFunction != NULL);
return PeiRegisterCallBackWorker (ExTokenNumber, Guid, CallBackFunction, FALSE);