]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange64.c
2 InterlockedCompareExchange64 function
4 Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
10 Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.
14 _InterlockedCompareExchange64 (
15 __int64
volatile *Destination
,
20 #pragma intrinsic(_InterlockedCompareExchange64)
23 Performs an atomic compare exchange operation on a 64-bit unsigned integer.
25 Performs an atomic compare exchange operation on the 64-bit unsigned integer specified
26 by Value. If Value is equal to CompareValue, then Value is set to ExchangeValue and
27 CompareValue is returned. If Value is not equal to CompareValue, then Value is returned.
28 The compare exchange operation must be performed using MP safe mechanisms.
30 @param Value A pointer to the 64-bit value for the compare exchange
32 @param CompareValue 64-bit value used in compare operation.
33 @param ExchangeValue 64-bit value used in exchange operation.
35 @return The original *Value before exchange.
40 InternalSyncCompareExchange64 (
41 IN
volatile UINT64
*Value
,
42 IN UINT64 CompareValue
,
43 IN UINT64 ExchangeValue
46 return _InterlockedCompareExchange64 (Value
, ExchangeValue
, CompareValue
);