]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange16.nasm
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseSynchronizationLib / X64 / 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 DEFAULT REL
20 SECTION .text
21
22 ;------------------------------------------------------------------------------
23 ; UINT16
24 ; EFIAPI
25 ; InternalSyncCompareExchange16 (
26 ; IN volatile UINT16 *Value,
27 ; IN UINT16 CompareValue,
28 ; IN UINT16 ExchangeValue
29 ; );
30 ;------------------------------------------------------------------------------
31 global ASM_PFX(InternalSyncCompareExchange16)
32 ASM_PFX(InternalSyncCompareExchange16):
33 mov ax, dx
34 lock cmpxchg [rcx], r8w
35 ret
36