]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompareExchange16.nasm
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseSynchronizationLib / Ia32 / InterlockedCompareExchange16.nasm
1 ;------------------------------------------------------------------------------
2 ;
3 ; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
4 ; Copyright (c) 2015, Linaro Ltd. All rights reserved.<BR>
5 ; SPDX-License-Identifier: BSD-2-Clause-Patent
6 ;
7 ; Module Name:
8 ;
9 ; InterlockedCompareExchange16.Asm
10 ;
11 ; Abstract:
12 ;
13 ; InterlockedCompareExchange16 function
14 ;
15 ; Notes:
16 ;
17 ;------------------------------------------------------------------------------
18
19 SECTION .text
20
21 ;------------------------------------------------------------------------------
22 ; UINT16
23 ; EFIAPI
24 ; InternalSyncCompareExchange16 (
25 ; IN volatile UINT16 *Value,
26 ; IN UINT16 CompareValue,
27 ; IN UINT16 ExchangeValue
28 ; );
29 ;------------------------------------------------------------------------------
30 global ASM_PFX(InternalSyncCompareExchange16)
31 ASM_PFX(InternalSyncCompareExchange16):
32 mov ecx, [esp + 4]
33 mov ax, [esp + 8]
34 mov dx, [esp + 12]
35 lock cmpxchg [ecx], dx
36 ret
37