X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;ds=sidebyside;f=MdePkg%2FLibrary%2FBasePcdLibNull%2FPcdLib.c;h=168803426358d34bdcf97e8df41c0f5ee3c60d5c;hb=9638ba6d3f663ba64cb06193f22bc5c70356da64;hp=aba7920baff488f4008bb512afe897889843b883;hpb=bbfaace4538789c959d0c1c75eaa68c3bcd71f8c;p=mirror_edk2.git diff --git a/MdePkg/Library/BasePcdLibNull/PcdLib.c b/MdePkg/Library/BasePcdLibNull/PcdLib.c index aba7920baf..1688034263 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, Intel Corporation + Copyright (c) 2006 - 2008, 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 @@ -12,7 +12,8 @@ **/ -#include +#include + #include #include #include @@ -24,7 +25,7 @@ @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and set values associated with a PCD token. - @retval SKU_ID Return the SKU ID that just be set. + @return Return the SKU ID that just be set. **/ UINTN @@ -33,19 +34,17 @@ LibPcdSetSku ( IN UINTN SkuId ) { - ASSERT (SkuId < 0x100); + ASSERT (FALSE); - return SkuId; + return 0; } - - /** Returns the 8-bit value for the token specified by TokenNumber. - @param[in] The PCD token number to retrieve a current value for. + @param[in] TokenNumber The PCD token number to retrieve a current value for. - @retval UINT8 Returns the 8-bit value for the token specified by TokenNumber. + @return Returns the 8-bit value for the token specified by TokenNumber. **/ UINT8 @@ -54,6 +53,8 @@ LibPcdGet8 ( IN UINTN TokenNumber ) { + ASSERT (FALSE); + return 0; } @@ -62,9 +63,9 @@ LibPcdGet8 ( /** Returns the 16-bit value for the token specified by TokenNumber. - @param[in] The PCD token number to retrieve a current value for. + @param[in] TokenNumber The PCD token number to retrieve a current value for. - @retval UINT16 Returns the 16-bit value for the token specified by TokenNumber. + @return Returns the 16-bit value for the token specified by TokenNumber. **/ UINT16 @@ -73,6 +74,8 @@ LibPcdGet16 ( IN UINTN TokenNumber ) { + ASSERT (FALSE); + return 0; } @@ -83,7 +86,7 @@ LibPcdGet16 ( @param[in] TokenNumber The PCD token number to retrieve a current value for. - @retval UINT32 Returns the 32-bit value for the token specified by TokenNumber. + @return Returns the 32-bit value for the token specified by TokenNumber. **/ UINT32 @@ -92,6 +95,8 @@ LibPcdGet32 ( IN UINTN TokenNumber ) { + ASSERT (FALSE); + return 0; } @@ -102,7 +107,7 @@ LibPcdGet32 ( @param[in] TokenNumber The PCD token number to retrieve a current value for. - @retval UINT64 Returns the 64-bit value for the token specified by TokenNumber. + @return Returns the 64-bit value for the token specified by TokenNumber. **/ UINT64 @@ -111,6 +116,8 @@ LibPcdGet64 ( IN UINTN TokenNumber ) { + ASSERT (FALSE); + return 0; } @@ -121,7 +128,7 @@ LibPcdGet64 ( @param[in] TokenNumber The PCD token number to retrieve a current value for. - @retval VOID* Returns the pointer to the token specified by TokenNumber. + @return Returns the pointer to the token specified by TokenNumber. **/ VOID * @@ -130,6 +137,8 @@ LibPcdGetPtr ( IN UINTN TokenNumber ) { + ASSERT (FALSE); + return 0; } @@ -140,7 +149,7 @@ LibPcdGetPtr ( @param[in] TokenNumber The PCD token number to retrieve a current value for. - @retval BOOLEAN Returns the Boolean value of the token specified by TokenNumber. + @return Returns the Boolean value of the token specified by TokenNumber. **/ BOOLEAN @@ -149,6 +158,8 @@ LibPcdGetBool ( IN UINTN TokenNumber ) { + ASSERT (FALSE); + return 0; } @@ -159,7 +170,7 @@ LibPcdGetBool ( @param[in] TokenNumber The PCD token number to retrieve a current value for. - @retval UINTN Returns the size of the token specified by TokenNumber. + @return Returns the size of the token specified by TokenNumber. **/ UINTN @@ -168,6 +179,8 @@ LibPcdGetSize ( IN UINTN TokenNumber ) { + ASSERT (FALSE); + return 0; } @@ -181,7 +194,7 @@ LibPcdGetSize ( which namespace to retrieve a value from. @param[in] TokenNumber The PCD token number to retrieve a current value for. - @retval UINT8 Return the UINT8. + @return Return the UINT8. **/ UINT8 @@ -191,7 +204,7 @@ LibPcdGetEx8 ( IN UINTN TokenNumber ) { - ASSERT (Guid != NULL); + ASSERT (FALSE); return 0; } @@ -206,7 +219,7 @@ LibPcdGetEx8 ( which namespace to retrieve a value from. @param[in] TokenNumber The PCD token number to retrieve a current value for. - @retval UINT16 Return the UINT16. + @return Return the UINT16. **/ UINT16 @@ -216,7 +229,7 @@ LibPcdGetEx16 ( IN UINTN TokenNumber ) { - ASSERT (Guid != NULL); + ASSERT (FALSE); return 0; } @@ -231,7 +244,7 @@ LibPcdGetEx16 ( which namespace to retrieve a value from. @param[in] TokenNumber The PCD token number to retrieve a current value for. - @retval UINT32 Return the UINT32. + @return Return the UINT32. **/ UINT32 @@ -241,7 +254,7 @@ LibPcdGetEx32 ( IN UINTN TokenNumber ) { - ASSERT (Guid != NULL); + ASSERT (FALSE); return 0; } @@ -256,7 +269,7 @@ LibPcdGetEx32 ( which namespace to retrieve a value from. @param[in] TokenNumber The PCD token number to retrieve a current value for. - @retval UINT64 Return the UINT64. + @return Return the UINT64. **/ UINT64 @@ -266,7 +279,7 @@ LibPcdGetEx64 ( IN UINTN TokenNumber ) { - ASSERT (Guid != NULL); + ASSERT (FALSE); return 0; } @@ -281,7 +294,7 @@ LibPcdGetEx64 ( which namespace to retrieve a value from. @param[in] TokenNumber The PCD token number to retrieve a current value for. - @retval VOID* Return the VOID* pointer. + @return Return the VOID* pointer. **/ VOID * @@ -291,7 +304,7 @@ LibPcdGetExPtr ( IN UINTN TokenNumber ) { - ASSERT (Guid != NULL); + ASSERT (FALSE); return 0; } @@ -306,7 +319,7 @@ LibPcdGetExPtr ( which namespace to retrieve a value from. @param[in] TokenNumber The PCD token number to retrieve a current value for. - @retval BOOLEAN Return the BOOLEAN. + @return Return the BOOLEAN. **/ BOOLEAN @@ -316,7 +329,7 @@ LibPcdGetExBool ( IN UINTN TokenNumber ) { - ASSERT (Guid != NULL); + ASSERT (FALSE); return 0; } @@ -331,7 +344,7 @@ LibPcdGetExBool ( which namespace to retrieve a value from. @param[in] TokenNumber The PCD token number to retrieve a current value for. - @retval UINTN Return the size. + @return Return the size. **/ UINTN @@ -341,7 +354,7 @@ LibPcdGetExSize ( IN UINTN TokenNumber ) { - ASSERT (Guid != NULL); + ASSERT (FALSE); return 0; } @@ -355,7 +368,7 @@ LibPcdGetExSize ( @param[in] TokenNumber The PCD token number to set a current value for. @param[in] Value The 8-bit value to set. - @retval UINT8 Return the value been set. + @return Return the value been set. **/ UINT8 @@ -365,7 +378,9 @@ LibPcdSet8 ( IN UINT8 Value ) { - return Value; + ASSERT (FALSE); + + return 0; } @@ -377,7 +392,7 @@ LibPcdSet8 ( @param[in] TokenNumber The PCD token number to set a current value for. @param[in] Value The 16-bit value to set. - @retval UINT16 Return the value been set. + @return Return the value been set. **/ UINT16 @@ -387,7 +402,9 @@ LibPcdSet16 ( IN UINT16 Value ) { - return Value; + ASSERT (FALSE); + + return 0; } @@ -399,7 +416,7 @@ LibPcdSet16 ( @param[in] TokenNumber The PCD token number to set a current value for. @param[in] Value The 32-bit value to set. - @retval UINT32 Return the value been set. + @return Return the value been set. **/ UINT32 @@ -409,7 +426,9 @@ LibPcdSet32 ( IN UINT32 Value ) { - return Value; + ASSERT (FALSE); + + return 0; } @@ -421,7 +440,7 @@ LibPcdSet32 ( @param[in] TokenNumber The PCD token number to set a current value for. @param[in] Value The 64-bit value to set. - @retval UINT64 Return the value been set. + @return Return the value been set. **/ UINT64 @@ -431,7 +450,9 @@ LibPcdSet64 ( IN UINT64 Value ) { - return Value; + ASSERT (FALSE); + + return 0; } @@ -450,28 +471,24 @@ LibPcdSet64 ( If SizeOfValue > 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] Value A pointer to the buffer to set. + @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. - @retval VOID* Return the pointer for the buffer been set. + @return Return the pointer for the buffer been set. **/ VOID * EFIAPI LibPcdSetPtr ( - IN UINTN TokenNumber, - IN OUT UINTN *SizeOfBuffer, - IN VOID *Buffer + IN UINTN TokenNumber, + IN OUT UINTN *SizeOfBuffer, + IN VOID *Buffer ) { - ASSERT (SizeOfBuffer != NULL); - - if (*SizeOfBuffer > 0) { - ASSERT (Buffer != NULL); - } + ASSERT (FALSE); - return Buffer; + return NULL; } @@ -483,7 +500,7 @@ LibPcdSetPtr ( @param[in] TokenNumber The PCD token number to set a current value for. @param[in] Value The boolean value to set. - @retval BOOLEAN Return the value been set. + @return Return the value been set. **/ BOOLEAN @@ -493,7 +510,9 @@ LibPcdSetBool ( IN BOOLEAN Value ) { - return Value; + ASSERT (FALSE); + + return FALSE; } @@ -508,7 +527,7 @@ LibPcdSetBool ( @param[in] TokenNumber The PCD token number to set a current value for. @param[in] Value The 8-bit value to set. - @retval UINT8 Return the value been set. + @return Return the value been set. **/ UINT8 @@ -519,9 +538,9 @@ LibPcdSetEx8 ( IN UINT8 Value ) { - ASSERT (Guid != NULL); + ASSERT (FALSE); - return Value; + return 0; } @@ -536,7 +555,7 @@ LibPcdSetEx8 ( @param[in] TokenNumber The PCD token number to set a current value for. @param[in] Value The 16-bit value to set. - @retval UINT8 Return the value been set. + @return Return the value been set. **/ UINT16 @@ -547,9 +566,9 @@ LibPcdSetEx16 ( IN UINT16 Value ) { - ASSERT (Guid != NULL); + ASSERT (FALSE); - return Value; + return 0; } @@ -564,7 +583,7 @@ LibPcdSetEx16 ( @param[in] TokenNumber The PCD token number to set a current value for. @param[in] Value The 32-bit value to set. - @retval UINT32 Return the value been set. + @return Return the value been set. **/ UINT32 @@ -575,9 +594,9 @@ LibPcdSetEx32 ( IN UINT32 Value ) { - ASSERT (Guid != NULL); + ASSERT (FALSE); - return Value; + return 0; } @@ -592,7 +611,7 @@ LibPcdSetEx32 ( @param[in] TokenNumber The PCD token number to set a current value for. @param[in] Value The 64-bit value to set. - @retval UINT64 Return the value been set. + @return Return the value been set. **/ UINT64 @@ -603,9 +622,9 @@ LibPcdSetEx64 ( IN UINT64 Value ) { - ASSERT (Guid != NULL); + ASSERT (FALSE); - return Value; + return 0; } @@ -625,7 +644,7 @@ LibPcdSetEx64 ( @param[in, out] SizeOfBuffer The size, in bytes, of Buffer. @param[in] Buffer A pointer to the buffer to set. - @retval VOID * Return the pinter to the buffer been set. + @return Return the pinter to the buffer been set. **/ VOID * @@ -637,15 +656,9 @@ LibPcdSetExPtr ( IN VOID *Buffer ) { - ASSERT (Guid != NULL); + ASSERT (FALSE); - ASSERT (SizeOfBuffer != NULL); - - if (*SizeOfBuffer > 0) { - ASSERT (Buffer != NULL); - } - - return Buffer; + return NULL; } @@ -660,7 +673,7 @@ LibPcdSetExPtr ( @param[in] TokenNumber The PCD token number to set a current value for. @param[in] Value The Boolean value to set. - @retval Boolean Return the value been set. + @return Return the value been set. **/ BOOLEAN @@ -671,9 +684,9 @@ LibPcdSetExBool ( IN BOOLEAN Value ) { - ASSERT (Guid != NULL); + ASSERT (FALSE); - return Value; + return FALSE; } @@ -691,8 +704,6 @@ LibPcdSetExBool ( @param[in] NotificationFunction The function to call when the token specified by Guid and TokenNumber is set. - @retval VOID - **/ VOID EFIAPI @@ -702,7 +713,7 @@ LibPcdCallbackOnSet ( IN PCD_CALLBACK NotificationFunction ) { - ASSERT (NotificationFunction != NULL); + ASSERT (FALSE); } @@ -715,8 +726,6 @@ LibPcdCallbackOnSet ( @param[in] TokenNumber Specify the token number. @param[in] NotificationFunction The callback function to be unregistered. - @retval VOID - **/ VOID EFIAPI @@ -726,7 +735,7 @@ LibPcdCancelCallback ( IN PCD_CALLBACK NotificationFunction ) { - ASSERT (NotificationFunction != NULL); + ASSERT (FALSE); } @@ -739,12 +748,12 @@ LibPcdCancelCallback ( 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] 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] The previous PCD token number. If 0, then retrieves the first PCD - token number. + @param[in] Guid 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 + token number. - @retval UINTN The next valid token number. + @return The next valid token number. **/ UINTN @@ -754,6 +763,8 @@ LibPcdGetNextToken ( IN UINTN TokenNumber ) { + ASSERT (FALSE); + return 0; } @@ -767,13 +778,11 @@ LibPcdGetNextToken ( then NULL is returned. If Guid is not NULL and is not a valid token space in the current platform, then ASSERT(). - - - @param[in] Pointer to a 128-bit unique value that designates from which namespace - to start the search. + @param[in] Guid Pointer to a 128-bit unique value that designates from which namespace + to start the search. - @retval CONST GUID * The next valid token namespace. + @return The next valid token namespace. **/ GUID * @@ -782,28 +791,33 @@ LibPcdGetNextTokenSpace ( IN CONST GUID *Guid ) { + ASSERT (FALSE); + return NULL; } - /** + 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 SizeOfValue. Buffer is returned. If SizeOfValue is greater than - MaximumDatumSize, then set SizeOfValue to MaximumDatumSize and return + 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 SizeOfValue is set to MAX_ADDRESS, then SizeOfValue must be set to + 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 SizeOfValue is NULL, then ASSERT(). - If SizeOfValue > 0 and Buffer 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 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 been set. **/ VOID *