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>
This commit is contained in:
Star Zeng 2018-10-12 18:01:40 +08:00
parent 04aa423c8d
commit 425084cd45
2 changed files with 8 additions and 1 deletions

View File

@ -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));
}

View File

@ -331,6 +331,7 @@
[Guids]
gPcdDataBaseHobGuid ## SOMETIMES_CONSUMES ## HOB
gPcdDataBaseSignatureGuid ## CONSUMES ## GUID # PCD database signature GUID.
gEfiMdeModulePkgTokenSpaceGuid ## SOMETIMES_CONSUMES ## GUID
[Protocols]
gPcdProtocolGuid ## PRODUCES
@ -343,6 +344,7 @@
[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress ## SOMETIMES_CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdSetNvStoreDefaultId ## SOMETIMES_CONSUMES
[Depex]
TRUE