X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FBPDG%2FGenVpd.py;h=003011b709b16d6a0622f7621d4280c372109cd6;hp=ee7e04295f1245afb0f0e0e50a3a6662cb629204;hb=815ada26cb7069d1121153c4e661e796c9e1da25;hpb=452582852dc3654ce51e0c6072aaf752d1b0e3ed diff --git a/BaseTools/Source/Python/BPDG/GenVpd.py b/BaseTools/Source/Python/BPDG/GenVpd.py index ee7e04295f..003011b709 100644 --- a/BaseTools/Source/Python/BPDG/GenVpd.py +++ b/BaseTools/Source/Python/BPDG/GenVpd.py @@ -420,8 +420,16 @@ class GenVPD : Alignment = 2 else: Alignment = 1 - if PCD.PcdOccupySize % Alignment != 0: - PCD.PcdOccupySize = (PCD.PcdOccupySize / Alignment + 1) * Alignment + + if PCD.PcdOffset != '*': + if PCD.PcdOccupySize % Alignment != 0: + if PCD.PcdUnpackValue.startswith("{"): + EdkLogger.warn("BPDG", "The offset value of PCD %s is not 8-byte aligned!" %(PCD.PcdCName), File=self.InputFileName) + else: + EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, 'The offset value of PCD %s should be %s-byte aligned.' % (PCD.PcdCName, Alignment)) + else: + if PCD.PcdOccupySize % Alignment != 0: + PCD.PcdOccupySize = (PCD.PcdOccupySize / Alignment + 1) * Alignment # # Translate PCD size string to an integer value.