From 4ba61e5e2a1b3cec7faaad36c252738f6f57f8a6 Mon Sep 17 00:00:00 2001 From: qhuang8 Date: Thu, 22 Jun 2006 06:08:00 +0000 Subject: =?UTF-8?q?1.=20UINTN=20&=20INTN=20issue=20for=20EBC=20architectur?= =?UTF-8?q?e:=20=09The=20MAX=5FBIT=20of=20EBC=20will=20no=20longer=20be=20?= =?UTF-8?q?fixed=20to=20bit=2063.=20It=20is=20defined=20as=20(1ULL=20<<=20?= =?UTF-8?q?(sizeof=20(INTN)=20*=208=20-=201)).=20=09Make=20EdkModulePkg=20?= =?UTF-8?q?&=20MdePkg=20EBC=20compiler=20clean:=20treat=20all=20EFI=5FSTAT?= =?UTF-8?q?US=20error=20code=20as=20variable.=202.=20PrintLib=20=09Complet?= =?UTF-8?q?e=20all=20missing=20ASSERT()s.=20=09Fix=20=E2=80=9C\n=E2=80=9D?= =?UTF-8?q?=20&=20=E2=80=9C%\n=E2=80=9D=20issue=20thanks=20to=20the=20clar?= =?UTF-8?q?ification=20of=20MWG=200.56d.=20=09Adjust=20StatusString=20arra?= =?UTF-8?q?y=20to=20support=20EBC=20build.=203.=20BaseMemoryLib=20=09Adjus?= =?UTF-8?q?t=20ASSERT=20()=20&=20function=20header=20of=20ComparaMem,=20Se?= =?UTF-8?q?tMemXX,=20ScanMemXX=20to=20synchronize=20with=20MWG=200.56d.=20?= =?UTF-8?q?4.SmbusLib=20=09Change=20Pec=20bit=20to=20bit=2022=20SmBusAddre?= =?UTF-8?q?ss=20to=20synchronize=20MWG=200.56d.=20=09Add=20ASSERT()s=20to?= =?UTF-8?q?=20check=20if=20length=20is=20illegal=20for=20SmBusBlockWrite()?= =?UTF-8?q?=20&=20SmBusProcessBlock()=20since=20it=20is=206=20bit=20now.?= =?UTF-8?q?=205.=20PerformanceLib=20=09Rename=20=E2=80=9CEdkDxePerformance?= =?UTF-8?q?Lib=E2=80=9D=20&=20=E2=80=9CEdkPeiPerformanceLib=E2=80=9D=20to?= =?UTF-8?q?=20=E2=80=9CDxePerformanceLib=E2=80=9D=20&=20=E2=80=9CPeiPerfor?= =?UTF-8?q?manceLib=E2=80=9D=20respectively.=20=09Synchronize=20the=20func?= =?UTF-8?q?tion=20header=20of=20GetPerformanceMeasurement()=20with=20MWG?= =?UTF-8?q?=200.56d.=206.=20BasePeCoffLoaderLib.=20=09Make=20PeCoffLoaderL?= =?UTF-8?q?oadImage=20()=20Assert()=20if=20ImageContext=20is=20NULL>=20=09?= =?UTF-8?q?Make=20PeCoffLoaderLoadImage=20()=20return=20RETURN=5FINVALID?= =?UTF-8?q?=5FPARAMETER=20if=20the=20ImageAddress=20in=20ImageContext=20is?= =?UTF-8?q?=200.=20=09Adjust=20some=20coding=20style.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@593 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Library/UefiMemoryLib/CompareMemWrapper.c | 40 ++++++++++++------------ MdePkg/Library/UefiMemoryLib/MemLibGeneric.c | 1 - MdePkg/Library/UefiMemoryLib/ScanMem16Wrapper.c | 38 +++++++++++----------- MdePkg/Library/UefiMemoryLib/ScanMem32Wrapper.c | 38 +++++++++++----------- MdePkg/Library/UefiMemoryLib/ScanMem64Wrapper.c | 38 +++++++++++----------- MdePkg/Library/UefiMemoryLib/ScanMem8Wrapper.c | 37 ++++++++++------------ MdePkg/Library/UefiMemoryLib/SetMem16Wrapper.c | 15 ++++----- MdePkg/Library/UefiMemoryLib/SetMem32Wrapper.c | 15 ++++----- MdePkg/Library/UefiMemoryLib/SetMem64Wrapper.c | 15 ++++----- MdePkg/Library/UefiMemoryLib/SetMemWrapper.c | 23 +++++++------- 10 files changed, 127 insertions(+), 133 deletions(-) (limited to 'MdePkg/Library/UefiMemoryLib') diff --git a/MdePkg/Library/UefiMemoryLib/CompareMemWrapper.c b/MdePkg/Library/UefiMemoryLib/CompareMemWrapper.c index c8199d8dc3..6081bbe1b7 100644 --- a/MdePkg/Library/UefiMemoryLib/CompareMemWrapper.c +++ b/MdePkg/Library/UefiMemoryLib/CompareMemWrapper.c @@ -26,26 +26,25 @@ #include "MemLibInternals.h" /** - Compares two memory buffers of a given length. + Compares the contents of two buffers. - This function compares Length bytes of SourceBuffer to Length bytes of - DestinationBuffer. If all Length bytes of the two buffers are identical, then - 0 is returned. Otherwise, the value returned is the first mismatched byte in - SourceBuffer subtracted from the first mismatched byte in DestinationBuffer. + This function compares Length bytes of SourceBuffer to Length bytes of DestinationBuffer. + If all Length bytes of the two buffers are identical, then 0 is returned. Otherwise, the + value returned is the first mismatched byte in SourceBuffer subtracted from the first + mismatched byte in DestinationBuffer. + If Length > 0 and DestinationBuffer is NULL and Length > 0, then ASSERT(). + If Length > 0 and SourceBuffer is NULL and Length > 0, then ASSERT(). + If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT(). - If DestinationBuffer is NULL and Length > 0, then ASSERT(). - If SourceBuffer is NULL and Length > 0, then ASSERT(). - If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then - ASSERT(). - If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT(). - @param DestinationBuffer First memory buffer - @param SourceBuffer Second memory buffer - @param Length Length of DestinationBuffer and SourceBuffer memory - regions to compare + @param DestinationBuffer Pointer to the destination buffer to compare. + @param SourceBuffer Pointer to the source buffer to compare. + @param Length Number of bytes to compare. - @retval 0 if DestinationBuffer == SourceBuffer - @retval Non-zero if DestinationBuffer != SourceBuffer + @return 0 All Length bytes of the two buffers are identical. + @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first + mismatched byte in DestinationBuffer. **/ INTN @@ -56,12 +55,13 @@ CompareMem ( IN UINTN Length ) { - ASSERT (DestinationBuffer != NULL); - ASSERT (SourceBuffer != NULL); - ASSERT (Length <= MAX_ADDRESS - (UINTN)DestinationBuffer + 1); - ASSERT (Length <= MAX_ADDRESS - (UINTN)SourceBuffer + 1); if (Length == 0) { return 0; } + ASSERT (DestinationBuffer != NULL); + ASSERT (SourceBuffer != NULL); + ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer)); + ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)SourceBuffer)); + return InternalMemCompareMem (DestinationBuffer, SourceBuffer, Length); } diff --git a/MdePkg/Library/UefiMemoryLib/MemLibGeneric.c b/MdePkg/Library/UefiMemoryLib/MemLibGeneric.c index bda1f4992f..53c4e4416b 100644 --- a/MdePkg/Library/UefiMemoryLib/MemLibGeneric.c +++ b/MdePkg/Library/UefiMemoryLib/MemLibGeneric.c @@ -132,7 +132,6 @@ InternalMemCompareMem ( IN UINTN Length ) { - ASSERT (Length > 0); while ((--Length != 0) && (*(INT8*)DestinationBuffer == *(INT8*)SourceBuffer)) { DestinationBuffer = (INT8*)DestinationBuffer + 1; diff --git a/MdePkg/Library/UefiMemoryLib/ScanMem16Wrapper.c b/MdePkg/Library/UefiMemoryLib/ScanMem16Wrapper.c index a17705db1d..d336d59641 100644 --- a/MdePkg/Library/UefiMemoryLib/ScanMem16Wrapper.c +++ b/MdePkg/Library/UefiMemoryLib/ScanMem16Wrapper.c @@ -26,25 +26,22 @@ #include "MemLibInternals.h" /** - Scans a target buffer for a 16-bit value, and returns a pointer to the - matching 16-bit value in the target buffer. + Scans a target buffer for a 16-bit value, and returns a pointer to the matching 16-bit value + in the target buffer. - This function searches target the buffer specified by Buffer and Length from - the lowest address to the highest address at 16-bit increments for a 16-bit - value that matches Value. If a match is found, then a pointer to the matching - value in the target buffer is returned. If no match is found, then NULL is - returned. If Length is 0, then NULL is returned. - - If Buffer is NULL, then ASSERT(). + This function searches target the buffer specified by Buffer and Length from the lowest + address to the highest address for a 16-bit value that matches Value. If a match is found, + then a pointer to the matching byte in the target buffer is returned. If no match is found, + then NULL is returned. If Length is 0, then NULL is returned. + If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 16-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). - @param Buffer Pointer to the target buffer to scan. - @param Length Number of bytes in Buffer to scan. - @param Value Value to search for in the target buffer. + @param Buffer Pointer to the target buffer to scan. + @param Length Number of bytes in Buffer to scan. + @param Value Value to search for in the target buffer. - @return Pointer to the first occurrence. - @retval NULL if Length == 0 or Value was not found. + @return A pointer to the matching byte in the target buffer or NULL otherwise. **/ VOID * @@ -55,12 +52,13 @@ ScanMem16 ( IN UINT16 Value ) { + if (Length == 0) { + return NULL; + } + ASSERT (Buffer != NULL); ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0); - ASSERT (Length <= MAX_ADDRESS + (UINTN)Buffer + 1); + ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer)); - if ((Length /= sizeof (Value)) == 0) { - return NULL; - } - return (VOID*)InternalMemScanMem16 (Buffer, Length, Value); + return (VOID*)InternalMemScanMem16 (Buffer, Length / sizeof (Value), Value); } diff --git a/MdePkg/Library/UefiMemoryLib/ScanMem32Wrapper.c b/MdePkg/Library/UefiMemoryLib/ScanMem32Wrapper.c index 67eb84d8ef..8de55945ce 100644 --- a/MdePkg/Library/UefiMemoryLib/ScanMem32Wrapper.c +++ b/MdePkg/Library/UefiMemoryLib/ScanMem32Wrapper.c @@ -26,25 +26,22 @@ #include "MemLibInternals.h" /** - Scans a target buffer for a 32-bit value, and returns a pointer to the - matching 32-bit value in the target buffer. + Scans a target buffer for a 32-bit value, and returns a pointer to the matching 32-bit value + in the target buffer. - This function searches target the buffer specified by Buffer and Length from - the lowest address to the highest address at 32-bit increments for a 32-bit - value that matches Value. If a match is found, then a pointer to the matching - value in the target buffer is returned. If no match is found, then NULL is - returned. If Length is 0, then NULL is returned. - - If Buffer is NULL, then ASSERT(). + This function searches target the buffer specified by Buffer and Length from the lowest + address to the highest address for a 32-bit value that matches Value. If a match is found, + then a pointer to the matching byte in the target buffer is returned. If no match is found, + then NULL is returned. If Length is 0, then NULL is returned. + If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 32-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). - @param Buffer Pointer to the target buffer to scan. - @param Length Number of bytes in Buffer to scan. - @param Value Value to search for in the target buffer. + @param Buffer Pointer to the target buffer to scan. + @param Length Number of bytes in Buffer to scan. + @param Value Value to search for in the target buffer. - @return Pointer to the first occurrence or NULL if not found. - @retval NULL if Length == 0 or Value was not found. + @return A pointer to the matching byte in the target buffer or NULL otherwise. **/ VOID * @@ -55,12 +52,13 @@ ScanMem32 ( IN UINT32 Value ) { + if (Length == 0) { + return NULL; + } + ASSERT (Buffer != NULL); ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0); - ASSERT (Length <= MAX_ADDRESS + (UINTN)Buffer + 1); + ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer)); - if ((Length /= sizeof (Value)) == 0) { - return NULL; - } - return (VOID*)InternalMemScanMem32 (Buffer, Length, Value); + return (VOID*)InternalMemScanMem32 (Buffer, Length / sizeof (Value), Value); } diff --git a/MdePkg/Library/UefiMemoryLib/ScanMem64Wrapper.c b/MdePkg/Library/UefiMemoryLib/ScanMem64Wrapper.c index c5f0762ebe..228c864b04 100644 --- a/MdePkg/Library/UefiMemoryLib/ScanMem64Wrapper.c +++ b/MdePkg/Library/UefiMemoryLib/ScanMem64Wrapper.c @@ -26,25 +26,22 @@ #include "MemLibInternals.h" /** - Scans a target buffer for a 64-bit value, and returns a pointer to the - matching 64-bit value in the target buffer. + Scans a target buffer for a 64-bit value, and returns a pointer to the matching 64-bit value + in the target buffer. - This function searches target the buffer specified by Buffer and Length from - the lowest address to the highest address at 64-bit increments for a 64-bit - value that matches Value. If a match is found, then a pointer to the matching - value in the target buffer is returned. If no match is found, then NULL is - returned. If Length is 0, then NULL is returned. - - If Buffer is NULL, then ASSERT(). + This function searches target the buffer specified by Buffer and Length from the lowest + address to the highest address for a 64-bit value that matches Value. If a match is found, + then a pointer to the matching byte in the target buffer is returned. If no match is found, + then NULL is returned. If Length is 0, then NULL is returned. + If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 64-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). - @param Buffer Pointer to the target buffer to scan. - @param Length Number of bytes in Buffer to scan. - @param Value Value to search for in the target buffer. + @param Buffer Pointer to the target buffer to scan. + @param Length Number of bytes in Buffer to scan. + @param Value Value to search for in the target buffer. - @return Pointer to the first occurrence or NULL if not found. - @retval NULL if Length == 0 or Value was not found. + @return A pointer to the matching byte in the target buffer or NULL otherwise. **/ VOID * @@ -55,12 +52,13 @@ ScanMem64 ( IN UINT64 Value ) { + if (Length == 0) { + return NULL; + } + ASSERT (Buffer != NULL); ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0); - ASSERT (Length <= MAX_ADDRESS + (UINTN)Buffer + 1); + ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer)); - if ((Length /= sizeof (Value)) == 0) { - return NULL; - } - return (VOID*)InternalMemScanMem64 (Buffer, Length, Value); + return (VOID*)InternalMemScanMem64 (Buffer, Length / sizeof (Value), Value); } diff --git a/MdePkg/Library/UefiMemoryLib/ScanMem8Wrapper.c b/MdePkg/Library/UefiMemoryLib/ScanMem8Wrapper.c index 9b817b1b0e..72a8078b81 100644 --- a/MdePkg/Library/UefiMemoryLib/ScanMem8Wrapper.c +++ b/MdePkg/Library/UefiMemoryLib/ScanMem8Wrapper.c @@ -26,24 +26,21 @@ #include "MemLibInternals.h" /** - Scans a target buffer for an 8-bit value, and returns a pointer to the - matching 8-bit value in the target buffer. + Scans a target buffer for an 8-bit value, and returns a pointer to the matching 8-bit value + in the target buffer. - This function searches target the buffer specified by Buffer and Length from - the lowest address to the highest address for an 8-bit value that matches - Value. If a match is found, then a pointer to the matching byte in the target - buffer is returned. If no match is found, then NULL is returned. If Length is - 0, then NULL is returned. + This function searches target the buffer specified by Buffer and Length from the lowest + address to the highest address for an 8-bit value that matches Value. If a match is found, + then a pointer to the matching byte in the target buffer is returned. If no match is found, + then NULL is returned. If Length is 0, then NULL is returned. + If Length > 0 and Buffer is NULL, then ASSERT(). + If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). - If Buffer is NULL, then ASSERT(). - If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). + @param Buffer Pointer to the target buffer to scan. + @param Length Number of bytes in Buffer to scan. + @param Value Value to search for in the target buffer. - @param Buffer Pointer to the target buffer to scan. - @param Length Number of bytes in Buffer to scan. - @param Value Value to search for in the target buffer. - - @return Pointer to the first occurrence or NULL if not found. - @retval NULL if Length == 0 or Value was not found. + @return A pointer to the matching byte in the target buffer or NULL otherwise. **/ VOID * @@ -54,11 +51,11 @@ ScanMem8 ( IN UINT8 Value ) { - ASSERT (Buffer != NULL); - ASSERT (Length <= MAX_ADDRESS + (UINTN)Buffer + 1); - - if ((Length /= sizeof (Value)) == 0) { + if (Length == 0) { return NULL; } - return (VOID*)InternalMemScanMem8 (Buffer, Length, Value); + ASSERT (Buffer != NULL); + ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer)); + + return (VOID*)InternalMemScanMem8 (Buffer, Length / sizeof (Value), Value); } diff --git a/MdePkg/Library/UefiMemoryLib/SetMem16Wrapper.c b/MdePkg/Library/UefiMemoryLib/SetMem16Wrapper.c index dea31608fe..fd3720cd51 100644 --- a/MdePkg/Library/UefiMemoryLib/SetMem16Wrapper.c +++ b/MdePkg/Library/UefiMemoryLib/SetMem16Wrapper.c @@ -32,7 +32,7 @@ Value, and returns Buffer. Value is repeated every 16-bits in for Length bytes of Buffer. - If Buffer is NULL and Length > 0, then ASSERT(). + If Length > 0 and Buffer is NULL and Length > 0, then ASSERT(). If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). If Buffer is not aligned on a 16-bit boundary, then ASSERT(). If Length is not aligned on a 16-bit boundary, then ASSERT(). @@ -52,13 +52,14 @@ SetMem16 ( IN UINT16 Value ) { - ASSERT (!(Buffer == NULL && Length > 0)); - ASSERT (Length <= MAX_ADDRESS - (UINTN)Buffer + 1); + if (Length == 0) { + return Buffer; + } + + ASSERT (Buffer != NULL); + ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer)); ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) == 0); ASSERT ((Length & (sizeof (Value) - 1)) == 0); - if ((Length /= sizeof (Value)) == 0) { - return Buffer; - } - return InternalMemSetMem16 (Buffer, Length, Value); + return InternalMemSetMem16 (Buffer, Length / sizeof (Value), Value); } diff --git a/MdePkg/Library/UefiMemoryLib/SetMem32Wrapper.c b/MdePkg/Library/UefiMemoryLib/SetMem32Wrapper.c index 1ae7acb013..77f1abda04 100644 --- a/MdePkg/Library/UefiMemoryLib/SetMem32Wrapper.c +++ b/MdePkg/Library/UefiMemoryLib/SetMem32Wrapper.c @@ -32,7 +32,7 @@ Value, and returns Buffer. Value is repeated every 32-bits in for Length bytes of Buffer. - If Buffer is NULL and Length > 0, then ASSERT(). + If Length > 0 and Buffer is NULL and Length > 0, then ASSERT(). If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). If Buffer is not aligned on a 32-bit boundary, then ASSERT(). If Length is not aligned on a 32-bit boundary, then ASSERT(). @@ -52,13 +52,14 @@ SetMem32 ( IN UINT32 Value ) { - ASSERT (!(Buffer == NULL && Length > 0)); - ASSERT (Length <= MAX_ADDRESS - (UINTN)Buffer + 1); + if (Length == 0) { + return Buffer; + } + + ASSERT (Buffer != NULL); + ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer)); ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) == 0); ASSERT ((Length & (sizeof (Value) - 1)) == 0); - if ((Length /= sizeof (Value)) == 0) { - return Buffer; - } - return InternalMemSetMem32 (Buffer, Length, Value); + return InternalMemSetMem32 (Buffer, Length / sizeof (Value), Value); } diff --git a/MdePkg/Library/UefiMemoryLib/SetMem64Wrapper.c b/MdePkg/Library/UefiMemoryLib/SetMem64Wrapper.c index 0128a2d6f1..f95b97ff87 100644 --- a/MdePkg/Library/UefiMemoryLib/SetMem64Wrapper.c +++ b/MdePkg/Library/UefiMemoryLib/SetMem64Wrapper.c @@ -32,7 +32,7 @@ Value, and returns Buffer. Value is repeated every 64-bits in for Length bytes of Buffer. - If Buffer is NULL and Length > 0, then ASSERT(). + If Length > 0 and Buffer is NULL and Length > 0, then ASSERT(). If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). If Buffer is not aligned on a 64-bit boundary, then ASSERT(). If Length is not aligned on a 64-bit boundary, then ASSERT(). @@ -52,13 +52,14 @@ SetMem64 ( IN UINT64 Value ) { - ASSERT (!(Buffer == NULL && Length > 0)); - ASSERT (Length <= MAX_ADDRESS - (UINTN)Buffer + 1); + if (Length == 0) { + return Buffer; + } + + ASSERT (Buffer != NULL); + ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer)); ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) == 0); ASSERT ((Length & (sizeof (Value) - 1)) == 0); - if ((Length /= sizeof (Value)) == 0) { - return Buffer; - } - return InternalMemSetMem64 (Buffer, Length, Value); + return InternalMemSetMem64 (Buffer, Length / sizeof (Value), Value); } diff --git a/MdePkg/Library/UefiMemoryLib/SetMemWrapper.c b/MdePkg/Library/UefiMemoryLib/SetMemWrapper.c index 0600dc289f..d0e8760ff6 100644 --- a/MdePkg/Library/UefiMemoryLib/SetMemWrapper.c +++ b/MdePkg/Library/UefiMemoryLib/SetMemWrapper.c @@ -26,30 +26,31 @@ #include "MemLibInternals.h" /** - Set Buffer to Value for Size bytes. + Fills a target buffer with a byte value, and returns the target buffer. This function fills Length bytes of Buffer with Value, and returns Buffer. + If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). - If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). + @param Buffer Memory to set. + @param Length Number of bytes to set + @param Value Value of the set operation. - @param Buffer Memory to set. - @param Size Number of bytes to set - @param Value Value of the set operation. - - @return Buffer + @return Buffer. **/ VOID * EFIAPI SetMem ( IN VOID *Buffer, - IN UINTN Size, + IN UINTN Length, IN UINT8 Value ) { - if (Size == 0) { + if (Length == 0) { return Buffer; } - ASSERT (Size - 1 <= MAX_ADDRESS - (UINTN)Buffer); - return InternalMemSetMem (Buffer, Size, Value); + + ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer)); + + return InternalMemSetMem (Buffer, Length, Value); } -- cgit v1.2.3