diff options
Diffstat (limited to 'MdePkg')
-rw-r--r-- | MdePkg/Include/Library/PcdLib.h | 23 | ||||
-rw-r--r-- | MdePkg/Library/BasePcdLibNull/PcdLib.c | 6 | ||||
-rw-r--r-- | MdePkg/Library/DxePcdLib/DxePcdLib.c | 11 | ||||
-rw-r--r-- | MdePkg/Library/PeiPcdLib/PeiPcdLib.c | 8 |
4 files changed, 32 insertions, 16 deletions
diff --git a/MdePkg/Include/Library/PcdLib.h b/MdePkg/Include/Library/PcdLib.h index 5858cfc475..fe8a1e6939 100644 --- a/MdePkg/Include/Library/PcdLib.h +++ b/MdePkg/Include/Library/PcdLib.h @@ -435,17 +435,16 @@ LibPcdSet64 ( /**
- Sets a buffer for the token specified by TokenNumber to
- the value specified by Buffer and SizeOfValue. Buffer to
- be set is returned. The content of the buffer could be
- overwritten if a Callback on SET is registered with this
- TokenNumber.
-
- If SizeOfValue is greater than the maximum
- size support by TokenNumber, then set SizeOfValue to the
- maximum size supported by TokenNumber and return NULL to
- indicate that the set operation was not actually performed.
+ Sets a buffer for the token specified by TokenNumber to the value
+ specified by Buffer and SizeOfValue. Buffer is returned.
+ If SizeOfValue is greater than the maximum size support by TokenNumber,
+ then set SizeOfValue to the maximum size supported by TokenNumber and
+ return NULL to indicate that the set operation was not actually performed.
+
+ If SizeOfValue is set to MAX_ADDRESS, then SizeOfValue must be set to the
+ maximum size supported by TokenName and NULL must be returned.
+ If SizeOfValue is NULL, then ASSERT().
If SizeOfValue > 0 and Buffer is NULL, then ASSERT().
@param[in] TokenNumber The PCD token number to set a current value for.
@@ -577,6 +576,8 @@ LibPcdSetEx64 ( supported by TokenNumber and return NULL to indicate that the set operation
was not actually performed.
+ If Guid is NULL, then ASSERT().
+ If SizeOfValue is NULL, then ASSERT().
If SizeOfValue > 0 and Buffer is NULL, then ASSERT().
@param[in] Guid Pointer to a 128-bit unique value that
@@ -731,7 +732,7 @@ LibPcdGetNextToken ( **/
-CONST GUID*
+GUID *
EFIAPI
LibPcdGetNextTokenSpace (
IN CONST GUID *Guid
diff --git a/MdePkg/Library/BasePcdLibNull/PcdLib.c b/MdePkg/Library/BasePcdLibNull/PcdLib.c index de90c2f90e..a2e46b05b2 100644 --- a/MdePkg/Library/BasePcdLibNull/PcdLib.c +++ b/MdePkg/Library/BasePcdLibNull/PcdLib.c @@ -31,6 +31,8 @@ LibPcdSetSku ( IN UINTN SkuId
)
{
+ ASSERT (SkuId < 0x100);
+
return SkuId;
}
@@ -633,6 +635,8 @@ LibPcdSetExPtr ( {
ASSERT (Guid != NULL);
+ ASSERT (SizeOfBuffer != NULL);
+
if (*SizeOfBuffer > 0) {
ASSERT (Buffer != NULL);
}
@@ -768,7 +772,7 @@ LibPcdGetNextToken ( @retval CONST GUID * The next valid token namespace.
**/
-CONST GUID*
+GUID *
EFIAPI
LibPcdGetNextTokenSpace (
IN CONST GUID *Guid
diff --git a/MdePkg/Library/DxePcdLib/DxePcdLib.c b/MdePkg/Library/DxePcdLib/DxePcdLib.c index ec5da259a6..b746614d5b 100644 --- a/MdePkg/Library/DxePcdLib/DxePcdLib.c +++ b/MdePkg/Library/DxePcdLib/DxePcdLib.c @@ -57,6 +57,8 @@ LibPcdSetSku ( IN UINTN SkuId
)
{
+ ASSERT (SkuId < 0x100);
+
mPcd->SetSku (SkuId);
return SkuId;
@@ -728,10 +730,15 @@ LibPcdSetExPtr ( EFI_STATUS Status;
UINTN Size;
+ ASSERT (Guid != NULL);
+
+ ASSERT (SizeOfBuffer != NULL);
+
if (*SizeOfBuffer > 0) {
ASSERT (Buffer != NULL);
}
+
Size = LibPcdGetExSize (Guid, TokenNumber);
if (*SizeOfBuffer > Size) {
*SizeOfBuffer = Size;
@@ -901,7 +908,7 @@ LibPcdGetNextToken ( @retval CONST GUID * The next valid token namespace.
**/
-CONST GUID*
+GUID *
EFIAPI
LibPcdGetNextTokenSpace (
IN CONST GUID *Guid
@@ -913,6 +920,6 @@ LibPcdGetNextTokenSpace ( ASSERT_EFI_ERROR (Status);
- return Guid;
+ return (GUID *) Guid;
}
diff --git a/MdePkg/Library/PeiPcdLib/PeiPcdLib.c b/MdePkg/Library/PeiPcdLib/PeiPcdLib.c index 4018e44f70..57fa821156 100644 --- a/MdePkg/Library/PeiPcdLib/PeiPcdLib.c +++ b/MdePkg/Library/PeiPcdLib/PeiPcdLib.c @@ -68,6 +68,8 @@ LibPcdSetSku ( )
{
+ ASSERT (SkuId < 0x100);
+
GetPcdPpiPtr()->SetSku (SkuId);;
return SkuId;
@@ -586,6 +588,8 @@ LibPcdSetPtr ( PCD_PPI *PcdPpi;
UINTN Size;
+ ASSERT (SizeOfBuffer != NULL);
+
if (*SizeOfBuffer > 0) {
ASSERT (Buffer != NULL);
}
@@ -999,7 +1003,7 @@ LibPcdGetNextToken ( @retval CONST GUID * The next valid token namespace.
**/
-CONST GUID*
+GUID *
EFIAPI
LibPcdGetNextTokenSpace (
IN CONST GUID *Guid
@@ -1015,6 +1019,6 @@ LibPcdGetNextTokenSpace ( ASSERT_EFI_ERROR (Status);
- return Guid;
+ return (GUID *)Guid;
}
|