BaseTools: Optimize VPD PCD value for the different SKUs

If VPD PCD value is same in the different SKUs, the different SKUs will
save the same offset for this PCD in VPD region. That means there is only
one PCD value copy in VPD region to save VPD space.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Feng Bob C <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Liming Gao
2017-12-22 20:19:20 +08:00
parent 7e6e459a3d
commit 626bece451
2 changed files with 50 additions and 27 deletions

View File

@ -79,6 +79,7 @@ class VpdInfoFile:
# @see BuildClassObject.PcdClassObject
# Value : offset in different SKU such as [sku1_offset, sku2_offset]
self._VpdArray = {}
self._VpdInfo = {}
## Add a VPD PCD collected from platform's autogen when building.
#
@ -179,6 +180,9 @@ class VpdInfoFile:
Found = False
if (TokenSpaceName, PcdTokenName) not in self._VpdInfo:
self._VpdInfo[(TokenSpaceName, PcdTokenName)] = []
self._VpdInfo[(TokenSpaceName, PcdTokenName)].append((SkuId,Offset, Value))
for VpdObject in self._VpdArray.keys():
VpdObjectTokenCName = VpdObject.TokenCName
for PcdItem in GlobalData.MixedPcd:
@ -217,6 +221,8 @@ class VpdInfoFile:
return None
return self._VpdArray[vpd]
def GetVpdInfo(self,(PcdTokenName,TokenSpaceName)):
return self._VpdInfo.get((TokenSpaceName, PcdTokenName))
## Call external BPDG tool to process VPD file
#