mirror of https://github.com/acidanthera/audk.git
MdeModulePkg Pcd DXE: Handle the case gPcdDataBaseHobGuid HOB is not present.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15027 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
b8b86ec6e0
commit
efd6b412c6
|
@ -231,7 +231,7 @@ DxeGetPcdInfoGetSku (
|
|||
VOID
|
||||
)
|
||||
{
|
||||
return mPcdDatabase.PeiDb->SystemSkuId;
|
||||
return mPcdDatabase.DxeDb->SystemSkuId;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -261,7 +261,7 @@ DxePcdSetSku (
|
|||
IN UINTN SkuId
|
||||
)
|
||||
{
|
||||
mPcdDatabase.PeiDb->SystemSkuId = (SKU_ID) SkuId;
|
||||
mPcdDatabase.DxeDb->SystemSkuId = (SKU_ID) SkuId;
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -774,6 +774,18 @@ BuildPcdDxeDataBase (
|
|||
UINT32 PcdDxeDbLen;
|
||||
VOID *PcdDxeDb;
|
||||
|
||||
//
|
||||
// Assign PCD Entries with default value to PCD DATABASE
|
||||
//
|
||||
mPcdDatabase.DxeDb = LocateExPcdBinary ();
|
||||
ASSERT(mPcdDatabase.DxeDb != NULL);
|
||||
PcdDxeDbLen = mPcdDatabase.DxeDb->Length + mPcdDatabase.DxeDb->UninitDataBaseSize;
|
||||
PcdDxeDb = AllocateZeroPool (PcdDxeDbLen);
|
||||
ASSERT (PcdDxeDb != NULL);
|
||||
CopyMem (PcdDxeDb, mPcdDatabase.DxeDb, mPcdDatabase.DxeDb->Length);
|
||||
FreePool (mPcdDatabase.DxeDb);
|
||||
mPcdDatabase.DxeDb = PcdDxeDb;
|
||||
|
||||
GuidHob = GetFirstGuidHob (&gPcdDataBaseHobGuid);
|
||||
if (GuidHob != NULL) {
|
||||
|
||||
|
@ -789,20 +801,15 @@ BuildPcdDxeDataBase (
|
|||
// Assign PCD Entries refereneced in PEI phase to PCD DATABASE
|
||||
//
|
||||
mPcdDatabase.PeiDb = PeiDatabase;
|
||||
//
|
||||
// Inherit the SystemSkuId from PEI phase.
|
||||
//
|
||||
mPcdDatabase.DxeDb->SystemSkuId = mPcdDatabase.PeiDb->SystemSkuId;
|
||||
} else {
|
||||
mPcdDatabase.PeiDb = AllocateZeroPool (sizeof (PEI_PCD_DATABASE));
|
||||
ASSERT(mPcdDatabase.PeiDb != NULL);
|
||||
}
|
||||
|
||||
//
|
||||
// Assign PCD Entries with default value to PCD DATABASE
|
||||
//
|
||||
mPcdDatabase.DxeDb = LocateExPcdBinary ();
|
||||
ASSERT(mPcdDatabase.DxeDb != NULL);
|
||||
PcdDxeDbLen = mPcdDatabase.DxeDb->Length + mPcdDatabase.DxeDb->UninitDataBaseSize;
|
||||
PcdDxeDb = AllocateZeroPool (PcdDxeDbLen);
|
||||
ASSERT (PcdDxeDb != NULL);
|
||||
CopyMem (PcdDxeDb, mPcdDatabase.DxeDb, mPcdDatabase.DxeDb->Length);
|
||||
FreePool (mPcdDatabase.DxeDb);
|
||||
mPcdDatabase.DxeDb = PcdDxeDb;
|
||||
|
||||
//
|
||||
// Initialized the external PCD database local variables
|
||||
//
|
||||
|
@ -945,7 +952,7 @@ GetSkuEnabledTokenNumber (
|
|||
//
|
||||
FoundSku = FALSE;
|
||||
for (Index = 0; Index < SkuIdTable[0]; Index++) {
|
||||
if (mPcdDatabase.PeiDb->SystemSkuId == SkuIdTable[Index + 1]) {
|
||||
if (mPcdDatabase.DxeDb->SystemSkuId == SkuIdTable[Index + 1]) {
|
||||
FoundSku = TRUE;
|
||||
break;
|
||||
}
|
||||
|
@ -1704,7 +1711,7 @@ GetPtrTypeSize (
|
|||
//
|
||||
SkuIdTable = GetSkuIdArray (LocalTokenNumberTableIdx, IsPeiDb);
|
||||
for (Index = 0; Index < SkuIdTable[0]; Index++) {
|
||||
if (SkuIdTable[1 + Index] == mPcdDatabase.PeiDb->SystemSkuId) {
|
||||
if (SkuIdTable[1 + Index] == mPcdDatabase.DxeDb->SystemSkuId) {
|
||||
return SizeTable[SizeTableIdx + 1 + Index];
|
||||
}
|
||||
}
|
||||
|
@ -1794,7 +1801,7 @@ SetPtrTypeSize (
|
|||
//
|
||||
SkuIdTable = GetSkuIdArray (LocalTokenNumberTableIdx, IsPeiDb);
|
||||
for (Index = 0; Index < SkuIdTable[0]; Index++) {
|
||||
if (SkuIdTable[1 + Index] == mPcdDatabase.PeiDb->SystemSkuId) {
|
||||
if (SkuIdTable[1 + Index] == mPcdDatabase.DxeDb->SystemSkuId) {
|
||||
SizeTable[SizeTableIdx + 1 + Index] = (SIZE_INFO) *CurrentSize;
|
||||
return TRUE;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue