Changeset 59055 in vbox
- Timestamp:
- Dec 8, 2015 12:42:24 PM (9 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 2 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/Makefile.kmk
r59047 r59055 180 180 win/amd64/ASMGetDR7.asm \ 181 181 common/asm/ASMAtomicCmpXchgU8.asm \ 182 common/asm/ASMAtomicCmpXchgU16.asm \ 183 common/asm/ASMAtomicXchgU16.asm \ 182 184 common/asm/ASMBitFirstClear.asm \ 183 185 common/asm/ASMBitFirstSet.asm \ -
trunk/src/VBox/Runtime/VBox/VBoxRTImp.def
r59053 r59055 44 44 ; code 45 45 ASMAtomicCmpXchgU8 ; not-some-systems... 46 ASMAtomicCmpXchgU16 ; not-some-systems... 46 47 ASMAtomicCmpXchgExU64 ; not-some-systems... 47 48 ASMAtomicCmpXchgU64 ; not-some-systems... 48 49 ASMAtomicReadU64 ; not-some-systems... 49 50 ASMAtomicUoReadU64 ; not-some-systems... 51 ASMAtomicXchgU16 ; not-some-systems... 50 52 ASMAtomicXchgU64 ; not-some-systems... 51 53 -
trunk/src/VBox/Runtime/common/asm/ASMAtomicCmpXchgU16.asm
r59052 r59055 1 1 ; $Id$ 2 2 ;; @file 3 ; IPRT - ASMAtomicCmpXchgU 8().3 ; IPRT - ASMAtomicCmpXchgU16(). 4 4 ; 5 5 … … 35 35 ; Atomically compares and exchanges an unsigned 8-bit int. 36 36 ; 37 ; @param pu 8x86:esp+4 msc:rcx gcc:rdi38 ; @param u 8New x86:esp+8 msc:dl gcc:sil39 ; @param u 8Old x86:esp+c msc:r8l gcc:dl37 ; @param pu16 x86:esp+4 msc:rcx gcc:rdi 38 ; @param u16New x86:esp+8 msc:dx gcc:si 39 ; @param u16Old x86:esp+c msc:r8l gcc:dl 40 40 ; 41 41 ; @returns bool result: true if successfully exchanged, false if not. 42 42 ; x86:al 43 43 ; 44 BEGINPROC_EXPORTED ASMAtomicCmpXchgU 844 BEGINPROC_EXPORTED ASMAtomicCmpXchgU16 45 45 %ifdef RT_ARCH_AMD64 46 46 %ifdef ASM_CALL64_MSC 47 mov a l, r8b48 lock cmpxchg [rcx], d l47 mov ax, r8w 48 lock cmpxchg [rcx], dx 49 49 %else 50 mov a l, dl51 lock cmpxchg [rdi], si l50 mov ax, dx 51 lock cmpxchg [rdi], si 52 52 %endif 53 53 %else 54 54 mov ecx, [esp + 04h] 55 mov d l, [esp + 08h]56 mov a l, [esp + 0ch]57 lock cmpxchg [ecx], d l55 mov dx, [esp + 08h] 56 mov ax, [esp + 0ch] 57 lock cmpxchg [ecx], dx 58 58 %endif 59 59 setz al 60 60 movzx eax, al 61 61 ret 62 ENDPROC ASMAtomicCmpXchgU 862 ENDPROC ASMAtomicCmpXchgU16 63 63 -
trunk/src/VBox/Runtime/common/asm/ASMAtomicXchgU16.asm
r59052 r59055 1 1 ; $Id$ 2 2 ;; @file 3 ; IPRT - ASMAtomicXchgU 64().3 ; IPRT - ASMAtomicXchgU16(). 4 4 ; 5 5 … … 33 33 34 34 ;; 35 ; Atomically Exchange an unsigned 64-bit value, ordered.35 ; Atomically Exchange an unsigned 16-bit value, ordered. 36 36 ; 37 ; @param pu 64x86:ebp+8 gcc:rdi msc:rcx38 ; @param u 64New x86:ebp+c gcc:rsi msc:rdx37 ; @param pu16 x86:ebp+8 gcc:rdi msc:rcx 38 ; @param u16New x86:ebp+c gcc:si msc:dx 39 39 ; 40 ; @returns bool result: true if successfully exchanged, false if not. 41 ; x86:al 40 ; @returns Current (i.e. old) *pu16 value (AX). 42 41 ; 43 BEGINPROC_EXPORTED ASMAtomicXchgU 6442 BEGINPROC_EXPORTED ASMAtomicXchgU16 44 43 %ifdef RT_ARCH_AMD64 45 44 %ifdef ASM_CALL64_MSC 46 mov rax, r8 47 .try_again: 48 lock cmpxchg [rcx], rdx 45 mov ax, dx 46 xchg [rcx], ax 49 47 %else 50 .try_again: 51 mov rax, rcx 52 lock cmpxchg [rdi], rsi 48 mov ax, si 49 xchg [rdi], ax 53 50 %endif 54 jnz .try_again 51 %elifdef RT_ARCH_X86 52 mov ecx, [esp+04h] 53 mov ax, [esp+08h] 54 xchg [ecx], ax 55 %else 56 %error "Unsupport arch." 57 %endif 55 58 ret 56 %endif 57 %ifdef RT_ARCH_X86 58 push ebp 59 mov ebp, esp 60 push ebx 61 push edi 59 ENDPROC ASMAtomicXchgU16 62 60 63 .try_again:64 mov ebx, dword [ebp+0ch]65 mov ecx, dword [ebp+0ch + 4]66 mov edi, [ebp+08h]67 lock cmpxchg8b [edi]68 jnz .try_again69 70 pop edi71 pop ebx72 leave73 ret74 %endif75 ENDPROC ASMAtomicXchgU6476
Note:
See TracChangeset
for help on using the changeset viewer.