]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange16.asm
ArmPkg/ArmDisassemblerLib: fix check for MSR instruction
[mirror_edk2.git] / MdePkg / Library / BaseSynchronizationLib / X64 / InterlockedCompareExchange16.asm
CommitLineData
09f08c92
HT
1;------------------------------------------------------------------------------\r
2;\r
4cee954e 3; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
09f08c92
HT
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 .code\r
26\r
27;------------------------------------------------------------------------------\r
28; UINT16\r
29; EFIAPI\r
fa1beef5 30; InternalSyncCompareExchange16 (\r
4cee954e 31; IN volatile UINT16 *Value,\r
09f08c92
HT
32; IN UINT16 CompareValue,\r
33; IN UINT16 ExchangeValue\r
34; );\r
35;------------------------------------------------------------------------------\r
36InternalSyncCompareExchange16 PROC\r
37 mov ax, dx\r
38 lock cmpxchg [rcx], r8w\r
39 ret\r
40InternalSyncCompareExchange16 ENDP\r
41\r
42 END\r