summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/AutoGen
diff options
context:
space:
mode:
authorFeng, Bob C <bob.c.feng@intel.com>2018-08-28 18:22:45 +0800
committerLiming Gao <liming.gao@intel.com>2018-09-03 10:14:50 +0800
commit4cf022f2f11fc3cd12ab5dd24e5ae74f541bac48 (patch)
tree92864f9004eef91cec297890f47e437e464c1d18 /BaseTools/Source/Python/AutoGen
parent7c193787623f89d161255e37d80bc2907690ab37 (diff)
downloadedk2-4cf022f2f11fc3cd12ab5dd24e5ae74f541bac48.tar.gz
edk2-4cf022f2f11fc3cd12ab5dd24e5ae74f541bac48.tar.bz2
edk2-4cf022f2f11fc3cd12ab5dd24e5ae74f541bac48.zip
BaseTools: Fixed the PcdValue trailing zero issue.
1. Not append trailing zero for PcdValue 2. make sure the point to Variable Name in PCD DataBase 2 bytes aligned. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen')
-rw-r--r--BaseTools/Source/Python/AutoGen/GenPcdDb.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/AutoGen/GenPcdDb.py b/BaseTools/Source/Python/AutoGen/GenPcdDb.py
index 2176bbefeb..5b260cd515 100644
--- a/BaseTools/Source/Python/AutoGen/GenPcdDb.py
+++ b/BaseTools/Source/Python/AutoGen/GenPcdDb.py
@@ -1184,6 +1184,12 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, DynamicPcdList, Phase):
# and calculate the VariableHeadStringIndex
VariableNameStructure = StringToArray(Sku.VariableName)
+
+ # Make pointer of VaraibleName(HII PCD) 2 bytes aligned
+ VariableNameStructureBytes = VariableNameStructure.lstrip("{").rstrip("}").split(",")
+ if len(VariableNameStructureBytes) % 2:
+ VariableNameStructure = "{%s,0x00}" % ",".join(VariableNameStructureBytes)
+
if VariableNameStructure not in Dict['STRING_TABLE_VALUE']:
Dict['STRING_TABLE_CNAME'].append(CName)
Dict['STRING_TABLE_GUID'].append(TokenSpaceGuid)