eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync; $Id$
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync;; @file
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync; IPRT - ASMAtomicUoDecU32().
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync;
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync;
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync; Copyright (C) 2014 Oracle Corporation
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync;
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync; This file is part of VirtualBox Open Source Edition (OSE), as
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync; available from http://www.virtualbox.org. This file is free software;
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync; you can redistribute it and/or modify it under the terms of the GNU
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync; General Public License (GPL) as published by the Free Software
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync; Foundation, in version 2 as it comes in the "COPYING" file of the
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync;
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync; The contents of this file may alternatively be used under the terms
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync; of the Common Development and Distribution License Version 1.0
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync; (CDDL) only, as it comes in the "COPYING.CDDL" file of the
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync; VirtualBox OSE distribution, in which case the provisions of the
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync; CDDL are applicable instead of those of the GPL.
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync;
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync; You may elect to license modified versions of this file under the
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync; terms and conditions of either the GPL or the CDDL or both.
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync;
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync;*******************************************************************************
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync;* Header Files *
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync;*******************************************************************************
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync%include "iprt/asmdefs.mac"
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsyncBEGINCODE
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync;;
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync; Atomically decrement an unsigned 32-bit value, unordered.
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync;
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync; @param pu32 x86:esp+4 gcc:rdi msc:rcx
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync; @returns the new decremented value.
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync;
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsyncBEGINPROC_EXPORTED ASMAtomicUoDecU32
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync mov eax, -1
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync%ifdef RT_ARCH_AMD64
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync %ifdef ASM_CALL64_MSC
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync xadd [rcx], eax
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync %else
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync xadd [rdi], eax
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync %endif
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync%elifdef RT_ARCH_X86
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync mov ecx, [esp + 04h]
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync xadd [ecx], eax
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync%endif
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync dec eax
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync ret
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsyncENDPROC ASMAtomicUoDecU32
eda35f91dbe2b4e221daaab631ef5eb225224185vboxsync