Code scrub:

MdePkg/Library/BaseCacheMaintenanceLib
MdePkg/Library/BaseDebugLibNull
MdePkg/Library/BaseIoLibIntrinsic
MdePkg/Library/BaseLib
MdePkg/Library/BaseMemoryLib
MdePkg/Library/BaseMemoryLibMmx
MdePkg/Library/BaseMemoryLibOptDxe
MdePkg/Library/BaseMemoryLibOptPei
MdePkg/Library/BaseMemoryLibRepStr
MdePkg/Library/BaseMemoryLibSse2
MdePkg/Library/BasePeCoffGetEntryPointLib


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5426 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
yshang1 2008-07-08 09:38:43 +00:00
parent d74eeda8a7
commit 38bbd3d91c
104 changed files with 392 additions and 286 deletions

View File

@ -471,7 +471,7 @@ StrStr (
@param String Pointer to a Null-terminated Unicode string. @param String Pointer to a Null-terminated Unicode string.
@retval UINTN @retval Value translated from String.
**/ **/
UINTN UINTN
@ -511,7 +511,7 @@ StrDecimalToUintn (
@param String Pointer to a Null-terminated Unicode string. @param String Pointer to a Null-terminated Unicode string.
@retval UINT64 @retval Value translated from String.
**/ **/
UINT64 UINT64
@ -553,7 +553,7 @@ StrDecimalToUint64 (
@param String Pointer to a Null-terminated Unicode string. @param String Pointer to a Null-terminated Unicode string.
@retval UINTN @retval Value translated from String.
**/ **/
UINTN UINTN
@ -595,7 +595,7 @@ StrHexToUintn (
@param String Pointer to a Null-terminated Unicode string. @param String Pointer to a Null-terminated Unicode string.
@retval UINT64 @retval Value translated from String.
**/ **/
UINT64 UINT64
@ -1127,7 +1127,7 @@ AsciiStrStr (
@param String Pointer to a Null-terminated ASCII string. @param String Pointer to a Null-terminated ASCII string.
@retval UINTN @retval Value translated from String.
**/ **/
UINTN UINTN
@ -1164,7 +1164,7 @@ AsciiStrDecimalToUintn (
@param String Pointer to a Null-terminated ASCII string. @param String Pointer to a Null-terminated ASCII string.
@retval UINT64 @retval Value translated from String.
**/ **/
UINT64 UINT64
@ -1205,7 +1205,7 @@ AsciiStrDecimalToUint64 (
@param String Pointer to a Null-terminated ASCII string. @param String Pointer to a Null-terminated ASCII string.
@retval UINTN @retval Value translated from String.
**/ **/
UINTN UINTN
@ -1246,7 +1246,7 @@ AsciiStrHexToUintn (
@param String Pointer to a Null-terminated ASCII string. @param String Pointer to a Null-terminated ASCII string.
@retval UINT64 @retval Value translated from String.
**/ **/
UINT64 UINT64
@ -1595,6 +1595,8 @@ IsNodeAtEnd (
@param FirstEntry A pointer to a node in a linked list. @param FirstEntry A pointer to a node in a linked list.
@param SecondEntry A pointer to another node in the same linked list. @param SecondEntry A pointer to another node in the same linked list.
@return SecondEntry
**/ **/
LIST_ENTRY * LIST_ENTRY *
@ -2237,7 +2239,7 @@ WriteUnaligned16 (
@param Buffer Pointer to a 24-bit value that may be unaligned. @param Buffer Pointer to a 24-bit value that may be unaligned.
@return The value read. @return The value read from Buffer.
**/ **/
UINT32 UINT32
@ -2259,7 +2261,7 @@ ReadUnaligned24 (
@param Buffer Pointer to a 24-bit value that may be unaligned. @param Buffer Pointer to a 24-bit value that may be unaligned.
@param Value 24-bit value to write to Buffer. @param Value 24-bit value to write to Buffer.
@return The value written. @return The value written to Buffer.
**/ **/
UINT32 UINT32
@ -2280,7 +2282,7 @@ WriteUnaligned24 (
@param Uint32 Pointer to a 32-bit value that may be unaligned. @param Uint32 Pointer to a 32-bit value that may be unaligned.
@return *Uint32 @return Value read from Uint32
**/ **/
UINT32 UINT32
@ -2302,7 +2304,7 @@ ReadUnaligned32 (
@param Uint32 Pointer to a 32-bit value that may be unaligned. @param Uint32 Pointer to a 32-bit value that may be unaligned.
@param Value 32-bit value to write to Buffer. @param Value 32-bit value to write to Buffer.
@return Value @return Value written to Uint32.
**/ **/
UINT32 UINT32
@ -2323,7 +2325,7 @@ WriteUnaligned32 (
@param Uint64 Pointer to a 64-bit value that may be unaligned. @param Uint64 Pointer to a 64-bit value that may be unaligned.
@return *Uint64 @return Value read from Uint64.
**/ **/
UINT64 UINT64
@ -2345,7 +2347,7 @@ ReadUnaligned64 (
@param Uint64 Pointer to a 64-bit value that may be unaligned. @param Uint64 Pointer to a 64-bit value that may be unaligned.
@param Value 64-bit value to write to Buffer. @param Value 64-bit value to write to Buffer.
@return Value @return Value written to Uint64.
**/ **/
UINT64 UINT64
@ -3048,7 +3050,7 @@ GetSpinLockProperties (
@param SpinLock A pointer to the spin lock to initialize to the released @param SpinLock A pointer to the spin lock to initialize to the released
state. state.
@return SpinLock @return SpinLock in release state.
**/ **/
SPIN_LOCK * SPIN_LOCK *
@ -3075,7 +3077,7 @@ InitializeSpinLock (
@param SpinLock A pointer to the spin lock to place in the acquired state. @param SpinLock A pointer to the spin lock to place in the acquired state.
@return SpinLock @return SpinLock accquired lock.
**/ **/
SPIN_LOCK * SPIN_LOCK *
@ -3120,7 +3122,7 @@ AcquireSpinLockOrFail (
@param SpinLock A pointer to the spin lock to release. @param SpinLock A pointer to the spin lock to release.
@return SpinLock @return SpinLock released lock.
**/ **/
SPIN_LOCK * SPIN_LOCK *
@ -3245,6 +3247,7 @@ InterlockedCompareExchange64 (
@param CompareValue Pointer value used in compare operation. @param CompareValue Pointer value used in compare operation.
@param ExchangeValue Pointer value used in exchange operation. @param ExchangeValue Pointer value used in exchange operation.
@return The original *Value before exchange.
**/ **/
VOID * VOID *
EFIAPI EFIAPI
@ -3552,8 +3555,6 @@ LongJump (
/** /**
Enables CPU interrupts. Enables CPU interrupts.
Enables CPU interrupts.
**/ **/
VOID VOID
EFIAPI EFIAPI
@ -3565,8 +3566,6 @@ EnableInterrupts (
/** /**
Disables CPU interrupts. Disables CPU interrupts.
Disables CPU interrupts.
**/ **/
VOID VOID
EFIAPI EFIAPI
@ -3579,9 +3578,6 @@ DisableInterrupts (
Disables CPU interrupts and returns the interrupt state prior to the disable Disables CPU interrupts and returns the interrupt state prior to the disable
operation. operation.
Disables CPU interrupts and returns the interrupt state prior to the disable
operation.
@retval TRUE CPU interrupts were enabled on entry to this call. @retval TRUE CPU interrupts were enabled on entry to this call.
@retval FALSE CPU interrupts were disabled on entry to this call. @retval FALSE CPU interrupts were disabled on entry to this call.
@ -3597,9 +3593,6 @@ SaveAndDisableInterrupts (
Enables CPU interrupts for the smallest window required to capture any Enables CPU interrupts for the smallest window required to capture any
pending interrupts. pending interrupts.
Enables CPU interrupts for the smallest window required to capture any
pending interrupts.
**/ **/
VOID VOID
EFIAPI EFIAPI
@ -3611,8 +3604,8 @@ EnableDisableInterrupts (
/** /**
Retrieves the current CPU interrupt state. Retrieves the current CPU interrupt state.
Retrieves the current CPU interrupt state. Returns TRUE is interrupts are Returns TRUE is interrupts are currently enabled. Otherwise
currently enabled. Otherwise returns FALSE. returns FALSE.
@retval TRUE CPU interrupts are enabled. @retval TRUE CPU interrupts are enabled.
@retval FALSE CPU interrupts are disabled. @retval FALSE CPU interrupts are disabled.

View File

@ -45,12 +45,10 @@
[Packages] [Packages]
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
[LibraryClasses]
DebugLib
[LibraryClasses.Ipf] [LibraryClasses.Ipf]
PalCallLib PalCallLib
[LibraryClasses.common] [LibraryClasses.common]
BaseLib BaseLib
DebugLib

View File

@ -56,7 +56,7 @@ InvalidateInstructionCache (
@param Length The number of bytes to invalidate from the instruction cache. @param Length The number of bytes to invalidate from the instruction cache.
@return Address @return Address of cache invalidation.
**/ **/
VOID * VOID *
@ -111,7 +111,7 @@ WriteBackInvalidateDataCache (
@param Length The number of bytes to write back and invalidate from the @param Length The number of bytes to write back and invalidate from the
data cache. data cache.
@return Address @return Address of cache invalidation.
**/ **/
VOID * VOID *
@ -165,7 +165,7 @@ WriteBackDataCache (
mode, then Address is a virtual address. mode, then Address is a virtual address.
@param Length The number of bytes to write back from the data cache. @param Length The number of bytes to write back from the data cache.
@return Address @return Address of cache wrote in main memory.
**/ **/
VOID * VOID *
@ -222,7 +222,7 @@ InvalidateDataCache (
then Address is a virtual address. then Address is a virtual address.
@param Length The number of bytes to invalidate from the data cache. @param Length The number of bytes to invalidate from the data cache.
@return Address @return Address of cache invalidation.
**/ **/
VOID * VOID *

View File

@ -61,7 +61,7 @@ InvalidateInstructionCache (
@param Length The number of bytes to invalidate from the instruction cache. @param Length The number of bytes to invalidate from the instruction cache.
@return Address @return Address of cahce invalidation.
**/ **/
VOID * VOID *
@ -116,7 +116,7 @@ WriteBackInvalidateDataCache (
@param Length The number of bytes to write back and invalidate from the @param Length The number of bytes to write back and invalidate from the
data cache. data cache.
@return Address @return Address of cache invalidation.
**/ **/
VOID * VOID *
@ -172,7 +172,7 @@ WriteBackDataCache (
mode, then Address is a virtual address. mode, then Address is a virtual address.
@param Length The number of bytes to write back from the data cache. @param Length The number of bytes to write back from the data cache.
@return Address @return Address of cache wrote in main memory.
**/ **/
VOID * VOID *
@ -231,7 +231,7 @@ InvalidateDataCache (
then Address is a virtual address. then Address is a virtual address.
@param Length The number of bytes to invalidate from the data cache. @param Length The number of bytes to invalidate from the data cache.
@return Address @return Address of cache invalidation.
**/ **/
VOID * VOID *

View File

@ -64,7 +64,7 @@ InvalidateInstructionCache (
@param Length The number of bytes to invalidate from the instruction cache. @param Length The number of bytes to invalidate from the instruction cache.
@return Address @return Address of cache invalidation.
**/ **/
VOID * VOID *
@ -120,7 +120,7 @@ WriteBackInvalidateDataCache (
@param Length The number of bytes to write back and invalidate from the @param Length The number of bytes to write back and invalidate from the
data cache. data cache.
@return Address @return Address of cache invalidation.
**/ **/
VOID * VOID *
@ -139,6 +139,9 @@ WriteBackInvalidateDataCacheRange (
} }
Start = (UINTN)Address; Start = (UINTN)Address;
//
// Calculate the cache line alignment
//
End = (Start + Length + (CACHE_LINE_SIZE - 1)) & ~(CACHE_LINE_SIZE - 1); End = (Start + Length + (CACHE_LINE_SIZE - 1)) & ~(CACHE_LINE_SIZE - 1);
Start &= ~(CACHE_LINE_SIZE - 1); Start &= ~(CACHE_LINE_SIZE - 1);
@ -189,7 +192,7 @@ WriteBackDataCache (
mode, then Address is a virtual address. mode, then Address is a virtual address.
@param Length The number of bytes to write back from the data cache. @param Length The number of bytes to write back from the data cache.
@return Address @return Address of cache wrote in main memory.
**/ **/
VOID * VOID *
@ -246,7 +249,7 @@ InvalidateDataCache (
then Address is a virtual address. then Address is a virtual address.
@param Length The number of bytes to invalidate from the data cache. @param Length The number of bytes to invalidate from the data cache.
@return Address @return Address of cache invalidation.
**/ **/
VOID * VOID *

View File

@ -93,7 +93,7 @@ DebugAssert (
@param Buffer Pointer to the target buffer to fill with PcdDebugClearMemoryValue. @param Buffer Pointer to the target buffer to fill with PcdDebugClearMemoryValue.
@param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. @param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue.
@return Buffer @return Buffer filled with PcdDebugClearMemoryValue.
**/ **/
VOID * VOID *
@ -116,6 +116,8 @@ DebugClearMemory (
@retval TRUE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set. @retval TRUE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.
@retval FALSE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear. @retval FALSE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.
@return Always return FALSE.
**/ **/
BOOLEAN BOOLEAN
@ -137,6 +139,8 @@ DebugAssertEnabled (
@retval TRUE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set. @retval TRUE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.
@retval FALSE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear. @retval FALSE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.
@return Always return FALSE.
**/ **/
BOOLEAN BOOLEAN
@ -158,6 +162,8 @@ DebugPrintEnabled (
@retval TRUE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set. @retval TRUE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.
@retval FALSE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear. @retval FALSE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.
@return Always return FALSE.
**/ **/
BOOLEAN BOOLEAN
@ -179,6 +185,8 @@ DebugCodeEnabled (
@retval TRUE The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set. @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 FALSE The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.
@return Always return FALSE.
**/ **/
BOOLEAN BOOLEAN

View File

@ -1,7 +1,7 @@
/**@file /**@file
Common header file shared by all source files. Common header file shared by all source files.
This file includes package header files, library classes and protocol, PPI & GUID definitions. This file includes package header files, dependent library classes.
Copyright (c) 2007, Intel Corporation. Copyright (c) 2007, Intel Corporation.
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
@ -12,8 +12,8 @@
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/ **/
#ifndef __COMMON_HEADER_H_ #ifndef __BASEIOLIB_INTRINSIC_INTERNAL_H_
#define __COMMON_HEADER_H_ #define __BASEIOLIB_INTRINSIC_INTERNAL_H_

View File

@ -130,7 +130,8 @@ IoAndThenOr8 (
@param EndBit The ordinal of the most significant bit in the bit field. @param EndBit The ordinal of the most significant bit in the bit field.
Range 0..7. Range 0..7.
@return The value read. @return The value read from I/O port specified by StartBit and
EndBit.
**/ **/
UINT8 UINT8
@ -410,7 +411,8 @@ IoAndThenOr16 (
@param EndBit The ordinal of the most significant bit in the bit field. @param EndBit The ordinal of the most significant bit in the bit field.
Range 0..15. Range 0..15.
@return The value read. @return The value read from I/O port specified by StartBit and
EndBit.
**/ **/
UINT16 UINT16
@ -690,7 +692,8 @@ IoAndThenOr32 (
@param EndBit The ordinal of the most significant bit in the bit field. @param EndBit The ordinal of the most significant bit in the bit field.
Range 0..31. Range 0..31.
@return The value read. @return The value read from I/O port specified by StartBit and
EndBit.
**/ **/
UINT32 UINT32
@ -970,7 +973,8 @@ IoAndThenOr64 (
@param EndBit The ordinal of the most significant bit in the bit field. @param EndBit The ordinal of the most significant bit in the bit field.
Range 0..63. Range 0..63.
@return The value read. @return The value read from I/O port specified by StartBit and
EndBit.
**/ **/
UINT64 UINT64
@ -1251,7 +1255,8 @@ MmioAndThenOr8 (
@param EndBit The ordinal of the most significant bit in the bit field. @param EndBit The ordinal of the most significant bit in the bit field.
Range 0..7. Range 0..7.
@return The value read. @return The value read from I/O port specified by StartBit and
EndBit.
**/ **/
UINT8 UINT8
@ -1533,7 +1538,8 @@ MmioAndThenOr16 (
@param EndBit The ordinal of the most significant bit in the bit field. @param EndBit The ordinal of the most significant bit in the bit field.
Range 0..15. Range 0..15.
@return The value read. @return The value read from I/O port specified by StartBit and
EndBit.
**/ **/
UINT16 UINT16
@ -1815,7 +1821,8 @@ MmioAndThenOr32 (
@param EndBit The ordinal of the most significant bit in the bit field. @param EndBit The ordinal of the most significant bit in the bit field.
Range 0..31. Range 0..31.
@return The value read. @return The value read from I/O port specified by StartBit and
EndBit.
**/ **/
UINT32 UINT32
@ -2097,7 +2104,8 @@ MmioAndThenOr64 (
@param EndBit The ordinal of the most significant bit in the bit field. @param EndBit The ordinal of the most significant bit in the bit field.
Range 0..63. Range 0..63.
@return The value read. @return The value read from I/O port specified by StartBit and
EndBit.
**/ **/
UINT64 UINT64

View File

@ -12,9 +12,6 @@
**/ **/
//
// Include common header file for this module.
//
#include "BaseIoLibIntrinsicInternal.h" #include "BaseIoLibIntrinsicInternal.h"
/** /**
@ -28,7 +25,7 @@
@param Port The I/O port to read. @param Port The I/O port to read.
@return The value read. @return Always return zero.
**/ **/
UINT64 UINT64
@ -53,7 +50,7 @@ IoRead64 (
@param Port The I/O port to write. @param Port The I/O port to write.
@param Value The value to write to the I/O port. @param Value The value to write to the I/O port.
@return The value written the I/O port. @return Always return zero.
**/ **/
UINT64 UINT64

View File

@ -37,7 +37,7 @@
@param Address The MMIO register to read. @param Address The MMIO register to read.
@return The value read. @return The value read from Address.
**/ **/
UINT8 UINT8
@ -61,6 +61,9 @@ MmioRead8 (
@param Address The MMIO register to write. @param Address The MMIO register to write.
@param Value The value to write to the MMIO register. @param Value The value to write to the MMIO register.
@return The value written to the Mmio. It equals to the input
Value instead of the actual value read back from the
Mmio.
**/ **/
UINT8 UINT8
EFIAPI EFIAPI
@ -83,7 +86,7 @@ MmioWrite8 (
@param Address The MMIO register to read. @param Address The MMIO register to read.
@return The value read. @return The value read from Address.
**/ **/
UINT16 UINT16
@ -108,6 +111,9 @@ MmioRead16 (
@param Address The MMIO register to write. @param Address The MMIO register to write.
@param Value The value to write to the MMIO register. @param Value The value to write to the MMIO register.
@return The value written to the Mmio. It equals to the input
Value instead of the actual value read back from the
Mmio.
**/ **/
UINT16 UINT16
EFIAPI EFIAPI
@ -131,7 +137,7 @@ MmioWrite16 (
@param Address The MMIO register to read. @param Address The MMIO register to read.
@return The value read. @return The value read from Address.
**/ **/
UINT32 UINT32
@ -156,6 +162,9 @@ MmioRead32 (
@param Address The MMIO register to write. @param Address The MMIO register to write.
@param Value The value to write to the MMIO register. @param Value The value to write to the MMIO register.
@return The value written to the Mmio. It equals to the input
Value instead of the actual value read back from the
Mmio.
**/ **/
UINT32 UINT32
EFIAPI EFIAPI
@ -179,7 +188,7 @@ MmioWrite32 (
@param Address The MMIO register to read. @param Address The MMIO register to read.
@return The value read. @return The value read from Address.
**/ **/
UINT64 UINT64
@ -204,6 +213,9 @@ MmioRead64 (
@param Address The MMIO register to write. @param Address The MMIO register to write.
@param Value The value to write to the MMIO register. @param Value The value to write to the MMIO register.
@return The value written to the Mmio. It equals to the input
Value instead of the actual value read back from the
Mmio.
**/ **/
UINT64 UINT64
EFIAPI EFIAPI
@ -229,7 +241,7 @@ MmioWrite64 (
@param Port The I/O port to read. @param Port The I/O port to read.
@return The value read. @return The value read from Port.
**/ **/
__inline__ __inline__
@ -257,7 +269,9 @@ IoRead8 (
@param Port The I/O port to write. @param Port The I/O port to write.
@param Value The value to write to the I/O port. @param Value The value to write to the I/O port.
@return The value written the I/O port. @return The value written to the I/O port. It equals to the
input Value instead of the actual value read back from
the I/O port.
**/ **/
__inline__ __inline__
@ -283,7 +297,7 @@ IoWrite8 (
@param Port The I/O port to read. @param Port The I/O port to read.
@return The value read. @return The value read from Port.
**/ **/
__inline__ __inline__
@ -312,7 +326,9 @@ IoRead16 (
@param Port The I/O port to write. @param Port The I/O port to write.
@param Value The value to write to the I/O port. @param Value The value to write to the I/O port.
@return The value written the I/O port. @return The value written to the I/O port. It equals to the
input Value instead of the actual value read back from
the I/O port.
**/ **/
__inline__ __inline__
@ -339,7 +355,7 @@ IoWrite16 (
@param Port The I/O port to read. @param Port The I/O port to read.
@return The value read. @return The value read from Port.
**/ **/
__inline__ __inline__
@ -368,7 +384,9 @@ IoRead32 (
@param Port The I/O port to write. @param Port The I/O port to write.
@param Value The value to write to the I/O port. @param Value The value to write to the I/O port.
@return The value written the I/O port. @return The value written to the I/O port. It equals to the
input Value instead of the actual value read back from
the I/O port.
**/ **/
__inline__ __inline__

View File

@ -13,9 +13,6 @@
**/ **/
//
// Include common header file for this module.
//
#include "BaseIoLibIntrinsicInternal.h" #include "BaseIoLibIntrinsicInternal.h"
/** /**
@ -29,7 +26,7 @@
@param Address The MMIO register to read. @param Address The MMIO register to read.
@return The value read. @return The value read from Address.
**/ **/
UINT8 UINT8
@ -52,6 +49,10 @@ MmioRead8 (
@param Address The MMIO register to write. @param Address The MMIO register to write.
@param Value The value to write to the MMIO register. @param Value The value to write to the MMIO register.
@return The value written to the Mmio. It equals to the input
Value instead of the actual value read back from the
Mmio.
**/ **/
UINT8 UINT8
@ -75,7 +76,7 @@ MmioWrite8 (
@param Address The MMIO register to read. @param Address The MMIO register to read.
@return The value read. @return The value read from Address.
**/ **/
UINT16 UINT16
@ -99,6 +100,10 @@ MmioRead16 (
@param Address The MMIO register to write. @param Address The MMIO register to write.
@param Value The value to write to the MMIO register. @param Value The value to write to the MMIO register.
@return The value written to the Mmio. It equals to the input
Value instead of the actual value read back from the
Mmio.
**/ **/
UINT16 UINT16
@ -123,7 +128,7 @@ MmioWrite16 (
@param Address The MMIO register to read. @param Address The MMIO register to read.
@return The value read. @return The value read from Address.
**/ **/
UINT32 UINT32
@ -147,6 +152,10 @@ MmioRead32 (
@param Address The MMIO register to write. @param Address The MMIO register to write.
@param Value The value to write to the MMIO register. @param Value The value to write to the MMIO register.
@return The value written to the Mmio. It equals to the input
Value instead of the actual value read back from the
Mmio.
**/ **/
UINT32 UINT32
@ -171,7 +180,7 @@ MmioWrite32 (
@param Address The MMIO register to read. @param Address The MMIO register to read.
@return The value read. @return The value read from Address.
**/ **/
UINT64 UINT64
@ -196,6 +205,9 @@ MmioRead64 (
@param Address The MMIO register to write. @param Address The MMIO register to write.
@param Value The value to write to the MMIO register. @param Value The value to write to the MMIO register.
@return The value written to the Mmio. It equals to the input
Value instead of the actual value read back from the
Mmio.
**/ **/
UINT64 UINT64
EFIAPI EFIAPI
@ -221,7 +233,7 @@ MmioWrite64 (
@param Port The I/O port to read. @param Port The I/O port to read.
@return The value read. @return The value read from Port.
**/ **/
UINT8 UINT8
@ -253,7 +265,9 @@ IoRead8 (
@param Port The I/O port to write. @param Port The I/O port to write.
@param Value The value to write to the I/O port. @param Value The value to write to the I/O port.
@return The value written the I/O port. @return The value written to the I/O port. It equals to the input
Value instead of the actual value read back from the
I/O port.
**/ **/
UINT8 UINT8
@ -282,7 +296,7 @@ IoWrite8 (
@param Port The I/O port to read. @param Port The I/O port to read.
@return The value read. @return The value read from Port.
**/ **/
UINT16 UINT16
@ -316,7 +330,9 @@ IoRead16 (
@param Port The I/O port to write. @param Port The I/O port to write.
@param Value The value to write to the I/O port. @param Value The value to write to the I/O port.
@return The value written the I/O port. @return The value written to the I/O port. It equals to the input
Value instead of the actual value read back from the
I/O port.
**/ **/
UINT16 UINT16
@ -351,7 +367,7 @@ IoWrite16 (
@param Port The I/O port to read. @param Port The I/O port to read.
@return The value read. @return The value read from Port.
**/ **/
UINT32 UINT32
@ -385,7 +401,9 @@ IoRead32 (
@param Port The I/O port to write. @param Port The I/O port to write.
@param Value The value to write to the I/O port. @param Value The value to write to the I/O port.
@return The value written the I/O port. @return The value written to the I/O port. It equals to the input
Value instead of the actual value read back from the
I/O port.
**/ **/
UINT32 UINT32

View File

@ -61,7 +61,7 @@ InternalGetMemoryMapAddress (
@param Port The I/O port to read. @param Port The I/O port to read.
@return The value read. @return The value read from Port.
**/ **/
UINT8 UINT8
@ -82,7 +82,7 @@ IoRead8 (
@param Port The I/O port to read. @param Port The I/O port to read.
@return The value read. @return The value read from Port.
**/ **/
UINT16 UINT16
@ -103,7 +103,7 @@ IoRead16 (
@param Port The I/O port to read. @param Port The I/O port to read.
@return The value read. @return The value read from Port.
**/ **/
UINT32 UINT32
@ -126,7 +126,7 @@ IoRead32 (
@param Port The I/O port to read. @param Port The I/O port to read.
@return The value read. @return The value read from Port.
**/ **/
UINT64 UINT64
@ -149,7 +149,9 @@ IoRead64 (
@param Port The I/O port to write. @param Port The I/O port to write.
@param Value The value to write to the I/O port. @param Value The value to write to the I/O port.
@return The value written the I/O port. @return The value written to the I/O port. It equals to the
input Value instead of the actual value read back from
the I/O port.
**/ **/
UINT8 UINT8
@ -172,7 +174,9 @@ IoWrite8 (
@param Port The I/O port to write. @param Port The I/O port to write.
@param Value The value to write to the I/O port. @param Value The value to write to the I/O port.
@return The value written the I/O port. @return The value written to the I/O port. It equals to the
input Value instead of the actual value read back from
the I/O port.
**/ **/
UINT16 UINT16
@ -195,7 +199,9 @@ IoWrite16 (
@param Port The I/O port to write. @param Port The I/O port to write.
@param Value The value to write to the I/O port. @param Value The value to write to the I/O port.
@return The value written the I/O port. @return The value written to the I/O port. It equals to the
input Value instead of the actual value read back from
the I/O port.
**/ **/
UINT32 UINT32
@ -220,7 +226,9 @@ IoWrite32 (
@param Port The I/O port to write. @param Port The I/O port to write.
@param Value The value to write to the I/O port. @param Value The value to write to the I/O port.
@return The value written the I/O port. @return The value written to the I/O port. It equals to the
input Value instead of the actual value read back from
the I/O port.
**/ **/
UINT64 UINT64
@ -243,7 +251,7 @@ IoWrite64 (
@param Address The MMIO register to read. @param Address The MMIO register to read.
@return The value read. @return The value read from Address.
**/ **/
UINT8 UINT8
@ -272,7 +280,7 @@ MmioRead8 (
@param Address The MMIO register to read. @param Address The MMIO register to read.
@return The value read. @return The value read from Address.
**/ **/
UINT16 UINT16
@ -306,7 +314,7 @@ MmioRead16 (
@param Address The MMIO register to read. @param Address The MMIO register to read.
@return The value read. @return The value read from Address.
**/ **/
UINT32 UINT32
@ -340,7 +348,7 @@ MmioRead32 (
@param Address The MMIO register to read. @param Address The MMIO register to read.
@return The value read. @return The value read from Address.
**/ **/
UINT64 UINT64
@ -376,7 +384,9 @@ MmioRead64 (
@param Address The MMIO register to write. @param Address The MMIO register to write.
@param Data The value to write to the MMIO register. @param Data The value to write to the MMIO register.
@return The value written the memory address. @return The value written to the Mmio. It equals to the
input Value instead of the actual value read back from
the Mmio.
**/ **/
UINT8 UINT8
@ -405,7 +415,9 @@ MmioWrite8 (
@param Address The MMIO register to write. @param Address The MMIO register to write.
@param Data The value to write to the MMIO register. @param Data The value to write to the MMIO register.
@return The value written the memory address. @return The value written to the Mmio. It equals to the
input Value instead of the actual value read back from
the Mmio.
**/ **/
UINT16 UINT16
@ -439,7 +451,9 @@ MmioWrite16 (
@param Address The MMIO register to write. @param Address The MMIO register to write.
@param Data The value to write to the MMIO register. @param Data The value to write to the MMIO register.
@return The value written the memory address. @return The value written to the Mmio. It equals to the
input Value instead of the actual value read back from
the Mmio.
**/ **/
UINT32 UINT32
@ -473,7 +487,9 @@ MmioWrite32 (
@param Address The MMIO register to write. @param Address The MMIO register to write.
@param Data The value to write to the MMIO register. @param Data The value to write to the MMIO register.
@return The value written the memory address. @return The value written to the Mmio. It equals to the
input Value instead of the actual value read back from
the Mmio.
**/ **/
UINT64 UINT64

View File

@ -12,9 +12,6 @@
**/ **/
//
// Include common header file for this module.
//
#include "BaseIoLibIntrinsicInternal.h" #include "BaseIoLibIntrinsicInternal.h"
/** /**
@ -32,7 +29,7 @@
@param Length Size in bytes of the copy. @param Length Size in bytes of the copy.
@param Buffer Pointer to a system memory buffer receiving the data read. @param Buffer Pointer to a system memory buffer receiving the data read.
@return Buffer @return Buffer contains the data read from Mmio.
**/ **/
UINT8 * UINT8 *
@ -76,7 +73,7 @@ MmioReadBuffer8 (
@param Length Size in bytes of the copy. @param Length Size in bytes of the copy.
@param Buffer Pointer to a system memory buffer receiving the data read. @param Buffer Pointer to a system memory buffer receiving the data read.
@return Buffer @return Buffer contains the data read from Mmio.
**/ **/
UINT16 * UINT16 *
@ -127,7 +124,7 @@ MmioReadBuffer16 (
@param Length Size in bytes of the copy. @param Length Size in bytes of the copy.
@param Buffer Pointer to a system memory buffer receiving the data read. @param Buffer Pointer to a system memory buffer receiving the data read.
@return Buffer @return Buffer contains the data read from Mmio.
**/ **/
UINT32 * UINT32 *
@ -178,7 +175,7 @@ MmioReadBuffer32 (
@param Length Size in bytes of the copy. @param Length Size in bytes of the copy.
@param Buffer Pointer to a system memory buffer receiving the data read. @param Buffer Pointer to a system memory buffer receiving the data read.
@return Buffer @return Buffer contains the data read from Mmio.
**/ **/
UINT64 * UINT64 *

View File

@ -63,7 +63,7 @@ void _ReadWriteBarrier (void);
@param Port The I/O port to read. @param Port The I/O port to read.
@return The value read. @return The value read from Port.
**/ **/
UINT8 UINT8
@ -119,7 +119,7 @@ IoWrite8 (
@param Port The I/O port to read. @param Port The I/O port to read.
@return The value read. @return The value read from Port.
**/ **/
UINT16 UINT16
@ -177,7 +177,7 @@ IoWrite16 (
@param Port The I/O port to read. @param Port The I/O port to read.
@return The value read. @return The value read from Port.
**/ **/
UINT32 UINT32
@ -236,7 +236,7 @@ IoWrite32 (
@param Address The MMIO register to read. @param Address The MMIO register to read.
@return The value read. @return The value read from Address.
**/ **/
UINT8 UINT8
@ -262,7 +262,11 @@ MmioRead8 (
@param Address The MMIO register to write. @param Address The MMIO register to write.
@param Value The value to write to the MMIO register. @param Value The value to write to the MMIO register.
@return The value written to the Mmio. It equals to the input
Value instead of the actual value read back from the
Mmio.
**/ **/
UINT8 UINT8
EFIAPI EFIAPI
@ -285,7 +289,7 @@ MmioWrite8 (
@param Address The MMIO register to read. @param Address The MMIO register to read.
@return The value read. @return The value read from Address.
**/ **/
UINT16 UINT16
@ -312,6 +316,9 @@ MmioRead16 (
@param Address The MMIO register to write. @param Address The MMIO register to write.
@param Value The value to write to the MMIO register. @param Value The value to write to the MMIO register.
@return The value read from the Mmio after wrote specified
Value.
**/ **/
UINT16 UINT16
@ -336,7 +343,7 @@ MmioWrite16 (
@param Address The MMIO register to read. @param Address The MMIO register to read.
@return The value read. @return The value read from Address.
**/ **/
UINT32 UINT32
@ -363,6 +370,10 @@ MmioRead32 (
@param Address The MMIO register to write. @param Address The MMIO register to write.
@param Value The value to write to the MMIO register. @param Value The value to write to the MMIO register.
@return The value written to the Mmio. It equals to the input
Value instead of the actual value read back from the
Mmio.
**/ **/
UINT32 UINT32
@ -387,7 +398,7 @@ MmioWrite32 (
@param Address The MMIO register to read. @param Address The MMIO register to read.
@return The value read. @return The value read from Address.
**/ **/
UINT64 UINT64
@ -415,6 +426,10 @@ MmioRead64 (
@param Address The MMIO register to write. @param Address The MMIO register to write.
@param Value The value to write to the MMIO register. @param Value The value to write to the MMIO register.
@return The value written to the Mmio. It equals to the input
Value instead of the actual value read back from the
Mmio.
**/ **/
UINT64 UINT64
EFIAPI EFIAPI

View File

@ -311,6 +311,7 @@ InternalMathDivRemU64x64 (
**/ **/
INT64 INT64
EFIAPI
InternalMathDivRemS64x64 ( InternalMathDivRemS64x64 (
IN INT64 Dividend, IN INT64 Dividend,
IN INT64 Divisor, IN INT64 Divisor,
@ -374,6 +375,7 @@ InternalSwitchStack (
**/ **/
BOOLEAN BOOLEAN
EFIAPI
IsNodeInList ( IsNodeInList (
IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *List,
IN CONST LIST_ENTRY *Node IN CONST LIST_ENTRY *Node
@ -484,6 +486,7 @@ InternalSyncCompareExchange64 (
**/ **/
unsigned int unsigned int
EFIAPI
BitFieldReadUint ( BitFieldReadUint (
IN unsigned int Operand, IN unsigned int Operand,
IN UINTN StartBit, IN UINTN StartBit,
@ -508,6 +511,7 @@ BitFieldReadUint (
**/ **/
unsigned int unsigned int
EFIAPI
BitFieldOrUint ( BitFieldOrUint (
IN unsigned int Operand, IN unsigned int Operand,
IN UINTN StartBit, IN UINTN StartBit,
@ -533,6 +537,7 @@ BitFieldOrUint (
**/ **/
unsigned int unsigned int
EFIAPI
BitFieldAndUint ( BitFieldAndUint (
IN unsigned int Operand, IN unsigned int Operand,
IN UINTN StartBit, IN UINTN StartBit,
@ -553,6 +558,7 @@ BitFieldAndUint (
**/ **/
VOID VOID
EFIAPI
InternalAssertJumpBuffer ( InternalAssertJumpBuffer (
IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
); );

View File

@ -32,6 +32,7 @@
**/ **/
unsigned int unsigned int
EFIAPI
BitFieldReadUint ( BitFieldReadUint (
IN unsigned int Operand, IN unsigned int Operand,
IN UINTN StartBit, IN UINTN StartBit,
@ -62,6 +63,7 @@ BitFieldReadUint (
**/ **/
unsigned int unsigned int
EFIAPI
BitFieldOrUint ( BitFieldOrUint (
IN unsigned int Operand, IN unsigned int Operand,
IN UINTN StartBit, IN UINTN StartBit,
@ -93,6 +95,7 @@ BitFieldOrUint (
**/ **/
unsigned int unsigned int
EFIAPI
BitFieldAndUint ( BitFieldAndUint (
IN unsigned int Operand, IN unsigned int Operand,
IN UINTN StartBit, IN UINTN StartBit,

View File

@ -36,5 +36,5 @@ CpuDeadLoop (
{ {
volatile UINTN Index; volatile UINTN Index;
for (Index = 0; Index == 0;); for (Index = 0; 0 == Index;);
} }

View File

@ -28,6 +28,7 @@
**/ **/
VOID VOID
EFIAPI
InternalAssertJumpBuffer ( InternalAssertJumpBuffer (
IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
); );

View File

@ -12,6 +12,25 @@
**/ **/
/**
Performs an atomic compare exchange operation on a 32-bit
unsigned integer.
Performs an atomic compare exchange operation on the 32-bit
unsigned integer specified by Value. If Value is equal to
CompareValue, then Value is set to ExchangeValue and
CompareValue is returned. If Value is not equal to
CompareValue, then Value is returned. The compare exchange
operation must be performed using MP safe mechanisms.
@param Value A pointer to the 32-bit value for the
compare exchange operation.
@param CompareValue 32-bit value used in compare operation.
@param ExchangeValue 32-bit value used in exchange operation.
@return The original *Value before exchange.
**/
UINT32 UINT32
EFIAPI EFIAPI
InternalSyncCompareExchange32 ( InternalSyncCompareExchange32 (

View File

@ -38,7 +38,7 @@ GetPowerOfTwo32 (
IN UINT32 Operand IN UINT32 Operand
) )
{ {
if (Operand == 0) { if (0 == Operand) {
return 0; return 0;
} }

View File

@ -37,6 +37,7 @@
**/ **/
INT64 INT64
EFIAPI
InternalMathDivRemS64x64 ( InternalMathDivRemS64x64 (
IN INT64 Dividend, IN INT64 Dividend,
IN INT64 Divisor, IN INT64 Divisor,

View File

@ -41,6 +41,7 @@
**/ **/
BOOLEAN BOOLEAN
EFIAPI
IsNodeInList ( IsNodeInList (
IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *List,
IN CONST LIST_ENTRY *Node IN CONST LIST_ENTRY *Node
@ -384,6 +385,8 @@ IsNodeAtEnd (
@param FirstEntry A pointer to a node in a linked list. @param FirstEntry A pointer to a node in a linked list.
@param SecondEntry A pointer to another node in the same linked list. @param SecondEntry A pointer to another node in the same linked list.
@return SecondEntry
**/ **/
LIST_ENTRY * LIST_ENTRY *

View File

@ -44,6 +44,6 @@ LowBitSet32 (
return -1; return -1;
} }
for (BitIndex = 0; (Operand & 1) == 0; BitIndex++, Operand >>= 1); for (BitIndex = 0; 0 == (Operand & 1); BitIndex++, Operand >>= 1);
return BitIndex; return BitIndex;
} }

View File

@ -361,6 +361,7 @@ InternalMathDivRemU64x64 (
**/ **/
INT64 INT64
EFIAPI
InternalMathDivRemS64x64 ( InternalMathDivRemS64x64 (
IN INT64 Dividend, IN INT64 Dividend,
IN INT64 Divisor, IN INT64 Divisor,

View File

@ -193,7 +193,7 @@ StrLen (
@param String Pointer to a Null-terminated Unicode string. @param String Pointer to a Null-terminated Unicode string.
@return The size of String. @return The size in bytes of String.
**/ **/
UINTN UINTN
@ -291,7 +291,7 @@ StrnCmp (
IN UINTN Length IN UINTN Length
) )
{ {
if (Length == 0) { if (0 == Length) {
return 0; return 0;
} }
@ -469,7 +469,7 @@ StrStr (
SearchStringTmp++; SearchStringTmp++;
} }
if (*SearchStringTmp == '\0') { if ('\0' == *SearchStringTmp) {
return (CHAR16 *) FirstMatch; return (CHAR16 *) FirstMatch;
} }
@ -641,14 +641,14 @@ StrDecimalToUintn (
// //
// Ignore the pad spaces (space or tab) // Ignore the pad spaces (space or tab)
// //
while ((*String == L' ') || (*String == L'\t')) { while ((L' ' ==*String) || (L'\t' == *String)) {
String++; String++;
} }
// //
// Ignore leading Zeros after the spaces // Ignore leading Zeros after the spaces
// //
while (*String == L'0') { while (L'0' == *String) {
String++; String++;
} }
@ -660,7 +660,7 @@ StrDecimalToUintn (
// to the range defined by UINTN, then ASSERT(). // to the range defined by UINTN, then ASSERT().
// //
ASSERT ((Result < QUIENT_MAX_UINTN_DIVIDED_BY_10) || ASSERT ((Result < QUIENT_MAX_UINTN_DIVIDED_BY_10) ||
((Result == QUIENT_MAX_UINTN_DIVIDED_BY_10) && ((QUIENT_MAX_UINTN_DIVIDED_BY_10 == Result) &&
(*String - L'0') <= REMINDER_MAX_UINTN_DIVIDED_BY_10) (*String - L'0') <= REMINDER_MAX_UINTN_DIVIDED_BY_10)
); );
@ -723,14 +723,14 @@ StrDecimalToUint64 (
// //
// Ignore the pad spaces (space or tab) // Ignore the pad spaces (space or tab)
// //
while ((*String == L' ') || (*String == L'\t')) { while ((L' ' == *String) || (L'\t' == *String)) {
String++; String++;
} }
// //
// Ignore leading Zeros after the spaces // Ignore leading Zeros after the spaces
// //
while (*String == L'0') { while (L'0' == *String) {
String++; String++;
} }
@ -742,7 +742,7 @@ StrDecimalToUint64 (
// to the range defined by UINTN, then ASSERT(). // to the range defined by UINTN, then ASSERT().
// //
ASSERT ((Result < QUIENT_MAX_UINT64_DIVIDED_BY_10) || ASSERT ((Result < QUIENT_MAX_UINT64_DIVIDED_BY_10) ||
((Result == QUIENT_MAX_UINT64_DIVIDED_BY_10) && ((QUIENT_MAX_UINT64_DIVIDED_BY_10 == Result) &&
(*String - L'0') <= REMINDER_MAX_UINT64_DIVIDED_BY_10) (*String - L'0') <= REMINDER_MAX_UINT64_DIVIDED_BY_10)
); );
@ -805,19 +805,19 @@ StrHexToUintn (
// //
// Ignore the pad spaces (space or tab) // Ignore the pad spaces (space or tab)
// //
while ((*String == L' ') || (*String == L'\t')) { while ((L' ' == *String) || (L'\t' == *String)) {
String++; String++;
} }
// //
// Ignore leading Zeros after the spaces // Ignore leading Zeros after the spaces
// //
while (*String == L'0') { while (L'0' == *String) {
String++; String++;
} }
if (InternalCharToUpper (*String) == L'X') { if (InternalCharToUpper (*String) == L'X') {
ASSERT (*(String - 1) == L'0'); ASSERT (L'0' == *(String - 1));
if (*(String - 1) != L'0') { if (*(String - 1) != L'0') {
return 0; return 0;
} }
@ -835,7 +835,7 @@ StrHexToUintn (
// to the range defined by UINTN, then ASSERT(). // to the range defined by UINTN, then ASSERT().
// //
ASSERT ((Result < QUIENT_MAX_UINTN_DIVIDED_BY_16) || ASSERT ((Result < QUIENT_MAX_UINTN_DIVIDED_BY_16) ||
((Result == QUIENT_MAX_UINTN_DIVIDED_BY_16) && ((QUIENT_MAX_UINTN_DIVIDED_BY_16 == Result) &&
(InternalHexCharToUintn (*String) <= REMINDER_MAX_UINTN_DIVIDED_BY_16)) (InternalHexCharToUintn (*String) <= REMINDER_MAX_UINTN_DIVIDED_BY_16))
); );
@ -899,19 +899,19 @@ StrHexToUint64 (
// //
// Ignore the pad spaces (space or tab) // Ignore the pad spaces (space or tab)
// //
while ((*String == L' ') || (*String == L'\t')) { while ((L' ' == *String) || (L'\t' == *String)) {
String++; String++;
} }
// //
// Ignore leading Zeros after the spaces // Ignore leading Zeros after the spaces
// //
while (*String == L'0') { while (L'0' == *String) {
String++; String++;
} }
if (InternalCharToUpper (*String) == L'X') { if (InternalCharToUpper (*String) == L'X') {
ASSERT (*(String - 1) == L'0'); ASSERT (L'0' == *(String - 1));
if (*(String - 1) != L'0') { if (*(String - 1) != L'0') {
return 0; return 0;
} }
@ -929,7 +929,7 @@ StrHexToUint64 (
// to the range defined by UINTN, then ASSERT(). // to the range defined by UINTN, then ASSERT().
// //
ASSERT ((Result < QUIENT_MAX_UINT64_DIVIDED_BY_16)|| ASSERT ((Result < QUIENT_MAX_UINT64_DIVIDED_BY_16)||
((Result == QUIENT_MAX_UINT64_DIVIDED_BY_16) && ((QUIENT_MAX_UINT64_DIVIDED_BY_16 == Result) &&
(InternalHexCharToUintn (*String) <= REMINDER_MAX_UINT64_DIVIDED_BY_16)) (InternalHexCharToUintn (*String) <= REMINDER_MAX_UINT64_DIVIDED_BY_16))
); );
@ -1153,7 +1153,7 @@ AsciiStrnCpy (
{ {
CHAR8 *ReturnValue; CHAR8 *ReturnValue;
if (Length == 0) { if (0 == Length) {
return Destination; return Destination;
} }
@ -1432,7 +1432,7 @@ AsciiStrnCmp (
IN UINTN Length IN UINTN Length
) )
{ {
if (Length == 0) { if (0 == Length) {
return 0; return 0;
} }
@ -1662,14 +1662,14 @@ AsciiStrDecimalToUintn (
// //
// Ignore the pad spaces (space or tab) // Ignore the pad spaces (space or tab)
// //
while ((*String == ' ') || (*String == '\t')) { while ((' ' == *String) || ('\t' == *String)) {
String++; String++;
} }
// //
// Ignore leading Zeros after the spaces // Ignore leading Zeros after the spaces
// //
while (*String == '0') { while ('0' == *String) {
String++; String++;
} }
@ -1681,7 +1681,7 @@ AsciiStrDecimalToUintn (
// to the range defined by UINTN, then ASSERT(). // to the range defined by UINTN, then ASSERT().
// //
ASSERT ((Result < QUIENT_MAX_UINTN_DIVIDED_BY_10) || ASSERT ((Result < QUIENT_MAX_UINTN_DIVIDED_BY_10) ||
((Result == QUIENT_MAX_UINTN_DIVIDED_BY_10) && ((QUIENT_MAX_UINTN_DIVIDED_BY_10 == Result) &&
(*String - '0') <= REMINDER_MAX_UINTN_DIVIDED_BY_10) (*String - '0') <= REMINDER_MAX_UINTN_DIVIDED_BY_10)
); );
@ -1739,14 +1739,14 @@ AsciiStrDecimalToUint64 (
// //
// Ignore the pad spaces (space or tab) // Ignore the pad spaces (space or tab)
// //
while ((*String == ' ') || (*String == '\t')) { while ((' ' == *String) || ('\t' == *String)) {
String++; String++;
} }
// //
// Ignore leading Zeros after the spaces // Ignore leading Zeros after the spaces
// //
while (*String == '0') { while ('0' == *String) {
String++; String++;
} }
@ -1758,7 +1758,7 @@ AsciiStrDecimalToUint64 (
// to the range defined by UINTN, then ASSERT(). // to the range defined by UINTN, then ASSERT().
// //
ASSERT ((Result < QUIENT_MAX_UINT64_DIVIDED_BY_10) || ASSERT ((Result < QUIENT_MAX_UINT64_DIVIDED_BY_10) ||
((Result == QUIENT_MAX_UINT64_DIVIDED_BY_10) && ((QUIENT_MAX_UINT64_DIVIDED_BY_10 == Result) &&
(*String - '0') <= REMINDER_MAX_UINT64_DIVIDED_BY_10) (*String - '0') <= REMINDER_MAX_UINT64_DIVIDED_BY_10)
); );
@ -1819,19 +1819,19 @@ AsciiStrHexToUintn (
// //
// Ignore the pad spaces (space or tab) // Ignore the pad spaces (space or tab)
// //
while ((*String == ' ') || (*String == '\t')) { while ((' ' == *String) || ('\t' == *String)) {
String++; String++;
} }
// //
// Ignore leading Zeros after the spaces // Ignore leading Zeros after the spaces
// //
while (*String == '0') { while ('0' == *String) {
String++; String++;
} }
if (AsciiToUpper (*String) == 'X') { if (AsciiToUpper (*String) == 'X') {
ASSERT (*(String - 1) == '0'); ASSERT ('0' == *(String - 1));
if (*(String - 1) != '0') { if (*(String - 1) != '0') {
return 0; return 0;
} }
@ -1849,7 +1849,7 @@ AsciiStrHexToUintn (
// to the range defined by UINTN, then ASSERT(). // to the range defined by UINTN, then ASSERT().
// //
ASSERT ((Result < QUIENT_MAX_UINTN_DIVIDED_BY_16) || ASSERT ((Result < QUIENT_MAX_UINTN_DIVIDED_BY_16) ||
((Result == QUIENT_MAX_UINTN_DIVIDED_BY_16) && ((QUIENT_MAX_UINTN_DIVIDED_BY_16 == Result) &&
(InternalAsciiHexCharToUintn (*String) <= REMINDER_MAX_UINTN_DIVIDED_BY_16)) (InternalAsciiHexCharToUintn (*String) <= REMINDER_MAX_UINTN_DIVIDED_BY_16))
); );
@ -1914,19 +1914,19 @@ AsciiStrHexToUint64 (
// //
// Ignore the pad spaces (space or tab) // Ignore the pad spaces (space or tab)
// //
while ((*String == ' ') || (*String == '\t')) { while ((' ' == *String) || ('\t' == *String)) {
String++; String++;
} }
// //
// Ignore leading Zeros after the spaces // Ignore leading Zeros after the spaces
// //
while (*String == '0') { while ('0' == *String) {
String++; String++;
} }
if (AsciiToUpper (*String) == 'X') { if (AsciiToUpper (*String) == 'X') {
ASSERT (*(String - 1) == '0'); ASSERT ('0' == *(String - 1));
if (*(String - 1) != '0') { if (*(String - 1) != '0') {
return 0; return 0;
} }
@ -1944,7 +1944,7 @@ AsciiStrHexToUint64 (
// to the range defined by UINTN, then ASSERT(). // to the range defined by UINTN, then ASSERT().
// //
ASSERT ((Result < QUIENT_MAX_UINT64_DIVIDED_BY_16) || ASSERT ((Result < QUIENT_MAX_UINT64_DIVIDED_BY_16) ||
((Result == QUIENT_MAX_UINT64_DIVIDED_BY_16) && ((QUIENT_MAX_UINT64_DIVIDED_BY_16 == Result) &&
(InternalAsciiHexCharToUintn (*String) <= REMINDER_MAX_UINT64_DIVIDED_BY_16)) (InternalAsciiHexCharToUintn (*String) <= REMINDER_MAX_UINT64_DIVIDED_BY_16))
); );

View File

@ -44,7 +44,6 @@ GetSpinLockProperties (
VOID VOID
) )
{ {
// @bug May use a PCD entry to determine this alignment.
return 32; return 32;
} }
@ -61,7 +60,7 @@ GetSpinLockProperties (
@param SpinLock A pointer to the spin lock to initialize to the released @param SpinLock A pointer to the spin lock to initialize to the released
state. state.
@return SpinLock @return SpinLock initialized in release state.
**/ **/
SPIN_LOCK * SPIN_LOCK *
@ -92,7 +91,7 @@ InitializeSpinLock (
@param SpinLock A pointer to the spin lock to place in the acquired state. @param SpinLock A pointer to the spin lock to place in the acquired state.
@return SpinLock @return SpinLock aquired lock.
**/ **/
SPIN_LOCK * SPIN_LOCK *
@ -190,7 +189,7 @@ AcquireSpinLockOrFail (
ASSERT (SpinLock != NULL); ASSERT (SpinLock != NULL);
LockValue = *SpinLock; LockValue = *SpinLock;
ASSERT (LockValue == SPIN_LOCK_ACQUIRED || LockValue == SPIN_LOCK_RELEASED); ASSERT (SPIN_LOCK_ACQUIRED == LockValue || SPIN_LOCK_RELEASED == LockValue);
return (BOOLEAN)( return (BOOLEAN)(
InterlockedCompareExchangePointer ( InterlockedCompareExchangePointer (
@ -226,7 +225,7 @@ ReleaseSpinLock (
ASSERT (SpinLock != NULL); ASSERT (SpinLock != NULL);
LockValue = *SpinLock; LockValue = *SpinLock;
ASSERT (LockValue == SPIN_LOCK_ACQUIRED || LockValue == SPIN_LOCK_RELEASED); ASSERT (SPIN_LOCK_ACQUIRED == LockValue || SPIN_LOCK_RELEASED == LockValue);
*SpinLock = SPIN_LOCK_RELEASED; *SpinLock = SPIN_LOCK_RELEASED;
return SpinLock; return SpinLock;
@ -358,6 +357,8 @@ InterlockedCompareExchange64 (
operation. operation.
@param CompareValue Pointer value used in compare operation. @param CompareValue Pointer value used in compare operation.
@param ExchangeValue Pointer value used in exchange operation. @param ExchangeValue Pointer value used in exchange operation.
@return The original *Value before exchange.
**/ **/
VOID * VOID *

View File

@ -49,7 +49,6 @@ GetSpinLockProperties (
VOID VOID
) )
{ {
// @bug May use a PCD entry to determine this alignment.
return 32; return 32;
} }
@ -66,7 +65,7 @@ GetSpinLockProperties (
@param SpinLock A pointer to the spin lock to initialize to the released @param SpinLock A pointer to the spin lock to initialize to the released
state. state.
@return SpinLock @return SpinLock in release state.
**/ **/
SPIN_LOCK * SPIN_LOCK *
@ -101,7 +100,7 @@ InitializeSpinLock (
@param SpinLock A pointer to the spin lock to place in the acquired state. @param SpinLock A pointer to the spin lock to place in the acquired state.
@return SpinLock @return SpinLock accquired lock.
**/ **/
SPIN_LOCK * SPIN_LOCK *
@ -224,7 +223,7 @@ AcquireSpinLockOrFail (
@param SpinLock A pointer to the spin lock to release. @param SpinLock A pointer to the spin lock to release.
@return SpinLock @return SpinLock released lock.
**/ **/
SPIN_LOCK * SPIN_LOCK *
@ -374,6 +373,7 @@ InterlockedCompareExchange64 (
@param CompareValue Pointer value used in compare operation. @param CompareValue Pointer value used in compare operation.
@param ExchangeValue Pointer value used in exchange operation. @param ExchangeValue Pointer value used in exchange operation.
@return The original *Value before exchange.
**/ **/
VOID * VOID *
EFIAPI EFIAPI

View File

@ -51,7 +51,6 @@ GetSpinLockProperties (
VOID VOID
) )
{ {
// @bug May use a PCD entry to determine this alignment.
return 32; return 32;
} }
@ -68,7 +67,7 @@ GetSpinLockProperties (
@param SpinLock A pointer to the spin lock to initialize to the released @param SpinLock A pointer to the spin lock to initialize to the released
state. state.
@return SpinLock @return SpinLock in released state.
**/ **/
SPIN_LOCK * SPIN_LOCK *
@ -103,7 +102,7 @@ InitializeSpinLock (
@param SpinLock A pointer to the spin lock to place in the acquired state. @param SpinLock A pointer to the spin lock to place in the acquired state.
@return SpinLock @return SpinLock aquiring lock.
**/ **/
SPIN_LOCK * SPIN_LOCK *
@ -226,7 +225,7 @@ AcquireSpinLockOrFail (
@param SpinLock A pointer to the spin lock to release. @param SpinLock A pointer to the spin lock to release.
@return SpinLock @return SpinLock releasing lock.
**/ **/
SPIN_LOCK * SPIN_LOCK *
@ -375,6 +374,8 @@ InterlockedCompareExchange64 (
operation. operation.
@param CompareValue Pointer value used in compare operation. @param CompareValue Pointer value used in compare operation.
@param ExchangeValue Pointer value used in exchange operation. @param ExchangeValue Pointer value used in exchange operation.
@return The original *Value before exchange.
**/ **/
VOID * VOID *

View File

@ -28,7 +28,7 @@
@param Buffer Pointer to a 16-bit value that may be unaligned. @param Buffer Pointer to a 16-bit value that may be unaligned.
@return *Uint16 @return Data read from Buffer.
**/ **/
UINT16 UINT16
@ -54,7 +54,7 @@ ReadUnaligned16 (
@param Buffer Pointer to a 16-bit value that may be unaligned. @param Buffer Pointer to a 16-bit value that may be unaligned.
@param Value 16-bit value to write to Buffer. @param Value 16-bit value to write to Buffer.
@return Value @return Value written to Buffer
**/ **/
UINT16 UINT16
@ -79,7 +79,7 @@ WriteUnaligned16 (
@param Buffer Pointer to a 24-bit value that may be unaligned. @param Buffer Pointer to a 24-bit value that may be unaligned.
@return The value read. @return The value read from Buffer.
**/ **/
UINT32 UINT32
@ -105,7 +105,7 @@ ReadUnaligned24 (
@param Buffer Pointer to a 24-bit value that may be unaligned. @param Buffer Pointer to a 24-bit value that may be unaligned.
@param Value 24-bit value to write to Buffer. @param Value 24-bit value to write to Buffer.
@return The value written. @return The value written to Buffer.
**/ **/
UINT32 UINT32
@ -131,7 +131,7 @@ WriteUnaligned24 (
@param Buffer Pointer to a 32-bit value that may be unaligned. @param Buffer Pointer to a 32-bit value that may be unaligned.
@return *Uint32 @return Data read from Buffer.
**/ **/
UINT32 UINT32
@ -157,7 +157,7 @@ ReadUnaligned32 (
@param Buffer Pointer to a 32-bit value that may be unaligned. @param Buffer Pointer to a 32-bit value that may be unaligned.
@param Value 32-bit value to write to Buffer. @param Value 32-bit value to write to Buffer.
@return Value @return Value written to Buffer
**/ **/
UINT32 UINT32
@ -182,7 +182,7 @@ WriteUnaligned32 (
@param Buffer Pointer to a 64-bit value that may be unaligned. @param Buffer Pointer to a 64-bit value that may be unaligned.
@return *Uint64 @return Data read from Buffer.
**/ **/
UINT64 UINT64
@ -208,7 +208,7 @@ ReadUnaligned64 (
@param Buffer Pointer to a 64-bit value that may be unaligned. @param Buffer Pointer to a 64-bit value that may be unaligned.
@param Value 64-bit value to write to Buffer. @param Value 64-bit value to write to Buffer.
@return Value @return Value written to Buffer.
**/ **/
UINT64 UINT64

View File

@ -40,12 +40,12 @@ AsmFxRestore (
) )
{ {
ASSERT (Buffer != NULL); ASSERT (Buffer != NULL);
ASSERT (((UINTN)Buffer & 0xf) == 0); ASSERT (0 == ((UINTN)Buffer & 0xf));
// //
// Check the flag recorded by AsmFxSave() // Check the flag recorded by AsmFxSave()
// //
ASSERT (*(UINT32 *) (&Buffer[sizeof (IA32_FX_BUFFER) - 4]) == 0xAA5555AA); ASSERT (0xAA5555AA == *(UINT32 *) (&Buffer[sizeof (IA32_FX_BUFFER) - 4]));
InternalX86FxRestore (Buffer); InternalX86FxRestore (Buffer);
} }

View File

@ -39,7 +39,7 @@ AsmFxSave (
) )
{ {
ASSERT (Buffer != NULL); ASSERT (Buffer != NULL);
ASSERT (((UINTN)Buffer & 0xf) == 0); ASSERT (0 == ((UINTN)Buffer & 0xf));
InternalX86FxSave (Buffer); InternalX86FxSave (Buffer);

View File

@ -37,7 +37,7 @@ GetInterruptState (
IA32_EFLAGS32 EFlags; IA32_EFLAGS32 EFlags;
EFlags.UintN = AsmReadEflags (); EFlags.UintN = AsmReadEflags ();
return (BOOLEAN)(EFlags.Bits.IF == 1); return (BOOLEAN)(1 == EFlags.Bits.IF);
} }

View File

@ -58,7 +58,7 @@ CompareMem (
IN UINTN Length IN UINTN Length
) )
{ {
if (Length == 0) { if (0 == Length) {
return 0; return 0;
} }
ASSERT (DestinationBuffer != NULL); ASSERT (DestinationBuffer != NULL);

View File

@ -52,7 +52,7 @@ CopyMem (
IN UINTN Length IN UINTN Length
) )
{ {
if (Length == 0) { if (0 == Length) {
return DestinationBuffer; return DestinationBuffer;
} }
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer)); ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));

View File

@ -56,14 +56,14 @@ ScanMem16 (
IN UINT16 Value IN UINT16 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return NULL; return NULL;
} }
ASSERT (Buffer != NULL); ASSERT (Buffer != NULL);
ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0); ASSERT (0 == ((UINTN)Buffer & (sizeof (Value) - 1)));
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer)); ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
ASSERT ((Length & (sizeof (Value) - 1)) == 0); ASSERT (0 == (Length & (sizeof (Value) - 1)));
return (VOID*)InternalMemScanMem16 (Buffer, Length / sizeof (Value), Value); return (VOID*)InternalMemScanMem16 (Buffer, Length / sizeof (Value), Value);
} }

View File

@ -56,14 +56,14 @@ ScanMem32 (
IN UINT32 Value IN UINT32 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return NULL; return NULL;
} }
ASSERT (Buffer != NULL); ASSERT (Buffer != NULL);
ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0); ASSERT (0 == ((UINTN)Buffer & (sizeof (Value) - 1)));
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer)); ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
ASSERT ((Length & (sizeof (Value) - 1)) == 0); ASSERT (0 == (Length & (sizeof (Value) - 1)));
return (VOID*)InternalMemScanMem32 (Buffer, Length / sizeof (Value), Value); return (VOID*)InternalMemScanMem32 (Buffer, Length / sizeof (Value), Value);
} }

View File

@ -56,14 +56,14 @@ ScanMem64 (
IN UINT64 Value IN UINT64 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return NULL; return NULL;
} }
ASSERT (Buffer != NULL); ASSERT (Buffer != NULL);
ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0); ASSERT (0 == ((UINTN)Buffer & (sizeof (Value) - 1)));
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer)); ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
ASSERT ((Length & (sizeof (Value) - 1)) == 0); ASSERT (0 == (Length & (sizeof (Value) - 1)));
return (VOID*)InternalMemScanMem64 (Buffer, Length / sizeof (Value), Value); return (VOID*)InternalMemScanMem64 (Buffer, Length / sizeof (Value), Value);
} }

View File

@ -54,7 +54,7 @@ ScanMem8 (
IN UINT8 Value IN UINT8 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return NULL; return NULL;
} }
ASSERT (Buffer != NULL); ASSERT (Buffer != NULL);

View File

@ -55,14 +55,14 @@ SetMem16 (
IN UINT16 Value IN UINT16 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return Buffer; return Buffer;
} }
ASSERT (Buffer != NULL); ASSERT (Buffer != NULL);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer)); ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) == 0); ASSERT (0 == (((UINTN)Buffer) & (sizeof (Value) - 1)));
ASSERT ((Length & (sizeof (Value) - 1)) == 0); ASSERT (0 == (Length & (sizeof (Value) - 1)));
return InternalMemSetMem16 (Buffer, Length / sizeof (Value), Value); return InternalMemSetMem16 (Buffer, Length / sizeof (Value), Value);
} }

View File

@ -55,14 +55,14 @@ SetMem32 (
IN UINT32 Value IN UINT32 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return Buffer; return Buffer;
} }
ASSERT (Buffer != NULL); ASSERT (Buffer != NULL);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer)); ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) == 0); ASSERT (0 == (((UINTN)Buffer) & (sizeof (Value) - 1)));
ASSERT ((Length & (sizeof (Value) - 1)) == 0); ASSERT (0 == (Length & (sizeof (Value) - 1)));
return InternalMemSetMem32 (Buffer, Length / sizeof (Value), Value); return InternalMemSetMem32 (Buffer, Length / sizeof (Value), Value);
} }

View File

@ -55,14 +55,14 @@ SetMem64 (
IN UINT64 Value IN UINT64 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return Buffer; return Buffer;
} }
ASSERT (Buffer != NULL); ASSERT (Buffer != NULL);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer)); ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) == 0); ASSERT (0 == (((UINTN)Buffer) & (sizeof (Value) - 1)));
ASSERT ((Length & (sizeof (Value) - 1)) == 0); ASSERT (0 == (Length & (sizeof (Value) - 1)));
return InternalMemSetMem64 (Buffer, Length / sizeof (Value), Value); return InternalMemSetMem64 (Buffer, Length / sizeof (Value), Value);
} }

View File

@ -49,7 +49,7 @@ SetMem (
IN UINT8 Value IN UINT8 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return Buffer; return Buffer;
} }

View File

@ -55,7 +55,7 @@ CompareMem (
IN UINTN Length IN UINTN Length
) )
{ {
if (Length == 0) { if (0 == Length) {
return 0; return 0;
} }
ASSERT (DestinationBuffer != NULL); ASSERT (DestinationBuffer != NULL);

View File

@ -49,7 +49,7 @@ CopyMem (
IN UINTN Length IN UINTN Length
) )
{ {
if (Length == 0) { if (0 == Length) {
return DestinationBuffer; return DestinationBuffer;
} }
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer)); ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));

View File

@ -26,6 +26,7 @@
#ifndef __MEM_LIB_INTERNALS__ #ifndef __MEM_LIB_INTERNALS__
#define __MEM_LIB_INTERNALS__ #define __MEM_LIB_INTERNALS__
#include <Base.h>
#include <Library/BaseMemoryLib.h> #include <Library/BaseMemoryLib.h>
#include <Library/BaseLib.h> #include <Library/BaseLib.h>
#include <Library/DebugLib.h> #include <Library/DebugLib.h>
@ -52,7 +53,7 @@ InternalMemCopyMem (
Set Buffer to Value for Size bytes. Set Buffer to Value for Size bytes.
@param Buffer Memory to set. @param Buffer Memory to set.
@param Size Number of bytes to set @param Length Number of bytes to set
@param Value Value of the set operation. @param Value Value of the set operation.
@return Buffer @return Buffer
@ -124,7 +125,7 @@ InternalMemSetMem64 (
Set Buffer to 0 for Size bytes. Set Buffer to 0 for Size bytes.
@param Buffer Memory to set. @param Buffer Memory to set.
@param Size Number of bytes to set @param Length Number of bytes to set
@return Buffer @return Buffer

View File

@ -53,7 +53,7 @@ ScanMem16 (
IN UINT16 Value IN UINT16 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return NULL; return NULL;
} }

View File

@ -53,7 +53,7 @@ ScanMem32 (
IN UINT32 Value IN UINT32 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return NULL; return NULL;
} }

View File

@ -53,7 +53,7 @@ ScanMem64 (
IN UINT64 Value IN UINT64 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return NULL; return NULL;
} }

View File

@ -51,7 +51,7 @@ ScanMem8 (
IN UINT8 Value IN UINT8 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return NULL; return NULL;
} }
ASSERT (Buffer != NULL); ASSERT (Buffer != NULL);

View File

@ -52,7 +52,7 @@ SetMem16 (
IN UINT16 Value IN UINT16 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return Buffer; return Buffer;
} }

View File

@ -52,7 +52,7 @@ SetMem32 (
IN UINT32 Value IN UINT32 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return Buffer; return Buffer;
} }

View File

@ -52,7 +52,7 @@ SetMem64 (
IN UINT64 Value IN UINT64 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return Buffer; return Buffer;
} }

View File

@ -46,7 +46,7 @@ SetMem (
IN UINT8 Value IN UINT8 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return Buffer; return Buffer;
} }

View File

@ -45,7 +45,7 @@ ZeroMem (
IN UINTN Length IN UINTN Length
) )
{ {
ASSERT (!(Buffer == NULL && Length > 0)); ASSERT (!(NULL == Buffer && Length > 0));
ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1)); ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));
return InternalMemZeroMem (Buffer, Length); return InternalMemZeroMem (Buffer, Length);
} }

View File

@ -58,7 +58,7 @@ CompareMem (
IN UINTN Length IN UINTN Length
) )
{ {
if (Length == 0) { if (0 == Length) {
return 0; return 0;
} }
ASSERT (DestinationBuffer != NULL); ASSERT (DestinationBuffer != NULL);

View File

@ -52,7 +52,7 @@ CopyMem (
IN UINTN Length IN UINTN Length
) )
{ {
if (Length == 0) { if (0 == Length) {
return DestinationBuffer; return DestinationBuffer;
} }
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer)); ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));

View File

@ -56,7 +56,7 @@ ScanMem16 (
IN UINT16 Value IN UINT16 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return NULL; return NULL;
} }

View File

@ -56,7 +56,7 @@ ScanMem32 (
IN UINT32 Value IN UINT32 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return NULL; return NULL;
} }

View File

@ -56,7 +56,7 @@ ScanMem64 (
IN UINT64 Value IN UINT64 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return NULL; return NULL;
} }

View File

@ -54,7 +54,7 @@ ScanMem8 (
IN UINT8 Value IN UINT8 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return NULL; return NULL;
} }
ASSERT (Buffer != NULL); ASSERT (Buffer != NULL);

View File

@ -55,7 +55,7 @@ SetMem16 (
IN UINT16 Value IN UINT16 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return Buffer; return Buffer;
} }

View File

@ -55,7 +55,7 @@ SetMem32 (
IN UINT32 Value IN UINT32 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return Buffer; return Buffer;
} }

View File

@ -55,7 +55,7 @@ SetMem64 (
IN UINT64 Value IN UINT64 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return Buffer; return Buffer;
} }

View File

@ -49,7 +49,7 @@ SetMem (
IN UINT8 Value IN UINT8 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return Buffer; return Buffer;
} }

View File

@ -48,7 +48,7 @@ ZeroMem (
IN UINTN Length IN UINTN Length
) )
{ {
ASSERT (!(Buffer == NULL && Length > 0)); ASSERT (!(NULL == Buffer && Length > 0));
ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1)); ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));
return InternalMemZeroMem (Buffer, Length); return InternalMemZeroMem (Buffer, Length);
} }

View File

@ -58,7 +58,7 @@ CompareMem (
IN UINTN Length IN UINTN Length
) )
{ {
if (Length == 0) { if (0 == Length) {
return 0; return 0;
} }
ASSERT (DestinationBuffer != NULL); ASSERT (DestinationBuffer != NULL);

View File

@ -52,7 +52,7 @@ CopyMem (
IN UINTN Length IN UINTN Length
) )
{ {
if (Length == 0) { if (0 == Length) {
return DestinationBuffer; return DestinationBuffer;
} }
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer)); ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));

View File

@ -24,7 +24,7 @@
// //
// Include common header file for this module. // Include common header file for this module.
// //
#include <MemLibInternals.h> #include "MemLibInternals.h"
/** /**

View File

@ -51,7 +51,7 @@ InternalMemCopyMem (
Set Buffer to Value for Size bytes. Set Buffer to Value for Size bytes.
@param Buffer Memory to set. @param Buffer Memory to set.
@param Size Number of bytes to set @param Length Number of bytes to set
@param Value Value of the set operation. @param Value Value of the set operation.
@return Buffer @return Buffer
@ -123,7 +123,7 @@ InternalMemSetMem64 (
Set Buffer to 0 for Size bytes. Set Buffer to 0 for Size bytes.
@param Buffer Memory to set. @param Buffer Memory to set.
@param Size Number of bytes to set @param Length Number of bytes to set
@return Buffer @return Buffer

View File

@ -56,7 +56,7 @@ ScanMem16 (
IN UINT16 Value IN UINT16 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return NULL; return NULL;
} }

View File

@ -56,7 +56,7 @@ ScanMem32 (
IN UINT32 Value IN UINT32 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return NULL; return NULL;
} }

View File

@ -56,7 +56,7 @@ ScanMem64 (
IN UINT64 Value IN UINT64 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return NULL; return NULL;
} }

View File

@ -54,7 +54,7 @@ ScanMem8 (
IN UINT8 Value IN UINT8 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return NULL; return NULL;
} }
ASSERT (Buffer != NULL); ASSERT (Buffer != NULL);

View File

@ -55,7 +55,7 @@ SetMem16 (
IN UINT16 Value IN UINT16 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return Buffer; return Buffer;
} }

View File

@ -55,7 +55,7 @@ SetMem32 (
IN UINT32 Value IN UINT32 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return Buffer; return Buffer;
} }

View File

@ -55,7 +55,7 @@ SetMem64 (
IN UINT64 Value IN UINT64 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return Buffer; return Buffer;
} }

View File

@ -49,7 +49,7 @@ SetMem (
IN UINT8 Value IN UINT8 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return Buffer; return Buffer;
} }

View File

@ -48,7 +48,7 @@ ZeroMem (
IN UINTN Length IN UINTN Length
) )
{ {
ASSERT (!(Buffer == NULL && Length > 0)); ASSERT (!(NULL == Buffer && Length > 0));
ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1)); ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));
return InternalMemZeroMem (Buffer, Length); return InternalMemZeroMem (Buffer, Length);
} }

View File

@ -58,7 +58,7 @@ CompareMem (
IN UINTN Length IN UINTN Length
) )
{ {
if (Length == 0) { if (0 == Length) {
return 0; return 0;
} }
ASSERT (DestinationBuffer != NULL); ASSERT (DestinationBuffer != NULL);

View File

@ -52,7 +52,7 @@ CopyMem (
IN UINTN Length IN UINTN Length
) )
{ {
if (Length == 0) { if (0 == Length) {
return DestinationBuffer; return DestinationBuffer;
} }
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer)); ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));

View File

@ -51,7 +51,7 @@ InternalMemCopyMem (
Set Buffer to Value for Size bytes. Set Buffer to Value for Size bytes.
@param Buffer Memory to set. @param Buffer Memory to set.
@param Size Number of bytes to set @param Length Number of bytes to set
@param Value Value of the set operation. @param Value Value of the set operation.
@return Buffer @return Buffer
@ -123,7 +123,7 @@ InternalMemSetMem64 (
Set Buffer to 0 for Size bytes. Set Buffer to 0 for Size bytes.
@param Buffer Memory to set. @param Buffer Memory to set.
@param Size Number of bytes to set @param Length Number of bytes to set
@return Buffer @return Buffer

View File

@ -56,7 +56,7 @@ ScanMem16 (
IN UINT16 Value IN UINT16 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return NULL; return NULL;
} }

View File

@ -56,7 +56,7 @@ ScanMem32 (
IN UINT32 Value IN UINT32 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return NULL; return NULL;
} }

View File

@ -56,7 +56,7 @@ ScanMem64 (
IN UINT64 Value IN UINT64 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return NULL; return NULL;
} }

View File

@ -54,7 +54,7 @@ ScanMem8 (
IN UINT8 Value IN UINT8 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return NULL; return NULL;
} }
ASSERT (Buffer != NULL); ASSERT (Buffer != NULL);

View File

@ -55,7 +55,7 @@ SetMem16 (
IN UINT16 Value IN UINT16 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return Buffer; return Buffer;
} }

View File

@ -55,7 +55,7 @@ SetMem32 (
IN UINT32 Value IN UINT32 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return Buffer; return Buffer;
} }

View File

@ -55,7 +55,7 @@ SetMem64 (
IN UINT64 Value IN UINT64 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return Buffer; return Buffer;
} }

View File

@ -49,7 +49,7 @@ SetMem (
IN UINT8 Value IN UINT8 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return Buffer; return Buffer;
} }

View File

@ -48,7 +48,7 @@ ZeroMem (
IN UINTN Length IN UINTN Length
) )
{ {
ASSERT (!(Buffer == NULL && Length > 0)); ASSERT (!(NULL == Buffer && Length > 0));
ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1)); ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));
return InternalMemZeroMem (Buffer, Length); return InternalMemZeroMem (Buffer, Length);
} }

View File

@ -58,7 +58,7 @@ CompareMem (
IN UINTN Length IN UINTN Length
) )
{ {
if (Length == 0) { if (0 == Length) {
return 0; return 0;
} }
ASSERT (DestinationBuffer != NULL); ASSERT (DestinationBuffer != NULL);

View File

@ -52,7 +52,7 @@ CopyMem (
IN UINTN Length IN UINTN Length
) )
{ {
if (Length == 0) { if (0 == Length) {
return DestinationBuffer; return DestinationBuffer;
} }
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer)); ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));

View File

@ -80,22 +80,17 @@ CompareGuid (
IN CONST GUID *Guid2 IN CONST GUID *Guid2
) )
{ {
UINT64 Guid1ValueLo; UINT64 LowPartOfGuid1;
UINT64 Guid1ValueHi; UINT64 LowPartOfGuid2;
UINT64 Guid2ValueLo; UINT64 HighPartOfGuid1;
UINT64 Guid2ValueHi; UINT64 HighPartOfGuid2;
Guid1ValueLo = ReadUnaligned64 ((CONST UINT64*)Guid1); LowPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1);
Guid2ValueLo = ReadUnaligned64 ((CONST UINT64*)Guid2); LowPartOfGuid2 = ReadUnaligned64 ((CONST UINT64*) Guid2);
HighPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1 + 1);
HighPartOfGuid2 = ReadUnaligned64 ((CONST UINT64*) Guid2 + 1);
Guid1ValueHi = ReadUnaligned64 ((CONST UINT64*)Guid1 + 1); return (BOOLEAN) (LowPartOfGuid1 == LowPartOfGuid2 && HighPartOfGuid1 == HighPartOfGuid2);
Guid2ValueHi = ReadUnaligned64 ((CONST UINT64*)Guid2 + 1);
return (BOOLEAN)
((Guid1ValueLo == Guid2ValueLo) &&
(Guid1ValueHi == Guid2ValueHi)
);
} }
/** /**

View File

@ -51,7 +51,7 @@ InternalMemCopyMem (
Set Buffer to Value for Size bytes. Set Buffer to Value for Size bytes.
@param Buffer Memory to set. @param Buffer Memory to set.
@param Size Number of bytes to set @param Length Number of bytes to set
@param Value Value of the set operation. @param Value Value of the set operation.
@return Buffer @return Buffer
@ -123,7 +123,7 @@ InternalMemSetMem64 (
Set Buffer to 0 for Size bytes. Set Buffer to 0 for Size bytes.
@param Buffer Memory to set. @param Buffer Memory to set.
@param Size Number of bytes to set @param Length Number of bytes to set
@return Buffer @return Buffer

View File

@ -56,7 +56,7 @@ ScanMem16 (
IN UINT16 Value IN UINT16 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return NULL; return NULL;
} }

View File

@ -56,7 +56,7 @@ ScanMem32 (
IN UINT32 Value IN UINT32 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return NULL; return NULL;
} }

View File

@ -56,7 +56,7 @@ ScanMem64 (
IN UINT64 Value IN UINT64 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return NULL; return NULL;
} }

View File

@ -54,7 +54,7 @@ ScanMem8 (
IN UINT8 Value IN UINT8 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return NULL; return NULL;
} }
ASSERT (Buffer != NULL); ASSERT (Buffer != NULL);

View File

@ -55,7 +55,7 @@ SetMem16 (
IN UINT16 Value IN UINT16 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return Buffer; return Buffer;
} }

View File

@ -55,7 +55,7 @@ SetMem32 (
IN UINT32 Value IN UINT32 Value
) )
{ {
if (Length == 0) { if (0 == Length) {
return Buffer; return Buffer;
} }

Some files were not shown because too many files have changed in this diff Show More