]> git.proxmox.com Git - mirror_edk2.git/commitdiff
According to PI 1.2 spec Vol 3 chapter 8 PCD, if the PCD service determined that...
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 14 Jan 2010 16:29:29 +0000 (16:29 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 14 Jan 2010 16:29:29 +0000 (16:29 +0000)
incompatible with a call to this function, PCD_PPI/PROTOCOL's SetXEx interfaces should be return EFI_INVALID_PARAEMTER instead of ASSERT().

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9753 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/PCD/Dxe/Service.c
MdeModulePkg/Universal/PCD/Dxe/Service.h
MdeModulePkg/Universal/PCD/Pei/Service.c
MdeModulePkg/Universal/PCD/Pei/Service.h

index 532bb39cc40ae78955a0878f3dfb68cfea9dbd74..1999ac6cc498068fcf624586c30b36842c1644d9 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
     Help functions used by PCD DXE driver.\r
 \r
-Copyright (c) 2006 - 2007, Intel Corporation\r
+Copyright (c) 2006 - 2010, Intel Corporation\r
 All rights reserved. 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
@@ -678,6 +678,7 @@ SetValueWorker (
 \r
   @retval EFI_INVALID_PARAMETER  If this PCD type is VPD, VPD PCD can not be set.\r
   @retval EFI_INVALID_PARAMETER  If Size can not be set to size table.\r
+  @retval EFI_INVALID_PARAMETER  If Size of non-Ptr type PCD does not match the size information in PCD database.  \r
   @retval EFI_NOT_FOUND          If value type of PCD entry is intergrate, but not in\r
                                  range of UINT8, UINT16, UINT32, UINT64\r
   @retval EFI_NOT_FOUND          Can not find the PCD type according to token number.                                \r
@@ -727,8 +728,8 @@ SetWorker (
   //\r
   ASSERT (TokenNumber + 1 < PCD_TOTAL_TOKEN_NUMBER + 1);\r
 \r
-  if (!PtrType) {\r
-    ASSERT (*Size == DxePcdGetSize (TokenNumber + 1));\r
+  if ((!PtrType) && (*Size != DxePcdGetSize (TokenNumber + 1))) {\r
+    return EFI_INVALID_PARAMETER;\r
   }\r
   \r
   //\r
index 583b0d657d5600363af49b73a917d482489b8725..5602a728681f82913bb6e22254566a173cf334b6 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Private functions used by PCD DXE driver.\r
 \r
-Copyright (c) 2006 - 2007, Intel Corporation\r
+Copyright (c) 2006 - 2010, Intel Corporation\r
 All rights reserved. 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
@@ -775,6 +775,7 @@ SetValueWorker (
 \r
   @retval EFI_INVALID_PARAMETER  If this PCD type is VPD, VPD PCD can not be set.\r
   @retval EFI_INVALID_PARAMETER  If Size can not be set to size table.\r
+  @retval EFI_INVALID_PARAMETER  If Size of non-Ptr type PCD does not match the size information in PCD database.  \r
   @retval EFI_NOT_FOUND          If value type of PCD entry is intergrate, but not in\r
                                  range of UINT8, UINT16, UINT32, UINT64\r
   @retval EFI_NOT_FOUND          Can not find the PCD type according to token number.                                \r
index a791ef725a35d5b1cc05036ac90da9043b61d997..135d3dd3975141b5ac9130ee77d048daf6d6d1d8 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 - 2009, Intel Corporation\r
+Copyright (c) 2006 - 2010, Intel Corporation\r
 All rights reserved. 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
@@ -344,6 +344,7 @@ SetValueWorker (
 \r
   @retval EFI_INVALID_PARAMETER  If this PCD type is VPD, VPD PCD can not be set.\r
   @retval EFI_INVALID_PARAMETER  If Size can not be set to size table.\r
+  @retval EFI_INVALID_PARAMETER  If Size of non-Ptr type PCD does not match the size information in PCD database.\r
   @retval EFI_NOT_FOUND          If value type of PCD entry is intergrate, but not in\r
                                  range of UINT8, UINT16, UINT32, UINT64\r
   @retval EFI_NOT_FOUND          Can not find the PCD type according to token number.                                \r
@@ -383,8 +384,8 @@ SetWorker (
 \r
   LocalTokenNumber = PeiPcdDb->Init.LocalTokenNumberTable[TokenNumber];\r
 \r
-  if (!PtrType) {\r
-    ASSERT (PeiPcdGetSize(TokenNumber + 1) == *Size);\r
+  if ((!PtrType) && (PeiPcdGetSize(TokenNumber + 1) != *Size)) {\r
+    return EFI_INVALID_PARAMETER;\r
   }\r
 \r
   //\r
index b5c2a872a80cfe5c12bab59c886a785b752d325c..c4a08f127d5f181ebb8e956da4bfe25ad4512fd9 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 - 2009, Intel Corporation\r
+Copyright (c) 2006 - 2010, Intel Corporation\r
 All rights reserved. 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
@@ -794,6 +794,7 @@ SetValueWorker (
 \r
   @retval EFI_INVALID_PARAMETER  If this PCD type is VPD, VPD PCD can not be set.\r
   @retval EFI_INVALID_PARAMETER  If Size can not be set to size table.\r
+  @retval EFI_INVALID_PARAMETER  If Size of non-Ptr type PCD does not match the size information in PCD database.\r
   @retval EFI_NOT_FOUND          If value type of PCD entry is intergrate, but not in\r
                                  range of UINT8, UINT16, UINT32, UINT64\r
   @retval EFI_NOT_FOUND          Can not find the PCD type according to token number.                                \r