Make MDE package pass intel IPF compiler with /W4 /WX switched on.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2312 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -575,4 +575,219 @@ InternalX86DisablePaging64 (
|
||||
IN UINT32 NewStack
|
||||
);
|
||||
|
||||
/**
|
||||
Worker function that locates the Node in the List
|
||||
|
||||
By searching the List, finds the location of the Node in List. At the same time,
|
||||
verifies the validity of this list.
|
||||
|
||||
If List is NULL, then ASSERT().
|
||||
If List->ForwardLink is NULL, then ASSERT().
|
||||
If List->backLink is NULL, then ASSERT().
|
||||
If Node is NULL, then ASSERT();
|
||||
If PcdMaximumLinkedListLenth is not zero, and prior to insertion the number
|
||||
of nodes in ListHead, including the ListHead node, is greater than or
|
||||
equal to PcdMaximumLinkedListLength, then ASSERT().
|
||||
|
||||
@param List A pointer to a node in a linked list.
|
||||
@param Node A pointer to one nod.
|
||||
|
||||
@retval TRUE Node is in List
|
||||
@retval FALSE Node isn't in List, or List is invalid
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
IsNodeInList (
|
||||
IN CONST LIST_ENTRY *List,
|
||||
IN CONST LIST_ENTRY *Node
|
||||
);
|
||||
|
||||
/**
|
||||
Performs an atomic increment of an 32-bit unsigned integer.
|
||||
|
||||
Performs an atomic increment of the 32-bit unsigned integer specified by
|
||||
Value and returns the incremented value. The increment operation must be
|
||||
performed using MP safe mechanisms. The state of the return value is not
|
||||
guaranteed to be MP safe.
|
||||
|
||||
@param Value A pointer to the 32-bit value to increment.
|
||||
|
||||
@return The incremented value.
|
||||
|
||||
**/
|
||||
UINT32
|
||||
EFIAPI
|
||||
InternalSyncIncrement (
|
||||
IN volatile UINT32 *Value
|
||||
);
|
||||
|
||||
/**
|
||||
Performs an atomic decrement of an 32-bit unsigned integer.
|
||||
|
||||
Performs an atomic decrement of the 32-bit unsigned integer specified by
|
||||
Value and returns the decrement value. The decrement operation must be
|
||||
performed using MP safe mechanisms. The state of the return value is not
|
||||
guaranteed to be MP safe.
|
||||
|
||||
@param Value A pointer to the 32-bit value to decrement.
|
||||
|
||||
@return The decrement value.
|
||||
|
||||
**/
|
||||
UINT32
|
||||
EFIAPI
|
||||
InternalSyncDecrement (
|
||||
IN volatile UINT32 *Value
|
||||
);
|
||||
|
||||
/**
|
||||
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 (
|
||||
IN volatile UINT32 *Value,
|
||||
IN UINT32 CompareValue,
|
||||
IN UINT32 ExchangeValue
|
||||
);
|
||||
|
||||
/**
|
||||
Performs an atomic compare exchange operation on a 64-bit unsigned integer.
|
||||
|
||||
Performs an atomic compare exchange operation on the 64-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 64-bit value for the compare exchange
|
||||
operation.
|
||||
@param CompareValue 64-bit value used in compare operation.
|
||||
@param ExchangeValue 64-bit value used in exchange operation.
|
||||
|
||||
@return The original *Value before exchange.
|
||||
|
||||
**/
|
||||
UINT64
|
||||
EFIAPI
|
||||
InternalSyncCompareExchange64 (
|
||||
IN volatile UINT64 *Value,
|
||||
IN UINT64 CompareValue,
|
||||
IN UINT64 ExchangeValue
|
||||
);
|
||||
|
||||
/**
|
||||
Worker function that returns a bit field from Operand
|
||||
|
||||
Returns the bitfield specified by the StartBit and the EndBit from Operand.
|
||||
|
||||
@param Operand Operand on which to perform the bitfield operation.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@param EndBit The ordinal of the most significant bit in the bit field.
|
||||
|
||||
@return The bit field read.
|
||||
|
||||
**/
|
||||
unsigned int
|
||||
BitFieldReadUint (
|
||||
IN unsigned int Operand,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit
|
||||
);
|
||||
|
||||
/**
|
||||
Worker function that reads a bit field from Operand, performs a bitwise OR,
|
||||
and returns the result.
|
||||
|
||||
Performs a bitwise OR between the bit field specified by StartBit and EndBit
|
||||
in Operand and the value specified by AndData. All other bits in Operand are
|
||||
preserved. The new value is returned.
|
||||
|
||||
@param Operand Operand on which to perform the bitfield operation.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@param EndBit The ordinal of the most significant bit in the bit field.
|
||||
@param OrData The value to OR with the read value from the value
|
||||
|
||||
@return The new value.
|
||||
|
||||
**/
|
||||
unsigned int
|
||||
BitFieldOrUint (
|
||||
IN unsigned int Operand,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN unsigned int OrData
|
||||
);
|
||||
|
||||
/**
|
||||
Worker function that reads a bit field from Operand, performs a bitwise AND,
|
||||
and returns the result.
|
||||
|
||||
Performs a bitwise AND between the bit field specified by StartBit and EndBit
|
||||
in Operand and the value specified by AndData. All other bits in Operand are
|
||||
preserved. The new value is returned.
|
||||
|
||||
@param Operand Operand on which to perform the bitfield operation.
|
||||
@param StartBit The ordinal of the least significant bit in the bit field.
|
||||
@param EndBit The ordinal of the most significant bit in the bit field.
|
||||
@param AndData The value to And with the read value from the value
|
||||
|
||||
@return The new value.
|
||||
|
||||
**/
|
||||
unsigned int
|
||||
BitFieldAndUint (
|
||||
IN unsigned int Operand,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN unsigned int AndData
|
||||
);
|
||||
|
||||
/**
|
||||
Worker function that checks ASSERT condition for JumpBuffer
|
||||
|
||||
Checks ASSERT condition for JumpBuffer.
|
||||
|
||||
If JumpBuffer is NULL, then ASSERT().
|
||||
For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
|
||||
|
||||
@param JumpBuffer A pointer to CPU context buffer.
|
||||
|
||||
**/
|
||||
VOID
|
||||
InternalAssertJumpBuffer (
|
||||
IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
|
||||
);
|
||||
|
||||
/**
|
||||
Restores the CPU context that was saved with SetJump().
|
||||
|
||||
Restores the CPU context from the buffer specified by JumpBuffer.
|
||||
This function never returns to the caller.
|
||||
Instead is resumes execution based on the state of JumpBuffer.
|
||||
|
||||
@param JumpBuffer A pointer to CPU context buffer.
|
||||
@param Value The value to return when the SetJump() context is restored.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
InternalLongJump (
|
||||
IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
|
||||
IN UINTN Value
|
||||
);
|
||||
|
||||
#endif
|
||||
|
@@ -14,6 +14,8 @@
|
||||
|
||||
**/
|
||||
|
||||
#include "BaseLibInternals.h"
|
||||
|
||||
/**
|
||||
Worker function that returns a bit field from Operand
|
||||
|
||||
@@ -763,10 +765,16 @@ BitFieldOr64 (
|
||||
IN UINT64 OrData
|
||||
)
|
||||
{
|
||||
UINT64 Value1;
|
||||
UINT64 Value2;
|
||||
|
||||
ASSERT (EndBit < sizeof (Operand) * 8);
|
||||
ASSERT (StartBit <= EndBit);
|
||||
return Operand |
|
||||
(LShiftU64 (OrData, StartBit) & ~LShiftU64 ((UINT64)-2, EndBit));
|
||||
|
||||
Value1 = LShiftU64 (OrData, StartBit);
|
||||
Value2 = LShiftU64 ((UINT64) - 2, EndBit);
|
||||
|
||||
return Operand | (Value1 & ~Value2);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -801,10 +809,16 @@ BitFieldAnd64 (
|
||||
IN UINT64 AndData
|
||||
)
|
||||
{
|
||||
UINT64 Value1;
|
||||
UINT64 Value2;
|
||||
|
||||
ASSERT (EndBit < sizeof (Operand) * 8);
|
||||
ASSERT (StartBit <= EndBit);
|
||||
return Operand &
|
||||
~(LShiftU64 (~AndData, StartBit) & ~LShiftU64 ((UINT64)-2, EndBit));
|
||||
|
||||
Value1 = LShiftU64 (~AndData, StartBit);
|
||||
Value2 = LShiftU64 ((UINT64)-2, EndBit);
|
||||
|
||||
return Operand & ~(Value1 & ~Value2);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -14,30 +14,7 @@
|
||||
|
||||
**/
|
||||
|
||||
/**
|
||||
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 (
|
||||
IN volatile UINT32 *Value,
|
||||
IN UINT32 CompareValue,
|
||||
IN UINT32 ExchangeValue
|
||||
);
|
||||
#include "BaseLibInternals.h"
|
||||
|
||||
/**
|
||||
Performs an atomic increment of an 32-bit unsigned integer.
|
||||
|
@@ -143,12 +143,15 @@ ReadUnaligned32 (
|
||||
IN CONST UINT32 *Buffer
|
||||
)
|
||||
{
|
||||
UINT16 LowerBytes;
|
||||
UINT16 HigherBytes;
|
||||
|
||||
ASSERT (Buffer != NULL);
|
||||
|
||||
return (UINT32)(
|
||||
ReadUnaligned16 ((UINT16*)Buffer) |
|
||||
(ReadUnaligned16 ((UINT16*)Buffer + 1) << 16)
|
||||
);
|
||||
LowerBytes = ReadUnaligned16 ((UINT16*) Buffer);
|
||||
HigherBytes = ReadUnaligned16 ((UINT16*) Buffer + 1);
|
||||
|
||||
return (UINT32) (LowerBytes | (HigherBytes << 16));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -199,12 +202,15 @@ ReadUnaligned64 (
|
||||
IN CONST UINT64 *Buffer
|
||||
)
|
||||
{
|
||||
UINT32 LowerBytes;
|
||||
UINT32 HigherBytes;
|
||||
|
||||
ASSERT (Buffer != NULL);
|
||||
|
||||
return (UINT64)(
|
||||
ReadUnaligned32 ((UINT32*)Buffer) |
|
||||
LShiftU64 (ReadUnaligned32 ((UINT32*)Buffer + 1), 32)
|
||||
);
|
||||
LowerBytes = ReadUnaligned32 ((UINT32*) Buffer);
|
||||
HigherBytes = ReadUnaligned32 ((UINT32*) Buffer + 1);
|
||||
|
||||
return (UINT64) (LowerBytes | LShiftU64 (HigherBytes, 32));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -14,6 +14,8 @@
|
||||
|
||||
**/
|
||||
|
||||
#include "BaseLibInternals.h"
|
||||
|
||||
/**
|
||||
Worker function that locates the Node in the List
|
||||
|
||||
|
@@ -14,39 +14,7 @@
|
||||
|
||||
**/
|
||||
|
||||
/**
|
||||
Worker function that checks ASSERT condition for JumpBuffer
|
||||
|
||||
Checks ASSERT condition for JumpBuffer.
|
||||
|
||||
If JumpBuffer is NULL, then ASSERT().
|
||||
For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
|
||||
|
||||
@param JumpBuffer A pointer to CPU context buffer.
|
||||
|
||||
**/
|
||||
VOID
|
||||
InternalAssertJumpBuffer (
|
||||
IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
|
||||
);
|
||||
|
||||
/**
|
||||
Restores the CPU context that was saved with SetJump().
|
||||
|
||||
Restores the CPU context from the buffer specified by JumpBuffer.
|
||||
This function never returns to the caller.
|
||||
Instead is resumes execution based on the state of JumpBuffer.
|
||||
|
||||
@param JumpBuffer A pointer to CPU context buffer.
|
||||
@param Value The value to return when the SetJump() context is restored.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
InternalLongJump (
|
||||
IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
|
||||
IN UINTN Value
|
||||
);
|
||||
#include "BaseLibInternals.h"
|
||||
|
||||
/**
|
||||
Restores the CPU context that was saved with SetJump().
|
||||
|
@@ -85,10 +85,13 @@ InternalMathARShiftU64 (
|
||||
IN UINTN Count
|
||||
)
|
||||
{
|
||||
INTN TestValue;
|
||||
|
||||
//
|
||||
// Test if this compiler supports arithmetic shift
|
||||
//
|
||||
if ((((-1) << (sizeof (-1) * 8 - 1)) >> (sizeof (-1) * 8 - 1)) == -1) {
|
||||
TestValue = (((-1) << (sizeof (-1) * 8 - 1)) >> (sizeof (-1) * 8 - 1));
|
||||
if (TestValue == -1) {
|
||||
//
|
||||
// Arithmetic shift is supported
|
||||
//
|
||||
@@ -169,10 +172,13 @@ InternalMathSwapBytes64 (
|
||||
IN UINT64 Operand
|
||||
)
|
||||
{
|
||||
return (UINT64)(
|
||||
((UINT64)SwapBytes32 ((UINT32)Operand) << 32) |
|
||||
((UINT64)SwapBytes32 ((UINT32)(Operand >> 32)))
|
||||
);
|
||||
UINT64 LowerBytes;
|
||||
UINT64 HigherBytes;
|
||||
|
||||
LowerBytes = (UINT64) SwapBytes32 ((UINT32) Operand);
|
||||
HigherBytes = (UINT64) SwapBytes32 ((UINT32) (Operand >> 32));
|
||||
|
||||
return (LowerBytes << 32 | HigherBytes);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -14,6 +14,8 @@
|
||||
|
||||
**/
|
||||
|
||||
#include "BaseLibInternals.h"
|
||||
|
||||
/**
|
||||
Worker function that checks ASSERT condition for JumpBuffer
|
||||
|
||||
|
@@ -636,7 +636,7 @@ AsciiToUpper (
|
||||
IN CHAR8 Chr
|
||||
)
|
||||
{
|
||||
return (Chr >= 'a' && Chr <= 'z') ? Chr - ('a' - 'A') : Chr;
|
||||
return (UINT8) ((Chr >= 'a' && Chr <= 'z') ? Chr - ('a' - 'A') : Chr);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -675,19 +675,25 @@ AsciiStriCmp (
|
||||
IN CONST CHAR8 *SecondString
|
||||
)
|
||||
{
|
||||
CHAR8 UpperFirstString;
|
||||
CHAR8 UpperSecondString;
|
||||
|
||||
//
|
||||
// ASSERT both strings are less long than PcdMaximumAsciiStringLength
|
||||
//
|
||||
ASSERT (AsciiStrSize (FirstString));
|
||||
ASSERT (AsciiStrSize (SecondString));
|
||||
|
||||
while ((*FirstString != '\0') &&
|
||||
(AsciiToUpper (*FirstString) == AsciiToUpper (*SecondString))) {
|
||||
UpperFirstString = AsciiToUpper (*FirstString);
|
||||
UpperSecondString = AsciiToUpper (*SecondString);
|
||||
while ((*FirstString != '\0') && (UpperFirstString == UpperSecondString)) {
|
||||
FirstString++;
|
||||
SecondString++;
|
||||
UpperFirstString = AsciiToUpper (*FirstString);
|
||||
UpperSecondString = AsciiToUpper (*SecondString);
|
||||
}
|
||||
|
||||
return AsciiToUpper (*FirstString) - AsciiToUpper (*SecondString);
|
||||
return UpperFirstString - UpperSecondString;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -861,7 +867,7 @@ DecimalToBcd8 (
|
||||
)
|
||||
{
|
||||
ASSERT (Value < 100);
|
||||
return ((Value / 10) << 4) | (Value % 10);
|
||||
return (UINT8) (((Value / 10) << 4) | (Value % 10));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -886,5 +892,5 @@ BcdToDecimal8 (
|
||||
{
|
||||
ASSERT (Value < 0xa0);
|
||||
ASSERT ((Value & 0xf) < 0xa);
|
||||
return (Value >> 4) * 10 + (Value & 0xf);
|
||||
return (UINT8) ((Value >> 4) * 10 + (Value & 0xf));
|
||||
}
|
||||
|
@@ -32,5 +32,5 @@ SwapBytes16 (
|
||||
IN UINT16 Operand
|
||||
)
|
||||
{
|
||||
return (Operand << 8) | (Operand >> 8);
|
||||
return (UINT16) ((Operand << 8) | (Operand >> 8));
|
||||
}
|
||||
|
@@ -32,8 +32,11 @@ SwapBytes32 (
|
||||
IN UINT32 Operand
|
||||
)
|
||||
{
|
||||
return (UINT32)(
|
||||
((UINT32)SwapBytes16 ((UINT16)Operand) << 16) |
|
||||
((UINT32)SwapBytes16 ((UINT16)(Operand >> 16)))
|
||||
);
|
||||
UINT32 LowerBytes;
|
||||
UINT32 HigherBytes;
|
||||
|
||||
LowerBytes = (UINT32) SwapBytes16 ((UINT16) Operand);
|
||||
HigherBytes = (UINT32) SwapBytes16 ((UINT16) (Operand >> 16));
|
||||
|
||||
return (LowerBytes << 16 | HigherBytes);
|
||||
}
|
||||
|
@@ -14,96 +14,11 @@
|
||||
|
||||
**/
|
||||
|
||||
#include "BaseLibInternals.h"
|
||||
|
||||
#define SPIN_LOCK_RELEASED ((SPIN_LOCK)1)
|
||||
#define SPIN_LOCK_ACQUIRED ((SPIN_LOCK)2)
|
||||
|
||||
/**
|
||||
Performs an atomic increment of an 32-bit unsigned integer.
|
||||
|
||||
Performs an atomic increment of the 32-bit unsigned integer specified by
|
||||
Value and returns the incremented value. The increment operation must be
|
||||
performed using MP safe mechanisms. The state of the return value is not
|
||||
guaranteed to be MP safe.
|
||||
|
||||
@param Value A pointer to the 32-bit value to increment.
|
||||
|
||||
@return The incremented value.
|
||||
|
||||
**/
|
||||
UINT32
|
||||
EFIAPI
|
||||
InternalSyncIncrement (
|
||||
IN volatile UINT32 *Value
|
||||
);
|
||||
|
||||
/**
|
||||
Performs an atomic decrement of an 32-bit unsigned integer.
|
||||
|
||||
Performs an atomic decrement of the 32-bit unsigned integer specified by
|
||||
Value and returns the decrement value. The decrement operation must be
|
||||
performed using MP safe mechanisms. The state of the return value is not
|
||||
guaranteed to be MP safe.
|
||||
|
||||
@param Value A pointer to the 32-bit value to decrement.
|
||||
|
||||
@return The decrement value.
|
||||
|
||||
**/
|
||||
UINT32
|
||||
EFIAPI
|
||||
InternalSyncDecrement (
|
||||
IN volatile UINT32 *Value
|
||||
);
|
||||
|
||||
/**
|
||||
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 (
|
||||
IN volatile UINT32 *Value,
|
||||
IN UINT32 CompareValue,
|
||||
IN UINT32 ExchangeValue
|
||||
);
|
||||
|
||||
/**
|
||||
Performs an atomic compare exchange operation on a 64-bit unsigned integer.
|
||||
|
||||
Performs an atomic compare exchange operation on the 64-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 64-bit value for the compare exchange
|
||||
operation.
|
||||
@param CompareValue 64-bit value used in compare operation.
|
||||
@param ExchangeValue 64-bit value used in exchange operation.
|
||||
|
||||
@return The original *Value before exchange.
|
||||
|
||||
**/
|
||||
UINT64
|
||||
EFIAPI
|
||||
InternalSyncCompareExchange64 (
|
||||
IN volatile UINT64 *Value,
|
||||
IN UINT64 CompareValue,
|
||||
IN UINT64 ExchangeValue
|
||||
);
|
||||
|
||||
/**
|
||||
Retrieves the architecture specific spin lock alignment requirements for
|
||||
optimal spin lock performance.
|
||||
@@ -419,7 +334,11 @@ InterlockedCompareExchangePointer (
|
||||
IN VOID *ExchangeValue
|
||||
)
|
||||
{
|
||||
switch (sizeof (*Value)) {
|
||||
UINT8 SizeOfValue;
|
||||
|
||||
SizeOfValue = sizeof (*Value);
|
||||
|
||||
switch (SizeOfValue) {
|
||||
case sizeof (UINT32):
|
||||
return (VOID*)(UINTN)InterlockedCompareExchange32 (
|
||||
(UINT32*)Value,
|
||||
|
Reference in New Issue
Block a user