public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Star Zeng <star.zeng@intel.com>
To: edk2-devel@lists.01.org
Cc: michael.a.rothman@intel.com, Star Zeng <star.zeng@intel.com>,
	Liming Gao <liming.gao@intel.com>,
	Yonghong Zhu <yonghong.zhu@intel.com>
Subject: [PATCH 2/2] MdeModulePkg PCD: Update PCD database structure definition to match BaseTools
Date: Fri,  2 Sep 2016 19:59:18 +0800	[thread overview]
Message-ID: <1472817558-234220-3-git-send-email-star.zeng@intel.com> (raw)
In-Reply-To: <1472817558-234220-1-git-send-email-star.zeng@intel.com>

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>
---
 MdeModulePkg/Include/Guid/PcdDataBaseSignatureGuid.h | 14 +++++++-------
 MdeModulePkg/Universal/PCD/Dxe/Pcd.c                 |  2 +-
 MdeModulePkg/Universal/PCD/Dxe/Service.c             |  2 +-
 MdeModulePkg/Universal/PCD/Dxe/Service.h             |  4 ++--
 MdeModulePkg/Universal/PCD/Pei/Pcd.c                 |  2 +-
 MdeModulePkg/Universal/PCD/Pei/Service.c             |  4 ++--
 MdeModulePkg/Universal/PCD/Pei/Service.h             |  4 ++--
 7 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/MdeModulePkg/Include/Guid/PcdDataBaseSignatureGuid.h b/MdeModulePkg/Include/Guid/PcdDataBaseSignatureGuid.h
