BaseTool: Fixed the issue of empty PcdDB.
If there is no dynamic pcds, there should be DB header in the Pcd DataBase. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
@ -980,8 +980,6 @@ def CreatePcdDatabaseCode (Info, AutoGenC, AutoGenH):
|
|||||||
def CreatePcdDataBase(PcdDBData):
|
def CreatePcdDataBase(PcdDBData):
|
||||||
delta = {}
|
delta = {}
|
||||||
basedata = {}
|
basedata = {}
|
||||||
if not PcdDBData:
|
|
||||||
return ""
|
|
||||||
for skuname,skuid in PcdDBData:
|
for skuname,skuid in PcdDBData:
|
||||||
if len(PcdDBData[(skuname,skuid)][1]) != len(PcdDBData[("DEFAULT","0")][1]):
|
if len(PcdDBData[(skuname,skuid)][1]) != len(PcdDBData[("DEFAULT","0")][1]):
|
||||||
EdkLogger.ERROR("The size of each sku in one pcd are not same")
|
EdkLogger.ERROR("The size of each sku in one pcd are not same")
|
||||||
@ -1061,9 +1059,12 @@ def NewCreatePcdDatabasePhaseSpecificAutoGen(Platform,Phase):
|
|||||||
AdditionalAutoGenH, AdditionalAutoGenC = CreateAutoGen(PcdDriverAutoGenData)
|
AdditionalAutoGenH, AdditionalAutoGenC = CreateAutoGen(PcdDriverAutoGenData)
|
||||||
else:
|
else:
|
||||||
AdditionalAutoGenH, AdditionalAutoGenC, PcdDbBuffer,VarCheckTab = CreatePcdDatabasePhaseSpecificAutoGen (Platform,{}, Phase)
|
AdditionalAutoGenH, AdditionalAutoGenC, PcdDbBuffer,VarCheckTab = CreatePcdDatabasePhaseSpecificAutoGen (Platform,{}, Phase)
|
||||||
|
final_data = ()
|
||||||
|
for item in PcdDbBuffer:
|
||||||
|
final_data += unpack("B",item)
|
||||||
|
PcdDBData[("DEFAULT","0")] = (PcdDbBuffer, final_data)
|
||||||
|
|
||||||
PcdDbBuffer = CreatePcdDataBase(PcdDBData)
|
return AdditionalAutoGenH, AdditionalAutoGenC, CreatePcdDataBase(PcdDBData)
|
||||||
return AdditionalAutoGenH, AdditionalAutoGenC, PcdDbBuffer
|
|
||||||
## Create PCD database in DXE or PEI phase
|
## Create PCD database in DXE or PEI phase
|
||||||
#
|
#
|
||||||
# @param Platform The platform object
|
# @param Platform The platform object
|
||||||
|
Reference in New Issue
Block a user