diff options
Diffstat (limited to 'MdePkg/Library/BasePcdLibNull/PcdLib.c')
-rw-r--r-- | MdePkg/Library/BasePcdLibNull/PcdLib.c | 286 |
1 files changed, 140 insertions, 146 deletions
diff --git a/MdePkg/Library/BasePcdLibNull/PcdLib.c b/MdePkg/Library/BasePcdLibNull/PcdLib.c index 44180d70887b..b79cb089caf8 100644 --- a/MdePkg/Library/BasePcdLibNull/PcdLib.c +++ b/MdePkg/Library/BasePcdLibNull/PcdLib.c @@ -1,14 +1,8 @@ /** @file A emptry template implementation of PCD Library. - Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR> - 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 - http://opensource.org/licenses/bsd-license.php. - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR> + SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -24,7 +18,7 @@ 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. @return Return the SKU ID that just be set. @@ -43,12 +37,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 @@ -66,12 +60,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 @@ -89,8 +83,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. @@ -112,7 +106,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. @@ -135,7 +129,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. @@ -158,15 +152,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 @@ -184,7 +178,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 @@ -202,12 +196,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. @@ -232,10 +226,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. @@ -258,9 +252,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. @@ -283,12 +277,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. @@ -311,12 +305,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. @@ -339,12 +333,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. @@ -367,12 +361,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. @@ -396,8 +390,8 @@ 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 + + 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. @@ -422,8 +416,8 @@ 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 + + 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. @@ -448,8 +442,8 @@ 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 + + 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. @@ -474,8 +468,8 @@ 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 + + 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. @@ -500,19 +494,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 + + 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 + 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. @@ -537,8 +531,8 @@ 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 + + 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. @@ -563,13 +557,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(). - @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. @@ -594,13 +588,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(). - @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. @@ -625,13 +619,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(). - @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. @@ -656,13 +650,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(). - @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. @@ -687,18 +681,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 + + 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. @@ -725,13 +719,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(). - @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. @@ -1091,18 +1085,18 @@ LibPcdSetExBoolS ( /** 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. **/ @@ -1121,13 +1115,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. @@ -1148,24 +1142,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 @@ -1181,18 +1175,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 @@ -1206,24 +1200,24 @@ 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[out] 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. **/ @@ -1238,7 +1232,7 @@ LibPatchPcdSetPtr ( { ASSERT (PatchVariable != NULL); ASSERT (SizeOfBuffer != NULL); - + if (*SizeOfBuffer > 0) { ASSERT (Buffer != NULL); } @@ -1248,9 +1242,9 @@ LibPatchPcdSetPtr ( *SizeOfBuffer = MaximumDatumSize; return NULL; } - + CopyMem (PatchVariable, Buffer, *SizeOfBuffer); - + return (VOID *) Buffer; } @@ -1273,7 +1267,7 @@ LibPatchPcdSetPtr ( @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. **/ @@ -1288,7 +1282,7 @@ LibPatchPcdSetPtrS ( { ASSERT (PatchVariable != NULL); ASSERT (SizeOfBuffer != NULL); - + if (*SizeOfBuffer > 0) { ASSERT (Buffer != NULL); } @@ -1306,26 +1300,26 @@ LibPatchPcdSetPtrS ( /** 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 + + 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 + @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. **/ @@ -1342,7 +1336,7 @@ LibPatchPcdSetPtrAndSize ( ASSERT (PatchVariable != NULL); ASSERT (SizeOfPatchVariable != NULL); ASSERT (SizeOfBuffer != NULL); - + if (*SizeOfBuffer > 0) { ASSERT (Buffer != NULL); } @@ -1352,10 +1346,10 @@ LibPatchPcdSetPtrAndSize ( *SizeOfBuffer = MaximumDatumSize; return NULL; } - + CopyMem (PatchVariable, Buffer, *SizeOfBuffer); *SizeOfPatchVariable = *SizeOfBuffer; - + return (VOID *) Buffer; } @@ -1380,7 +1374,7 @@ LibPatchPcdSetPtrAndSize ( @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. **/ @@ -1397,7 +1391,7 @@ LibPatchPcdSetPtrAndSizeS ( ASSERT (PatchVariable != NULL); ASSERT (SizeOfPatchVariable != NULL); ASSERT (SizeOfBuffer != NULL); - + if (*SizeOfBuffer > 0) { ASSERT (Buffer != NULL); } |