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