VirtualBox

Changeset 25664 in vbox for trunk/src/VBox/Runtime/common


Ignore:
Timestamp:
Jan 6, 2010 3:56:01 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
56379
Message:

ASMAtomicCmpXchgU64.asm,ASMAtomicReadU64.asm: Quickly hacked up some 64-bit code (untested).

Location:
trunk/src/VBox/Runtime/common/asm
Files:
2 edited

Legend:

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

    r19605 r25664  
    3939; Atomically compares and exchanges an unsigned 64-bit int.
    4040;
    41 ; @param    pu64     x86:ebp+8
    42 ; @param    u64New   x86:ebp+c
    43 ; @param    u64Old   x86:ebp+14
     41; @param    pu64     x86:ebp+8   gcc:rdi  msc:rcx
     42; @param    u64New   x86:ebp+c   gcc:rsi  msc:rdx
     43; @param    u64Old   x86:ebp+14  gcc:rcx  msc:r8
    4444;
    4545; @returns  bool result: true if succesfully exchanged, false if not.
     
    4747;
    4848BEGINPROC_EXPORTED ASMAtomicCmpXchgU64
    49 %ifndef RT_ARCH_X86
    50  %error port me
     49%ifdef RT_ARCH_AMD64
     50 %ifdef ASM_CALL64_MSC
     51        mov     rax, r8
     52        lock cmpxchg [rcx], rdx
     53 %else
     54        mov     rax, rcx
     55        lock cmpxchg [rdi], rsi
     56 %endif
     57        setz    al
     58        movzx   eax, al
     59        ret
    5160%endif
     61%ifdef RT_ARCH_X86
    5262        push    ebp
    5363        mov     ebp, esp
     
    6878        leave
    6979        ret
     80%endif
    7081ENDPROC ASMAtomicCmpXchgU64
    7182
  • trunk/src/VBox/Runtime/common/asm/ASMAtomicReadU64.asm

    r19605 r25664  
    4545;
    4646BEGINPROC_EXPORTED ASMAtomicReadU64
    47 %ifndef RT_ARCH_X86
    48  %error port me
     47%ifdef RT_ARCH_AMD64
     48        mfence                          ; ASSUME its present.
     49 %ifdef ASM_CALL64_MSC
     50        mov     rax, [rcx]
     51 %else
     52        mov     rax, [rdi]
     53 %endif
     54        ret
    4955%endif
     56%ifdef RT_ARCH_X86
    5057        push    ebp
    5158        mov     ebp, esp
     
    6471        leave
    6572        ret
     73%endif
    6674ENDPROC ASMAtomicReadU64
    6775
Note: See TracChangeset for help on using the changeset viewer.

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