]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompareExchange64.nasm
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseSynchronizationLib / Ia32 / InterlockedCompareExchange64.nasm
CommitLineData
5a59c50e
JJ
1;------------------------------------------------------------------------------\r
2;\r
4cee954e 3; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
9344f092 4; SPDX-License-Identifier: BSD-2-Clause-Patent\r
5a59c50e
JJ
5;\r
6; Module Name:\r
7;\r
8; InterlockedCompareExchange64.Asm\r
9;\r
10; Abstract:\r
11;\r
12; InterlockedCompareExchange64 function\r
13;\r
14; Notes:\r
15;\r
16;------------------------------------------------------------------------------\r
17\r
18 SECTION .text\r
19\r
20;------------------------------------------------------------------------------\r
21; UINT64\r
22; EFIAPI\r
23; InternalSyncCompareExchange64 (\r
4cee954e 24; IN volatile UINT64 *Value,\r
5a59c50e
JJ
25; IN UINT64 CompareValue,\r
26; IN UINT64 ExchangeValue\r
27; );\r
28;------------------------------------------------------------------------------\r
29global ASM_PFX(InternalSyncCompareExchange64)\r
30ASM_PFX(InternalSyncCompareExchange64):\r
31 push esi\r
32 push ebx\r
33 mov esi, [esp + 12]\r
34 mov eax, [esp + 16]\r
35 mov edx, [esp + 20]\r
36 mov ebx, [esp + 24]\r
37 mov ecx, [esp + 28]\r
9ba2869c 38 lock cmpxchg8b [esi]\r
5a59c50e
JJ
39 pop ebx\r
40 pop esi\r
41 ret\r
42\r