ASMAtomicBitTestAndToggle.asm revision a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fc
78a072e1b56619e3230735ae073668311232ec94vboxsync;; @file
78a072e1b56619e3230735ae073668311232ec94vboxsync; innotek Portable Runtime - ASMAtomicBitTestAndToggle().
78a072e1b56619e3230735ae073668311232ec94vboxsync;
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync;
78a072e1b56619e3230735ae073668311232ec94vboxsync; Copyright (C) 2006-2007 innotek GmbH
78a072e1b56619e3230735ae073668311232ec94vboxsync;
78a072e1b56619e3230735ae073668311232ec94vboxsync; This file is part of VirtualBox Open Source Edition (OSE), as
2f139cbf73f9adba01382892f33558ad7bcb40cbvboxsync; available from http://www.virtualbox.org. This file is free software;
2f139cbf73f9adba01382892f33558ad7bcb40cbvboxsync; you can redistribute it and/or modify it under the terms of the GNU
2f139cbf73f9adba01382892f33558ad7bcb40cbvboxsync; General Public License (GPL) as published by the Free Software
2f139cbf73f9adba01382892f33558ad7bcb40cbvboxsync; Foundation, in version 2 as it comes in the "COPYING" file of the
2f139cbf73f9adba01382892f33558ad7bcb40cbvboxsync; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
2f139cbf73f9adba01382892f33558ad7bcb40cbvboxsync; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
2f139cbf73f9adba01382892f33558ad7bcb40cbvboxsync;
78a072e1b56619e3230735ae073668311232ec94vboxsync; The contents of this file may alternatively be used under the terms
78a072e1b56619e3230735ae073668311232ec94vboxsync; of the Common Development and Distribution License Version 1.0
78a072e1b56619e3230735ae073668311232ec94vboxsync; (CDDL) only, as it comes in the "COPYING.CDDL" file of the
78a072e1b56619e3230735ae073668311232ec94vboxsync; VirtualBox OSE distribution, in which case the provisions of the
78a072e1b56619e3230735ae073668311232ec94vboxsync; CDDL are applicable instead of those of the GPL.
78a072e1b56619e3230735ae073668311232ec94vboxsync;
78a072e1b56619e3230735ae073668311232ec94vboxsync; You may elect to license modified versions of this file under the
78a072e1b56619e3230735ae073668311232ec94vboxsync; terms and conditions of either the GPL or the CDDL or both.
78a072e1b56619e3230735ae073668311232ec94vboxsync;
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync;*******************************************************************************
78a072e1b56619e3230735ae073668311232ec94vboxsync;* Header Files *
78a072e1b56619e3230735ae073668311232ec94vboxsync;*******************************************************************************
78a072e1b56619e3230735ae073668311232ec94vboxsync%include "iprt/asmdefs.mac"
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsyncBEGINCODE
78a072e1b56619e3230735ae073668311232ec94vboxsync
78a072e1b56619e3230735ae073668311232ec94vboxsync;;
78a072e1b56619e3230735ae073668311232ec94vboxsync; Atomically tests and toggles a bit in a bitmap.
78a072e1b56619e3230735ae073668311232ec94vboxsync;
78a072e1b56619e3230735ae073668311232ec94vboxsync; @returns al(rax) true if the bit was set.
78a072e1b56619e3230735ae073668311232ec94vboxsync; @returns al(rax) false if the bit was clear.
78a072e1b56619e3230735ae073668311232ec94vboxsync; @param rcx pvBitmap Pointer to the bitmap.
78a072e1b56619e3230735ae073668311232ec94vboxsync; @param edx iBit The bit to test and toggle.
78a072e1b56619e3230735ae073668311232ec94vboxsyncBEGINPROC_EXPORTED ASMAtomicBitTestAndToggle
78a072e1b56619e3230735ae073668311232ec94vboxsync lock btc [rcx], edx
78a072e1b56619e3230735ae073668311232ec94vboxsync sbb eax, eax
78a072e1b56619e3230735ae073668311232ec94vboxsync ret
78a072e1b56619e3230735ae073668311232ec94vboxsyncENDPROC ASMAtomicBitTestAndToggle
e068057c82b010bc7cc663e8f57ac3ef1890a33cvboxsync
e068057c82b010bc7cc663e8f57ac3ef1890a33cvboxsync