34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync; $Id$
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync;; @file
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync; IPRT - ASMAtomicUoOrU64().
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync;
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync;
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync; Copyright (C) 2013 Oracle Corporation
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync;
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync; This file is part of VirtualBox Open Source Edition (OSE), as
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync; available from http://www.virtualbox.org. This file is free software;
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync; you can redistribute it and/or modify it under the terms of the GNU
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync; General Public License (GPL) as published by the Free Software
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync; Foundation, in version 2 as it comes in the "COPYING" file of the
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync;
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync; The contents of this file may alternatively be used under the terms
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync; of the Common Development and Distribution License Version 1.0
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync; (CDDL) only, as it comes in the "COPYING.CDDL" file of the
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync; VirtualBox OSE distribution, in which case the provisions of the
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync; CDDL are applicable instead of those of the GPL.
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync;
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync; You may elect to license modified versions of this file under the
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync; terms and conditions of either the GPL or the CDDL or both.
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync;
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync;*******************************************************************************
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync;* Header Files *
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync;*******************************************************************************
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync%include "iprt/asmdefs.mac"
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsyncBEGINCODE
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync;;
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync; Atomically OR an unsigned 64-bit value, unordered.
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync;
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync; @param pu64 x86:ebp+8 gcc:rdi msc:rcx
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync; @param u64Or x86:ebp+c gcc:rsi msc:rdx
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync;
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync; @returns void
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync;
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsyncBEGINPROC_EXPORTED ASMAtomicUoOrU64
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync%ifdef RT_ARCH_AMD64
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync %ifdef ASM_CALL64_MSC
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync or [rcx], rdx
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync %else
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync or [rdi], rsi
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync %endif
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync%elifdef RT_ARCH_X86
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync push ebp
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync mov ebp, esp
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync push ebx
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync push edi
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync mov edi, [ebp + 08h]
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync mov ebx, [ebp + 0ch]
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync mov ecx, [ebp + 0ch + 4]
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync mov eax, ebx
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync mov edx, ecx
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync.try_again:
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync cmpxchg8b [edi]
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync jz .done
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync mov ebx, eax
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync or ebx, [ebp + 0ch]
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync mov ecx, edx
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync or ecx, [ebp + 0ch + 4]
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync jmp .try_again
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync.done:
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync pop edi
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync pop ebx
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync leave
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync%endif
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync ret
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsyncENDPROC ASMAtomicUoOrU64
34edf41b7b7cb5219f0ce1b172e131ae7520ae83vboxsync