VirtualBox

Ignore:
Timestamp:
Jan 6, 2010 4:19:49 AM (15 years ago)
Author:
vboxsync
Message:

iprt/asm.h,ASMAtomic*.asm: the darwin x86 gcc also has trouble with our cmpxchg8b usage, do like we did for gcc 4.3.x/x86 a while back. Did it for *all* cmpxchg8b users (we missed(?) 3 last time).

File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/asm/ASMAtomicXchgU64.asm

    r25664 r25665  
    11; $Id$
    22;; @file
    3 ; IPRT - ASMAtomicCmpXchgU64().
     3; IPRT - ASMAtomicXchgU64().
    44;
    55
    66;
    7 ; Copyright (C) 2006-2009 Sun Microsystems, Inc.
     7; Copyright (C) 2006-2010 Sun Microsystems, Inc.
    88;
    99; This file is part of VirtualBox Open Source Edition (OSE), as
     
    3737
    3838;;
    39 ; Atomically compares and exchanges an unsigned 64-bit int.
     39; Atomically Exchange an unsigned 64-bit value, ordered.
    4040;
    4141; @param    pu64     x86:ebp+8   gcc:rdi  msc:rcx
    4242; @param    u64New   x86:ebp+c   gcc:rsi  msc:rdx
    43 ; @param    u64Old   x86:ebp+14  gcc:rcx  msc:r8
    4443;
    4544; @returns  bool result: true if succesfully exchanged, false if not.
    4645;           x86:al
    4746;
    48 BEGINPROC_EXPORTED ASMAtomicCmpXchgU64
     47BEGINPROC_EXPORTED ASMAtomicXchgU64
    4948%ifdef RT_ARCH_AMD64
    5049 %ifdef ASM_CALL64_MSC
    5150        mov     rax, r8
     51.try_again:
    5252        lock cmpxchg [rcx], rdx
    5353 %else
     54.try_again:
    5455        mov     rax, rcx
    5556        lock cmpxchg [rdi], rsi
    5657 %endif
    57         setz    al
    58         movzx   eax, al
     58        jnz     .try_again
    5959        ret
    6060%endif
     
    6565        push    edi
    6666
     67.try_again:
    6768        mov     ebx, dword [ebp+0ch]
    6869        mov     ecx, dword [ebp+0ch + 4]
    6970        mov     edi, [ebp+08h]
    70         mov     eax, dword [ebp+14h]
    71         mov     edx, dword [ebp+14h + 4]
    7271        lock cmpxchg8b [edi]
    73         setz    al
    74         movzx   eax, al
     72        jnz     .try_again
    7573
    7674        pop     edi
     
    7977        ret
    8078%endif
    81 ENDPROC ASMAtomicCmpXchgU64
     79ENDPROC ASMAtomicXchgU64
    8280
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette