summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/PCD/Dxe/Pcd.c
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2018-10-12 18:01:40 +0800
committerStar Zeng <star.zeng@intel.com>2018-10-15 14:11:31 +0800
commit425084cd45860df8959ea1f890ca0e855d2a6220 (patch)
tree6fb89f658727c86614005e8be8690a686a505ab1 /MdeModulePkg/Universal/PCD/Dxe/Pcd.c
parent04aa423c8d08e93e8369fbe7793c7df9b3327c8c (diff)
downloadedk2-425084cd45860df8959ea1f890ca0e855d2a6220.zip
edk2-425084cd45860df8959ea1f890ca0e855d2a6220.tar.gz
edk2-425084cd45860df8959ea1f890ca0e855d2a6220.tar.bz2
MdeModulePkg PcdDxe: ASSERT PcdSetNvStoreDefaultId set
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1245 In current implementation and according to the description in MdeModulePkg.dec, PcdSetNvStoreDefaultId should be set in PEI phase to take effect. This patch ASSERTs PcdSetNvStoreDefaultId set in PcdDxe to alert the invalid operation. Cc: Liming Gao <liming.gao@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Diffstat (limited to 'MdeModulePkg/Universal/PCD/Dxe/Pcd.c')
-rw-r--r--MdeModulePkg/Universal/PCD/Dxe/Pcd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/PCD/Dxe/Pcd.c b/MdeModulePkg/Universal/PCD/Dxe/Pcd.c
index bc308af..f977c7f 100644
--- a/MdeModulePkg/Universal/PCD/Dxe/Pcd.c
+++ b/MdeModulePkg/Universal/PCD/Dxe/Pcd.c
@@ -890,6 +890,11 @@ DxePcdSet16Ex (
IN UINT16 Value
)
{
+ //
+ // PcdSetNvStoreDefaultId should be set in PEI phase to take effect.
+ //
+ ASSERT (!(CompareGuid (Guid, &gEfiMdeModulePkgTokenSpaceGuid) &&
+ (ExTokenNumber == PcdToken(PcdSetNvStoreDefaultId))));
return ExSetValueWorker (ExTokenNumber, Guid, &Value, sizeof (Value));
}