PDMAllCritSect.cpp revision eacb04ad1b681683b2578a5547318d51934b0a2b
2N/A * PDM - Critical Sections, All Contexts. 2N/A * Copyright (C) 2006-2007 Sun Microsystems, Inc. 2N/A * This file is part of VirtualBox Open Source Edition (OSE), as 2N/A * you can redistribute it and/or modify it under the terms of the GNU 2N/A * General Public License (GPL) as published by the Free Software 2N/A * Foundation, in version 2 as it comes in the "COPYING" file of the 2N/A * VirtualBox OSE distribution. VirtualBox OSE is distributed in the 2N/A * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 2N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa 2N/A * additional information or have any questions. 2N/A/******************************************************************************* 2N/A*******************************************************************************/ 2N/A * Enters a PDM critical section. 2N/A * @returns VINF_SUCCESS if entered successfully. 2N/A * @returns rcBusy when encountering a busy critical section in GC/R0. 2N/A * @returns VERR_SEM_DESTROYED if the critical section is dead. 2N/A * @param pCritSect The PDM critical section to enter. 2N/A * @param rcBusy The status code to return when we're in GC or R0 2N/A * and the section is busy. * Enters a PDM critical section. * @returns VINF_SUCCESS if entered successfully. * @returns rcBusy when encountering a busy critical section in GC/R0. * @returns VERR_SEM_DESTROYED if the critical section is dead. * @param pCritSect The PDM critical section to enter. * @param fCallHost Whether this is a VMMGCCallHost() or VMMR0CallHost() request. * Leaves a critical section entered with PDMCritSectEnter(). * @param pCritSect The PDM critical section to leave. * Deal with nested attempts first. * (We're exploiting nesting to avoid queuing multiple R3 leaves for the same section.) /* darn, someone raced in on us. */ * Checks the caller is the owner of the critical section. * @returns true if owner. * @returns false if not owner. * @param pCritSect The critical section. * Checks if a critical section is initialized or not. * @returns true if initialized. * @returns false if not initialized. * @param pCritSect The critical section.