]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg PCD: Update PCD database structure definition to match BaseTools
authorStar Zeng <star.zeng@intel.com>
Wed, 31 Aug 2016 06:47:36 +0000 (14:47 +0800)
committerStar Zeng <star.zeng@intel.com>
Tue, 20 Sep 2016 08:50:52 +0000 (16:50 +0800)
To follow PI1.4a, BaseTools has be updated to fix artificial limitation of
SkuId range.

This patch is to update PCD database structure definition to match BaseTools.

Note: The source code and BaseTools need to be upgraded at the same time,
and if they are not upgraded at the same time, build error like below will
be triggered to help user identify the problem.

"Please make sure the version of PCD PEIM Service and the generated
PCD PEI Database match."

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdeModulePkg/Include/Guid/PcdDataBaseSignatureGuid.h
MdeModulePkg/Universal/PCD/Dxe/Pcd.c
MdeModulePkg/Universal/PCD/Dxe/Service.c
MdeModulePkg/Universal/PCD/Dxe/Service.h
MdeModulePkg/Universal/PCD/Pei/Pcd.c
MdeModulePkg/Universal/PCD/Pei/Service.c
MdeModulePkg/Universal/PCD/Pei/Service.h

index ac95f7e21ae8712a04c64252cc64a1199a7da374..d2e848800b75d97c7976f699c010a6e302b52404 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Guid for Pcd DataBase Signature.\r
 \r
-Copyright (c) 2012 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2012 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials are licensed and made available under\r
 the terms and conditions of the BSD License that accompanies this distribution.\r
 The full text of the license may be found at\r
@@ -23,7 +23,7 @@ extern EFI_GUID gPcdDataBaseSignatureGuid;
 //\r
 // Common definitions\r
 //\r
-typedef UINT8 SKU_ID;\r
+typedef UINT64 SKU_ID;\r
 \r
 #define PCD_TYPE_SHIFT        28\r
 \r
@@ -62,7 +62,7 @@ typedef struct  {
 } DYNAMICEX_MAPPING;\r
 \r
 typedef struct {\r
-  UINT32  SkuDataStartOffset;   // Offset(with TYPE info) from the PCD_DB.\r
+  UINT32  SkuDataStartOffset;   // Offset(with DATUM TYPE info) from the PCD_DB.\r
   UINT32  SkuIdTableOffset;     // Offset from the PCD_DB.\r
 } SKU_HEAD;\r
 \r
