]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Ia32/InterlockedCompareExchange64.S
Import some basic libraries instances for Mde Packages.
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / InterlockedCompareExchange64.S
1 //
2 // Include common header file for this module.
3 //
4 #include "CommonHeader.h"
5
6 #------------------------------------------------------------------------------
7 #
8 # Copyright (c) 2006, Intel Corporation
9 # All rights reserved. This program and the accompanying materials
10 # are licensed and made available under the terms and conditions of the BSD License
11 # which accompanies this distribution. The full text of the license may be found at
12 # http://opensource.org/licenses/bsd-license.php
13 #
14 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #
17 # Module Name:
18 #
19 # InterlockedCompareExchange64.Asm
20 #
21 # Abstract:
22 #
23 # InternalSyncCompareExchange64 function
24 #
25 # Notes:
26 #
27 #------------------------------------------------------------------------------
28
29 .globl ASM_PFX(InternalSyncCompareExchange64)
30
31 #------------------------------------------------------------------------------
32 # UINT64
33 # EFIAPI
34 # InternalSyncCompareExchange64 (
35 # IN UINT64 *Value,
36 # IN UINT64 CompareValue,
37 # IN UINT64 ExchangeValue
38 # );
39 #------------------------------------------------------------------------------
40 ASM_PFX(InternalSyncCompareExchange64):
41 push %esi
42 push %ebx
43 movl 12(%esp), %esi
44 movl 16(%esp), %eax
45 movl 20(%esp), %edx
46 movl 24(%esp), %ebx
47 movl 28(%esp), %ecx
48 lock
49 cmpxchg8b (%esi)
50 pop %ebx
51 pop %esi
52 ret