VMMRZ.cpp revision 683371bbf37760161d1b8454ce978acf89bbb04f
/* $Id$ */
/** @file
* VMM - Virtual Machine Monitor, Raw-mode and ring-0 context code.
*/
/*
* Copyright (C) 2009 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#include "VMMInternal.h"
/**
* Calls the ring-3 host code.
*
* @returns VBox status code of the ring-3 call.
* @retval VERR_VMM_RING3_CALL_DISABLED if called at the wrong time. This must
* be passed up the stack, or if that isn't possible then VMMRZCallRing3
* needs to change it into an assertion.
*
*
* @param pVM The VM handle.
* @param pVCpu The virtual CPU handle of the calling EMT.
* @param enmOperation The operation.
* @param uArg The argument to the operation.
*/
{
/*
* Check if calling ring-3 has been disabled and only let let fatal calls thru.
*/
{
/*
* In most cases, it's sufficient to return a status code which
* will then be propagated up the code usually encountering several
* AssertRC invocations along the way. Hitting one of those is more
* helpful than stopping here.
*
* However, some doesn't check the status code because they are called
* from void functions, and for these we'll turn this into a ring-0
* assertion host call.
*/
return VERR_VMM_RING3_CALL_DISABLED;
#ifdef IN_RC
#endif
}
/*
* The normal path.
*/
/** @todo profile this! */
#ifdef IN_RC
#else
if (RT_FAILURE(rc))
return rc;
#endif
}
/**
* Simple wrapper that adds the pVCpu argument.
*
* @returns VBox status code of the ring-3 call.
* @retval VERR_VMM_RING3_CALL_DISABLED if called at the wrong time. This must
* be passed up the stack, or if that isn't possible then VMMRZCallRing3
* needs to change it into an assertion.
*
* @param pVM The VM handle.
* @param enmOperation The operation.
* @param uArg The argument to the operation.
*/
{
}
/**
* Disables all host calls, except certain fatal ones.
*
* @param pVCpu The CPU struct for the calling EMT.
* @thread EMT.
*/
{
{
/** @todo it might make more sense to just disable logging here, then we
* won't flush away important bits... but that goes both ways really. */
#ifdef IN_RC
#else
# ifdef LOG_ENABLED
# endif
#endif
}
}
/**
* Counters VMMRZCallRing3Disable and re-enables host calls.
*
* @param pVCpu The CPU struct for the calling EMT.
* @thread EMT.
*/
{
{
#ifdef IN_RC
#else
# ifdef LOG_ENABLED
# endif
#endif
}
}
/**
* Checks whether its possible to call host context or not.
*
* @returns true if it's safe, false if it isn't.
* @param pVCpu The CPU struct for the calling EMT.
*/
{
}