diff options
author | Liming Gao <liming.gao@intel.com> | 2017-11-24 14:30:11 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2017-12-25 11:05:45 +0800 |
commit | ae7b6df816e913394a7f11264f24953658ff34ba (patch) | |
tree | 10906d07aa821e1aa531ee3048f3d946cd485cc2 /BaseTools/Source/Python/AutoGen/AutoGen.py | |
parent | 309e37a22915dca12d3e5b914d8b3429f7624601 (diff) | |
download | edk2-ae7b6df816e913394a7f11264f24953658ff34ba.tar.gz edk2-ae7b6df816e913394a7f11264f24953658ff34ba.tar.bz2 edk2-ae7b6df816e913394a7f11264f24953658ff34ba.zip |
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>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/AutoGen.py')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/AutoGen.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index b00390ce7d..12861399ac 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -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'
|