]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/AutoGen/AutoGen.py
BaseTools: Support Structure PCD value assignment in DEC/DSC
[mirror_edk2.git] / BaseTools / Source / Python / AutoGen / AutoGen.py
index b00390ce7dd48d44717660d7764ac1abc4b657d3..12861399ac8623e8f05ed06f970f56695da8257b 100644 (file)
@@ -316,8 +316,8 @@ class WorkspaceAutoGen(AutoGen):
 \r
         EdkLogger.verbose("\nFLASH_DEFINITION = %s" % self.FdfFile)\r
 \r
-        if Progress:\r
-            Progress.Start("\nProcessing meta-data")\r
+        if Progress:\r
+            Progress.Start("\nProcessing meta-data")\r
 \r
         if self.FdfFile:\r
             #\r
@@ -1557,12 +1557,19 @@ class PlatformAutoGen(AutoGen):
             if pcd not in self._PlatformPcds.keys():\r
                 self._PlatformPcds[pcd] = self.Platform.Pcds[pcd]\r
 \r
+        for item in self._PlatformPcds:\r
+            if self._PlatformPcds[item].DatumType and self._PlatformPcds[item].DatumType not in [TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_UINT64, TAB_VOID, "BOOLEAN"]:\r
+                self._PlatformPcds[item].DatumType = "VOID*"\r
+\r
         if (self.Workspace.ArchList[-1] == self.Arch): \r
             for Pcd in self._DynamicPcdList:\r
                 # just pick the a value to determine whether is unicode string type\r
                 Sku = Pcd.SkuInfoList[Pcd.SkuInfoList.keys()[0]]\r
                 Sku.VpdOffset = Sku.VpdOffset.strip()\r
 \r
+                if Pcd.DatumType not in [TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_UINT64, TAB_VOID, "BOOLEAN"]:\r
+                    Pcd.DatumType = "VOID*"\r
+\r
                 PcdValue = Sku.DefaultValue\r
                 if Pcd.DatumType == 'VOID*' and PcdValue.startswith("L"):\r
                     # if found PCD which datum value is unicode string the insert to left size of UnicodeIndex\r
@@ -4059,7 +4066,7 @@ class ModuleAutoGen(AutoGen):
                     elif BoolValue == 'FALSE':\r
                         Pcd.DefaultValue = '0'\r
 \r
-                if Pcd.DatumType != 'VOID*':\r
+                if Pcd.DatumType in ['UINT8', 'UINT16', 'UINT32', 'UINT64', 'BOOLEAN']:\r
                     HexFormat = '0x%02x'\r
                     if Pcd.DatumType == 'UINT16':\r
                         HexFormat = '0x%04x'\r