summaryrefslogtreecommitdiff
path: root/EdkModulePkg/Universal/PCD/Pei/Service.c
diff options
context:
space:
mode:
Diffstat (limited to 'EdkModulePkg/Universal/PCD/Pei/Service.c')
-rw-r--r--EdkModulePkg/Universal/PCD/Pei/Service.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/EdkModulePkg/Universal/PCD/Pei/Service.c b/EdkModulePkg/Universal/PCD/Pei/Service.c
index 255267c9ab..521c88b7fc 100644
--- a/EdkModulePkg/Universal/PCD/Pei/Service.c
+++ b/EdkModulePkg/Universal/PCD/Pei/Service.c
@@ -337,6 +337,10 @@ SetWorker (
VOID *InternalData;
UINTN MaxSize;
+ if (!FeaturePcdGet(PcdPeiPcdDatabaseSetEnabled)) {
+ return EFI_UNSUPPORTED;
+ }
+
//
// TokenNumber Zero is reserved as PCD_INVALID_TOKEN_NUMBER.
// We have to decrement TokenNumber by 1 to make it usable
@@ -462,6 +466,10 @@ ExSetWorker (
{
UINTN TokenNumber;
+ if (!FeaturePcdGet(PcdPeiPcdDatabaseSetEnabled)) {
+ return EFI_UNSUPPORTED;
+ }
+
TokenNumber = GetExPcdTokenNumber (Guid, ExTokenNumber);
InvokeCallbackOnSet (ExTokenNumber, Guid, TokenNumber, Data, *Size);
@@ -480,6 +488,11 @@ ExGetWorker (
IN UINTN GetSize
)
{
+ if (!FeaturePcdGet (PcdPeiPcdDatabaseExEnabled)) {
+ ASSERT (FALSE);
+ return 0;
+ }
+
return GetWorker (GetExPcdTokenNumber (Guid, ExTokenNumber), GetSize);
}