summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
195c943)
The original bug is only consider int format of PcdSize, but forgot the
Hex format. The fix is use the already exist variable PCD.PcdBinSize
which done to translate PCD size cover both format.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
# This file include GenVpd class for fix the Vpd type PCD offset, and PcdEntry for describe\r
# and process each entry of vpd type PCD.\r
#\r
# This file include GenVpd class for fix the Vpd type PCD offset, and PcdEntry for describe\r
# and process each entry of vpd type PCD.\r
#\r
-# Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
#\r
PCD.PcdUnpackValue = str(PCD.PcdValue)\r
\r
#\r
PCD.PcdUnpackValue = str(PCD.PcdValue)\r
\r
+ #\r
+ # Translate PCD size string to an integer value.\r
+ PackSize = None\r
+ try:\r
+ PackSize = int(PCD.PcdSize, 10)\r
+ PCD.PcdBinSize = PackSize\r
+ except:\r
+ try:\r
+ PackSize = int(PCD.PcdSize, 16)\r
+ PCD.PcdBinSize = PackSize\r
+ except:\r
+ EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, "Invalid PCD size value %s at file: %s line: %s" % (PCD.PcdSize, self.InputFileName, PCD.Lineno))\r
+\r
#\r
# If value is Unicode string (e.g. L""), then use 2-byte alignment\r
# If value is byte array (e.g. {}), then use 8-byte alignment\r
#\r
#\r
# If value is Unicode string (e.g. L""), then use 2-byte alignment\r
# If value is byte array (e.g. {}), then use 8-byte alignment\r
#\r
- PCD.PcdOccupySize = int(PCD.PcdSize)\r
+ PCD.PcdOccupySize = PCD.PcdBinSize\r
if PCD.PcdUnpackValue.startswith("{"):\r
Alignment = 8\r
elif PCD.PcdUnpackValue.startswith("L"):\r
if PCD.PcdUnpackValue.startswith("{"):\r
Alignment = 8\r
elif PCD.PcdUnpackValue.startswith("L"):\r
if PCD.PcdOccupySize % Alignment != 0:\r
PCD.PcdOccupySize = (PCD.PcdOccupySize / Alignment + 1) * Alignment\r
\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
- PackSize = None\r
- try:\r
- PackSize = int(PCD.PcdSize, 10)\r
- PCD.PcdBinSize = PackSize\r
- except:\r
- try:\r
- PackSize = int(PCD.PcdSize, 16)\r
- PCD.PcdBinSize = PackSize\r
- except:\r
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, "Invalid PCD size value %s at file: %s line: %s" % (PCD.PcdSize, self.InputFileName, PCD.Lineno))\r
-\r
if PCD._IsBoolean(PCD.PcdValue, PCD.PcdSize):\r
PCD._PackBooleanValue(PCD.PcdValue)\r
self.FileLinesList[count] = PCD\r
if PCD._IsBoolean(PCD.PcdValue, PCD.PcdSize):\r
PCD._PackBooleanValue(PCD.PcdValue)\r
self.FileLinesList[count] = PCD\r