summaryrefslogtreecommitdiffstats
path: root/MdePkg
diff options
context:
space:
mode:
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-03 15:40:49 +0000
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-03 15:40:49 +0000
commitbb5545b663e1d8ac4fd37003d5ba26fafdad5831 (patch)
treecfc7c990d6c40fa4be7996e1609af57f05edb7b8 /MdePkg
parenta15bb0d31f5345dd81dde0e978a3cbdc54fa27e7 (diff)
downloadedk2-bb5545b663e1d8ac4fd37003d5ba26fafdad5831.tar.gz
edk2-bb5545b663e1d8ac4fd37003d5ba26fafdad5831.tar.bz2
edk2-bb5545b663e1d8ac4fd37003d5ba26fafdad5831.zip
Add PcdDxe and PcdPEIM to all-arch for EdkModulePkg-All-Archs.fpd
Fix a few bugs in PcdDxe and PcdPEIM git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@722 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg')
-rw-r--r--MdePkg/Include/Library/PcdLib.h23
-rw-r--r--MdePkg/Library/BasePcdLibNull/PcdLib.c6
-rw-r--r--MdePkg/Library/DxePcdLib/DxePcdLib.c11
-rw-r--r--MdePkg/Library/PeiPcdLib/PeiPcdLib.c8
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;
}