Changeset 25665 in vbox for trunk/src/VBox/Runtime/common/asm/ASMAtomicXchgU64.asm
- Timestamp:
- Jan 6, 2010 4:19:49 AM (15 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/asm/ASMAtomicXchgU64.asm
r25664 r25665 1 1 ; $Id$ 2 2 ;; @file 3 ; IPRT - ASMAtomic CmpXchgU64().3 ; IPRT - ASMAtomicXchgU64(). 4 4 ; 5 5 6 6 ; 7 ; Copyright (C) 2006-20 09Sun Microsystems, Inc.7 ; Copyright (C) 2006-2010 Sun Microsystems, Inc. 8 8 ; 9 9 ; This file is part of VirtualBox Open Source Edition (OSE), as … … 37 37 38 38 ;; 39 ; Atomically compares and exchanges an unsigned 64-bit int.39 ; Atomically Exchange an unsigned 64-bit value, ordered. 40 40 ; 41 41 ; @param pu64 x86:ebp+8 gcc:rdi msc:rcx 42 42 ; @param u64New x86:ebp+c gcc:rsi msc:rdx 43 ; @param u64Old x86:ebp+14 gcc:rcx msc:r844 43 ; 45 44 ; @returns bool result: true if succesfully exchanged, false if not. 46 45 ; x86:al 47 46 ; 48 BEGINPROC_EXPORTED ASMAtomic CmpXchgU6447 BEGINPROC_EXPORTED ASMAtomicXchgU64 49 48 %ifdef RT_ARCH_AMD64 50 49 %ifdef ASM_CALL64_MSC 51 50 mov rax, r8 51 .try_again: 52 52 lock cmpxchg [rcx], rdx 53 53 %else 54 .try_again: 54 55 mov rax, rcx 55 56 lock cmpxchg [rdi], rsi 56 57 %endif 57 setz al 58 movzx eax, al 58 jnz .try_again 59 59 ret 60 60 %endif … … 65 65 push edi 66 66 67 .try_again: 67 68 mov ebx, dword [ebp+0ch] 68 69 mov ecx, dword [ebp+0ch + 4] 69 70 mov edi, [ebp+08h] 70 mov eax, dword [ebp+14h]71 mov edx, dword [ebp+14h + 4]72 71 lock cmpxchg8b [edi] 73 setz al 74 movzx eax, al 72 jnz .try_again 75 73 76 74 pop edi … … 79 77 ret 80 78 %endif 81 ENDPROC ASMAtomic CmpXchgU6479 ENDPROC ASMAtomicXchgU64 82 80
Note:
See TracChangeset
for help on using the changeset viewer.