X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdePkg%2FLibrary%2FBasePcdLibNull%2FPcdLib.c;h=fbaff2b9c0f0f1d5ac329c54d146063fbd09856e;hb=9095d37b8fe5bfc3d02adad6ba7fd7359ebc0107;hp=e03c01da5fbe7750fac6c1ab49a98af10f7c0bf9;hpb=0befb08d23593e0c6fcb0b7fc45bce74b822cced;p=mirror_edk2.git diff --git a/MdePkg/Library/BasePcdLibNull/PcdLib.c b/MdePkg/Library/BasePcdLibNull/PcdLib.c index e03c01da5f..fbaff2b9c0 100644 --- a/MdePkg/Library/BasePcdLibNull/PcdLib.c +++ b/MdePkg/Library/BasePcdLibNull/PcdLib.c @@ -1,7 +1,7 @@ /** @file A emptry template implementation of PCD Library. - Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
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 @@ -24,10 +24,8 @@ Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned. - @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and + @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and set values associated with a PCD token. - - If SkuId >= 0x100, then ASSERT(). @return Return the SKU ID that just be set. @@ -45,12 +43,12 @@ LibPcdSetSku ( /** This function provides a means by which to retrieve a value for a given PCD token. - - Returns the 8-bit value for the token specified by TokenNumber. + + Returns the 8-bit value for the token specified by TokenNumber. @param[in] TokenNumber The PCD token number to retrieve a current value for. - @return Returns the 8-bit value for the token specified by TokenNumber. + @return Returns the 8-bit value for the token specified by TokenNumber. **/ UINT8 @@ -68,12 +66,12 @@ LibPcdGet8 ( /** This function provides a means by which to retrieve a value for a given PCD token. - - Returns the 16-bit value for the token specified by TokenNumber. + + Returns the 16-bit value for the token specified by TokenNumber. @param[in] TokenNumber The PCD token number to retrieve a current value for. - @return Returns the 16-bit value for the token specified by TokenNumber. + @return Returns the 16-bit value for the token specified by TokenNumber. **/ UINT16 @@ -91,8 +89,8 @@ LibPcdGet16 ( /** This function provides a means by which to retrieve a value for a given PCD token. - - Returns the 32-bit value for the token specified by TokenNumber. + + Returns the 32-bit value for the token specified by TokenNumber. @param[in] TokenNumber The PCD token number to retrieve a current value for. @@ -114,7 +112,7 @@ LibPcdGet32 ( /** This function provides a means by which to retrieve a value for a given PCD token. - + Returns the 64-bit value for the token specified by TokenNumber. @param[in] TokenNumber The PCD token number to retrieve a current value for. @@ -137,7 +135,7 @@ LibPcdGet64 ( /** This function provides a means by which to retrieve a value for a given PCD token. - + Returns the pointer to the buffer of the token specified by TokenNumber. @param[in] TokenNumber The PCD token number to retrieve a current value for. @@ -160,15 +158,15 @@ LibPcdGetPtr ( /** This function provides a means by which to retrieve a value for a given PCD token. - - Returns the Boolean value of the token specified by TokenNumber. + + Returns the Boolean value of the token specified by TokenNumber. @param[in] TokenNumber The PCD token number to retrieve a current value for. - @return Returns the Boolean value of the token specified by TokenNumber. + @return Returns the Boolean value of the token specified by TokenNumber. **/ -BOOLEAN +BOOLEAN EFIAPI LibPcdGetBool ( IN UINTN TokenNumber @@ -186,7 +184,7 @@ LibPcdGetBool ( @param[in] TokenNumber The PCD token number to retrieve a current value for. - @return Returns the size of the token specified by TokenNumber. + @return Returns the size of the token specified by TokenNumber. **/ UINTN @@ -204,12 +202,12 @@ LibPcdGetSize ( /** This function provides a means by which to retrieve a value for a given PCD token. - + Returns the 8-bit value for the token specified by TokenNumber and Guid. - - If Guid is NULL, then ASSERT(). - @param[in] Guid The pointer to a 128-bit unique value that designates + If Guid is NULL, then ASSERT(). + + @param[in] Guid The pointer to a 128-bit unique value that designates which namespace to retrieve a value from. @param[in] TokenNumber The PCD token number to retrieve a current value for. @@ -234,10 +232,10 @@ LibPcdGetEx8 ( This function provides a means by which to retrieve a value for a given PCD token. Returns the 16-bit value for the token specified by TokenNumber and Guid. - - If Guid is NULL, then ASSERT(). - @param[in] Guid The pointer to a 128-bit unique value that designates + If Guid is NULL, then ASSERT(). + + @param[in] Guid The pointer to a 128-bit unique value that designates which namespace to retrieve a value from. @param[in] TokenNumber The PCD token number to retrieve a current value for. @@ -260,9 +258,9 @@ LibPcdGetEx16 ( /** Returns the 32-bit value for the token specified by TokenNumber and Guid. - If Guid is NULL, then ASSERT(). + If Guid is NULL, then ASSERT(). - @param[in] Guid The pointer to a 128-bit unique value that designates + @param[in] Guid The pointer to a 128-bit unique value that designates which namespace to retrieve a value from. @param[in] TokenNumber The PCD token number to retrieve a current value for. @@ -285,12 +283,12 @@ LibPcdGetEx32 ( /** This function provides a means by which to retrieve a value for a given PCD token. - + Returns the 64-bit value for the token specified by TokenNumber and Guid. - - If Guid is NULL, then ASSERT(). - @param[in] Guid The pointer to a 128-bit unique value that designates + If Guid is NULL, then ASSERT(). + + @param[in] Guid The pointer to a 128-bit unique value that designates which namespace to retrieve a value from. @param[in] TokenNumber The PCD token number to retrieve a current value for. @@ -313,12 +311,12 @@ LibPcdGetEx64 ( /** This function provides a means by which to retrieve a value for a given PCD token. - + Returns the pointer to the buffer of token specified by TokenNumber and Guid. - - If Guid is NULL, then ASSERT(). - @param[in] Guid The pointer to a 128-bit unique value that designates + If Guid is NULL, then ASSERT(). + + @param[in] Guid The pointer to a 128-bit unique value that designates which namespace to retrieve a value from. @param[in] TokenNumber The PCD token number to retrieve a current value for. @@ -341,12 +339,12 @@ LibPcdGetExPtr ( /** This function provides a means by which to retrieve a value for a given PCD token. - - Returns the Boolean value of the token specified by TokenNumber and Guid. - - If Guid is NULL, then ASSERT(). - @param[in] Guid The pointer to a 128-bit unique value that designates + Returns the Boolean value of the token specified by TokenNumber and Guid. + + If Guid is NULL, then ASSERT(). + + @param[in] Guid The pointer to a 128-bit unique value that designates which namespace to retrieve a value from. @param[in] TokenNumber The PCD token number to retrieve a current value for. @@ -369,12 +367,12 @@ LibPcdGetExBool ( /** This function provides a means by which to retrieve the size of a given PCD token. - - Returns the size of the token specified by TokenNumber and Guid. - - If Guid is NULL, then ASSERT(). - @param[in] Guid The pointer to a 128-bit unique value that designates + Returns the size of the token specified by TokenNumber and Guid. + + If Guid is NULL, then ASSERT(). + + @param[in] Guid The pointer to a 128-bit unique value that designates which namespace to retrieve a value from. @param[in] TokenNumber The PCD token number to retrieve a current value for. @@ -395,13 +393,12 @@ LibPcdGetExSize ( +#ifndef DISABLE_NEW_DEPRECATED_INTERFACES /** This function provides a means by which to set a value for a given PCD token. - - Sets the 8-bit value for the token specified by TokenNumber - to the value specified by Value. Value is returned. - If the set operation was not correctly performed, then ASSERT(). + Sets the 8-bit value for the token specified by TokenNumber + to the value specified by Value. Value is returned. @param[in] TokenNumber The PCD token number to set a current value for. @param[in] Value The 8-bit value to set. @@ -425,11 +422,9 @@ LibPcdSet8 ( /** This function provides a means by which to set a value for a given PCD token. - - Sets the 16-bit value for the token specified by TokenNumber - to the value specified by Value. Value is returned. - If the set operation was not correctly performed, then ASSERT(). + Sets the 16-bit value for the token specified by TokenNumber + to the value specified by Value. Value is returned. @param[in] TokenNumber The PCD token number to set a current value for. @param[in] Value The 16-bit value to set. @@ -453,11 +448,9 @@ LibPcdSet16 ( /** This function provides a means by which to set a value for a given PCD token. - - Sets the 32-bit value for the token specified by TokenNumber - to the value specified by Value. Value is returned. - If the set operation was not correctly performed, then ASSERT(). + Sets the 32-bit value for the token specified by TokenNumber + to the value specified by Value. Value is returned. @param[in] TokenNumber The PCD token number to set a current value for. @param[in] Value The 32-bit value to set. @@ -481,11 +474,9 @@ LibPcdSet32 ( /** This function provides a means by which to set a value for a given PCD token. - - Sets the 64-bit value for the token specified by TokenNumber - to the value specified by Value. Value is returned. - If the set operation was not correctly performed, then ASSERT(). + Sets the 64-bit value for the token specified by TokenNumber + to the value specified by Value. Value is returned. @param[in] TokenNumber The PCD token number to set a current value for. @param[in] Value The 64-bit value to set. @@ -509,20 +500,19 @@ LibPcdSet64 ( /** This function provides a means by which to set a value for a given PCD token. - - Sets a buffer for the token specified by TokenNumber to the value - specified by Buffer and SizeOfBuffer. Buffer is returned. - If SizeOfBuffer is greater than the maximum size support by TokenNumber, - then set SizeOfBuffer to the maximum size supported by TokenNumber and - return NULL to indicate that the set operation was not actually performed, - or ASSERT() if the set operation was not corretly performed. - - If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the + + Sets a buffer for the token specified by TokenNumber to the value + specified by Buffer and SizeOfBuffer. Buffer is returned. + If SizeOfBuffer is greater than the maximum size support by TokenNumber, + then set SizeOfBuffer to the maximum size supported by TokenNumber and + return NULL to indicate that the set operation was not actually performed. + + If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size supported by TokenName and NULL must be returned. - + If SizeOfBuffer is NULL, then ASSERT(). If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). - + @param[in] TokenNumber The PCD token number to set a current value for. @param[in, out] SizeOfBuffer The size, in bytes, of Buffer. @param[in] Buffer A pointer to the buffer to set. @@ -547,11 +537,9 @@ LibPcdSetPtr ( /** This function provides a means by which to set a value for a given PCD token. - - Sets the Boolean value for the token specified by TokenNumber - to the value specified by Value. Value is returned. - If the set operation was not correctly performed, then ASSERT(). + Sets the Boolean value for the token specified by TokenNumber + to the value specified by Value. Value is returned. @param[in] TokenNumber The PCD token number to set a current value for. @param[in] Value The boolean value to set. @@ -575,14 +563,13 @@ LibPcdSetBool ( /** This function provides a means by which to set a value for a given PCD token. - - Sets the 8-bit value for the token specified by TokenNumber and + + Sets the 8-bit value for the token specified by TokenNumber and Guid to the value specified by Value. Value is returned. If Guid is NULL, then ASSERT(). - If the set operation was not correctly performed, then ASSERT(). - @param[in] Guid The pointer to a 128-bit unique value that + @param[in] Guid The pointer to a 128-bit unique value that designates which namespace to set a value from. @param[in] TokenNumber The PCD token number to set a current value for. @param[in] Value The 8-bit value to set. @@ -607,14 +594,13 @@ LibPcdSetEx8 ( /** This function provides a means by which to set a value for a given PCD token. - - Sets the 16-bit value for the token specified by TokenNumber and + + Sets the 16-bit value for the token specified by TokenNumber and Guid to the value specified by Value. Value is returned. If Guid is NULL, then ASSERT(). - If the set operation was not correctly performed, then ASSERT(). - @param[in] Guid The pointer to a 128-bit unique value that + @param[in] Guid The pointer to a 128-bit unique value that designates which namespace to set a value from. @param[in] TokenNumber The PCD token number to set a current value for. @param[in] Value The 16-bit value to set. @@ -639,14 +625,13 @@ LibPcdSetEx16 ( /** This function provides a means by which to set a value for a given PCD token. - - Sets the 32-bit value for the token specified by TokenNumber and + + Sets the 32-bit value for the token specified by TokenNumber and Guid to the value specified by Value. Value is returned. If Guid is NULL, then ASSERT(). - If the set operation was not correctly performed, then ASSERT(). - @param[in] Guid The pointer to a 128-bit unique value that + @param[in] Guid The pointer to a 128-bit unique value that designates which namespace to set a value from. @param[in] TokenNumber The PCD token number to set a current value for. @param[in] Value The 32-bit value to set. @@ -671,14 +656,13 @@ LibPcdSetEx32 ( /** This function provides a means by which to set a value for a given PCD token. - - Sets the 64-bit value for the token specified by TokenNumber and + + Sets the 64-bit value for the token specified by TokenNumber and Guid to the value specified by Value. Value is returned. If Guid is NULL, then ASSERT(). - If the set operation was not correctly performed, then ASSERT(). - @param[in] Guid The pointer to a 128-bit unique value that + @param[in] Guid The pointer to a 128-bit unique value that designates which namespace to set a value from. @param[in] TokenNumber The PCD token number to set a current value for. @param[in] Value The 64-bit value to set. @@ -703,18 +687,18 @@ LibPcdSetEx64 ( /** This function provides a means by which to set a value for a given PCD token. - - Sets a buffer for the token specified by TokenNumber to the value specified by - Buffer and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than - the maximum size support by TokenNumber, then set SizeOfBuffer to the maximum size - supported by TokenNumber and return NULL to indicate that the set operation - was not actually performed, or ASSERT() if the set operation was not corretly performed. - + + Sets a buffer for the token specified by TokenNumber to the value specified by + Buffer and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than + the maximum size support by TokenNumber, then set SizeOfBuffer to the maximum size + supported by TokenNumber and return NULL to indicate that the set operation + was not actually performed. + If Guid is NULL, then ASSERT(). If SizeOfBuffer is NULL, then ASSERT(). If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). - - @param[in] Guid The pointer to a 128-bit unique value that + + @param[in] Guid The pointer to a 128-bit unique value that designates which namespace to set a value from. @param[in] TokenNumber The PCD token number to set a current value for. @param[in, out] SizeOfBuffer The size, in bytes, of Buffer. @@ -741,14 +725,13 @@ LibPcdSetExPtr ( /** This function provides a means by which to set a value for a given PCD token. - - Sets the Boolean value for the token specified by TokenNumber and + + Sets the Boolean value for the token specified by TokenNumber and Guid to the value specified by Value. Value is returned. If Guid is NULL, then ASSERT(). - If the set operation was not correctly performed, then ASSERT(). - @param[in] Guid The pointer to a 128-bit unique value that + @param[in] Guid The pointer to a 128-bit unique value that designates which namespace to set a value from. @param[in] TokenNumber The PCD token number to set a current value for. @param[in] Value The Boolean value to set. @@ -768,23 +751,358 @@ LibPcdSetExBool ( return FALSE; } +#endif + +/** + This function provides a means by which to set a value for a given PCD token. + + Sets the 8-bit value for the token specified by TokenNumber + to the value specified by Value. + + @param[in] TokenNumber The PCD token number to set a current value for. + @param[in] Value The 8-bit value to set. + + @return The status of the set operation. + +**/ +RETURN_STATUS +EFIAPI +LibPcdSet8S ( + IN UINTN TokenNumber, + IN UINT8 Value + ) +{ + ASSERT (FALSE); + + return RETURN_INVALID_PARAMETER; +} + +/** + This function provides a means by which to set a value for a given PCD token. + + Sets the 16-bit value for the token specified by TokenNumber + to the value specified by Value. + + @param[in] TokenNumber The PCD token number to set a current value for. + @param[in] Value The 16-bit value to set. + + @return The status of the set operation. + +**/ +RETURN_STATUS +EFIAPI +LibPcdSet16S ( + IN UINTN TokenNumber, + IN UINT16 Value + ) +{ + ASSERT (FALSE); + + return RETURN_INVALID_PARAMETER; +} + +/** + This function provides a means by which to set a value for a given PCD token. + + Sets the 32-bit value for the token specified by TokenNumber + to the value specified by Value. + + @param[in] TokenNumber The PCD token number to set a current value for. + @param[in] Value The 32-bit value to set. + + @return The status of the set operation. + +**/ +RETURN_STATUS +EFIAPI +LibPcdSet32S ( + IN UINTN TokenNumber, + IN UINT32 Value + ) +{ + ASSERT (FALSE); + + return RETURN_INVALID_PARAMETER; +} + +/** + This function provides a means by which to set a value for a given PCD token. + + Sets the 64-bit value for the token specified by TokenNumber + to the value specified by Value. + + @param[in] TokenNumber The PCD token number to set a current value for. + @param[in] Value The 64-bit value to set. + + @return The status of the set operation. + +**/ +RETURN_STATUS +EFIAPI +LibPcdSet64S ( + IN UINTN TokenNumber, + IN UINT64 Value + ) +{ + ASSERT (FALSE); + + return RETURN_INVALID_PARAMETER; +} + +/** + This function provides a means by which to set a value for a given PCD token. + + Sets a buffer for the token specified by TokenNumber to the value specified + by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than the maximum size + support by TokenNumber, then set SizeOfBuffer to the maximum size supported by + TokenNumber and return EFI_INVALID_PARAMETER to indicate that the set operation + was not actually performed. + + If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the + maximum size supported by TokenName and EFI_INVALID_PARAMETER must be returned. + + If SizeOfBuffer is NULL, then ASSERT(). + If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). + + @param[in] TokenNumber The PCD token number to set a current value for. + @param[in, out] SizeOfBuffer The size, in bytes, of Buffer. + @param[in] Buffer A pointer to the buffer to set. + + @return The status of the set operation. + +**/ +RETURN_STATUS +EFIAPI +LibPcdSetPtrS ( + IN UINTN TokenNumber, + IN OUT UINTN *SizeOfBuffer, + IN CONST VOID *Buffer + ) +{ + ASSERT (FALSE); + + return RETURN_INVALID_PARAMETER; +} + +/** + This function provides a means by which to set a value for a given PCD token. + + Sets the boolean value for the token specified by TokenNumber + to the value specified by Value. + + @param[in] TokenNumber The PCD token number to set a current value for. + @param[in] Value The boolean value to set. + + @return The status of the set operation. + +**/ +RETURN_STATUS +EFIAPI +LibPcdSetBoolS ( + IN UINTN TokenNumber, + IN BOOLEAN Value + ) +{ + ASSERT (FALSE); + + return RETURN_INVALID_PARAMETER; +} +/** + This function provides a means by which to set a value for a given PCD token. + + Sets the 8-bit value for the token specified by TokenNumber + to the value specified by Value. + + If Guid is NULL, then ASSERT(). + + @param[in] Guid The pointer to a 128-bit unique value that + designates which namespace to set a value from. + @param[in] TokenNumber The PCD token number to set a current value for. + @param[in] Value The 8-bit value to set. + + @return The status of the set operation. + +**/ +RETURN_STATUS +EFIAPI +LibPcdSetEx8S ( + IN CONST GUID *Guid, + IN UINTN TokenNumber, + IN UINT8 Value + ) +{ + ASSERT (FALSE); + + return RETURN_INVALID_PARAMETER; +} + +/** + This function provides a means by which to set a value for a given PCD token. + + Sets the 16-bit value for the token specified by TokenNumber + to the value specified by Value. + + If Guid is NULL, then ASSERT(). + + @param[in] Guid The pointer to a 128-bit unique value that + designates which namespace to set a value from. + @param[in] TokenNumber The PCD token number to set a current value for. + @param[in] Value The 16-bit value to set. + + @return The status of the set operation. + +**/ +RETURN_STATUS +EFIAPI +LibPcdSetEx16S ( + IN CONST GUID *Guid, + IN UINTN TokenNumber, + IN UINT16 Value + ) +{ + ASSERT (FALSE); + return RETURN_INVALID_PARAMETER; +} + +/** + This function provides a means by which to set a value for a given PCD token. + + Sets the 32-bit value for the token specified by TokenNumber + to the value specified by Value. + + If Guid is NULL, then ASSERT(). + + @param[in] Guid The pointer to a 128-bit unique value that + designates which namespace to set a value from. + @param[in] TokenNumber The PCD token number to set a current value for. + @param[in] Value The 32-bit value to set. + + @return The status of the set operation. + +**/ +RETURN_STATUS +EFIAPI +LibPcdSetEx32S ( + IN CONST GUID *Guid, + IN UINTN TokenNumber, + IN UINT32 Value + ) +{ + ASSERT (FALSE); + + return RETURN_INVALID_PARAMETER; +} + +/** + This function provides a means by which to set a value for a given PCD token. + + Sets the 64-bit value for the token specified by TokenNumber + to the value specified by Value. + + If Guid is NULL, then ASSERT(). + + @param[in] Guid The pointer to a 128-bit unique value that + designates which namespace to set a value from. + @param[in] TokenNumber The PCD token number to set a current value for. + @param[in] Value The 64-bit value to set. + + @return The status of the set operation. + +**/ +RETURN_STATUS +EFIAPI +LibPcdSetEx64S ( + IN CONST GUID *Guid, + IN UINTN TokenNumber, + IN UINT64 Value + ) +{ + ASSERT (FALSE); + + return RETURN_INVALID_PARAMETER; +} + +/** + This function provides a means by which to set a value for a given PCD token. + + Sets a buffer for the token specified by TokenNumber to the value specified by + Buffer and SizeOfBuffer. If SizeOfBuffer is greater than the maximum size + support by TokenNumber, then set SizeOfBuffer to the maximum size supported by + TokenNumber and return EFI_INVALID_PARAMETER to indicate that the set operation + was not actually performed. + + If Guid is NULL, then ASSERT(). + If SizeOfBuffer is NULL, then ASSERT(). + If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). + + @param[in] Guid Pointer to a 128-bit unique value that + designates which namespace to set a value from. + @param[in] TokenNumber The PCD token number to set a current value for. + @param[in, out] SizeOfBuffer The size, in bytes, of Buffer. + @param[in] Buffer A pointer to the buffer to set. + + @return The status of the set operation. + +**/ +RETURN_STATUS +EFIAPI +LibPcdSetExPtrS ( + IN CONST GUID *Guid, + IN UINTN TokenNumber, + IN OUT UINTN *SizeOfBuffer, + IN VOID *Buffer + ) +{ + ASSERT (FALSE); + + return RETURN_INVALID_PARAMETER; +} + +/** + This function provides a means by which to set a value for a given PCD token. + + Sets the boolean value for the token specified by TokenNumber + to the value specified by Value. + + If Guid is NULL, then ASSERT(). + + @param[in] Guid The pointer to a 128-bit unique value that + designates which namespace to set a value from. + @param[in] TokenNumber The PCD token number to set a current value for. + @param[in] Value The boolean value to set. + + @return The status of the set operation. + +**/ +RETURN_STATUS +EFIAPI +LibPcdSetExBoolS ( + IN CONST GUID *Guid, + IN UINTN TokenNumber, + IN BOOLEAN Value + ) +{ + ASSERT (FALSE); + + return RETURN_INVALID_PARAMETER; +} /** Set up a notification function that is called when a specified token is set. - - When the token specified by TokenNumber and Guid is set, - then notification function specified by NotificationFunction is called. - If Guid is NULL, then the default token space is used. - + + When the token specified by TokenNumber and Guid is set, + then notification function specified by NotificationFunction is called. + If Guid is NULL, then the default token space is used. + If NotificationFunction is NULL, then ASSERT(). - @param[in] Guid The pointer to a 128-bit unique value that designates which - namespace to set a value from. If NULL, then the default + @param[in] Guid The pointer to a 128-bit unique value that designates which + namespace to set a value from. If NULL, then the default token space is used. @param[in] TokenNumber The PCD token number to monitor. - @param[in] NotificationFunction The function to call when the token + @param[in] NotificationFunction The function to call when the token specified by Guid and TokenNumber is set. **/ @@ -803,13 +1121,13 @@ LibPcdCallbackOnSet ( /** Disable a notification function that was established with LibPcdCallbackonSet(). - - Disable a notification function that was previously established with LibPcdCallbackOnSet(). - + + Disable a notification function that was previously established with LibPcdCallbackOnSet(). + If NotificationFunction is NULL, then ASSERT(). - If LibPcdCallbackOnSet() was not previously called with Guid, TokenNumber, + If LibPcdCallbackOnSet() was not previously called with Guid, TokenNumber, and NotificationFunction, then ASSERT(). - + @param[in] Guid Specify the GUID token space. @param[in] TokenNumber Specify the token number. @param[in] NotificationFunction The callback function to be unregistered. @@ -830,24 +1148,24 @@ LibPcdCancelCallback ( /** Retrieves the next token in a token space. - - Retrieves the next PCD token number from the token space specified by Guid. - If Guid is NULL, then the default token space is used. If TokenNumber is 0, - then the first token number is returned. Otherwise, the token number that - follows TokenNumber in the token space is returned. If TokenNumber is the last - token number in the token space, then 0 is returned. - + + Retrieves the next PCD token number from the token space specified by Guid. + If Guid is NULL, then the default token space is used. If TokenNumber is 0, + then the first token number is returned. Otherwise, the token number that + follows TokenNumber in the token space is returned. If TokenNumber is the last + token number in the token space, then 0 is returned. + If TokenNumber is not 0 and is not in the token space specified by Guid, then ASSERT(). - @param[in] Guid The pointer to a 128-bit unique value that designates which namespace + @param[in] Guid The pointer to a 128-bit unique value that designates which namespace to set a value from. If NULL, then the default token space is used. - @param[in] TokenNumber The previous PCD token number. If 0, then retrieves the first PCD + @param[in] TokenNumber The previous PCD token number. If 0, then retrieves the first PCD token number. @return The next valid token number. **/ -UINTN +UINTN EFIAPI LibPcdGetNextToken ( IN CONST GUID *Guid, OPTIONAL @@ -863,18 +1181,18 @@ LibPcdGetNextToken ( /** Used to retrieve the list of available PCD token space GUIDs. - + Returns the PCD token space GUID that follows TokenSpaceGuid in the list of token spaces in the platform. If TokenSpaceGuid is NULL, then a pointer to the first PCD token spaces returned. If TokenSpaceGuid is the last PCD token space GUID in the list, then NULL is returned. - + @param TokenSpaceGuid The pointer to a PCD token space GUID. @return The next valid token namespace. **/ -GUID * +GUID * EFIAPI LibPcdGetNextTokenSpace ( IN CONST GUID *TokenSpaceGuid @@ -888,31 +1206,31 @@ LibPcdGetNextTokenSpace ( /** Sets a value of a patchable PCD entry that is type pointer. - - Sets the PCD entry specified by PatchVariable to the value specified by Buffer - and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than - MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return - NULL to indicate that the set operation was not actually performed. - If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to + + Sets the PCD entry specified by PatchVariable to the value specified by Buffer + and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than + MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return + NULL to indicate that the set operation was not actually performed. + If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to MaximumDatumSize and NULL must be returned. - + If PatchVariable is NULL, then ASSERT(). If SizeOfBuffer is NULL, then ASSERT(). If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). - @param[in] PatchVariable A pointer to the global variable in a module that is + @param[out] PatchVariable A pointer to the global variable in a module that is the target of the set operation. @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable. @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer. @param[in] Buffer A pointer to the buffer to used to set the target variable. - + @return Return the pointer to the buffer that was set. **/ VOID * EFIAPI LibPatchPcdSetPtr ( - IN VOID *PatchVariable, + OUT VOID *PatchVariable, IN UINTN MaximumDatumSize, IN OUT UINTN *SizeOfBuffer, IN CONST VOID *Buffer @@ -920,7 +1238,7 @@ LibPatchPcdSetPtr ( { ASSERT (PatchVariable != NULL); ASSERT (SizeOfBuffer != NULL); - + if (*SizeOfBuffer > 0) { ASSERT (Buffer != NULL); } @@ -930,12 +1248,172 @@ LibPatchPcdSetPtr ( *SizeOfBuffer = MaximumDatumSize; return NULL; } - + CopyMem (PatchVariable, Buffer, *SizeOfBuffer); - + return (VOID *) Buffer; } +/** + Sets a value of a patchable PCD entry that is type pointer. + + Sets the PCD entry specified by PatchVariable to the value specified + by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize, + then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER + to indicate that the set operation was not actually performed. + If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to + MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned. + + If PatchVariable is NULL, then ASSERT(). + If SizeOfBuffer is NULL, then ASSERT(). + If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). + + @param[out] PatchVariable A pointer to the global variable in a module that is + the target of the set operation. + @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable. + @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer. + @param[in] Buffer A pointer to the buffer to used to set the target variable. + + @return The status of the set operation. + +**/ +RETURN_STATUS +EFIAPI +LibPatchPcdSetPtrS ( + OUT VOID *PatchVariable, + IN UINTN MaximumDatumSize, + IN OUT UINTN *SizeOfBuffer, + IN CONST VOID *Buffer + ) +{ + ASSERT (PatchVariable != NULL); + ASSERT (SizeOfBuffer != NULL); + + if (*SizeOfBuffer > 0) { + ASSERT (Buffer != NULL); + } + + if ((*SizeOfBuffer > MaximumDatumSize) || + (*SizeOfBuffer == MAX_ADDRESS)) { + *SizeOfBuffer = MaximumDatumSize; + return RETURN_INVALID_PARAMETER; + } + + CopyMem (PatchVariable, Buffer, *SizeOfBuffer); + + return RETURN_SUCCESS; +} + +/** + Sets a value and size of a patchable PCD entry that is type pointer. + + Sets the PCD entry specified by PatchVariable to the value specified by Buffer + and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than + MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return + NULL to indicate that the set operation was not actually performed. + If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to + MaximumDatumSize and NULL must be returned. + + If PatchVariable is NULL, then ASSERT(). + If SizeOfPatchVariable is NULL, then ASSERT(). + If SizeOfBuffer is NULL, then ASSERT(). + If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). + + @param[out] PatchVariable A pointer to the global variable in a module that is + the target of the set operation. + @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable. + @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable. + @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer. + @param[in] Buffer A pointer to the buffer to used to set the target variable. + + @return Return the pointer to the buffer been set. + +**/ +VOID * +EFIAPI +LibPatchPcdSetPtrAndSize ( + OUT VOID *PatchVariable, + OUT UINTN *SizeOfPatchVariable, + IN UINTN MaximumDatumSize, + IN OUT UINTN *SizeOfBuffer, + IN CONST VOID *Buffer + ) +{ + ASSERT (PatchVariable != NULL); + ASSERT (SizeOfPatchVariable != NULL); + ASSERT (SizeOfBuffer != NULL); + + if (*SizeOfBuffer > 0) { + ASSERT (Buffer != NULL); + } + + if ((*SizeOfBuffer > MaximumDatumSize) || + (*SizeOfBuffer == MAX_ADDRESS)) { + *SizeOfBuffer = MaximumDatumSize; + return NULL; + } + + CopyMem (PatchVariable, Buffer, *SizeOfBuffer); + *SizeOfPatchVariable = *SizeOfBuffer; + + return (VOID *) Buffer; +} + +/** + Sets a value and size of a patchable PCD entry that is type pointer. + + Sets the PCD entry specified by PatchVariable to the value specified + by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize, + then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER + to indicate that the set operation was not actually performed. + If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to + MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned. + + If PatchVariable is NULL, then ASSERT(). + If SizeOfPatchVariable is NULL, then ASSERT(). + If SizeOfBuffer is NULL, then ASSERT(). + If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). + + @param[out] PatchVariable A pointer to the global variable in a module that is + the target of the set operation. + @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable. + @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable. + @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer. + @param[in] Buffer A pointer to the buffer to used to set the target variable. + + @return The status of the set operation. + +**/ +RETURN_STATUS +EFIAPI +LibPatchPcdSetPtrAndSizeS ( + OUT VOID *PatchVariable, + OUT UINTN *SizeOfPatchVariable, + IN UINTN MaximumDatumSize, + IN OUT UINTN *SizeOfBuffer, + IN CONST VOID *Buffer + ) +{ + ASSERT (PatchVariable != NULL); + ASSERT (SizeOfPatchVariable != NULL); + ASSERT (SizeOfBuffer != NULL); + + if (*SizeOfBuffer > 0) { + ASSERT (Buffer != NULL); + } + + if ((*SizeOfBuffer > MaximumDatumSize) || + (*SizeOfBuffer == MAX_ADDRESS)) { + *SizeOfBuffer = MaximumDatumSize; + return RETURN_INVALID_PARAMETER; + } + + CopyMem (PatchVariable, Buffer, *SizeOfBuffer); + *SizeOfPatchVariable = *SizeOfBuffer; + + return RETURN_SUCCESS; +} + /** Retrieve additional information associated with a PCD token. @@ -985,8 +1463,6 @@ LibPcdGetInfoEx ( /** Retrieve the currently set SKU Id. - If the sku id got >= PCD_MAX_SKU_ID, then ASSERT(). - @return The currently set SKU Id. If the platform has not set at a SKU Id, then the default SKU Id value of 0 is returned. If the platform has set a SKU Id, then the currently set SKU Id is returned.