summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/AutoGen/GenPcdDb.py
diff options
context:
space:
mode:
authorLiming Gao <liming.gao@intel.com>2017-12-20 17:16:28 +0800
committerLiming Gao <liming.gao@intel.com>2017-12-25 11:05:49 +0800
commit7e6e459a3d91c07db1f97258aec323a982375e19 (patch)
tree16b31611cf1f90a197448859e6c25be6073a2000 /BaseTools/Source/Python/AutoGen/GenPcdDb.py
parent47854fd598b73267d57594c5bac6a2326332b08c (diff)
downloadedk2-7e6e459a3d91c07db1f97258aec323a982375e19.tar.gz
edk2-7e6e459a3d91c07db1f97258aec323a982375e19.tar.bz2
edk2-7e6e459a3d91c07db1f97258aec323a982375e19.zip
BaseTools: Update SkuId as SKU_ID type to follow current implementation
Update PCD DB and Default setting format as nature alignment. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/GenPcdDb.py')
-rw-r--r--BaseTools/Source/Python/AutoGen/GenPcdDb.py24
1 files changed, 15 insertions, 9 deletions
diff --git a/BaseTools/Source/Python/AutoGen/GenPcdDb.py b/BaseTools/Source/Python/AutoGen/GenPcdDb.py
index fe1a598e41..b60d33526a 100644
--- a/BaseTools/Source/Python/AutoGen/GenPcdDb.py
+++ b/BaseTools/Source/Python/AutoGen/GenPcdDb.py
@@ -176,7 +176,8 @@ typedef struct {
//GUID Signature; // PcdDataBaseGuid
//UINT32 BuildVersion;
//UINT32 Length;
- //SKU_ID SystemSkuId; // Current SkuId value.
+ //SKU_ID SystemSkuId; // Current SkuId value.
+ //UINT32 LengthForAllSkus; // Length of all SKU PCD DB
//UINT32 UninitDataBaseSize;// Total size for PCD those default value with 0.
//TABLE_OFFSET LocalTokenNumberTableOffset;
//TABLE_OFFSET ExMapTableOffset;
@@ -188,7 +189,7 @@ typedef struct {
//UINT16 LocalTokenCount; // LOCAL_TOKEN_NUMBER for all
//UINT16 ExTokenCount; // EX_TOKEN_NUMBER for DynamicEx
//UINT16 GuidTableCount; // The Number of Guid in GuidTable
- //UINT8 Pad[2];
+ //UINT8 Pad[6];
${PHASE}_PCD_DATABASE_INIT Init;
${PHASE}_PCD_DATABASE_UNINIT Uninit;
} ${PHASE}_PCD_DATABASE;
@@ -767,7 +768,7 @@ def BuildExDataBase(Dict):
# VardefValueBoolean is the last table in the init table items
InitTableNum = DbNameTotle.index("VardefValueBoolean") + 1
# The FixedHeader length of the PCD_DATABASE_INIT, from Signature to Pad
- FixedHeaderLen = 76
+ FixedHeaderLen = 80
# Get offset of SkuId table in the database
SkuIdTableOffset = FixedHeaderLen
@@ -924,10 +925,11 @@ def BuildExDataBase(Dict):
Buffer += b
b = pack('=B', Pad)
-
Buffer += b
- b = pack('=B', Pad)
-
+ Buffer += b
+ Buffer += b
+ Buffer += b
+ Buffer += b
Buffer += b
Index = 0
@@ -991,9 +993,13 @@ def CreatePcdDataBase(PcdDBData):
databasebuff = PcdDBData[("DEFAULT","0")][0]
for skuname,skuid in delta:
- databasebuff += pack('=H', int(skuid))
- databasebuff += pack('=H', 0)
- databasebuff += pack('=L', 8+4*len(delta[(skuname,skuid)]))
+ # 8 byte align
+ if len(databasebuff) % 8 > 0:
+ for i in range(8 - (len(databasebuff) % 8)):
+ databasebuff += pack("=B",0)
+ databasebuff += pack('=Q', int(skuid))
+ databasebuff += pack('=Q', 0)
+ databasebuff += pack('=L', 8+8+4+4*len(delta[(skuname,skuid)]))
for item in delta[(skuname,skuid)]:
databasebuff += pack("=L",item[0])
databasebuff = databasebuff[:-1] + pack("=B",item[1])