]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/BPDG/GenVpd.py
BaseTools: report warning if VOID* PCD with {} value is not 8-byte aligned
[mirror_edk2.git] / BaseTools / Source / Python / BPDG / GenVpd.py
index ee7e04295f1245afb0f0e0e50a3a6662cb629204..003011b709b16d6a0622f7621d4280c372109cd6 100644 (file)
@@ -420,8 +420,16 @@ class GenVPD :
                     Alignment = 2\r
                 else:\r
                     Alignment = 1\r
-                if PCD.PcdOccupySize % Alignment != 0:\r
-                    PCD.PcdOccupySize = (PCD.PcdOccupySize / Alignment + 1) * Alignment\r
+\r
+                if PCD.PcdOffset != '*':\r
+                    if PCD.PcdOccupySize % Alignment != 0:\r
+                        if PCD.PcdUnpackValue.startswith("{"):\r
+                            EdkLogger.warn("BPDG", "The offset value of PCD %s is not 8-byte aligned!" %(PCD.PcdCName), File=self.InputFileName)\r
+                        else:\r
+                            EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, 'The offset value of PCD %s should be %s-byte aligned.' % (PCD.PcdCName, Alignment))\r
+                else:\r
+                    if PCD.PcdOccupySize % Alignment != 0:\r
+                        PCD.PcdOccupySize = (PCD.PcdOccupySize / Alignment + 1) * Alignment\r
 \r
                 #\r
                 # Translate PCD size string to an integer value.\r