diff options
author | Liming Gao <liming.gao@intel.com> | 2017-12-22 20:04:04 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2017-12-25 11:05:47 +0800 |
commit | 2b8a6c44e0deb508f79804dd5ff7156bc7e25493 (patch) | |
tree | 8f8d979291dabc3c918d821ecbb7c28186ca5e9d /BaseTools/Source/Python/Common | |
parent | 8518bf0b92a78938341a2752a0044f04336668cc (diff) | |
download | edk2-2b8a6c44e0deb508f79804dd5ff7156bc7e25493.tar.gz edk2-2b8a6c44e0deb508f79804dd5ff7156bc7e25493.tar.bz2 edk2-2b8a6c44e0deb508f79804dd5ff7156bc7e25493.zip |
BaseTools: PcdDataBase Optimization for multiple SkuIds
https://bugzilla.tianocore.org/show_bug.cgi?id=546
BaseTools will generate the optimized PCD database to save the image size
at build time for multiple SKUs. The optimized PCD database layout will be like
below, the PCD database will be composed of the full default SKU data
(PCD_DATABASE_INIT) and the non-default SKU delta data(PCD_DATABASE_SKU_DELTA).
PCD driver will build HOB to store the full default SKU data, and patch HOB
data based on non-default SKU delta data for the SKU set by SetSku(),
it can save memory resource at boot time.
//
// PCD database layout:
// +---------------------------------+
// | PCD_DATABASE_INIT (DEFAULT SKU) |
// +---------------------------------+
// | PCD_DATABASE_SKU_DELTA (SKU A) |
// +---------------------------------+
// | PCD_DATABASE_SKU_DELTA (SKU B) |
// +---------------------------------+
// | ...... |
// +---------------------------------+
//
BaseTools, PCD database and driver updates are needed for this proposal.
For single SKU (default) case, this proposal is expected to have no impact.
For multi-SKU case, PCD database format will be changed.
So, PcdDataBase Version is also updated from 6 to 7.
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>
Diffstat (limited to 'BaseTools/Source/Python/Common')
-rw-r--r-- | BaseTools/Source/Python/Common/BuildToolError.py | 1 | ||||
-rw-r--r-- | BaseTools/Source/Python/Common/Misc.py | 5 | ||||
-rw-r--r-- | BaseTools/Source/Python/Common/VpdInfoFile.py | 5 |
3 files changed, 8 insertions, 3 deletions
diff --git a/BaseTools/Source/Python/Common/BuildToolError.py b/BaseTools/Source/Python/Common/BuildToolError.py index d3e5f9f167..27779c5d98 100644 --- a/BaseTools/Source/Python/Common/BuildToolError.py +++ b/BaseTools/Source/Python/Common/BuildToolError.py @@ -85,6 +85,7 @@ WARNING_AS_ERROR = 0xF006 MIGRATION_ERROR = 0xF010
PCD_VALIDATION_INFO_ERROR = 0xF011
PCD_VARIABLE_ATTRIBUTES_ERROR = 0xF012
+PCD_VARIABLE_INFO_ERROR = 0xF016
PCD_VARIABLE_ATTRIBUTES_CONFLICT_ERROR = 0xF013
PCD_STRUCTURE_PCD_INVALID_FIELD_ERROR = 0xF014
PCD_STRUCTURE_PCD_ERROR = 0xF015
diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py index 8b9eed8a09..2ff8516469 100644 --- a/BaseTools/Source/Python/Common/Misc.py +++ b/BaseTools/Source/Python/Common/Misc.py @@ -2111,7 +2111,10 @@ class DefaultStore(): def GetMin(self,DefaultSIdList):
if not DefaultSIdList:
return "STANDARD"
- minid = min({storeid for storeid, storename in self.DefaultStores.values() if storename in DefaultSIdList} )
+ storeidset = {storeid for storeid, storename in self.DefaultStores.values() if storename in DefaultSIdList}
+ if not storeidset:
+ return ""
+ minid = min(storeidset )
for sid,name in self.DefaultStores.values():
if sid == minid:
return name
diff --git a/BaseTools/Source/Python/Common/VpdInfoFile.py b/BaseTools/Source/Python/Common/VpdInfoFile.py index d45fb4cf03..56161efe6a 100644 --- a/BaseTools/Source/Python/Common/VpdInfoFile.py +++ b/BaseTools/Source/Python/Common/VpdInfoFile.py @@ -102,8 +102,9 @@ class VpdInfoFile: if Vpd.MaxDatumSize == None or Vpd.MaxDatumSize == "":
Vpd.MaxDatumSize = VpdInfoFile._MAX_SIZE_TYPE[Vpd.DatumType]
else:
- EdkLogger.error("VpdInfoFile", BuildToolError.PARAMETER_INVALID,
- "Invalid DatumType %s for VPD PCD %s.%s" % (Vpd.DatumType, Vpd.TokenSpaceGuidCName, Vpd.TokenCName))
+ if Vpd.MaxDatumSize <= 0:
+ EdkLogger.error("VpdInfoFile", BuildToolError.PARAMETER_INVALID,
+ "Invalid max datum size for VPD PCD %s.%s" % (Vpd.TokenSpaceGuidCName, Vpd.TokenCName))
if Vpd not in self._VpdArray.keys():
#
|