summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/BPDG
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2016-03-09 14:03:39 +0800
committerHao Wu <hao.a.wu@intel.com>2016-03-11 10:44:54 +0800
commit1b299fd5023e2ea913bda9224e9c7b01e19f68a1 (patch)
tree13e72849518293bcf6296a46d2e1f0a7bb0746e3 /BaseTools/Source/Python/BPDG
parent4b32c3ec23167573b184f00560a686dd381ebd2b (diff)
downloadedk2-platforms-1b299fd5023e2ea913bda9224e9c7b01e19f68a1.tar.xz
BaseTools: report warning if VOID* PCD with {} value is not 8-byte aligned
For VOID* Pcd with {} value, If platform developer wants to put in a specific hex offset value that is not 8-byte aligned for VOID * then we allow it with a warning message. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> (cherry picked from commit 815ada26cb7069d1121153c4e661e796c9e1da25)
Diffstat (limited to 'BaseTools/Source/Python/BPDG')
-rw-r--r--BaseTools/Source/Python/BPDG/GenVpd.py12
1 files changed, 10 insertions, 2 deletions
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.