From 61ee1dff160dabbb0855d56c925985030af702bc Mon Sep 17 00:00:00 2001 From: Yonghong Zhu Date: Tue, 19 Apr 2016 10:43:57 +0800 Subject: [PATCH] BaseTools: fix a bug for PEI VPD Pcd collection When a PEI phase VPD PCD only list in the DSC IA32 arch, then build X64 arch image, it missed to collect this PEI VPD pcd into VPD Pcd map file. Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- BaseTools/Source/Python/AutoGen/AutoGen.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index f29d3680e0..50d585f6aa 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -861,6 +861,7 @@ class PlatformAutoGen(AutoGen): # _DynaPcdList_ = [] _NonDynaPcdList_ = [] + _PlatformPcds = {} # # The priority list while override build option @@ -1213,8 +1214,12 @@ class PlatformAutoGen(AutoGen): OtherPcdArray = [] VpdPcdDict = {} VpdFile = VpdInfoFile.VpdInfoFile() - NeedProcessVpdMapFile = False - + NeedProcessVpdMapFile = False + + for pcd in self.Platform.Pcds.keys(): + if pcd not in self._PlatformPcds.keys(): + self._PlatformPcds[pcd] = self.Platform.Pcds[pcd] + if (self.Workspace.ArchList[-1] == self.Arch): for Pcd in self._DynamicPcdList: # just pick the a value to determine whether is unicode string type @@ -1233,13 +1238,13 @@ class PlatformAutoGen(AutoGen): if Pcd.Type in [TAB_PCDS_DYNAMIC_VPD, TAB_PCDS_DYNAMIC_EX_VPD]: VpdPcdDict[(Pcd.TokenCName, Pcd.TokenSpaceGuidCName)] = Pcd - PlatformPcds = self.Platform.Pcds.keys() + PlatformPcds = self._PlatformPcds.keys() PlatformPcds.sort() # # Add VPD type PCD into VpdFile and determine whether the VPD PCD need to be fixed up. # for PcdKey in PlatformPcds: - Pcd = self.Platform.Pcds[PcdKey] + Pcd = self._PlatformPcds[PcdKey] if Pcd.Type in [TAB_PCDS_DYNAMIC_VPD, TAB_PCDS_DYNAMIC_EX_VPD] and \ PcdKey in VpdPcdDict: Pcd = VpdPcdDict[PcdKey] @@ -1281,7 +1286,7 @@ class PlatformAutoGen(AutoGen): # An example is PCD for signature usage. # for DscPcd in PlatformPcds: - DscPcdEntry = self.Platform.Pcds[DscPcd] + DscPcdEntry = self._PlatformPcds[DscPcd] if DscPcdEntry.Type in [TAB_PCDS_DYNAMIC_VPD, TAB_PCDS_DYNAMIC_EX_VPD]: if not (self.Platform.VpdToolGuid == None or self.Platform.VpdToolGuid == ''): FoundFlag = False -- 2.39.2