diff options
author | Star Zeng <star.zeng@intel.com> | 2018-10-12 18:01:40 +0800 |
---|---|---|
committer | Star Zeng <star.zeng@intel.com> | 2018-10-15 14:11:31 +0800 |
commit | 425084cd45860df8959ea1f890ca0e855d2a6220 (patch) | |
tree | 6fb89f658727c86614005e8be8690a686a505ab1 /MdeModulePkg/Universal/PCD/Dxe | |
parent | 04aa423c8d08e93e8369fbe7793c7df9b3327c8c (diff) | |
download | edk2-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')
-rw-r--r-- | MdeModulePkg/Universal/PCD/Dxe/Pcd.c | 5 | ||||
-rw-r--r-- | MdeModulePkg/Universal/PCD/Dxe/Pcd.inf | 4 |
2 files changed, 8 insertions, 1 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));
}
diff --git a/MdeModulePkg/Universal/PCD/Dxe/Pcd.inf b/MdeModulePkg/Universal/PCD/Dxe/Pcd.inf index 066b86a..1f41a31 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/Pcd.inf +++ b/MdeModulePkg/Universal/PCD/Dxe/Pcd.inf @@ -331,6 +331,7 @@ [Guids]
gPcdDataBaseHobGuid ## SOMETIMES_CONSUMES ## HOB
gPcdDataBaseSignatureGuid ## CONSUMES ## GUID # PCD database signature GUID.
+ gEfiMdeModulePkgTokenSpaceGuid ## SOMETIMES_CONSUMES ## GUID
[Protocols]
gPcdProtocolGuid ## PRODUCES
@@ -342,7 +343,8 @@ gEdkiiVariableLockProtocolGuid
[Pcd]
- gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress ## SOMETIMES_CONSUMES
+ gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress ## SOMETIMES_CONSUMES
+ gEfiMdeModulePkgTokenSpaceGuid.PcdSetNvStoreDefaultId ## SOMETIMES_CONSUMES
[Depex]
TRUE
|