aboutsummaryrefslogtreecommitdiffstats
path: root/roms/edk2/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange16.nasm
diff options
context:
space:
mode:
Diffstat (limited to 'roms/edk2/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange16.nasm')
-rw-r--r--roms/edk2/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange16.nasm36
1 files changed, 36 insertions, 0 deletions
diff --git a/roms/edk2/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange16.nasm b/roms/edk2/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange16.nasm
new file mode 100644
index 000000000..81a243231
--- /dev/null
+++ b/roms/edk2/MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange16.nasm
@@ -0,0 +1,36 @@
+;------------------------------------------------------------------------------
+;
+; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
+; Copyright (c) 2015, Linaro Ltd. All rights reserved.<BR>
+; SPDX-License-Identifier: BSD-2-Clause-Patent
+;
+; Module Name:
+;
+; InterlockedCompareExchange16.Asm
+;
+; Abstract:
+;
+; InterlockedCompareExchange16 function
+;
+; Notes:
+;
+;------------------------------------------------------------------------------
+
+ DEFAULT REL
+ SECTION .text
+
+;------------------------------------------------------------------------------
+; UINT16
+; EFIAPI
+; InternalSyncCompareExchange16 (
+; IN volatile UINT16 *Value,
+; IN UINT16 CompareValue,
+; IN UINT16 ExchangeValue
+; );
+;------------------------------------------------------------------------------
+global ASM_PFX(InternalSyncCompareExchange16)
+ASM_PFX(InternalSyncCompareExchange16):
+ mov ax, dx
+ lock cmpxchg [rcx], r8w
+ ret
+