diff options
author | yshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-07-08 09:38:43 +0000 |
---|---|---|
committer | yshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-07-08 09:38:43 +0000 |
commit | 38bbd3d91c38481d18c1a7e2049473c951ee98ed (patch) | |
tree | ae4da246ac9d5b8501d017de66aecf1c7c8bb8b4 /MdePkg/Library/BaseLib | |
parent | d74eeda8a7ed223d49e59378f33b2bcfb1bb73b1 (diff) | |
download | edk2-platforms-38bbd3d91c38481d18c1a7e2049473c951ee98ed.tar.xz |
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
Diffstat (limited to 'MdePkg/Library/BaseLib')
-rw-r--r-- | MdePkg/Library/BaseLib/BaseLibInternals.h | 6 | ||||
-rw-r--r-- | MdePkg/Library/BaseLib/BitField.c | 3 | ||||
-rw-r--r-- | MdePkg/Library/BaseLib/CpuDeadLoop.c | 2 | ||||
-rw-r--r-- | MdePkg/Library/BaseLib/Ebc/SetJumpLongJump.c | 1 | ||||
-rw-r--r-- | MdePkg/Library/BaseLib/Ebc/Synchronization.c | 19 | ||||
-rw-r--r-- | MdePkg/Library/BaseLib/GetPowerOfTwo32.c | 2 | ||||
-rw-r--r-- | MdePkg/Library/BaseLib/Ia32/DivS64x64Remainder.c | 1 | ||||
-rw-r--r-- | MdePkg/Library/BaseLib/LinkedList.c | 3 | ||||
-rw-r--r-- | MdePkg/Library/BaseLib/LowBitSet32.c | 2 | ||||
-rw-r--r-- | MdePkg/Library/BaseLib/Math64.c | 1 | ||||
-rw-r--r-- | MdePkg/Library/BaseLib/String.c | 66 | ||||
-rw-r--r-- | MdePkg/Library/BaseLib/Synchronization.c | 11 | ||||
-rw-r--r-- | MdePkg/Library/BaseLib/SynchronizationGcc.c | 8 | ||||
-rw-r--r-- | MdePkg/Library/BaseLib/SynchronizationMsc.c | 9 | ||||
-rw-r--r-- | MdePkg/Library/BaseLib/Unaligned.c | 16 | ||||
-rw-r--r-- | MdePkg/Library/BaseLib/x86FxRestore.c | 4 | ||||
-rw-r--r-- | MdePkg/Library/BaseLib/x86FxSave.c | 2 | ||||
-rw-r--r-- | MdePkg/Library/BaseLib/x86GetInterruptState.c | 2 |
18 files changed, 97 insertions, 61 deletions
diff --git a/MdePkg/Library/BaseLib/BaseLibInternals.h b/MdePkg/Library/BaseLib/BaseLibInternals.h index 51f3c96cb8..04f622b79a 100644 --- a/MdePkg/Library/BaseLib/BaseLibInternals.h +++ b/MdePkg/Library/BaseLib/BaseLibInternals.h @@ -311,6 +311,7 @@ InternalMathDivRemU64x64 ( **/
INT64
+EFIAPI
InternalMathDivRemS64x64 (
IN INT64 Dividend,
IN INT64 Divisor,
@@ -374,6 +375,7 @@ InternalSwitchStack ( **/
BOOLEAN
+EFIAPI
IsNodeInList (
IN CONST LIST_ENTRY *List,
IN CONST LIST_ENTRY *Node
@@ -484,6 +486,7 @@ InternalSyncCompareExchange64 ( **/
unsigned int
+EFIAPI
BitFieldReadUint (
IN unsigned int Operand,
IN UINTN StartBit,
@@ -508,6 +511,7 @@ BitFieldReadUint ( **/
unsigned int
+EFIAPI
BitFieldOrUint (
IN unsigned int Operand,
IN UINTN StartBit,
@@ -533,6 +537,7 @@ BitFieldOrUint ( **/
unsigned int
+EFIAPI
BitFieldAndUint (
IN unsigned int Operand,
IN UINTN StartBit,
@@ -553,6 +558,7 @@ BitFieldAndUint ( **/
VOID
+EFIAPI
InternalAssertJumpBuffer (
IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
);
diff --git a/MdePkg/Library/BaseLib/BitField.c b/MdePkg/Library/BaseLib/BitField.c index 372ba12355..5e894843b2 100644 --- a/MdePkg/Library/BaseLib/BitField.c +++ b/MdePkg/Library/BaseLib/BitField.c @@ -32,6 +32,7 @@ **/
unsigned int
+EFIAPI
BitFieldReadUint (
IN unsigned int Operand,
IN UINTN StartBit,
@@ -62,6 +63,7 @@ BitFieldReadUint ( **/
unsigned int
+EFIAPI
BitFieldOrUint (
IN unsigned int Operand,
IN UINTN StartBit,
@@ -93,6 +95,7 @@ BitFieldOrUint ( **/
unsigned int
+EFIAPI
BitFieldAndUint (
IN unsigned int Operand,
IN UINTN StartBit,
diff --git a/MdePkg/Library/BaseLib/CpuDeadLoop.c b/MdePkg/Library/BaseLib/CpuDeadLoop.c index b2014c77af..325be96d93 100644 --- a/MdePkg/Library/BaseLib/CpuDeadLoop.c +++ b/MdePkg/Library/BaseLib/CpuDeadLoop.c @@ -36,5 +36,5 @@ CpuDeadLoop ( {
volatile UINTN Index;
- for (Index = 0; Index == 0;);
+ for (Index = 0; 0 == Index;);
}
diff --git a/MdePkg/Library/BaseLib/Ebc/SetJumpLongJump.c b/MdePkg/Library/BaseLib/Ebc/SetJumpLongJump.c index 44d393f6b4..13de998127 100644 --- a/MdePkg/Library/BaseLib/Ebc/SetJumpLongJump.c +++ b/MdePkg/Library/BaseLib/Ebc/SetJumpLongJump.c @@ -28,6 +28,7 @@ **/
VOID
+EFIAPI
InternalAssertJumpBuffer (
IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
);
diff --git a/MdePkg/Library/BaseLib/Ebc/Synchronization.c b/MdePkg/Library/BaseLib/Ebc/Synchronization.c index ef3fa62d89..cb5d1f3450 100644 --- a/MdePkg/Library/BaseLib/Ebc/Synchronization.c +++ b/MdePkg/Library/BaseLib/Ebc/Synchronization.c @@ -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
EFIAPI
InternalSyncCompareExchange32 (
diff --git a/MdePkg/Library/BaseLib/GetPowerOfTwo32.c b/MdePkg/Library/BaseLib/GetPowerOfTwo32.c index 19b00dd760..f9849c34c4 100644 --- a/MdePkg/Library/BaseLib/GetPowerOfTwo32.c +++ b/MdePkg/Library/BaseLib/GetPowerOfTwo32.c @@ -38,7 +38,7 @@ GetPowerOfTwo32 ( IN UINT32 Operand
)
{
- if (Operand == 0) {
+ if (0 == Operand) {
return 0;
}
diff --git a/MdePkg/Library/BaseLib/Ia32/DivS64x64Remainder.c b/MdePkg/Library/BaseLib/Ia32/DivS64x64Remainder.c index 3a1867b094..36b256f07c 100644 --- a/MdePkg/Library/BaseLib/Ia32/DivS64x64Remainder.c +++ b/MdePkg/Library/BaseLib/Ia32/DivS64x64Remainder.c @@ -37,6 +37,7 @@ **/
INT64
+EFIAPI
InternalMathDivRemS64x64 (
IN INT64 Dividend,
IN INT64 Divisor,
diff --git a/MdePkg/Library/BaseLib/LinkedList.c b/MdePkg/Library/BaseLib/LinkedList.c index 5d804109ab..73cfe4d7a8 100644 --- a/MdePkg/Library/BaseLib/LinkedList.c +++ b/MdePkg/Library/BaseLib/LinkedList.c @@ -41,6 +41,7 @@ **/
BOOLEAN
+EFIAPI
IsNodeInList (
IN CONST LIST_ENTRY *List,
IN CONST LIST_ENTRY *Node
@@ -384,6 +385,8 @@ IsNodeAtEnd ( @param FirstEntry A pointer to a node in a linked list.
@param SecondEntry A pointer to another node in the same linked list.
+
+ @return SecondEntry
**/
LIST_ENTRY *
diff --git a/MdePkg/Library/BaseLib/LowBitSet32.c b/MdePkg/Library/BaseLib/LowBitSet32.c index a598a1f71f..58d0063e22 100644 --- a/MdePkg/Library/BaseLib/LowBitSet32.c +++ b/MdePkg/Library/BaseLib/LowBitSet32.c @@ -44,6 +44,6 @@ LowBitSet32 ( return -1;
}
- for (BitIndex = 0; (Operand & 1) == 0; BitIndex++, Operand >>= 1);
+ for (BitIndex = 0; 0 == (Operand & 1); BitIndex++, Operand >>= 1);
return BitIndex;
}
diff --git a/MdePkg/Library/BaseLib/Math64.c b/MdePkg/Library/BaseLib/Math64.c index 43dd575f09..02a29fb73f 100644 --- a/MdePkg/Library/BaseLib/Math64.c +++ b/MdePkg/Library/BaseLib/Math64.c @@ -361,6 +361,7 @@ InternalMathDivRemU64x64 ( **/
INT64
+EFIAPI
InternalMathDivRemS64x64 (
IN INT64 Dividend,
IN INT64 Divisor,
diff --git a/MdePkg/Library/BaseLib/String.c b/MdePkg/Library/BaseLib/String.c index 909262e587..bdfa7a3c6d 100644 --- a/MdePkg/Library/BaseLib/String.c +++ b/MdePkg/Library/BaseLib/String.c @@ -193,7 +193,7 @@ StrLen ( @param String Pointer to a Null-terminated Unicode string.
- @return The size of String.
+ @return The size in bytes of String.
**/
UINTN
@@ -291,7 +291,7 @@ StrnCmp ( IN UINTN Length
)
{
- if (Length == 0) {
+ if (0 == Length) {
return 0;
}
@@ -469,7 +469,7 @@ StrStr ( SearchStringTmp++;
}
- if (*SearchStringTmp == '\0') {
+ if ('\0' == *SearchStringTmp) {
return (CHAR16 *) FirstMatch;
}
@@ -641,14 +641,14 @@ StrDecimalToUintn ( //
// Ignore the pad spaces (space or tab)
//
- while ((*String == L' ') || (*String == L'\t')) {
+ while ((L' ' ==*String) || (L'\t' == *String)) {
String++;
}
//
// Ignore leading Zeros after the spaces
//
- while (*String == L'0') {
+ while (L'0' == *String) {
String++;
}
@@ -660,7 +660,7 @@ StrDecimalToUintn ( // to the range defined by UINTN, then ASSERT().
//
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)
);
@@ -723,14 +723,14 @@ StrDecimalToUint64 ( //
// Ignore the pad spaces (space or tab)
//
- while ((*String == L' ') || (*String == L'\t')) {
+ while ((L' ' == *String) || (L'\t' == *String)) {
String++;
}
//
// Ignore leading Zeros after the spaces
//
- while (*String == L'0') {
+ while (L'0' == *String) {
String++;
}
@@ -742,7 +742,7 @@ StrDecimalToUint64 ( // to the range defined by UINTN, then ASSERT().
//
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)
);
@@ -805,19 +805,19 @@ StrHexToUintn ( //
// Ignore the pad spaces (space or tab)
//
- while ((*String == L' ') || (*String == L'\t')) {
+ while ((L' ' == *String) || (L'\t' == *String)) {
String++;
}
//
// Ignore leading Zeros after the spaces
//
- while (*String == L'0') {
+ while (L'0' == *String) {
String++;
}
if (InternalCharToUpper (*String) == L'X') {
- ASSERT (*(String - 1) == L'0');
+ ASSERT (L'0' == *(String - 1));
if (*(String - 1) != L'0') {
return 0;
}
@@ -835,7 +835,7 @@ StrHexToUintn ( // to the range defined by UINTN, then ASSERT().
//
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))
);
@@ -899,19 +899,19 @@ StrHexToUint64 ( //
// Ignore the pad spaces (space or tab)
//
- while ((*String == L' ') || (*String == L'\t')) {
+ while ((L' ' == *String) || (L'\t' == *String)) {
String++;
}
//
// Ignore leading Zeros after the spaces
//
- while (*String == L'0') {
+ while (L'0' == *String) {
String++;
}
if (InternalCharToUpper (*String) == L'X') {
- ASSERT (*(String - 1) == L'0');
+ ASSERT (L'0' == *(String - 1));
if (*(String - 1) != L'0') {
return 0;
}
@@ -929,7 +929,7 @@ StrHexToUint64 ( // to the range defined by UINTN, then ASSERT().
//
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))
);
@@ -1153,7 +1153,7 @@ AsciiStrnCpy ( {
CHAR8 *ReturnValue;
- if (Length == 0) {
+ if (0 == Length) {
return Destination;
}
@@ -1432,7 +1432,7 @@ AsciiStrnCmp ( IN UINTN Length
)
{
- if (Length == 0) {
+ if (0 == Length) {
return 0;
}
@@ -1662,14 +1662,14 @@ AsciiStrDecimalToUintn ( //
// Ignore the pad spaces (space or tab)
//
- while ((*String == ' ') || (*String == '\t')) {
+ while ((' ' == *String) || ('\t' == *String)) {
String++;
}
//
// Ignore leading Zeros after the spaces
//
- while (*String == '0') {
+ while ('0' == *String) {
String++;
}
@@ -1681,7 +1681,7 @@ AsciiStrDecimalToUintn ( // to the range defined by UINTN, then ASSERT().
//
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)
);
@@ -1739,14 +1739,14 @@ AsciiStrDecimalToUint64 ( //
// Ignore the pad spaces (space or tab)
//
- while ((*String == ' ') || (*String == '\t')) {
+ while ((' ' == *String) || ('\t' == *String)) {
String++;
}
//
// Ignore leading Zeros after the spaces
//
- while (*String == '0') {
+ while ('0' == *String) {
String++;
}
@@ -1758,7 +1758,7 @@ AsciiStrDecimalToUint64 ( // to the range defined by UINTN, then ASSERT().
//
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)
);
@@ -1819,19 +1819,19 @@ AsciiStrHexToUintn ( //
// Ignore the pad spaces (space or tab)
//
- while ((*String == ' ') || (*String == '\t')) {
+ while ((' ' == *String) || ('\t' == *String)) {
String++;
}
//
// Ignore leading Zeros after the spaces
//
- while (*String == '0') {
+ while ('0' == *String) {
String++;
}
if (AsciiToUpper (*String) == 'X') {
- ASSERT (*(String - 1) == '0');
+ ASSERT ('0' == *(String - 1));
if (*(String - 1) != '0') {
return 0;
}
@@ -1849,7 +1849,7 @@ AsciiStrHexToUintn ( // to the range defined by UINTN, then ASSERT().
//
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))
);
@@ -1914,19 +1914,19 @@ AsciiStrHexToUint64 ( //
// Ignore the pad spaces (space or tab)
//
- while ((*String == ' ') || (*String == '\t')) {
+ while ((' ' == *String) || ('\t' == *String)) {
String++;
}
//
// Ignore leading Zeros after the spaces
//
- while (*String == '0') {
+ while ('0' == *String) {
String++;
}
if (AsciiToUpper (*String) == 'X') {
- ASSERT (*(String - 1) == '0');
+ ASSERT ('0' == *(String - 1));
if (*(String - 1) != '0') {
return 0;
}
@@ -1944,7 +1944,7 @@ AsciiStrHexToUint64 ( // to the range defined by UINTN, then ASSERT().
//
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))
);
diff --git a/MdePkg/Library/BaseLib/Synchronization.c b/MdePkg/Library/BaseLib/Synchronization.c index f1565db3fd..8e8a2bf7e1 100644 --- a/MdePkg/Library/BaseLib/Synchronization.c +++ b/MdePkg/Library/BaseLib/Synchronization.c @@ -44,7 +44,6 @@ GetSpinLockProperties ( VOID
)
{
- // @bug May use a PCD entry to determine this alignment.
return 32;
}
@@ -61,7 +60,7 @@ GetSpinLockProperties ( @param SpinLock A pointer to the spin lock to initialize to the released
state.
- @return SpinLock
+ @return SpinLock initialized in release state.
**/
SPIN_LOCK *
@@ -92,7 +91,7 @@ InitializeSpinLock ( @param SpinLock A pointer to the spin lock to place in the acquired state.
- @return SpinLock
+ @return SpinLock aquired lock.
**/
SPIN_LOCK *
@@ -190,7 +189,7 @@ AcquireSpinLockOrFail ( ASSERT (SpinLock != NULL);
LockValue = *SpinLock;
- ASSERT (LockValue == SPIN_LOCK_ACQUIRED || LockValue == SPIN_LOCK_RELEASED);
+ ASSERT (SPIN_LOCK_ACQUIRED == LockValue || SPIN_LOCK_RELEASED == LockValue);
return (BOOLEAN)(
InterlockedCompareExchangePointer (
@@ -226,7 +225,7 @@ ReleaseSpinLock ( ASSERT (SpinLock != NULL);
LockValue = *SpinLock;
- ASSERT (LockValue == SPIN_LOCK_ACQUIRED || LockValue == SPIN_LOCK_RELEASED);
+ ASSERT (SPIN_LOCK_ACQUIRED == LockValue || SPIN_LOCK_RELEASED == LockValue);
*SpinLock = SPIN_LOCK_RELEASED;
return SpinLock;
@@ -358,6 +357,8 @@ InterlockedCompareExchange64 ( operation.
@param CompareValue Pointer value used in compare operation.
@param ExchangeValue Pointer value used in exchange operation.
+
+ @return The original *Value before exchange.
**/
VOID *
diff --git a/MdePkg/Library/BaseLib/SynchronizationGcc.c b/MdePkg/Library/BaseLib/SynchronizationGcc.c index 4c30dbc4b1..67a8f17be3 100644 --- a/MdePkg/Library/BaseLib/SynchronizationGcc.c +++ b/MdePkg/Library/BaseLib/SynchronizationGcc.c @@ -49,7 +49,6 @@ GetSpinLockProperties ( VOID
)
{
- // @bug May use a PCD entry to determine this alignment.
return 32;
}
@@ -66,7 +65,7 @@ GetSpinLockProperties ( @param SpinLock A pointer to the spin lock to initialize to the released
state.
- @return SpinLock
+ @return SpinLock in release state.
**/
SPIN_LOCK *
@@ -101,7 +100,7 @@ InitializeSpinLock ( @param SpinLock A pointer to the spin lock to place in the acquired state.
- @return SpinLock
+ @return SpinLock accquired lock.
**/
SPIN_LOCK *
@@ -224,7 +223,7 @@ AcquireSpinLockOrFail ( @param SpinLock A pointer to the spin lock to release.
- @return SpinLock
+ @return SpinLock released lock.
**/
SPIN_LOCK *
@@ -374,6 +373,7 @@ InterlockedCompareExchange64 ( @param CompareValue Pointer value used in compare operation.
@param ExchangeValue Pointer value used in exchange operation.
+ @return The original *Value before exchange.
**/
VOID *
EFIAPI
diff --git a/MdePkg/Library/BaseLib/SynchronizationMsc.c b/MdePkg/Library/BaseLib/SynchronizationMsc.c index 0bc60259b1..a4fc399387 100644 --- a/MdePkg/Library/BaseLib/SynchronizationMsc.c +++ b/MdePkg/Library/BaseLib/SynchronizationMsc.c @@ -51,7 +51,6 @@ GetSpinLockProperties ( VOID
)
{
- // @bug May use a PCD entry to determine this alignment.
return 32;
}
@@ -68,7 +67,7 @@ GetSpinLockProperties ( @param SpinLock A pointer to the spin lock to initialize to the released
state.
- @return SpinLock
+ @return SpinLock in released state.
**/
SPIN_LOCK *
@@ -103,7 +102,7 @@ InitializeSpinLock ( @param SpinLock A pointer to the spin lock to place in the acquired state.
- @return SpinLock
+ @return SpinLock aquiring lock.
**/
SPIN_LOCK *
@@ -226,7 +225,7 @@ AcquireSpinLockOrFail ( @param SpinLock A pointer to the spin lock to release.
- @return SpinLock
+ @return SpinLock releasing lock.
**/
SPIN_LOCK *
@@ -375,6 +374,8 @@ InterlockedCompareExchange64 ( operation.
@param CompareValue Pointer value used in compare operation.
@param ExchangeValue Pointer value used in exchange operation.
+
+ @return The original *Value before exchange.
**/
VOID *
diff --git a/MdePkg/Library/BaseLib/Unaligned.c b/MdePkg/Library/BaseLib/Unaligned.c index e7b19e4dee..49518c0287 100644 --- a/MdePkg/Library/BaseLib/Unaligned.c +++ b/MdePkg/Library/BaseLib/Unaligned.c @@ -28,7 +28,7 @@ @param Buffer Pointer to a 16-bit value that may be unaligned.
- @return *Uint16
+ @return Data read from Buffer.
**/
UINT16
@@ -54,7 +54,7 @@ ReadUnaligned16 ( @param Buffer Pointer to a 16-bit value that may be unaligned.
@param Value 16-bit value to write to Buffer.
- @return Value
+ @return Value written to Buffer
**/
UINT16
@@ -79,7 +79,7 @@ WriteUnaligned16 ( @param Buffer Pointer to a 24-bit value that may be unaligned.
- @return The value read.
+ @return The value read from Buffer.
**/
UINT32
@@ -105,7 +105,7 @@ ReadUnaligned24 ( @param Buffer Pointer to a 24-bit value that may be unaligned.
@param Value 24-bit value to write to Buffer.
- @return The value written.
+ @return The value written to Buffer.
**/
UINT32
@@ -131,7 +131,7 @@ WriteUnaligned24 ( @param Buffer Pointer to a 32-bit value that may be unaligned.
- @return *Uint32
+ @return Data read from Buffer.
**/
UINT32
@@ -157,7 +157,7 @@ ReadUnaligned32 ( @param Buffer Pointer to a 32-bit value that may be unaligned.
@param Value 32-bit value to write to Buffer.
- @return Value
+ @return Value written to Buffer
**/
UINT32
@@ -182,7 +182,7 @@ WriteUnaligned32 ( @param Buffer Pointer to a 64-bit value that may be unaligned.
- @return *Uint64
+ @return Data read from Buffer.
**/
UINT64
@@ -208,7 +208,7 @@ ReadUnaligned64 ( @param Buffer Pointer to a 64-bit value that may be unaligned.
@param Value 64-bit value to write to Buffer.
- @return Value
+ @return Value written to Buffer.
**/
UINT64
diff --git a/MdePkg/Library/BaseLib/x86FxRestore.c b/MdePkg/Library/BaseLib/x86FxRestore.c index 3da5ae202c..40410ecbbd 100644 --- a/MdePkg/Library/BaseLib/x86FxRestore.c +++ b/MdePkg/Library/BaseLib/x86FxRestore.c @@ -40,12 +40,12 @@ AsmFxRestore ( )
{
ASSERT (Buffer != NULL);
- ASSERT (((UINTN)Buffer & 0xf) == 0);
+ ASSERT (0 == ((UINTN)Buffer & 0xf));
//
// 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);
}
diff --git a/MdePkg/Library/BaseLib/x86FxSave.c b/MdePkg/Library/BaseLib/x86FxSave.c index 2f44c55543..6b8173d724 100644 --- a/MdePkg/Library/BaseLib/x86FxSave.c +++ b/MdePkg/Library/BaseLib/x86FxSave.c @@ -39,7 +39,7 @@ AsmFxSave ( )
{
ASSERT (Buffer != NULL);
- ASSERT (((UINTN)Buffer & 0xf) == 0);
+ ASSERT (0 == ((UINTN)Buffer & 0xf));
InternalX86FxSave (Buffer);
diff --git a/MdePkg/Library/BaseLib/x86GetInterruptState.c b/MdePkg/Library/BaseLib/x86GetInterruptState.c index 613d012f85..6898b8db51 100644 --- a/MdePkg/Library/BaseLib/x86GetInterruptState.c +++ b/MdePkg/Library/BaseLib/x86GetInterruptState.c @@ -37,7 +37,7 @@ GetInterruptState ( IA32_EFLAGS32 EFlags;
EFlags.UintN = AsmReadEflags ();
- return (BOOLEAN)(EFlags.Bits.IF == 1);
+ return (BOOLEAN)(1 == EFlags.Bits.IF);
}
|