BaseTools: Support Structure PCD value assignment in DEC/DSC
https://bugzilla.tianocore.org/show_bug.cgi?id=542 This is pure BaseTools enhancement to support PCD with one structure. User can specify PCD value based on its structure field. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
@ -316,8 +316,8 @@ class WorkspaceAutoGen(AutoGen):
|
||||
|
||||
EdkLogger.verbose("\nFLASH_DEFINITION = %s" % self.FdfFile)
|
||||
|
||||
if Progress:
|
||||
Progress.Start("\nProcessing meta-data")
|
||||
# if Progress:
|
||||
# Progress.Start("\nProcessing meta-data")
|
||||
|
||||
if self.FdfFile:
|
||||
#
|
||||
@ -1557,12 +1557,19 @@ class PlatformAutoGen(AutoGen):
|
||||
if pcd not in self._PlatformPcds.keys():
|
||||
self._PlatformPcds[pcd] = self.Platform.Pcds[pcd]
|
||||
|
||||
for item in self._PlatformPcds:
|
||||
if self._PlatformPcds[item].DatumType and self._PlatformPcds[item].DatumType not in [TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_UINT64, TAB_VOID, "BOOLEAN"]:
|
||||
self._PlatformPcds[item].DatumType = "VOID*"
|
||||
|
||||
if (self.Workspace.ArchList[-1] == self.Arch):
|
||||
for Pcd in self._DynamicPcdList:
|
||||
# just pick the a value to determine whether is unicode string type
|
||||
Sku = Pcd.SkuInfoList[Pcd.SkuInfoList.keys()[0]]
|
||||
Sku.VpdOffset = Sku.VpdOffset.strip()
|
||||
|
||||
if Pcd.DatumType not in [TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_UINT64, TAB_VOID, "BOOLEAN"]:
|
||||
Pcd.DatumType = "VOID*"
|
||||
|
||||
PcdValue = Sku.DefaultValue
|
||||
if Pcd.DatumType == 'VOID*' and PcdValue.startswith("L"):
|
||||
# if found PCD which datum value is unicode string the insert to left size of UnicodeIndex
|
||||
@ -4059,7 +4066,7 @@ class ModuleAutoGen(AutoGen):
|
||||
elif BoolValue == 'FALSE':
|
||||
Pcd.DefaultValue = '0'
|
||||
|
||||
if Pcd.DatumType != 'VOID*':
|
||||
if Pcd.DatumType in ['UINT8', 'UINT16', 'UINT32', 'UINT64', 'BOOLEAN']:
|
||||
HexFormat = '0x%02x'
|
||||
if Pcd.DatumType == 'UINT16':
|
||||
HexFormat = '0x%04x'
|
||||
|
Reference in New Issue
Block a user