From eceb3a4cb9b97d331ba91ea0a930465c05e8e20b Mon Sep 17 00:00:00 2001 From: lgao4 Date: Tue, 15 Jul 2008 11:12:43 +0000 Subject: Code scrub for the Debug library, PostCode library, Print library, and ExtractGuidedSection library. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5478 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Include/Library/DebugLib.h | 11 ++++---- MdePkg/Include/Library/ExtractGuidedSectionLib.h | 34 ++++++++++++------------ MdePkg/Include/Library/PostCodeLib.h | 32 +++++++++++----------- MdePkg/Include/Library/PrintLib.h | 22 ++++++++------- MdePkg/Include/Library/SerialPortLib.h | 20 +++++++------- MdePkg/Include/Library/UefiDecompressLib.h | 34 +++++++++++++++++------- 6 files changed, 86 insertions(+), 67 deletions(-) (limited to 'MdePkg/Include') diff --git a/MdePkg/Include/Library/DebugLib.h b/MdePkg/Include/Library/DebugLib.h index 47ac3dc4f2..5f0c923fb4 100644 --- a/MdePkg/Include/Library/DebugLib.h +++ b/MdePkg/Include/Library/DebugLib.h @@ -75,6 +75,7 @@ @param ErrorLevel The error level of the debug message. @param Format Format string for the debug message to print. + @param ... The variable argument list. **/ VOID @@ -129,10 +130,10 @@ DebugAssert ( If Length is greater than (MAX_ADDRESS ?Buffer + 1), then ASSERT(). - @param Buffer Pointer to the target buffer to fill with PcdDebugClearMemoryValue. + @param Buffer Pointer to the target buffer to be filled with PcdDebugClearMemoryValue. @param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. - @return Buffer + @return Buffer Pointer to the target buffer filled with PcdDebugClearMemoryValue. **/ VOID * @@ -201,11 +202,11 @@ DebugCodeEnabled ( Returns TRUE if DEBUG_CLEAR_MEMORY()macro is enabled. - This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of + This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set. Otherwise FALSE is returned. - @retval TRUE The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set. - @retval FALSE The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear. + @retval TRUE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set. + @retval FALSE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear. **/ BOOLEAN diff --git a/MdePkg/Include/Library/ExtractGuidedSectionLib.h b/MdePkg/Include/Library/ExtractGuidedSectionLib.h index 27faeeceb0..72e979d0e3 100644 --- a/MdePkg/Include/Library/ExtractGuidedSectionLib.h +++ b/MdePkg/Include/Library/ExtractGuidedSectionLib.h @@ -1,7 +1,8 @@ /** @file - Extract Guided Section Library class + Extract Guided Section Library class defintions, + which can provide many handlers for the different guided section data. - Copyright (c) 2007, Intel Corporation + Copyright (c) 2007 - 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 @@ -10,13 +11,12 @@ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - ExtractGuidedSectionLib.h **/ #ifndef __EXTRACT_GUIDED_SECTION_H__ #define __EXTRACT_GUIDED_SECTION_H__ /** - Get information Handler for the input guided section data. + Get information for the input guided section data. It will ASSERT () if the pointer to OutputBufferSize is NULL. It will ASSERT () if the pointer to ScratchBufferSize is NULL. It will ASSERT () if the pointer to SectionAttribute is NULL. @@ -27,7 +27,7 @@ @param[out] SectionAttribute The attribute of the input guided section. @retval RETURN_SUCCESS Get the required information successfully. - @retval RETURN_INVALID_PARAMETER The input data can't be parsed correctly. + @retval RETURN_INVALID_PARAMETER The input data is not the valid guided section. **/ typedef @@ -40,21 +40,21 @@ RETURN_STATUS ); /** - Extract data Handler for one specific guided section. + Extract data and Auth from the specific guided section. It will ASSERT () if the pointer to OutputBuffer is NULL. It will ASSERT () if the pointer to AuthenticationStatus is NULL. @param[in] InputSection Buffer containing the input GUIDed section to be processed. - @param[out] OutputBuffer OutputBuffer to point to the start of the section's contents. + @param[out] OutputBuffer OutputBuffer directly points to the start of the section's contents, if guided data is not prcessed. Otherwise, - OutputBuffer to contain the output data, which is allocated by the caller. + OutputBuffer contains the output data, which is allocated by the caller. @param[out] ScratchBuffer A pointer to a caller-allocated buffer for function internal use. @param[out] AuthenticationStatus A pointer to a caller-allocated UINT32 that indicates the authentication status of the output buffer. @retval RETURN_SUCCESS Get the output data and AuthenticationStatus successfully. - @retval RETURN_INVALID_PARAMETER The input data can't be parsed correctly. + @retval RETURN_INVALID_PARAMETER The input data is not the valid guided section. **/ typedef @@ -70,12 +70,12 @@ RETURN_STATUS Register Guided Section Extract and GetInfo Handler. @param[in] SectionGuid The guid matches this Extraction Handler. - @param[in] GetInfoHandler Handler to get info from guided section. + @param[in] GetInfoHandler Handler to get information from guided section. @param[in] DecodeHandler Handler to extract guided section. @retval RETURN_SUCCESS Register Guided Section Extract Handler successfully. @retval RETURN_OUT_OF_RESOURCES Resource is not enough to register new Handler. - @retval RETURN_INVALID_PARAMETER Input pointer to Guid value is not valid. + @retval RETURN_INVALID_PARAMETER Pointer to Guid value is not valid. **/ RETURN_STATUS @@ -88,18 +88,18 @@ ExtractGuidedSectionRegisterHandlers ( /** Get the supported exract guided section Handler guid table, which is maintained - by library. The caller can directly get this guid table pointer + by library. The caller can directly get the guid table without responsibility to allocate or free this table buffer. It will ASSERT () if ExtractHandlerGuidTable = NULL. - @param[in, out] ExtractHandlerGuidTable The extract Handler guid pointer list. + @param[out] ExtractHandlerGuidTable The extract Handler guid pointer list. - @retval return the number of the supported extract guided Handler. + @return the number of the supported extract guided Handler. **/ UINTN EFIAPI ExtractGuidedSectionGetGuidList ( - IN OUT GUID **ExtractHandlerGuidTable + OUT GUID **ExtractHandlerGuidTable ); /** @@ -120,7 +120,7 @@ ExtractGuidedSectionGetGuidList ( @retval RETURN_SUCCESS Get the required information successfully. @retval RETURN_UNSUPPORTED Guided section data is not supported. - @retval RETURN_INVALID_PARAMETER The input data can't be parsed correctly. + @retval RETURN_INVALID_PARAMETER The input data is not the valid guided section. **/ RETURN_STATUS @@ -154,7 +154,7 @@ ExtractGuidedSectionGetInfo ( @retval RETURN_SUCCESS Get the output data and AuthenticationStatus successfully. @retval RETURN_UNSUPPORTED Guided section data is not supported to be decoded. - @retval RETURN_INVALID_PARAMETER The input data can't be parsed correctly. + @retval RETURN_INVALID_PARAMETER The input data is not the valid guided section. **/ RETURN_STATUS EFIAPI diff --git a/MdePkg/Include/Library/PostCodeLib.h b/MdePkg/Include/Library/PostCodeLib.h index 5a80c561df..17ece49e4d 100644 --- a/MdePkg/Include/Library/PostCodeLib.h +++ b/MdePkg/Include/Library/PostCodeLib.h @@ -1,7 +1,7 @@ /** @file - Report Status Code Library public .h file + Post Code Library functions defintion. - 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 @@ -28,12 +28,12 @@ display the 32-bit value on the status reporting device. PostCode() must actively prevent recursion. If PostCode() is called while - processing another any other Report Status Code Library function, then + processing another any other Post Code Library function, then PostCode() must return Value immediately. @param Value The 32-bit value to write to the POST card. - @return Value + @return Value The 32-bit value to write to the POST card. **/ UINT32 @@ -55,16 +55,16 @@ PostCode ( value on the status reporting device. PostCodeWithDescription()must actively prevent recursion. If - PostCodeWithDescription() is called while processing another any other Report - Status Code Library function, then PostCodeWithDescription() must return Value - immediately. + PostCodeWithDescription() is called while processing another any other + Post Code Library function, then PostCodeWithDescription() + must return Value immediately. @param Value The 32-bit value to write to the POST card. @param Description Pointer to an ASCII string that is a description of the POST code value. This is an optional parameter that may be NULL. - @return Value + @return Value The 32-bit value to write to the POST card. **/ UINT32 @@ -97,14 +97,13 @@ PostCodeEnabled ( /** Returns TRUE if POST code descriptions are enabled. - This function returns TRUE if the - POST_CODE_PROPERTY_POST_CODE_ENABLED bit of - PcdPostCodePropertyMask is set. Otherwise FALSE is returned. + This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED + bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned. - @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED - bit of PcdPostCodeProperyMask is set. - @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED - bit of PcdPostCodeProperyMask is clear. + @retval TRUE The POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED bit of + PcdPostCodeProperyMask is set. + @retval FALSE The POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED bit of + PcdPostCodeProperyMask is clear. **/ BOOLEAN @@ -122,7 +121,7 @@ PostCodeDescriptionEnabled ( @param Value The 32-bit value to write to the POST card. - @return Value + @return Value The 32-bit value to write to the POST card. **/ #define POST_CODE(Value) PostCodeEnabled() ? PostCode(Value) : Value @@ -139,6 +138,7 @@ PostCodeDescriptionEnabled ( @param Description Pointer to an ASCII string that is a description of the POST code value. + @return Value The 32-bit value to write to the POST card. **/ #define POST_CODE_WITH_DESCRIPTION(Value,Description) \ PostCodeEnabled() ? \ diff --git a/MdePkg/Include/Library/PrintLib.h b/MdePkg/Include/Library/PrintLib.h index c5c550c2e7..21eea03278 100644 --- a/MdePkg/Include/Library/PrintLib.h +++ b/MdePkg/Include/Library/PrintLib.h @@ -1,7 +1,7 @@ /** @file - Library that provides print services + Library header file that defines print services - Copyright (c) 2006 - 2007, 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 @@ -110,6 +110,7 @@ UnicodeVSPrint ( Unicode string. @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. @param FormatString Null-terminated Unicode format string. + @param ... The variable argument list. @return The number of Unicode characters in the produced output buffer not including the Null-terminator. @@ -150,7 +151,7 @@ UnicodeSPrint ( @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated Unicode string. @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. - @param FormatString Null-terminated Unicode format string. + @param FormatString Null-terminated ASCII format string. @param Marker VA_LIST marker for the variable argument list. @return The number of Unicode characters in the produced output buffer not including the @@ -192,7 +193,8 @@ UnicodeVSPrintAsciiFormat ( @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated Unicode string. @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. - @param FormatString Null-terminated Unicode format string. + @param FormatString Null-terminated ASCII format string. + @param ... The variable argument list. @return The number of Unicode characters in the produced output buffer not including the Null-terminator. @@ -282,7 +284,7 @@ UnicodeValueToString ( @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated ASCII string. @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. - @param FormatString Null-terminated Unicode format string. + @param FormatString Null-terminated ASCII format string. @param Marker VA_LIST marker for the variable argument list. @return The number of ASCII characters in the produced output buffer not including the @@ -323,8 +325,9 @@ AsciiVSPrint ( @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated ASCII string. @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. - @param FormatString Null-terminated Unicode format string. - + @param FormatString Null-terminated ASCII format string. + @param ... The variable argument list. + @return The number of ASCII characters in the produced output buffer not including the Null-terminator. @@ -340,7 +343,7 @@ AsciiSPrint ( /** Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated - ASCII format string and a VA_LIST argument list. + Unicode format string and a VA_LIST argument list. Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer and BufferSize. @@ -382,7 +385,7 @@ AsciiVSPrintUnicodeFormat ( /** Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated - ASCII format string and variable argument list. + Unicode format string and variable argument list. Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer and BufferSize. @@ -407,6 +410,7 @@ AsciiVSPrintUnicodeFormat ( ASCII string. @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer. @param FormatString Null-terminated Unicode format string. + @param ... The variable argument list. @return The number of ASCII characters in the produced output buffer not including the Null-terminator. diff --git a/MdePkg/Include/Library/SerialPortLib.h b/MdePkg/Include/Library/SerialPortLib.h index 19f56f7edd..dc4031a974 100644 --- a/MdePkg/Include/Library/SerialPortLib.h +++ b/MdePkg/Include/Library/SerialPortLib.h @@ -1,8 +1,7 @@ - /** @file - Serial I/O Port library functions with no library constructor/destructor + Serial I/O Port library functions definition. - 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 @@ -30,15 +29,15 @@ SerialPortInitialize ( ); /** - Write data to serial device. + Write data from buffer to serial device. - If the buffer is NULL, then return 0; + If the Buffer is NULL, then return 0; if NumberOfBytes is zero, then return 0. @param Buffer Point of data buffer which need to be writed. @param NumberOfBytes Number of output bytes which are cached in Buffer. - @retval 0 Write data failed. + @retval 0 Write data failed, or No data is to be written. @retval !0 Actual number of bytes writed to serial device. **/ @@ -53,13 +52,14 @@ SerialPortWrite ( /** Read data from serial device and save the datas in buffer. - If the buffer is NULL, then return zero; + If the Buffer is NULL, then return zero; if NumberOfBytes is zero, then return zero. - @param Buffer Point of data buffer which need to be writed. - @param NumberOfBytes Number of output bytes which are cached in Buffer. + @param Buffer Point of data buffer, which contains the data + returned from the serial device. + @param NumberOfBytes Number of bytes which will be read. - @retval 0 Read data failed. + @retval 0 Read data failed, No data is to be read. @retval !0 Aactual number of bytes read from serial device. **/ diff --git a/MdePkg/Include/Library/UefiDecompressLib.h b/MdePkg/Include/Library/UefiDecompressLib.h index afedf307b5..2af91de273 100644 --- a/MdePkg/Include/Library/UefiDecompressLib.h +++ b/MdePkg/Include/Library/UefiDecompressLib.h @@ -1,7 +1,12 @@ /** @file - Return UEFI Decompress Protocol + UEFI Decompress Library Functions defintion - Copyright (c) 2006, Intel Corporation + The UEFI Decompress Library enables the decompression of objects that + were compressed using the UEFI compression scheme. The UEFI Decompress + Library is independent of environment and requires the caller to allocate + all required memory buffers. + + 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 @@ -16,7 +21,9 @@ #define __UEFI_DECPOMPRESS_LIB_H__ /** - Retrieves the size of the uncompressed buffer and the size of the scratch buffer. + Given a compressed source buffer, this function retrieves the size of + the uncompressed buffer and the size of the scratch buffer required + to decompress the compressed source buffer. Retrieves the size of the uncompressed buffer and the temporary scratch buffer required to decompress the buffer specified by Source and SourceSize. @@ -43,10 +50,14 @@ is required to decompress the compressed buffer specified by Source and SourceSize. - @retval RETURN_SUCCESS The size of destination buffer and the size of scratch - buffer are successull retrieved. - @retval RETURN_INVALID_PARAMETER The source data is corrupted - + @retval RETURN_SUCCESS The size of the uncompressed data was returned + in DestinationSize and the size of the scratch + buffer was returned in ScratchSize. + @retval RETURN_INVALID_PARAMETER + The size of the uncompressed data or the size of + the scratch buffer cannot be determined from + the compressed data specified by Source + and SourceSize. **/ RETURN_STATUS EFIAPI @@ -60,6 +71,7 @@ UefiDecompressGetInfo ( /** Decompresses a compressed source buffer. + Extracts decompressed data to its original form. This function is designed so that the decompression algorithm can be implemented without using any memory services. As a result, this function is not allowed to call any memory allocation services in its implementation. It is the caller's r @@ -79,9 +91,11 @@ UefiDecompressGetInfo ( This is an optional parameter that may be NULL if the required scratch buffer size is 0. - @retval RETURN_SUCCESS Decompression is successfull - @retval RETURN_INVALID_PARAMETER The source data is corrupted - + @retval RETURN_SUCCESS Decompression completed successfully, and + the uncompressed buffer is returned in Destination. + @retval RETURN_INVALID_PARAMETER + The source buffer specified by Source is corrupted + (not in a valid compressed format). **/ RETURN_STATUS EFIAPI -- cgit v1.2.3