]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompareExchange16.c
2 InterlockedCompareExchange16 function
4 Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
5 Copyright (c) 2015, Linaro Ltd. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
14 Performs an atomic compare exchange operation on a 16-bit unsigned integer.
16 Performs an atomic compare exchange operation on the 16-bit unsigned integer
17 specified by Value. If Value is equal to CompareValue, then Value is set to
18 ExchangeValue and CompareValue is returned. If Value is not equal to CompareValue,
19 then Value is returned. The compare exchange operation must be performed using
22 @param Value A pointer to the 16-bit value for the compare exchange
24 @param CompareValue 16-bit value used in compare operation.
25 @param ExchangeValue 16-bit value used in exchange operation.
27 @return The original *Value before exchange.
32 InternalSyncCompareExchange16 (
33 IN
volatile UINT16
*Value
,
34 IN UINT16 CompareValue
,
35 IN UINT16 ExchangeValue
42 lock cmpxchg
[ecx
], dx