11#define SPIN_LOCK_RELEASED ((UINTN) 1)
12#define SPIN_LOCK_ACQUIRED ((UINTN) 2)
61 ASSERT (SpinLock !=
NULL);
62 *SpinLock = SPIN_LOCK_RELEASED;
101 if (
PcdGet32 (PcdSpinLockTimeout) == 0) {
140 Delta = (INT64)(Current - Previous);
150 ASSERT (Total < Timeout);
182 ASSERT (SpinLock !=
NULL);
184 LockValue = *SpinLock;
185 ASSERT (SPIN_LOCK_ACQUIRED == LockValue || SPIN_LOCK_RELEASED == LockValue);
190 (VOID *)SPIN_LOCK_RELEASED,
191 (VOID *)SPIN_LOCK_ACQUIRED
192 ) == (VOID *)SPIN_LOCK_RELEASED
218 ASSERT (SpinLock !=
NULL);
220 LockValue = *SpinLock;
221 ASSERT (SPIN_LOCK_ACQUIRED == LockValue || SPIN_LOCK_RELEASED == LockValue);
223 *SpinLock = SPIN_LOCK_RELEASED;
244 IN volatile UINT32 *Value
247 ASSERT (Value !=
NULL);
268 IN volatile UINT32 *Value
271 ASSERT (Value !=
NULL);
297 IN OUT volatile UINT16 *Value,
298 IN UINT16 CompareValue,
299 IN UINT16 ExchangeValue
302 ASSERT (Value !=
NULL);
328 IN OUT volatile UINT32 *Value,
329 IN UINT32 CompareValue,
330 IN UINT32 ExchangeValue
333 ASSERT (Value !=
NULL);
358 IN OUT volatile UINT64 *Value,
359 IN UINT64 CompareValue,
360 IN UINT64 ExchangeValue
363 ASSERT (Value !=
NULL);
388 IN OUT VOID *
volatile *Value,
389 IN VOID *CompareValue,
390 IN VOID *ExchangeValue
395 SizeOfValue =
sizeof (*Value);
397 switch (SizeOfValue) {
398 case sizeof (UINT32):
400 (
volatile UINT32 *)Value,
401 (UINT32)(
UINTN)CompareValue,
402 (UINT32)(
UINTN)ExchangeValue
404 case sizeof (UINT64):
406 (
volatile UINT64 *)Value,
407 (UINT64)(
UINTN)CompareValue,
408 (UINT64)(
UINTN)ExchangeValue
UINT64 EFIAPI GetPerformanceCounterProperties(OUT UINT64 *StartValue OPTIONAL, OUT UINT64 *EndValue OPTIONAL)
UINT64 EFIAPI GetPerformanceCounter(VOID)
UINT64 EFIAPI DivU64x32(IN UINT64 Dividend, IN UINT32 Divisor)
VOID EFIAPI CpuPause(VOID)
UINT64 EFIAPI MultU64x32(IN UINT64 Multiplicand, IN UINT32 Multiplier)
UINT32 EFIAPI InternalSyncDecrement(IN volatile UINT32 *Value)
UINT32 EFIAPI InternalSyncIncrement(IN volatile UINT32 *Value)
UINT64 EFIAPI InternalSyncCompareExchange64(IN volatile UINT64 *Value, IN UINT64 CompareValue, IN UINT64 ExchangeValue)
UINT32 EFIAPI InternalSyncCompareExchange32(IN volatile UINT32 *Value, IN UINT32 CompareValue, IN UINT32 ExchangeValue)
UINT16 EFIAPI InternalSyncCompareExchange16(IN volatile UINT16 *Value, IN UINT16 CompareValue, IN UINT16 ExchangeValue)
#define PcdGet32(TokenName)
UINT32 EFIAPI InterlockedIncrement(IN volatile UINT32 *Value)
VOID *EFIAPI InterlockedCompareExchangePointer(IN OUT VOID *volatile *Value, IN VOID *CompareValue, IN VOID *ExchangeValue)
SPIN_LOCK *EFIAPI AcquireSpinLock(IN OUT SPIN_LOCK *SpinLock)
UINTN EFIAPI GetSpinLockProperties(VOID)
UINT32 EFIAPI InterlockedCompareExchange32(IN OUT volatile UINT32 *Value, IN UINT32 CompareValue, IN UINT32 ExchangeValue)
UINT16 EFIAPI InterlockedCompareExchange16(IN OUT volatile UINT16 *Value, IN UINT16 CompareValue, IN UINT16 ExchangeValue)
UINT32 EFIAPI InterlockedDecrement(IN volatile UINT32 *Value)
SPIN_LOCK *EFIAPI InitializeSpinLock(OUT SPIN_LOCK *SpinLock)
SPIN_LOCK *EFIAPI ReleaseSpinLock(IN OUT SPIN_LOCK *SpinLock)
BOOLEAN EFIAPI AcquireSpinLockOrFail(IN OUT SPIN_LOCK *SpinLock)
UINT64 EFIAPI InterlockedCompareExchange64(IN OUT volatile UINT64 *Value, IN UINT64 CompareValue, IN UINT64 ExchangeValue)