]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompareExchange32.c
2 InterlockedCompareExchange32 function
4 Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
13 Performs an atomic compare exchange operation on a 32-bit unsigned integer.
15 Performs an atomic compare exchange operation on the 32-bit unsigned integer
16 specified by Value. If Value is equal to CompareValue, then Value is set to
17 ExchangeValue and CompareValue is returned. If Value is not equal to CompareValue,
18 then Value is returned. The compare exchange operation must be performed using
21 @param Value A pointer to the 32-bit value for the compare exchange
23 @param CompareValue 32-bit value used in compare operation.
24 @param ExchangeValue 32-bit value used in exchange operation.
26 @return The original *Value before exchange.
31 InternalSyncCompareExchange32 (
32 IN
volatile UINT32
*Value
,
33 IN UINT32 CompareValue
,
34 IN UINT32 ExchangeValue
40 mov edx
, ExchangeValue
41 lock cmpxchg
[ecx
], edx