@@ -95,6 +95,7 @@ typedef struct {
     GUID                  Signature;            // PcdDataBaseGuid.\r
     UINT32                BuildVersion;\r
     UINT32                Length;\r
+    SKU_ID                SystemSkuId;          // Current SkuId value.\r
     UINT32                UninitDataBaseSize;   // Total size for PCD those default value with 0.\r
     TABLE_OFFSET          LocalTokenNumberTableOffset;\r
     TABLE_OFFSET          ExMapTableOffset;\r
@@ -106,14 +107,15 @@ typedef struct {
     UINT16                LocalTokenCount;      // LOCAL_TOKEN_NUMBER for all.\r
     UINT16                ExTokenCount;         // EX_TOKEN_NUMBER for DynamicEx.\r
     UINT16                GuidTableCount;       // The Number of Guid in GuidTable.\r
-    SKU_ID                SystemSkuId;          // Current SkuId value.\r
-    UINT8                 Pad;                  // Pad bytes to satisfy the alignment.\r
+    UINT8                 Pad[2];               // Pad bytes to satisfy the alignment.\r
 \r
     //\r
     // Default initialized external PCD database binary structure\r
     //\r
     // Padding is needed to keep necessary alignment\r
     //\r
+    //SKU_ID                         SkuIdTable[];            // SkuIds system supports.\r
+    //SKU_ID                         SkuIndexTable[];         // SkuIds for each PCD with SKU enable.\r
     //UINT64                         ValueUint64[];\r
     //UINT32                         ValueUint32[];\r
     //VPD_HEAD                       VpdHead[];               // VPD Offset\r
@@ -129,8 +131,6 @@ typedef struct {
     //UINT16                         ValueUint16[];\r
     //UINT8                          ValueUint8[];\r
     //BOOLEAN                        ValueBoolean[];\r
-    //UINT8                          SkuIdTable[];            // SkuIds system supports.\r
-    //UINT8                          SkuIndexTable[];         // SkuIds for each PCD with SKU enable.\r
 \r
 } PCD_DATABASE_INIT;\r
 \r
index b9cf9e4e76464665a8f4a58e608751da1531dd38..1bb9098c04cf2fe118e4006a39ddc1889ded10ea 100644 (file)
@@ -239,7 +239,7 @@ DxeGetPcdInfoGetSku (
   VOID\r
   )\r
 {\r
-  return mPcdDatabase.DxeDb->SystemSkuId;\r
+  return (UINTN) mPcdDatabase.DxeDb->SystemSkuId;\r
 }\r
 \r
 /**\r
index 9ab456624fc7086427c6a446d58d71acc28ab48d..6d0b0f8adec6af82bbe51671ae54f9c683a437ae 100644 (file)
@@ -958,7 +958,7 @@ GetSkuEnabledTokenNumber (
 {\r
   SKU_HEAD              *SkuHead;\r
   SKU_ID                *SkuIdTable;\r
-  INTN                  Index;\r
+  UINTN                 Index;\r
   UINT8                 *Value;\r
   UINT8                 *PcdDb;\r
   BOOLEAN               FoundSku;\r
index 4d8ab0f13fd6fdc74a8ac335d810b0e9919afd5b..0257a3487cc4c7d904c9b08dc8bdaecb54866193 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Private functions used by PCD DXE driver.\r
 \r
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -39,7 +39,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 // Please make sure the PCD Serivce DXE Version is consistent with\r
 // the version of the generated DXE PCD Database by build tool.\r
 //\r
-#define PCD_SERVICE_DXE_VERSION      5\r
+#define PCD_SERVICE_DXE_VERSION      6\r
 \r
 //\r
 // PCD_DXE_SERVICE_DRIVER_VERSION is defined in Autogen.h.\r
index 4d0caed5a94ef218f5afc6d8622917efbda0b982..7a486b7d1d0503be801f5b948b158e210e6f0735 100644 (file)
@@ -226,7 +226,7 @@ PeiGetPcdInfoGetSku (
   VOID\r
   )\r
 {\r
-  return GetPcdDatabase()->SystemSkuId;\r
+  return (UINTN) GetPcdDatabase()->SystemSkuId;\r
 }\r
 \r
 /**\r
index 45ce01b1fa736e9025568465bd9691b95c321fe9..66ca892ed2e05b3511d21604206f11f86610e1a5 100644 (file)
@@ -2,7 +2,7 @@
   The driver internal functions are implmented here.\r
   They build Pei PCD database, and provide access service to PCD database.\r
 \r
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -550,7 +550,7 @@ GetSkuEnabledTokenNumber (
   PEI_PCD_DATABASE      *PeiPcdDb;\r
   SKU_HEAD              *SkuHead;\r
   SKU_ID                *SkuIdTable;\r
-  INTN                  Index;\r
+  UINTN                 Index;\r
   UINT8                 *Value;\r
   BOOLEAN               FoundSku;\r
 \r
index c75187c2b117a8109cb0c92caf28a46a3c8991e8..fa14abeaa3b1b7b4b6b51b7e8ed6583ff277939b 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The internal header file declares the private functions used by PeiPcd driver.\r
 \r
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -36,7 +36,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 // Please make sure the PCD Serivce PEIM Version is consistent with\r
 // the version of the generated PEIM PCD Database by build tool.\r
 //\r
-#define PCD_SERVICE_PEIM_VERSION      5\r
+#define PCD_SERVICE_PEIM_VERSION      6\r
 \r
 //\r
 // PCD_PEI_SERVICE_DRIVER_VERSION is defined in Autogen.h.\r