]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg: Follow PI1.4a to fix artificial limitation of SkuId range
authorStar Zeng <star.zeng@intel.com>
Fri, 20 May 2016 04:20:04 +0000 (12:20 +0800)
committerStar Zeng <star.zeng@intel.com>
Mon, 23 May 2016 02:48:53 +0000 (10:48 +0800)
There is absolutely no reason to artificially limit the SKU range to 1-255.
PI1.4a spec fixed the artificial limitation.

This patch is to follow PI1.4a spec to remove PCD_MAX_SKU_ID definition,
the check to PCD_MAX_SKU_ID and the comments describes the limitation.

Cc: Liming Gao <liming.gao@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>
MdePkg/Include/Library/PcdLib.h
MdePkg/Library/BasePcdLibNull/PcdLib.c
MdePkg/Library/DxePcdLib/DxePcdLib.c
MdePkg/Library/PeiPcdLib/PeiPcdLib.c

index ad8a70082acb4c8b1c9fca159a72ce55249289ee..4def328862941fdfd2b1798eb018e4fdb90e1c03 100644 (file)
@@ -14,7 +14,7 @@
   There are no restrictions on the use of FeaturePcd(), FixedPcdGetXX(),\r
   PatchPcdGetXX(), and PatchPcdSetXX().\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
@@ -28,8 +28,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #ifndef __PCD_LIB_H__\r
 #define __PCD_LIB_H__\r
 \r
-#define PCD_MAX_SKU_ID           0x100\r
-\r
 \r
 /**\r
   Retrieves a token number based on a token name.\r
@@ -1074,7 +1072,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   This function provides a means by which SKU support can be established in the PCD infrastructure.\r
 \r
   Sets the current SKU in the PCD database to the value specified by SkuId.  SkuId is returned.\r
-  If SkuId >= PCD_MAX_SKU_ID, then ASSERT(). \r
 \r
   @param  SkuId   The SKU value that will be used when the PCD service retrieves and sets values\r
                   associated with a PCD token.\r
@@ -2250,8 +2247,6 @@ LibPcdGetInfoEx (
 /**\r
   Retrieve the currently set SKU Id.\r
 \r
-  If the sku id got >= PCD_MAX_SKU_ID, then ASSERT().\r
-\r
   @return   The currently set SKU Id. If the platform has not set at a SKU Id, then the\r
             default SKU Id value of 0 is returned. If the platform has set a SKU Id, then the currently set SKU\r
             Id is returned.\r
index 5d914ada561c6abc62122134e4c587b8a51be63e..4fc3672b7a364c0d3d7ca9b5cab9da891d1df91c 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   A emptry template implementation of PCD Library.\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
@@ -26,8 +26,6 @@
 \r
   @param[in]  SkuId The SKU value that will be used when the PCD service will retrieve and \r
                     set values associated with a PCD token.\r
-                    \r
-  If SkuId >= 0x100, then ASSERT().                  \r
 \r
   @return Return the SKU ID that just be set.\r
 \r
@@ -1465,8 +1463,6 @@ LibPcdGetInfoEx (
 /**\r
   Retrieve the currently set SKU Id.\r
 \r
-  If the sku id got >= PCD_MAX_SKU_ID, then ASSERT().\r
-\r
   @return   The currently set SKU Id. If the platform has not set at a SKU Id, then the\r
             default SKU Id value of 0 is returned. If the platform has set a SKU Id, then the currently set SKU\r
             Id is returned.\r
index 79f769557b80213c26f47084a2d30453e4f43f4e..371166818a34a5fea352bf58232bbf12e8a4af41 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Implementation of PcdLib class library for DXE phase.\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
@@ -125,7 +125,6 @@ GetPcdInfoProtocolPointer (
   This function provides a means by which SKU support can be established in the PCD infrastructure.\r
 \r
   Sets the current SKU in the PCD database to the value specified by SkuId.  SkuId is returned.\r
-  If SkuId >= PCD_MAX_SKU_ID, then ASSERT(). \r
 \r
   @param  SkuId   The SKU value that will be used when the PCD service retrieves and sets values\r
                   associated with a PCD token.\r
@@ -139,8 +138,6 @@ LibPcdSetSku (
   IN UINTN   SkuId\r
   )\r
 {\r
-  ASSERT (SkuId < PCD_MAX_SKU_ID);\r
-\r
   GetPcdProtocol()->SetSku (SkuId);\r
 \r
   return SkuId;\r
@@ -1614,8 +1611,6 @@ LibPcdGetInfoEx (
 /**\r
   Retrieve the currently set SKU Id.\r
 \r
-  If the sku id got >= PCD_MAX_SKU_ID, then ASSERT().\r
-\r
   @return   The currently set SKU Id. If the platform has not set at a SKU Id, then the\r
             default SKU Id value of 0 is returned. If the platform has set a SKU Id, then the currently set SKU\r
             Id is returned.\r
@@ -1626,11 +1621,6 @@ LibPcdGetSku (
   VOID\r
   )\r
 {\r
-  UINTN SkuId;\r
-\r
-  SkuId = GetPiPcdInfoProtocolPointer()->GetSku ();\r
-  ASSERT (SkuId < PCD_MAX_SKU_ID);\r
-\r
-  return SkuId;\r
+  return GetPiPcdInfoProtocolPointer()->GetSku ();\r
 }\r
 \r
index 53e8ad6c00175c2b261a6a8f010dba6ec4c51adc..2496701862fdb789ad25408547b2b1b63f1ce09f 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Implementation of PcdLib class library for PEI phase.\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
@@ -124,7 +124,6 @@ GetPiPcdInfoPpiPointer (
   This function provides a means by which SKU support can be established in the PCD infrastructure.\r
 \r
   Sets the current SKU in the PCD database to the value specified by SkuId.  SkuId is returned.\r
-  If SkuId >= PCD_MAX_SKU_ID, then ASSERT(). \r
 \r
   @param  SkuId   The SKU value that will be used when the PCD service retrieves \r
                   and sets values associated with a PCD token.\r
@@ -138,9 +137,6 @@ LibPcdSetSku (
   IN UINTN   SkuId\r
   )\r
 {\r
-\r
-  ASSERT (SkuId < PCD_MAX_SKU_ID);\r
-\r
   GetPiPcdPpiPointer()->SetSku (SkuId);\r
   \r
   return SkuId;\r
@@ -1615,8 +1611,6 @@ LibPcdGetInfoEx (
 /**\r
   Retrieve the currently set SKU Id.\r
 \r
-  If the sku id got >= PCD_MAX_SKU_ID, then ASSERT().\r
-\r
   @return   The currently set SKU Id. If the platform has not set at a SKU Id, then the\r
             default SKU Id value of 0 is returned. If the platform has set a SKU Id, then the currently set SKU\r
             Id is returned.\r
@@ -1627,10 +1621,5 @@ LibPcdGetSku (
   VOID\r
   )\r
 {\r
-  UINTN SkuId;\r
-\r
-  SkuId = GetPiPcdInfoPpiPointer()->GetSku ();\r
-  ASSERT (SkuId < PCD_MAX_SKU_ID);\r
-\r
-  return SkuId;\r
+  return GetPiPcdInfoPpiPointer()->GetSku ();\r
 }\r