PDMAllCritSect.cpp revision 15f643ca32c8b3442869eb0db220d658c3bc22b1
907ba2c9b3d1821f95be17115ecad9fe8a2cae02vboxsync * PDM - Critical Sections, All Contexts.
907ba2c9b3d1821f95be17115ecad9fe8a2cae02vboxsync * Copyright (C) 2006-2007 Sun Microsystems, Inc.
907ba2c9b3d1821f95be17115ecad9fe8a2cae02vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
907ba2c9b3d1821f95be17115ecad9fe8a2cae02vboxsync * available from http://www.virtualbox.org. This file is free software;
907ba2c9b3d1821f95be17115ecad9fe8a2cae02vboxsync * you can redistribute it and/or modify it under the terms of the GNU
907ba2c9b3d1821f95be17115ecad9fe8a2cae02vboxsync * General Public License (GPL) as published by the Free Software
907ba2c9b3d1821f95be17115ecad9fe8a2cae02vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
907ba2c9b3d1821f95be17115ecad9fe8a2cae02vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
4b9d6701570cb98fd36e209314239d104ec584d3vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
4b9d6701570cb98fd36e209314239d104ec584d3vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
4b9d6701570cb98fd36e209314239d104ec584d3vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
4b9d6701570cb98fd36e209314239d104ec584d3vboxsync * additional information or have any questions.
4b9d6701570cb98fd36e209314239d104ec584d3vboxsync/*******************************************************************************
907ba2c9b3d1821f95be17115ecad9fe8a2cae02vboxsync* Header Files *
15617cf4cb5fa181f4d6f55f987a883cf298cce6vboxsync*******************************************************************************/
15617cf4cb5fa181f4d6f55f987a883cf298cce6vboxsync * Enters a PDM critical section.
15617cf4cb5fa181f4d6f55f987a883cf298cce6vboxsync * @returns VINF_SUCCESS if entered successfully.
15617cf4cb5fa181f4d6f55f987a883cf298cce6vboxsync * @returns rcBusy when encountering a busy critical section in GC/R0.
907ba2c9b3d1821f95be17115ecad9fe8a2cae02vboxsync * @returns VERR_SEM_DESTROYED if the critical section is dead.
#ifdef IN_RING3
STAM_STATS({ if (pCritSect->s.Core.cNestings == 1) STAM_PROFILE_ADV_START(&pCritSect->s.StatLocked, l); });
return rc;
AssertMsgReturn(pCritSect->s.Core.u32Magic == RTCRITSECT_MAGIC, ("%RX32\n", pCritSect->s.Core.u32Magic),
return VINF_SUCCESS;
return VINF_SUCCESS;
return rcBusy;
#ifdef IN_RING3
AssertMsgReturn(pCritSect->s.Core.u32Magic == RTCRITSECT_MAGIC, ("%RX32\n", pCritSect->s.Core.u32Magic),
return VINF_SUCCESS;
return VINF_SUCCESS;
return VERR_SEM_BUSY;
#ifdef IN_RING3
&& fCallHost
return rc;
#ifdef IN_RING3
# ifdef VBOX_WITH_STATISTICS
AssertMsg(pCritSect->s.Core.NativeThreadOwner == pVCpu->hNativeThread, ("Owner %RX64 emt=%RX64\n", pCritSect->s.Core.NativeThreadOwner, pVCpu->hNativeThread));
#ifdef IN_RING3
#ifdef IN_RING3