]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange16.nasm
MdePkg/Include: Add volatile to SynchronizationLib parameters
[mirror_edk2.git] / MdePkg / Library / BaseSynchronizationLib / X64 / InterlockedCompareExchange16.nasm
CommitLineData
a04618e6
JJ
1;------------------------------------------------------------------------------\r
2;\r
3; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
4; Copyright (c) 2015, Linaro Ltd. All rights reserved.<BR>\r
5; This program and the accompanying materials\r
6; are licensed and made available under the terms and conditions of the BSD License\r
7; which accompanies this distribution. The full text of the license may be found at\r
8; http://opensource.org/licenses/bsd-license.php.\r
9;\r
10; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12;\r
13; Module Name:\r
14;\r
15; InterlockedCompareExchange16.Asm\r
16;\r
17; Abstract:\r
18;\r
19; InterlockedCompareExchange16 function\r
20;\r
21; Notes:\r
22;\r
23;------------------------------------------------------------------------------\r
24\r
25 DEFAULT REL\r
26 SECTION .text\r
27\r
28;------------------------------------------------------------------------------\r
29; UINT16\r
30; EFIAPI\r
31; InterlockedCompareExchange16 (\r
32; IN UINT16 *Value,\r
33; IN UINT16 CompareValue,\r
34; IN UINT16 ExchangeValue\r
35; );\r
36;------------------------------------------------------------------------------\r
37global ASM_PFX(InternalSyncCompareExchange16)\r
38ASM_PFX(InternalSyncCompareExchange16):\r
39 mov ax, dx\r
40 lock cmpxchg [rcx], r8w\r
41 ret\r
42\r