]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompareExchange16.asm
MdePkg/BaseSynchronizationLib: Add volatile Interlocked*() APIs
[mirror_edk2.git] / MdePkg / Library / BaseSynchronizationLib / Ia32 / 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 .486\r
26 .model flat,C\r
27 .code\r
28\r
29;------------------------------------------------------------------------------\r
30; UINT16\r
31; EFIAPI\r
32; InternalSyncCompareExchange16 (\r
4cee954e 33; IN volatile UINT16 *Value,\r
09f08c92
HT
34; IN UINT16 CompareValue,\r
35; IN UINT16 ExchangeValue\r
36; );\r
37;------------------------------------------------------------------------------\r
38InternalSyncCompareExchange16 PROC\r
39 mov ecx, [esp + 4]\r
40 mov ax, [esp + 8]\r
41 mov dx, [esp + 12]\r
42 lock cmpxchg [ecx], dx\r
43 ret\r
44InternalSyncCompareExchange16 ENDP\r
45\r
46 END\r