index ac95f7e21ae8..d2e848800b75 100644
--- a/MdeModulePkg/Include/Guid/PcdDataBaseSignatureGuid.h
+++ b/MdeModulePkg/Include/Guid/PcdDataBaseSignatureGuid.h
@@ -1,7 +1,7 @@
 /** @file
   Guid for Pcd DataBase Signature.
 
-Copyright (c) 2012 - 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2012 - 2016, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials are licensed and made available under
 the terms and conditions of the BSD License that accompanies this distribution.
 The full text of the license may be found at
@@ -23,7 +23,7 @@ extern EFI_GUID gPcdDataBaseSignatureGuid;
 //
 // Common definitions
 //
-typedef UINT8 SKU_ID;
+typedef UINT64 SKU_ID;
 
 #define PCD_TYPE_SHIFT        28
 
@@ -62,7 +62,7 @@ typedef struct  {
 } DYNAMICEX_MAPPING;
 
 typedef struct {
-  UINT32  SkuDataStartOffset;   // Offset(with TYPE info) from the PCD_DB.
+  UINT32  SkuDataStartOffset;   // Offset(with DATUM TYPE info) from the PCD_DB.
   UINT32  SkuIdTableOffset;     // Offset from the PCD_DB.
 } SKU_HEAD;
 
@@ -95,6 +95,7 @@ typedef struct {
     GUID                  Signature;            // PcdDataBaseGuid.
     UINT32                BuildVersion;
     UINT32                Length;
+    SKU_ID                SystemSkuId;          // Current SkuId value.
     UINT32                UninitDataBaseSize;   // Total size for PCD those default value with 0.
     TABLE_OFFSET          LocalTokenNumberTableOffset;
     TABLE_OFFSET          ExMapTableOffset;
@@ -106,14 +107,15 @@ typedef struct {
     UINT16                LocalTokenCount;      // LOCAL_TOKEN_NUMBER for all.
     UINT16                ExTokenCount;         // EX_TOKEN_NUMBER for DynamicEx.
     UINT16                GuidTableCount;       // The Number of Guid in GuidTable.
-    SKU_ID                SystemSkuId;          // Current SkuId value.
-    UINT8                 Pad;                  // Pad bytes to satisfy the alignment.
+    UINT8                 Pad[2];               // Pad bytes to satisfy the alignment.
 
     //
     // Default initialized external PCD database binary structure
     //
     // 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
@@ -129,8 +131,6 @@ typedef struct {
     //UINT16                         ValueUint16[];
     //UINT8                          ValueUint8[];
     //BOOLEAN                        ValueBoolean[];
-    //UINT8                          SkuIdTable[];            // SkuIds system supports.
-    //UINT8                          SkuIndexTable[];         // SkuIds for each PCD with SKU enable.
 
 } PCD_DATABASE_INIT;
 
diff --git a/MdeModulePkg/Universal/PCD/Dxe/Pcd.c b/MdeModulePkg/Universal/PCD/Dxe/Pcd.c
index b9cf9e4e7646..1bb9098c04cf 100644
--- a/MdeModulePkg/Universal/PCD/Dxe/Pcd.c
+++ b/MdeModulePkg/Universal/PCD/Dxe/Pcd.c
@@ -239,7 +239,7 @@ DxeGetPcdInfoGetSku (
   VOID
   )
 {
-  return mPcdDatabase.DxeDb->SystemSkuId;
+  return (UINTN) mPcdDatabase.DxeDb->SystemSkuId;
 }
 
 /**
diff --git a/MdeModulePkg/Universal/PCD/Dxe/Service.c b/MdeModulePkg/Universal/PCD/Dxe/Service.c
index 9ab456624fc7..6d0b0f8adec6 100644
--- a/MdeModulePkg/Universal/PCD/Dxe/Service.c
+++ b/MdeModulePkg/Universal/PCD/Dxe/Service.c
@@ -958,7 +958,7 @@ GetSkuEnabledTokenNumber (
 {
   SKU_HEAD              *SkuHead;
   SKU_ID                *SkuIdTable;
-  INTN                  Index;
+  UINTN                 Index;
   UINT8                 *Value;
   UINT8                 *PcdDb;
   BOOLEAN               FoundSku;
diff --git a/MdeModulePkg/Universal/PCD/Dxe/Service.h b/MdeModulePkg/Universal/PCD/Dxe/Service.h
index 4d8ab0f13fd6..0257a3487cc4 100644
--- a/MdeModulePkg/Universal/PCD/Dxe/Service.h
+++ b/MdeModulePkg/Universal/PCD/Dxe/Service.h
@@ -1,7 +1,7 @@
 /** @file
 Private functions used by PCD DXE driver.
 
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD License
 which accompanies this distribution.  The full text of the license may be found at
@@ -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
 // the version of the generated DXE PCD Database by build tool.
 //
-#define PCD_SERVICE_DXE_VERSION      5
+#define PCD_SERVICE_DXE_VERSION      6
 
 //
 // PCD_DXE_SERVICE_DRIVER_VERSION is defined in Autogen.h.
diff --git a/MdeModulePkg/Universal/PCD/Pei/Pcd.c b/MdeModulePkg/Universal/PCD/Pei/Pcd.c
index 4d0caed5a94e..7a486b7d1d05 100644
--- a/MdeModulePkg/Universal/PCD/Pei/Pcd.c
+++ b/MdeModulePkg/Universal/PCD/Pei/Pcd.c
@@ -226,7 +226,7 @@ PeiGetPcdInfoGetSku (
   VOID
   )
 {
-  return GetPcdDatabase()->SystemSkuId;
+  return (UINTN) GetPcdDatabase()->SystemSkuId;
 }
 
 /**
diff --git a/MdeModulePkg/Universal/PCD/Pei/Service.c b/MdeModulePkg/Universal/PCD/Pei/Service.c
index 45ce01b1fa73..66ca892ed2e0 100644
--- a/MdeModulePkg/Universal/PCD/Pei/Service.c
+++ b/MdeModulePkg/Universal/PCD/Pei/Service.c
@@ -2,7 +2,7 @@
   The driver internal functions are implmented here.
   They build Pei PCD database, and provide access service to PCD database.
 
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD License
 which accompanies this distribution.  The full text of the license may be found at
@@ -550,7 +550,7 @@ GetSkuEnabledTokenNumber (
   PEI_PCD_DATABASE      *PeiPcdDb;
   SKU_HEAD              *SkuHead;
   SKU_ID                *SkuIdTable;
-  INTN                  Index;
+  UINTN                 Index;
   UINT8                 *Value;
   BOOLEAN               FoundSku;
 
diff --git a/MdeModulePkg/Universal/PCD/Pei/Service.h b/MdeModulePkg/Universal/PCD/Pei/Service.h
index c75187c2b117..fa14abeaa3b1 100644
--- a/MdeModulePkg/Universal/PCD/Pei/Service.h
+++ b/MdeModulePkg/Universal/PCD/Pei/Service.h
@@ -1,7 +1,7 @@
 /** @file
   The internal header file declares the private functions used by PeiPcd driver.
 
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD License
 which accompanies this distribution.  The full text of the license may be found at
@@ -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
 // the version of the generated PEIM PCD Database by build tool.
 //
-#define PCD_SERVICE_PEIM_VERSION      5
+#define PCD_SERVICE_PEIM_VERSION      6
 
 //
 // PCD_PEI_SERVICE_DRIVER_VERSION is defined in Autogen.h.
-- 
2.7.0.windows.1



  parent reply	other threads:[~2016-09-02 11:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-02 11:59 [PATCH 0/2] Follow PI1.4a to fix artificial limitation of PCD SkuId range Star Zeng
2016-09-02 11:59 ` [PATCH 1/2] BaseTools: " Star Zeng
2016-09-02 11:59 ` Star Zeng [this message]
2016-09-07  1:56 ` [PATCH 0/2] " Gao, Liming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1472817558-234220-3-git-send-email-star.zeng@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox