\r
@param String Pointer to a Null-terminated Unicode string.\r
\r
- @retval UINTN\r
+ @retval Value translated from String.\r
\r
**/\r
UINTN\r
\r
@param String Pointer to a Null-terminated Unicode string.\r
\r
- @retval UINT64\r
+ @retval Value translated from String.\r
\r
**/\r
UINT64\r
\r
@param String Pointer to a Null-terminated Unicode string.\r
\r
- @retval UINTN\r
+ @retval Value translated from String.\r
\r
**/\r
UINTN\r
\r
@param String Pointer to a Null-terminated Unicode string.\r
\r
- @retval UINT64\r
+ @retval Value translated from String.\r
\r
**/\r
UINT64\r
\r
@param String Pointer to a Null-terminated ASCII string.\r
\r
- @retval UINTN\r
+ @retval Value translated from String.\r
\r
**/\r
UINTN\r
\r
@param String Pointer to a Null-terminated ASCII string.\r
\r
- @retval UINT64\r
+ @retval Value translated from String.\r
\r
**/\r
UINT64\r
\r
@param String Pointer to a Null-terminated ASCII string.\r
\r
- @retval UINTN\r
+ @retval Value translated from String.\r
\r
**/\r
UINTN\r
\r
@param String Pointer to a Null-terminated ASCII string.\r
\r
- @retval UINT64\r
+ @retval Value translated from String.\r
\r
**/\r
UINT64\r
\r
@param FirstEntry A pointer to a node in a linked list.\r
@param SecondEntry A pointer to another node in the same linked list.\r
+ \r
+ @return SecondEntry\r
\r
**/\r
LIST_ENTRY *\r
\r
@param Buffer Pointer to a 24-bit value that may be unaligned.\r
\r
- @return The value read.\r
+ @return The value read from Buffer.\r
\r
**/\r
UINT32\r
@param Buffer Pointer to a 24-bit value that may be unaligned.\r
@param Value 24-bit value to write to Buffer.\r
\r
- @return The value written.\r
+ @return The value written to Buffer.\r
\r
**/\r
UINT32\r
\r
@param Uint32 Pointer to a 32-bit value that may be unaligned.\r
\r
- @return *Uint32\r
+ @return Value read from Uint32\r
\r
**/\r
UINT32\r
@param Uint32 Pointer to a 32-bit value that may be unaligned.\r
@param Value 32-bit value to write to Buffer.\r
\r
- @return Value\r
+ @return Value written to Uint32.\r
\r
**/\r
UINT32\r
\r
@param Uint64 Pointer to a 64-bit value that may be unaligned.\r
\r
- @return *Uint64\r
+ @return Value read from Uint64.\r
\r
**/\r
UINT64\r
@param Uint64 Pointer to a 64-bit value that may be unaligned.\r
@param Value 64-bit value to write to Buffer.\r
\r
- @return Value\r
+ @return Value written to Uint64.\r
\r
**/\r
UINT64\r
@param SpinLock A pointer to the spin lock to initialize to the released\r
state.\r
\r
- @return SpinLock\r
+ @return SpinLock in release state.\r
\r
**/\r
SPIN_LOCK *\r
\r
@param SpinLock A pointer to the spin lock to place in the acquired state.\r
\r
- @return SpinLock\r
+ @return SpinLock accquired lock.\r
\r
**/\r
SPIN_LOCK *\r
\r
@param SpinLock A pointer to the spin lock to release.\r
\r
- @return SpinLock\r
+ @return SpinLock released lock.\r
\r
**/\r
SPIN_LOCK *\r
@param CompareValue Pointer value used in compare operation.\r
@param ExchangeValue Pointer value used in exchange operation.\r
\r
+ @return The original *Value before exchange.\r
**/\r
VOID *\r
EFIAPI\r
/**\r
Enables CPU interrupts.\r
\r
- Enables CPU interrupts.\r
-\r
**/\r
VOID\r
EFIAPI\r
/**\r
Disables CPU interrupts.\r
\r
- Disables CPU interrupts.\r
-\r
**/\r
VOID\r
EFIAPI\r
Disables CPU interrupts and returns the interrupt state prior to the disable\r
operation.\r
\r
- Disables CPU interrupts and returns the interrupt state prior to the disable\r
- operation.\r
-\r
@retval TRUE CPU interrupts were enabled on entry to this call.\r
@retval FALSE CPU interrupts were disabled on entry to this call.\r
\r
Enables CPU interrupts for the smallest window required to capture any\r
pending interrupts.\r
\r
- Enables CPU interrupts for the smallest window required to capture any\r
- pending interrupts.\r
-\r
**/\r
VOID\r
EFIAPI\r
/**\r
Retrieves the current CPU interrupt state.\r
\r
- Retrieves the current CPU interrupt state. Returns TRUE is interrupts are\r
- currently enabled. Otherwise returns FALSE.\r
+ Returns TRUE is interrupts are currently enabled. Otherwise\r
+ returns FALSE.\r
\r
@retval TRUE CPU interrupts are enabled.\r
@retval FALSE CPU interrupts are disabled.\r
[Packages]\r
MdePkg/MdePkg.dec\r
\r
-[LibraryClasses]\r
- DebugLib\r
-\r
[LibraryClasses.Ipf]\r
PalCallLib\r
\r
[LibraryClasses.common]\r
BaseLib\r
+ DebugLib\r
\r
\r
@param Length The number of bytes to invalidate from the instruction cache.\r
\r
- @return Address\r
+ @return Address of cache invalidation.\r
\r
**/\r
VOID *\r
@param Length The number of bytes to write back and invalidate from the\r
data cache.\r
\r
- @return Address\r
+ @return Address of cache invalidation.\r
\r
**/\r
VOID *\r
mode, then Address is a virtual address.\r
@param Length The number of bytes to write back from the data cache.\r
\r
- @return Address\r
+ @return Address of cache wrote in main memory.\r
\r
**/\r
VOID *\r
then Address is a virtual address.\r
@param Length The number of bytes to invalidate from the data cache.\r
\r
- @return Address\r
+ @return Address of cache invalidation.\r
\r
**/\r
VOID *\r
\r
@param Length The number of bytes to invalidate from the instruction cache.\r
\r
- @return Address\r
+ @return Address of cahce invalidation.\r
\r
**/\r
VOID *\r
@param Length The number of bytes to write back and invalidate from the\r
data cache.\r
\r
- @return Address\r
+ @return Address of cache invalidation.\r
\r
**/\r
VOID *\r
mode, then Address is a virtual address.\r
@param Length The number of bytes to write back from the data cache.\r
\r
- @return Address\r
+ @return Address of cache wrote in main memory.\r
\r
**/\r
VOID *\r
then Address is a virtual address.\r
@param Length The number of bytes to invalidate from the data cache.\r
\r
- @return Address\r
+ @return Address of cache invalidation.\r
\r
**/\r
VOID *\r
\r
@param Length The number of bytes to invalidate from the instruction cache.\r
\r
- @return Address\r
+ @return Address of cache invalidation.\r
\r
**/\r
VOID *\r
@param Length The number of bytes to write back and invalidate from the\r
data cache.\r
\r
- @return Address\r
+ @return Address of cache invalidation.\r
\r
**/\r
VOID *\r
}\r
\r
Start = (UINTN)Address;\r
+ //\r
+ // Calculate the cache line alignment\r
+ // \r
End = (Start + Length + (CACHE_LINE_SIZE - 1)) & ~(CACHE_LINE_SIZE - 1);\r
Start &= ~(CACHE_LINE_SIZE - 1);\r
\r
mode, then Address is a virtual address.\r
@param Length The number of bytes to write back from the data cache.\r
\r
- @return Address\r
+ @return Address of cache wrote in main memory.\r
\r
**/\r
VOID *\r
then Address is a virtual address.\r
@param Length The number of bytes to invalidate from the data cache.\r
\r
- @return Address\r
+ @return Address of cache invalidation.\r
\r
**/\r
VOID *\r
@param Buffer Pointer to the target buffer to fill with PcdDebugClearMemoryValue.\r
@param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. \r
\r
- @return Buffer\r
+ @return Buffer filled with PcdDebugClearMemoryValue.\r
\r
**/\r
VOID *\r
\r
@retval TRUE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.\r
@retval FALSE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.\r
+ \r
+ @return Always return FALSE.\r
\r
**/\r
BOOLEAN\r
\r
@retval TRUE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.\r
@retval FALSE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.\r
+ \r
+ @return Always return FALSE.\r
\r
**/\r
BOOLEAN\r
\r
@retval TRUE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.\r
@retval FALSE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.\r
+ \r
+ @return Always return FALSE.\r
\r
**/\r
BOOLEAN\r
\r
@retval TRUE The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.\r
@retval FALSE The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.\r
+ \r
+ @return Always return FALSE.\r
\r
**/\r
BOOLEAN\r
/**@file\r
Common header file shared by all source files.\r
\r
- This file includes package header files, library classes and protocol, PPI & GUID definitions.\r
+ This file includes package header files, dependent library classes.\r
\r
Copyright (c) 2007, Intel Corporation.\r
All rights reserved. This program and the accompanying materials\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
**/\r
\r
-#ifndef __COMMON_HEADER_H_\r
-#define __COMMON_HEADER_H_\r
+#ifndef __BASEIOLIB_INTRINSIC_INTERNAL_H_\r
+#define __BASEIOLIB_INTRINSIC_INTERNAL_H_\r
\r
\r
\r
@param EndBit The ordinal of the most significant bit in the bit field.\r
Range 0..7.\r
\r
- @return The value read.\r
+ @return The value read from I/O port specified by StartBit and\r
+ EndBit.\r
\r
**/\r
UINT8\r
@param EndBit The ordinal of the most significant bit in the bit field.\r
Range 0..15.\r
\r
- @return The value read.\r
+ @return The value read from I/O port specified by StartBit and\r
+ EndBit.\r
\r
**/\r
UINT16\r
@param EndBit The ordinal of the most significant bit in the bit field.\r
Range 0..31.\r
\r
- @return The value read.\r
+ @return The value read from I/O port specified by StartBit and\r
+ EndBit.\r
\r
**/\r
UINT32\r
@param EndBit The ordinal of the most significant bit in the bit field.\r
Range 0..63.\r
\r
- @return The value read.\r
+ @return The value read from I/O port specified by StartBit and\r
+ EndBit.\r
\r
**/\r
UINT64\r
@param EndBit The ordinal of the most significant bit in the bit field.\r
Range 0..7.\r
\r
- @return The value read.\r
+ @return The value read from I/O port specified by StartBit and\r
+ EndBit.\r
\r
**/\r
UINT8\r
@param EndBit The ordinal of the most significant bit in the bit field.\r
Range 0..15.\r
\r
- @return The value read.\r
+ @return The value read from I/O port specified by StartBit and\r
+ EndBit.\r
\r
**/\r
UINT16\r
@param EndBit The ordinal of the most significant bit in the bit field.\r
Range 0..31.\r
\r
- @return The value read.\r
+ @return The value read from I/O port specified by StartBit and\r
+ EndBit.\r
\r
**/\r
UINT32\r
@param EndBit The ordinal of the most significant bit in the bit field.\r
Range 0..63.\r
\r
- @return The value read.\r
+ @return The value read from I/O port specified by StartBit and\r
+ EndBit.\r
\r
**/\r
UINT64\r
\r
**/\r
\r
-//\r
-// Include common header file for this module.\r
-//\r
#include "BaseIoLibIntrinsicInternal.h"\r
\r
/**\r
\r
@param Port The I/O port to read.\r
\r
- @return The value read.\r
+ @return Always return zero.\r
\r
**/\r
UINT64\r
@param Port The I/O port to write.\r
@param Value The value to write to the I/O port.\r
\r
- @return The value written the I/O port.\r
+ @return Always return zero.\r
\r
**/\r
UINT64\r
\r
@param Address The MMIO register to read.\r
\r
- @return The value read.\r
+ @return The value read from Address.\r
\r
**/\r
UINT8\r
@param Address The MMIO register to write.\r
@param Value The value to write to the MMIO register.\r
\r
+ @return The value written to the Mmio. It equals to the input\r
+ Value instead of the actual value read back from the\r
+ Mmio.\r
**/\r
UINT8\r
EFIAPI\r
\r
@param Address The MMIO register to read.\r
\r
- @return The value read.\r
+ @return The value read from Address.\r
\r
**/\r
UINT16\r
@param Address The MMIO register to write.\r
@param Value The value to write to the MMIO register.\r
\r
+ @return The value written to the Mmio. It equals to the input\r
+ Value instead of the actual value read back from the\r
+ Mmio.\r
**/\r
UINT16\r
EFIAPI\r
\r
@param Address The MMIO register to read.\r
\r
- @return The value read.\r
+ @return The value read from Address.\r
\r
**/\r
UINT32\r
@param Address The MMIO register to write.\r
@param Value The value to write to the MMIO register.\r
\r
+ @return The value written to the Mmio. It equals to the input\r
+ Value instead of the actual value read back from the\r
+ Mmio.\r
**/\r
UINT32\r
EFIAPI\r
\r
@param Address The MMIO register to read.\r
\r
- @return The value read.\r
+ @return The value read from Address.\r
\r
**/\r
UINT64\r
@param Address The MMIO register to write.\r
@param Value The value to write to the MMIO register.\r
\r
+ @return The value written to the Mmio. It equals to the input\r
+ Value instead of the actual value read back from the\r
+ Mmio.\r
**/\r
UINT64\r
EFIAPI\r
\r
@param Port The I/O port to read.\r
\r
- @return The value read.\r
+ @return The value read from Port.\r
\r
**/\r
__inline__\r
@param Port The I/O port to write.\r
@param Value The value to write to the I/O port.\r
\r
- @return The value written the I/O port.\r
+ @return The value written to the I/O port. It equals to the\r
+ input Value instead of the actual value read back from\r
+ the I/O port.\r
\r
**/\r
__inline__\r
\r
@param Port The I/O port to read.\r
\r
- @return The value read.\r
+ @return The value read from Port.\r
\r
**/\r
__inline__\r
@param Port The I/O port to write.\r
@param Value The value to write to the I/O port.\r
\r
- @return The value written the I/O port.\r
+ @return The value written to the I/O port. It equals to the\r
+ input Value instead of the actual value read back from\r
+ the I/O port.\r
\r
**/\r
__inline__\r
\r
@param Port The I/O port to read.\r
\r
- @return The value read.\r
+ @return The value read from Port.\r
\r
**/\r
__inline__\r
@param Port The I/O port to write.\r
@param Value The value to write to the I/O port.\r
\r
- @return The value written the I/O port.\r
+ @return The value written to the I/O port. It equals to the\r
+ input Value instead of the actual value read back from\r
+ the I/O port.\r
\r
**/\r
__inline__\r
\r
**/\r
\r
-//\r
-// Include common header file for this module.\r
-//\r
#include "BaseIoLibIntrinsicInternal.h"\r
\r
/**\r
\r
@param Address The MMIO register to read.\r
\r
- @return The value read.\r
+ @return The value read from Address.\r
\r
**/\r
UINT8\r
\r
@param Address The MMIO register to write.\r
@param Value The value to write to the MMIO register.\r
+ \r
+ @return The value written to the Mmio. It equals to the input\r
+ Value instead of the actual value read back from the\r
+ Mmio.\r
\r
**/\r
UINT8\r
\r
@param Address The MMIO register to read.\r
\r
- @return The value read.\r
+ @return The value read from Address.\r
\r
**/\r
UINT16\r
\r
@param Address The MMIO register to write.\r
@param Value The value to write to the MMIO register.\r
+ \r
+ @return The value written to the Mmio. It equals to the input\r
+ Value instead of the actual value read back from the\r
+ Mmio.\r
\r
**/\r
UINT16\r
\r
@param Address The MMIO register to read.\r
\r
- @return The value read.\r
+ @return The value read from Address.\r
\r
**/\r
UINT32\r
\r
@param Address The MMIO register to write.\r
@param Value The value to write to the MMIO register.\r
+ \r
+ @return The value written to the Mmio. It equals to the input\r
+ Value instead of the actual value read back from the\r
+ Mmio.\r
\r
**/\r
UINT32\r
\r
@param Address The MMIO register to read.\r
\r
- @return The value read.\r
+ @return The value read from Address.\r
\r
**/\r
UINT64\r
@param Address The MMIO register to write.\r
@param Value The value to write to the MMIO register.\r
\r
+ @return The value written to the Mmio. It equals to the input\r
+ Value instead of the actual value read back from the\r
+ Mmio.\r
**/\r
UINT64\r
EFIAPI\r
\r
@param Port The I/O port to read.\r
\r
- @return The value read.\r
+ @return The value read from Port.\r
\r
**/\r
UINT8\r
@param Port The I/O port to write.\r
@param Value The value to write to the I/O port.\r
\r
- @return The value written the I/O port.\r
+ @return The value written to the I/O port. It equals to the input\r
+ Value instead of the actual value read back from the\r
+ I/O port.\r
\r
**/\r
UINT8\r
\r
@param Port The I/O port to read.\r
\r
- @return The value read.\r
+ @return The value read from Port.\r
\r
**/\r
UINT16\r
@param Port The I/O port to write.\r
@param Value The value to write to the I/O port.\r
\r
- @return The value written the I/O port.\r
+ @return The value written to the I/O port. It equals to the input\r
+ Value instead of the actual value read back from the\r
+ I/O port.\r
\r
**/\r
UINT16\r
\r
@param Port The I/O port to read.\r
\r
- @return The value read.\r
+ @return The value read from Port.\r
\r
**/\r
UINT32\r
@param Port The I/O port to write.\r
@param Value The value to write to the I/O port.\r
\r
- @return The value written the I/O port.\r
+ @return The value written to the I/O port. It equals to the input\r
+ Value instead of the actual value read back from the\r
+ I/O port.\r
\r
**/\r
UINT32\r
\r
@param Port The I/O port to read.\r
\r
- @return The value read.\r
+ @return The value read from Port.\r
\r
**/\r
UINT8\r
\r
@param Port The I/O port to read.\r
\r
- @return The value read.\r
+ @return The value read from Port.\r
\r
**/\r
UINT16\r
\r
@param Port The I/O port to read.\r
\r
- @return The value read.\r
+ @return The value read from Port.\r
\r
**/\r
UINT32\r
\r
@param Port The I/O port to read.\r
\r
- @return The value read.\r
+ @return The value read from Port.\r
\r
**/\r
UINT64\r
@param Port The I/O port to write.\r
@param Value The value to write to the I/O port.\r
\r
- @return The value written the I/O port.\r
+ @return The value written to the I/O port. It equals to the\r
+ input Value instead of the actual value read back from\r
+ the I/O port.\r
\r
**/\r
UINT8\r
@param Port The I/O port to write.\r
@param Value The value to write to the I/O port.\r
\r
- @return The value written the I/O port.\r
+ @return The value written to the I/O port. It equals to the\r
+ input Value instead of the actual value read back from\r
+ the I/O port.\r
\r
**/\r
UINT16\r
@param Port The I/O port to write.\r
@param Value The value to write to the I/O port.\r
\r
- @return The value written the I/O port.\r
+ @return The value written to the I/O port. It equals to the\r
+ input Value instead of the actual value read back from\r
+ the I/O port.\r
\r
**/\r
UINT32\r
@param Port The I/O port to write.\r
@param Value The value to write to the I/O port.\r
\r
- @return The value written the I/O port.\r
+ @return The value written to the I/O port. It equals to the\r
+ input Value instead of the actual value read back from\r
+ the I/O port.\r
\r
**/\r
UINT64\r
\r
@param Address The MMIO register to read.\r
\r
- @return The value read.\r
+ @return The value read from Address.\r
\r
**/\r
UINT8\r
\r
@param Address The MMIO register to read.\r
\r
- @return The value read.\r
+ @return The value read from Address.\r
\r
**/\r
UINT16\r
\r
@param Address The MMIO register to read.\r
\r
- @return The value read.\r
+ @return The value read from Address.\r
\r
**/\r
UINT32\r
\r
@param Address The MMIO register to read.\r
\r
- @return The value read.\r
+ @return The value read from Address.\r
\r
**/\r
UINT64\r
@param Address The MMIO register to write.\r
@param Data The value to write to the MMIO register.\r
\r
- @return The value written the memory address.\r
+ @return The value written to the Mmio. It equals to the\r
+ input Value instead of the actual value read back from\r
+ the Mmio.\r
\r
**/\r
UINT8\r
@param Address The MMIO register to write.\r
@param Data The value to write to the MMIO register.\r
\r
- @return The value written the memory address.\r
+ @return The value written to the Mmio. It equals to the\r
+ input Value instead of the actual value read back from\r
+ the Mmio.\r
\r
**/\r
UINT16\r
@param Address The MMIO register to write.\r
@param Data The value to write to the MMIO register.\r
\r
- @return The value written the memory address.\r
+ @return The value written to the Mmio. It equals to the\r
+ input Value instead of the actual value read back from\r
+ the Mmio.\r
\r
**/\r
UINT32\r
@param Address The MMIO register to write.\r
@param Data The value to write to the MMIO register.\r
\r
- @return The value written the memory address.\r
+ @return The value written to the Mmio. It equals to the\r
+ input Value instead of the actual value read back from\r
+ the Mmio.\r
\r
**/\r
UINT64\r
\r
**/\r
\r
-//\r
-// Include common header file for this module.\r
-//\r
#include "BaseIoLibIntrinsicInternal.h"\r
\r
/**\r
@param Length Size in bytes of the copy.\r
@param Buffer Pointer to a system memory buffer receiving the data read.\r
\r
- @return Buffer\r
+ @return Buffer contains the data read from Mmio.\r
\r
**/\r
UINT8 *\r
@param Length Size in bytes of the copy.\r
@param Buffer Pointer to a system memory buffer receiving the data read.\r
\r
- @return Buffer\r
+ @return Buffer contains the data read from Mmio.\r
\r
**/\r
UINT16 *\r
@param Length Size in bytes of the copy.\r
@param Buffer Pointer to a system memory buffer receiving the data read.\r
\r
- @return Buffer\r
+ @return Buffer contains the data read from Mmio.\r
\r
**/\r
UINT32 *\r
@param Length Size in bytes of the copy.\r
@param Buffer Pointer to a system memory buffer receiving the data read.\r
\r
- @return Buffer\r
+ @return Buffer contains the data read from Mmio.\r
\r
**/\r
UINT64 *\r
\r
@param Port The I/O port to read.\r
\r
- @return The value read.\r
+ @return The value read from Port.\r
\r
**/\r
UINT8\r
\r
@param Port The I/O port to read.\r
\r
- @return The value read.\r
+ @return The value read from Port.\r
\r
**/\r
UINT16\r
\r
@param Port The I/O port to read.\r
\r
- @return The value read.\r
+ @return The value read from Port.\r
\r
**/\r
UINT32\r
\r
@param Address The MMIO register to read.\r
\r
- @return The value read.\r
+ @return The value read from Address.\r
\r
**/\r
UINT8\r
\r
@param Address The MMIO register to write.\r
@param Value The value to write to the MMIO register.\r
-\r
+ \r
+ @return The value written to the Mmio. It equals to the input\r
+ Value instead of the actual value read back from the\r
+ Mmio.\r
+ \r
**/\r
UINT8\r
EFIAPI\r
\r
@param Address The MMIO register to read.\r
\r
- @return The value read.\r
+ @return The value read from Address.\r
\r
**/\r
UINT16\r
\r
@param Address The MMIO register to write.\r
@param Value The value to write to the MMIO register.\r
+ \r
+ @return The value read from the Mmio after wrote specified\r
+ Value.\r
\r
**/\r
UINT16\r
\r
@param Address The MMIO register to read.\r
\r
- @return The value read.\r
+ @return The value read from Address.\r
\r
**/\r
UINT32\r
\r
@param Address The MMIO register to write.\r
@param Value The value to write to the MMIO register.\r
+ \r
+ @return The value written to the Mmio. It equals to the input\r
+ Value instead of the actual value read back from the\r
+ Mmio.\r
\r
**/\r
UINT32\r
\r
@param Address The MMIO register to read.\r
\r
- @return The value read.\r
+ @return The value read from Address.\r
\r
**/\r
UINT64\r
@param Address The MMIO register to write.\r
@param Value The value to write to the MMIO register.\r
\r
+ @return The value written to the Mmio. It equals to the input\r
+ Value instead of the actual value read back from the\r
+ Mmio.\r
+ \r
**/\r
UINT64\r
EFIAPI\r
\r
**/\r
INT64\r
+EFIAPI\r
InternalMathDivRemS64x64 (\r
IN INT64 Dividend,\r
IN INT64 Divisor,\r
\r
**/\r
BOOLEAN\r
+EFIAPI\r
IsNodeInList (\r
IN CONST LIST_ENTRY *List,\r
IN CONST LIST_ENTRY *Node\r
\r
**/\r
unsigned int\r
+EFIAPI\r
BitFieldReadUint (\r
IN unsigned int Operand,\r
IN UINTN StartBit,\r
\r
**/\r
unsigned int\r
+EFIAPI\r
BitFieldOrUint (\r
IN unsigned int Operand,\r
IN UINTN StartBit,\r
\r
**/\r
unsigned int\r
+EFIAPI\r
BitFieldAndUint (\r
IN unsigned int Operand,\r
IN UINTN StartBit,\r
\r
**/\r
VOID\r
+EFIAPI\r
InternalAssertJumpBuffer (\r
IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer\r
);\r
\r
**/\r
unsigned int\r
+EFIAPI\r
BitFieldReadUint (\r
IN unsigned int Operand,\r
IN UINTN StartBit,\r
\r
**/\r
unsigned int\r
+EFIAPI\r
BitFieldOrUint (\r
IN unsigned int Operand,\r
IN UINTN StartBit,\r
\r
**/\r
unsigned int\r
+EFIAPI\r
BitFieldAndUint (\r
IN unsigned int Operand,\r
IN UINTN StartBit,\r
{\r
volatile UINTN Index;\r
\r
- for (Index = 0; Index == 0;);\r
+ for (Index = 0; 0 == Index;);\r
}\r
\r
**/\r
VOID\r
+EFIAPI\r
InternalAssertJumpBuffer (\r
IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer\r
);\r
\r
**/\r
\r
+/**\r
+ Performs an atomic compare exchange operation on a 32-bit\r
+ unsigned integer.\r
+\r
+ Performs an atomic compare exchange operation on the 32-bit\r
+ unsigned integer specified by Value. If Value is equal to\r
+ CompareValue, then Value is set to ExchangeValue and\r
+ CompareValue is returned. If Value is not equal to\r
+ CompareValue, then Value is returned. The compare exchange\r
+ operation must be performed using MP safe mechanisms.\r
+\r
+ @param Value A pointer to the 32-bit value for the\r
+ compare exchange operation.\r
+ @param CompareValue 32-bit value used in compare operation.\r
+ @param ExchangeValue 32-bit value used in exchange operation.\r
+\r
+ @return The original *Value before exchange.\r
+\r
+**/\r
UINT32\r
EFIAPI\r
InternalSyncCompareExchange32 (\r
IN UINT32 Operand\r
)\r
{\r
- if (Operand == 0) {\r
+ if (0 == Operand) {\r
return 0;\r
}\r
\r
\r
**/\r
INT64\r
+EFIAPI\r
InternalMathDivRemS64x64 (\r
IN INT64 Dividend,\r
IN INT64 Divisor,\r
\r
**/\r
BOOLEAN\r
+EFIAPI\r
IsNodeInList (\r
IN CONST LIST_ENTRY *List,\r
IN CONST LIST_ENTRY *Node\r
\r
@param FirstEntry A pointer to a node in a linked list.\r
@param SecondEntry A pointer to another node in the same linked list.\r
+ \r
+ @return SecondEntry\r
\r
**/\r
LIST_ENTRY *\r
return -1;\r
}\r
\r
- for (BitIndex = 0; (Operand & 1) == 0; BitIndex++, Operand >>= 1);\r
+ for (BitIndex = 0; 0 == (Operand & 1); BitIndex++, Operand >>= 1);\r
return BitIndex;\r
}\r
\r
**/\r
INT64\r
+EFIAPI\r
InternalMathDivRemS64x64 (\r
IN INT64 Dividend,\r
IN INT64 Divisor,\r
\r
@param String Pointer to a Null-terminated Unicode string.\r
\r
- @return The size of String.\r
+ @return The size in bytes of String.\r
\r
**/\r
UINTN\r
IN UINTN Length\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return 0;\r
}\r
\r
SearchStringTmp++;\r
} \r
\r
- if (*SearchStringTmp == '\0') {\r
+ if ('\0' == *SearchStringTmp) {\r
return (CHAR16 *) FirstMatch;\r
}\r
\r
//\r
// Ignore the pad spaces (space or tab)\r
//\r
- while ((*String == L' ') || (*String == L'\t')) {\r
+ while ((L' ' ==*String) || (L'\t' == *String)) {\r
String++;\r
}\r
\r
//\r
// Ignore leading Zeros after the spaces\r
//\r
- while (*String == L'0') {\r
+ while (L'0' == *String) {\r
String++;\r
}\r
\r
// to the range defined by UINTN, then ASSERT().\r
//\r
ASSERT ((Result < QUIENT_MAX_UINTN_DIVIDED_BY_10) ||\r
- ((Result == QUIENT_MAX_UINTN_DIVIDED_BY_10) &&\r
+ ((QUIENT_MAX_UINTN_DIVIDED_BY_10 == Result) &&\r
(*String - L'0') <= REMINDER_MAX_UINTN_DIVIDED_BY_10)\r
);\r
\r
//\r
// Ignore the pad spaces (space or tab)\r
//\r
- while ((*String == L' ') || (*String == L'\t')) {\r
+ while ((L' ' == *String) || (L'\t' == *String)) {\r
String++;\r
}\r
\r
//\r
// Ignore leading Zeros after the spaces\r
//\r
- while (*String == L'0') {\r
+ while (L'0' == *String) {\r
String++;\r
}\r
\r
// to the range defined by UINTN, then ASSERT().\r
//\r
ASSERT ((Result < QUIENT_MAX_UINT64_DIVIDED_BY_10) || \r
- ((Result == QUIENT_MAX_UINT64_DIVIDED_BY_10) && \r
+ ((QUIENT_MAX_UINT64_DIVIDED_BY_10 == Result) && \r
(*String - L'0') <= REMINDER_MAX_UINT64_DIVIDED_BY_10)\r
);\r
\r
//\r
// Ignore the pad spaces (space or tab) \r
//\r
- while ((*String == L' ') || (*String == L'\t')) {\r
+ while ((L' ' == *String) || (L'\t' == *String)) {\r
String++;\r
}\r
\r
//\r
// Ignore leading Zeros after the spaces\r
//\r
- while (*String == L'0') {\r
+ while (L'0' == *String) {\r
String++;\r
}\r
\r
if (InternalCharToUpper (*String) == L'X') {\r
- ASSERT (*(String - 1) == L'0');\r
+ ASSERT (L'0' == *(String - 1));\r
if (*(String - 1) != L'0') {\r
return 0;\r
}\r
// to the range defined by UINTN, then ASSERT().\r
//\r
ASSERT ((Result < QUIENT_MAX_UINTN_DIVIDED_BY_16) ||\r
- ((Result == QUIENT_MAX_UINTN_DIVIDED_BY_16) && \r
+ ((QUIENT_MAX_UINTN_DIVIDED_BY_16 == Result) && \r
(InternalHexCharToUintn (*String) <= REMINDER_MAX_UINTN_DIVIDED_BY_16))\r
);\r
\r
//\r
// Ignore the pad spaces (space or tab) \r
//\r
- while ((*String == L' ') || (*String == L'\t')) {\r
+ while ((L' ' == *String) || (L'\t' == *String)) {\r
String++;\r
}\r
\r
//\r
// Ignore leading Zeros after the spaces\r
//\r
- while (*String == L'0') {\r
+ while (L'0' == *String) {\r
String++;\r
}\r
\r
if (InternalCharToUpper (*String) == L'X') {\r
- ASSERT (*(String - 1) == L'0');\r
+ ASSERT (L'0' == *(String - 1));\r
if (*(String - 1) != L'0') {\r
return 0;\r
}\r
// to the range defined by UINTN, then ASSERT().\r
//\r
ASSERT ((Result < QUIENT_MAX_UINT64_DIVIDED_BY_16)|| \r
- ((Result == QUIENT_MAX_UINT64_DIVIDED_BY_16) && \r
+ ((QUIENT_MAX_UINT64_DIVIDED_BY_16 == Result) && \r
(InternalHexCharToUintn (*String) <= REMINDER_MAX_UINT64_DIVIDED_BY_16))\r
);\r
\r
{\r
CHAR8 *ReturnValue;\r
\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return Destination;\r
}\r
\r
IN UINTN Length\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return 0;\r
}\r
\r
//\r
// Ignore the pad spaces (space or tab)\r
//\r
- while ((*String == ' ') || (*String == '\t')) {\r
+ while ((' ' == *String) || ('\t' == *String)) {\r
String++;\r
}\r
\r
//\r
// Ignore leading Zeros after the spaces\r
//\r
- while (*String == '0') {\r
+ while ('0' == *String) {\r
String++;\r
}\r
\r
// to the range defined by UINTN, then ASSERT().\r
//\r
ASSERT ((Result < QUIENT_MAX_UINTN_DIVIDED_BY_10) ||\r
- ((Result == QUIENT_MAX_UINTN_DIVIDED_BY_10) && \r
+ ((QUIENT_MAX_UINTN_DIVIDED_BY_10 == Result) && \r
(*String - '0') <= REMINDER_MAX_UINTN_DIVIDED_BY_10)\r
);\r
\r
//\r
// Ignore the pad spaces (space or tab)\r
//\r
- while ((*String == ' ') || (*String == '\t')) {\r
+ while ((' ' == *String) || ('\t' == *String)) {\r
String++;\r
}\r
\r
//\r
// Ignore leading Zeros after the spaces\r
//\r
- while (*String == '0') {\r
+ while ('0' == *String) {\r
String++;\r
}\r
\r
// to the range defined by UINTN, then ASSERT().\r
//\r
ASSERT ((Result < QUIENT_MAX_UINT64_DIVIDED_BY_10) || \r
- ((Result == QUIENT_MAX_UINT64_DIVIDED_BY_10) && \r
+ ((QUIENT_MAX_UINT64_DIVIDED_BY_10 == Result) && \r
(*String - '0') <= REMINDER_MAX_UINT64_DIVIDED_BY_10)\r
);\r
\r
//\r
// Ignore the pad spaces (space or tab) \r
//\r
- while ((*String == ' ') || (*String == '\t')) {\r
+ while ((' ' == *String) || ('\t' == *String)) {\r
String++;\r
}\r
\r
//\r
// Ignore leading Zeros after the spaces\r
//\r
- while (*String == '0') {\r
+ while ('0' == *String) {\r
String++;\r
}\r
\r
if (AsciiToUpper (*String) == 'X') {\r
- ASSERT (*(String - 1) == '0');\r
+ ASSERT ('0' == *(String - 1));\r
if (*(String - 1) != '0') {\r
return 0;\r
}\r
// to the range defined by UINTN, then ASSERT().\r
//\r
ASSERT ((Result < QUIENT_MAX_UINTN_DIVIDED_BY_16) ||\r
- ((Result == QUIENT_MAX_UINTN_DIVIDED_BY_16) && \r
+ ((QUIENT_MAX_UINTN_DIVIDED_BY_16 == Result) && \r
(InternalAsciiHexCharToUintn (*String) <= REMINDER_MAX_UINTN_DIVIDED_BY_16))\r
);\r
\r
//\r
// Ignore the pad spaces (space or tab) \r
//\r
- while ((*String == ' ') || (*String == '\t')) {\r
+ while ((' ' == *String) || ('\t' == *String)) {\r
String++;\r
}\r
\r
//\r
// Ignore leading Zeros after the spaces\r
//\r
- while (*String == '0') {\r
+ while ('0' == *String) {\r
String++;\r
}\r
\r
if (AsciiToUpper (*String) == 'X') {\r
- ASSERT (*(String - 1) == '0');\r
+ ASSERT ('0' == *(String - 1));\r
if (*(String - 1) != '0') {\r
return 0;\r
}\r
// to the range defined by UINTN, then ASSERT().\r
//\r
ASSERT ((Result < QUIENT_MAX_UINT64_DIVIDED_BY_16) ||\r
- ((Result == QUIENT_MAX_UINT64_DIVIDED_BY_16) && \r
+ ((QUIENT_MAX_UINT64_DIVIDED_BY_16 == Result) && \r
(InternalAsciiHexCharToUintn (*String) <= REMINDER_MAX_UINT64_DIVIDED_BY_16))\r
);\r
\r
VOID\r
)\r
{\r
- // @bug May use a PCD entry to determine this alignment.\r
return 32;\r
}\r
\r
@param SpinLock A pointer to the spin lock to initialize to the released\r
state.\r
\r
- @return SpinLock\r
+ @return SpinLock initialized in release state.\r
\r
**/\r
SPIN_LOCK *\r
\r
@param SpinLock A pointer to the spin lock to place in the acquired state.\r
\r
- @return SpinLock\r
+ @return SpinLock aquired lock.\r
\r
**/\r
SPIN_LOCK *\r
ASSERT (SpinLock != NULL);\r
\r
LockValue = *SpinLock;\r
- ASSERT (LockValue == SPIN_LOCK_ACQUIRED || LockValue == SPIN_LOCK_RELEASED);\r
+ ASSERT (SPIN_LOCK_ACQUIRED == LockValue || SPIN_LOCK_RELEASED == LockValue);\r
\r
return (BOOLEAN)(\r
InterlockedCompareExchangePointer (\r
ASSERT (SpinLock != NULL);\r
\r
LockValue = *SpinLock;\r
- ASSERT (LockValue == SPIN_LOCK_ACQUIRED || LockValue == SPIN_LOCK_RELEASED);\r
+ ASSERT (SPIN_LOCK_ACQUIRED == LockValue || SPIN_LOCK_RELEASED == LockValue);\r
\r
*SpinLock = SPIN_LOCK_RELEASED;\r
return SpinLock;\r
operation.\r
@param CompareValue Pointer value used in compare operation.\r
@param ExchangeValue Pointer value used in exchange operation.\r
+ \r
+ @return The original *Value before exchange.\r
\r
**/\r
VOID *\r
VOID\r
)\r
{\r
- // @bug May use a PCD entry to determine this alignment.\r
return 32;\r
}\r
\r
@param SpinLock A pointer to the spin lock to initialize to the released\r
state.\r
\r
- @return SpinLock\r
+ @return SpinLock in release state.\r
\r
**/\r
SPIN_LOCK *\r
\r
@param SpinLock A pointer to the spin lock to place in the acquired state.\r
\r
- @return SpinLock\r
+ @return SpinLock accquired lock.\r
\r
**/\r
SPIN_LOCK *\r
\r
@param SpinLock A pointer to the spin lock to release.\r
\r
- @return SpinLock\r
+ @return SpinLock released lock.\r
\r
**/\r
SPIN_LOCK *\r
@param CompareValue Pointer value used in compare operation.\r
@param ExchangeValue Pointer value used in exchange operation.\r
\r
+ @return The original *Value before exchange.\r
**/\r
VOID *\r
EFIAPI\r
VOID\r
)\r
{\r
- // @bug May use a PCD entry to determine this alignment.\r
return 32;\r
}\r
\r
@param SpinLock A pointer to the spin lock to initialize to the released\r
state.\r
\r
- @return SpinLock\r
+ @return SpinLock in released state.\r
\r
**/\r
SPIN_LOCK *\r
\r
@param SpinLock A pointer to the spin lock to place in the acquired state.\r
\r
- @return SpinLock\r
+ @return SpinLock aquiring lock.\r
\r
**/\r
SPIN_LOCK *\r
\r
@param SpinLock A pointer to the spin lock to release.\r
\r
- @return SpinLock\r
+ @return SpinLock releasing lock.\r
\r
**/\r
SPIN_LOCK *\r
operation.\r
@param CompareValue Pointer value used in compare operation.\r
@param ExchangeValue Pointer value used in exchange operation.\r
+ \r
+ @return The original *Value before exchange.\r
\r
**/\r
VOID *\r
\r
@param Buffer Pointer to a 16-bit value that may be unaligned.\r
\r
- @return *Uint16\r
+ @return Data read from Buffer.\r
\r
**/\r
UINT16\r
@param Buffer Pointer to a 16-bit value that may be unaligned.\r
@param Value 16-bit value to write to Buffer.\r
\r
- @return Value\r
+ @return Value written to Buffer\r
\r
**/\r
UINT16\r
\r
@param Buffer Pointer to a 24-bit value that may be unaligned.\r
\r
- @return The value read.\r
+ @return The value read from Buffer.\r
\r
**/\r
UINT32\r
@param Buffer Pointer to a 24-bit value that may be unaligned.\r
@param Value 24-bit value to write to Buffer.\r
\r
- @return The value written.\r
+ @return The value written to Buffer.\r
\r
**/\r
UINT32\r
\r
@param Buffer Pointer to a 32-bit value that may be unaligned.\r
\r
- @return *Uint32\r
+ @return Data read from Buffer.\r
\r
**/\r
UINT32\r
@param Buffer Pointer to a 32-bit value that may be unaligned.\r
@param Value 32-bit value to write to Buffer.\r
\r
- @return Value\r
+ @return Value written to Buffer\r
\r
**/\r
UINT32\r
\r
@param Buffer Pointer to a 64-bit value that may be unaligned.\r
\r
- @return *Uint64\r
+ @return Data read from Buffer.\r
\r
**/\r
UINT64\r
@param Buffer Pointer to a 64-bit value that may be unaligned.\r
@param Value 64-bit value to write to Buffer.\r
\r
- @return Value\r
+ @return Value written to Buffer.\r
\r
**/\r
UINT64\r
)\r
{\r
ASSERT (Buffer != NULL);\r
- ASSERT (((UINTN)Buffer & 0xf) == 0);\r
+ ASSERT (0 == ((UINTN)Buffer & 0xf));\r
\r
//\r
// Check the flag recorded by AsmFxSave()\r
//\r
- ASSERT (*(UINT32 *) (&Buffer[sizeof (IA32_FX_BUFFER) - 4]) == 0xAA5555AA);\r
+ ASSERT (0xAA5555AA == *(UINT32 *) (&Buffer[sizeof (IA32_FX_BUFFER) - 4]));\r
\r
InternalX86FxRestore (Buffer);\r
}\r
)\r
{\r
ASSERT (Buffer != NULL);\r
- ASSERT (((UINTN)Buffer & 0xf) == 0);\r
+ ASSERT (0 == ((UINTN)Buffer & 0xf));\r
\r
InternalX86FxSave (Buffer);\r
\r
IA32_EFLAGS32 EFlags;\r
\r
EFlags.UintN = AsmReadEflags ();\r
- return (BOOLEAN)(EFlags.Bits.IF == 1);\r
+ return (BOOLEAN)(1 == EFlags.Bits.IF);\r
}\r
\r
\r
IN UINTN Length\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return 0;\r
}\r
ASSERT (DestinationBuffer != NULL);\r
IN UINTN Length\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return DestinationBuffer;\r
}\r
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));\r
IN UINT16 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return NULL;\r
}\r
\r
ASSERT (Buffer != NULL);\r
- ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
+ ASSERT (0 == ((UINTN)Buffer & (sizeof (Value) - 1)));\r
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);\r
+ ASSERT (0 == (Length & (sizeof (Value) - 1)));\r
\r
return (VOID*)InternalMemScanMem16 (Buffer, Length / sizeof (Value), Value);\r
}\r
IN UINT32 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return NULL;\r
}\r
\r
ASSERT (Buffer != NULL);\r
- ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
+ ASSERT (0 == ((UINTN)Buffer & (sizeof (Value) - 1)));\r
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);\r
+ ASSERT (0 == (Length & (sizeof (Value) - 1)));\r
\r
return (VOID*)InternalMemScanMem32 (Buffer, Length / sizeof (Value), Value);\r
}\r
IN UINT64 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return NULL;\r
}\r
\r
ASSERT (Buffer != NULL);\r
- ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
+ ASSERT (0 == ((UINTN)Buffer & (sizeof (Value) - 1)));\r
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);\r
+ ASSERT (0 == (Length & (sizeof (Value) - 1)));\r
\r
return (VOID*)InternalMemScanMem64 (Buffer, Length / sizeof (Value), Value);\r
}\r
IN UINT8 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return NULL;\r
}\r
ASSERT (Buffer != NULL);\r
IN UINT16 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return Buffer;\r
}\r
\r
ASSERT (Buffer != NULL);\r
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
- ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) == 0);\r
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);\r
+ ASSERT (0 == (((UINTN)Buffer) & (sizeof (Value) - 1)));\r
+ ASSERT (0 == (Length & (sizeof (Value) - 1)));\r
\r
return InternalMemSetMem16 (Buffer, Length / sizeof (Value), Value);\r
}\r
IN UINT32 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return Buffer;\r
}\r
\r
ASSERT (Buffer != NULL);\r
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
- ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) == 0);\r
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);\r
+ ASSERT (0 == (((UINTN)Buffer) & (sizeof (Value) - 1)));\r
+ ASSERT (0 == (Length & (sizeof (Value) - 1)));\r
\r
return InternalMemSetMem32 (Buffer, Length / sizeof (Value), Value);\r
}\r
IN UINT64 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return Buffer;\r
}\r
\r
ASSERT (Buffer != NULL);\r
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
- ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) == 0);\r
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);\r
+ ASSERT (0 == (((UINTN)Buffer) & (sizeof (Value) - 1)));\r
+ ASSERT (0 == (Length & (sizeof (Value) - 1)));\r
\r
return InternalMemSetMem64 (Buffer, Length / sizeof (Value), Value);\r
}\r
IN UINT8 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return Buffer;\r
}\r
\r
IN UINTN Length\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return 0;\r
}\r
ASSERT (DestinationBuffer != NULL);\r
IN UINTN Length\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return DestinationBuffer;\r
}\r
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));\r
#ifndef __MEM_LIB_INTERNALS__\r
#define __MEM_LIB_INTERNALS__\r
\r
+#include <Base.h>\r
#include <Library/BaseMemoryLib.h>\r
#include <Library/BaseLib.h>\r
#include <Library/DebugLib.h>\r
Set Buffer to Value for Size bytes.\r
\r
@param Buffer Memory to set.\r
- @param Size Number of bytes to set\r
+ @param Length Number of bytes to set\r
@param Value Value of the set operation.\r
\r
@return Buffer\r
Set Buffer to 0 for Size bytes.\r
\r
@param Buffer Memory to set.\r
- @param Size Number of bytes to set\r
+ @param Length Number of bytes to set\r
\r
@return Buffer\r
\r
IN UINT16 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return NULL;\r
}\r
\r
IN UINT32 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return NULL;\r
}\r
\r
IN UINT64 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return NULL;\r
}\r
\r
IN UINT8 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return NULL;\r
}\r
ASSERT (Buffer != NULL);\r
IN UINT16 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return Buffer;\r
}\r
\r
IN UINT32 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return Buffer;\r
}\r
\r
IN UINT64 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return Buffer;\r
}\r
\r
IN UINT8 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return Buffer;\r
}\r
\r
IN UINTN Length\r
)\r
{\r
- ASSERT (!(Buffer == NULL && Length > 0));\r
+ ASSERT (!(NULL == Buffer && Length > 0));\r
ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));\r
return InternalMemZeroMem (Buffer, Length);\r
}\r
IN UINTN Length\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return 0;\r
}\r
ASSERT (DestinationBuffer != NULL);\r
IN UINTN Length\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return DestinationBuffer;\r
}\r
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));\r
IN UINT16 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return NULL;\r
}\r
\r
IN UINT32 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return NULL;\r
}\r
\r
IN UINT64 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return NULL;\r
}\r
\r
IN UINT8 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return NULL;\r
}\r
ASSERT (Buffer != NULL);\r
IN UINT16 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return Buffer;\r
}\r
\r
IN UINT32 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return Buffer;\r
}\r
\r
IN UINT64 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return Buffer;\r
}\r
\r
IN UINT8 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return Buffer;\r
}\r
\r
IN UINTN Length\r
)\r
{\r
- ASSERT (!(Buffer == NULL && Length > 0));\r
+ ASSERT (!(NULL == Buffer && Length > 0));\r
ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));\r
return InternalMemZeroMem (Buffer, Length);\r
}\r
IN UINTN Length\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return 0;\r
}\r
ASSERT (DestinationBuffer != NULL);\r
IN UINTN Length\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return DestinationBuffer;\r
}\r
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));\r
//\r
// Include common header file for this module.\r
//\r
-#include <MemLibInternals.h>\r
+#include "MemLibInternals.h"\r
\r
\r
/**\r
Set Buffer to Value for Size bytes.\r
\r
@param Buffer Memory to set.\r
- @param Size Number of bytes to set\r
+ @param Length Number of bytes to set\r
@param Value Value of the set operation.\r
\r
@return Buffer\r
Set Buffer to 0 for Size bytes.\r
\r
@param Buffer Memory to set.\r
- @param Size Number of bytes to set\r
+ @param Length Number of bytes to set\r
\r
@return Buffer\r
\r
IN UINT16 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return NULL;\r
}\r
\r
IN UINT32 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return NULL;\r
}\r
\r
IN UINT64 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return NULL;\r
}\r
\r
IN UINT8 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return NULL;\r
}\r
ASSERT (Buffer != NULL);\r
IN UINT16 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return Buffer;\r
}\r
\r
IN UINT32 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return Buffer;\r
}\r
\r
IN UINT64 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return Buffer;\r
}\r
\r
IN UINT8 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return Buffer;\r
}\r
\r
IN UINTN Length\r
)\r
{\r
- ASSERT (!(Buffer == NULL && Length > 0));\r
+ ASSERT (!(NULL == Buffer && Length > 0));\r
ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));\r
return InternalMemZeroMem (Buffer, Length);\r
}\r
IN UINTN Length\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return 0;\r
}\r
ASSERT (DestinationBuffer != NULL);\r
IN UINTN Length\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return DestinationBuffer;\r
}\r
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));\r
Set Buffer to Value for Size bytes.\r
\r
@param Buffer Memory to set.\r
- @param Size Number of bytes to set\r
+ @param Length Number of bytes to set\r
@param Value Value of the set operation.\r
\r
@return Buffer\r
Set Buffer to 0 for Size bytes.\r
\r
@param Buffer Memory to set.\r
- @param Size Number of bytes to set\r
+ @param Length Number of bytes to set\r
\r
@return Buffer\r
\r
IN UINT16 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return NULL;\r
}\r
\r
IN UINT32 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return NULL;\r
}\r
\r
IN UINT64 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return NULL;\r
}\r
\r
IN UINT8 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return NULL;\r
}\r
ASSERT (Buffer != NULL);\r
IN UINT16 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return Buffer;\r
}\r
\r
IN UINT32 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return Buffer;\r
}\r
\r
IN UINT64 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return Buffer;\r
}\r
\r
IN UINT8 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return Buffer;\r
}\r
\r
IN UINTN Length\r
)\r
{\r
- ASSERT (!(Buffer == NULL && Length > 0));\r
+ ASSERT (!(NULL == Buffer && Length > 0));\r
ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));\r
return InternalMemZeroMem (Buffer, Length);\r
}\r
IN UINTN Length\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return 0;\r
}\r
ASSERT (DestinationBuffer != NULL);\r
IN UINTN Length\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return DestinationBuffer;\r
}\r
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));\r
IN CONST GUID *Guid2\r
)\r
{\r
- UINT64 Guid1ValueLo;\r
- UINT64 Guid1ValueHi;\r
- UINT64 Guid2ValueLo;\r
- UINT64 Guid2ValueHi;\r
+ UINT64 LowPartOfGuid1;\r
+ UINT64 LowPartOfGuid2;\r
+ UINT64 HighPartOfGuid1;\r
+ UINT64 HighPartOfGuid2;\r
\r
- Guid1ValueLo = ReadUnaligned64 ((CONST UINT64*)Guid1);\r
- Guid2ValueLo = ReadUnaligned64 ((CONST UINT64*)Guid2);\r
+ LowPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1);\r
+ LowPartOfGuid2 = ReadUnaligned64 ((CONST UINT64*) Guid2);\r
+ HighPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1 + 1);\r
+ HighPartOfGuid2 = ReadUnaligned64 ((CONST UINT64*) Guid2 + 1);\r
\r
- Guid1ValueHi = ReadUnaligned64 ((CONST UINT64*)Guid1 + 1);\r
- Guid2ValueHi = ReadUnaligned64 ((CONST UINT64*)Guid2 + 1);\r
-\r
-\r
- return (BOOLEAN)\r
- ((Guid1ValueLo == Guid2ValueLo) &&\r
- (Guid1ValueHi == Guid2ValueHi)\r
- );\r
+ return (BOOLEAN) (LowPartOfGuid1 == LowPartOfGuid2 && HighPartOfGuid1 == HighPartOfGuid2);\r
}\r
\r
/**\r
Set Buffer to Value for Size bytes.\r
\r
@param Buffer Memory to set.\r
- @param Size Number of bytes to set\r
+ @param Length Number of bytes to set\r
@param Value Value of the set operation.\r
\r
@return Buffer\r
Set Buffer to 0 for Size bytes.\r
\r
@param Buffer Memory to set.\r
- @param Size Number of bytes to set\r
+ @param Length Number of bytes to set\r
\r
@return Buffer\r
\r
IN UINT16 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return NULL;\r
}\r
\r
IN UINT32 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return NULL;\r
}\r
\r
IN UINT64 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return NULL;\r
}\r
\r
IN UINT8 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return NULL;\r
}\r
ASSERT (Buffer != NULL);\r
IN UINT16 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return Buffer;\r
}\r
\r
IN UINT32 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return Buffer;\r
}\r
\r
IN UINT64 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return Buffer;\r
}\r
\r
IN UINT8 Value\r
)\r
{\r
- if (Length == 0) {\r
+ if (0 == Length) {\r
return Buffer;\r
}\r
\r
IN UINTN Length\r
)\r
{\r
- ASSERT (!(Buffer == NULL && Length > 0));\r
+ ASSERT (!(NULL == Buffer && Length > 0));\r
ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));\r
return InternalMemZeroMem (Buffer, Length);\r
}\r
ASSERT (EntryPoint != NULL);\r
\r
DosHdr = (EFI_IMAGE_DOS_HEADER *)Pe32Data;\r
- if (DosHdr->e_magic == EFI_IMAGE_DOS_SIGNATURE) {\r
+ if (EFI_IMAGE_DOS_SIGNATURE == DosHdr->e_magic) {\r
//\r
// DOS image header is present, so read the PE header after the DOS image header.\r
//\r
ASSERT (Pe32Data != NULL);\r
\r
DosHdr = (EFI_IMAGE_DOS_HEADER *)Pe32Data;\r
- if (DosHdr->e_magic == EFI_IMAGE_DOS_SIGNATURE) {\r
+ if (EFI_IMAGE_DOS_SIGNATURE == DosHdr->e_magic) {\r
//\r
// DOS image header is present, so read the PE header after the DOS image header.\r
//\r
Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data;\r
}\r
\r
- if (Hdr.Te->Signature == EFI_TE_IMAGE_HEADER_SIGNATURE) {\r
+ if (EFI_TE_IMAGE_HEADER_SIGNATURE == Hdr.Te->Signature) {\r
return Hdr.Te->Machine;\r
- } else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) {\r
+ } else if (EFI_IMAGE_NT_SIGNATURE == Hdr.Pe32->Signature) {\r
return Hdr.Pe32->FileHeader.Machine;\r
}\r
\r
NumberOfRvaAndSizes = 0;\r
\r
DosHdr = (EFI_IMAGE_DOS_HEADER *)Pe32Data;\r
- if (DosHdr->e_magic == EFI_IMAGE_DOS_SIGNATURE) {\r
+ if (EFI_IMAGE_DOS_SIGNATURE == DosHdr->e_magic) {\r
//\r
// DOS image header is present, so read the PE header after the DOS image header.\r
//\r
Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data;\r
}\r
\r
- if (Hdr.Te->Signature == EFI_TE_IMAGE_HEADER_SIGNATURE) {\r
+ if (EFI_TE_IMAGE_HEADER_SIGNATURE == Hdr.Te->Signature) {\r
if (Hdr.Te->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress != 0) {\r
DirectoryEntry = &Hdr.Te->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG];\r
TEImageAdjust = sizeof (EFI_TE_IMAGE_HEADER) - Hdr.Te->StrippedSize;\r
Hdr.Te->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress +\r
TEImageAdjust);\r
}\r
- } else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) {\r
+ } else if (EFI_IMAGE_NT_SIGNATURE == Hdr.Pe32->Signature) {\r
//\r
// NOTE: We use Machine field to identify PE32/PE32+, instead of Magic.\r
// It is due to backward-compatibility, for some system might\r
Magic = Hdr.Pe32->OptionalHeader.Magic;\r
}\r
\r
- if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {\r
+ if (EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC == Magic) {\r
//\r
// Use PE32 offset get Debug Directory Entry\r
//\r
return NULL;\r
}\r
\r
- if (DebugEntry == NULL || DirectoryEntry == NULL) {\r
+ if (NULL == DebugEntry || NULL == DirectoryEntry) {\r
return NULL;\r
}\r
\r
+ //\r
+ // Scan the directory to find the debug entry.\r
+ // \r
for (DirCount = 0; DirCount < DirectoryEntry->Size; DirCount += sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY), DebugEntry++) {\r
- if (DebugEntry->Type == EFI_IMAGE_DEBUG_TYPE_CODEVIEW) {\r
+ if (EFI_IMAGE_DEBUG_TYPE_CODEVIEW == DebugEntry->Type) {\r
if (DebugEntry->SizeOfData > 0) {\r
CodeViewEntryPointer = (VOID *) ((UINTN) DebugEntry->RVA + ((UINTN)Pe32Data) + (UINTN)TEImageAdjust);\r
switch (* (UINT32 *) CodeViewEntryPointer) {\r