summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Include
diff options
context:
space:
mode:
authorLiming Gao <liming.gao@intel.com>2017-12-22 13:41:54 +0800
committerLiming Gao <liming.gao@intel.com>2017-12-25 11:05:57 +0800
commit7c73626513238176bdd16dca14fcf3f9e10bcc81 (patch)
tree9a75f70d555811e298a00fbc0db906ec0e8ce6af /MdeModulePkg/Include
parent219247e16462d72e3b22db4e21bfaec256cc5fbb (diff)
downloadedk2-7c73626513238176bdd16dca14fcf3f9e10bcc81.tar.gz
edk2-7c73626513238176bdd16dca14fcf3f9e10bcc81.tar.bz2
edk2-7c73626513238176bdd16dca14fcf3f9e10bcc81.zip
MdeModulePkg: Update PCD driver to support the optimized PcdDataBase
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: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
Diffstat (limited to 'MdeModulePkg/Include')
-rw-r--r--MdeModulePkg/Include/Guid/PcdDataBaseSignatureGuid.h34
1 files changed, 25 insertions, 9 deletions
diff --git a/MdeModulePkg/Include/Guid/PcdDataBaseSignatureGuid.h b/MdeModulePkg/Include/Guid/PcdDataBaseSignatureGuid.h
index 9b1cb22bbb..d670af14e9 100644
--- a/MdeModulePkg/Include/Guid/PcdDataBaseSignatureGuid.h
+++ b/MdeModulePkg/Include/Guid/PcdDataBaseSignatureGuid.h
@@ -62,11 +62,6 @@ typedef struct {
} DYNAMICEX_MAPPING;
typedef struct {
- UINT32 SkuDataStartOffset; // Offset(with DATUM TYPE info) from the PCD_DB.
- UINT32 SkuIdTableOffset; // Offset from the PCD_DB.
-} SKU_HEAD;
-
-typedef struct {
UINT32 StringIndex; // Offset in String Table in units of UINT8.
UINT32 DefaultValueOffset; // Offset of the Default Value.
UINT16 GuidTableIndex; // Offset in Guid Table in units of GUID.
@@ -94,8 +89,9 @@ typedef UINT32 TABLE_OFFSET;
typedef struct {
GUID Signature; // PcdDataBaseGuid.
UINT32 BuildVersion;
- UINT32 Length;
+ UINT32 Length; // Length of DEFAULT SKU PCD DB
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;
@@ -107,7 +103,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]; // Pad bytes to satisfy the alignment.
+ UINT8 Pad[6]; // Pad bytes to satisfy the alignment.
//
// Default initialized external PCD database binary structure
@@ -115,7 +111,6 @@ typedef struct {
// Padding is needed to keep necessary alignment
//
//SKU_ID SkuIdTable[]; // SkuIds system supports.
- //SKU_ID SkuIndexTable[]; // SkuIds for each PCD with SKU enable.
//UINT64 ValueUint64[];
//UINT32 ValueUint32[];
//VPD_HEAD VpdHead[]; // VPD Offset
@@ -125,7 +120,6 @@ typedef struct {
//STRING_HEAD StringHead[]; // String PCD
//PCD_NAME_INDEX PcdNameTable[]; // PCD name index info. It can be accessed by the PcdNameTableOffset.
//VARIABLE_HEAD VariableHead[]; // HII PCD
- //SKU_HEAD SkuHead[]; // Store SKU info for each PCD with SKU enable.
//UINT8 StringTable[]; // String for String PCD value and HII PCD Variable Name. It can be accessed by StringTableOffset.
//SIZE_INFO SizeTable[]; // MaxSize and CurSize for String PCD. It can be accessed by SizeTableOffset.
//UINT16 ValueUint16[];
@@ -216,4 +210,26 @@ typedef struct {
// +-------------------------------------+
//
+#pragma pack(1)
+typedef struct {
+ SKU_ID SkuId;
+ SKU_ID SkuIdCompared;
+ UINT32 Length;
+ // PCD_DATA_DELTA DeltaData[]
+} PCD_DATABASE_SKU_DELTA;
+
+//
+// PCD database layout:
+// +---------------------------------+
+// | PCD_DATABASE_INIT (DEFAULT SKU) |
+// +---------------------------------+
+// | PCD_DATABASE_SKU_DELTA (SKU A) |
+// +---------------------------------+
+// | PCD_DATABASE_SKU_DELTA (SKU B) |
+// +---------------------------------+
+// | ...... |
+// +---------------------------------+
+//
+#pragma pack()
+
#endif