gvmm.h revision 86b51be433c7032578ae50e94ebe590cc428448b
/* $Id$ */
/** @file
* GVMM - The Global VM Manager.
*/
/*
* Copyright (C) 2007 InnoTek Systemberatung GmbH
*
* 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 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.
*
*/
#ifndef ___VBox_gvmm_h
#define ___VBox_gvmm_h
/** @defgroup grp_GVMM GVMM - The Global VM Manager.
* @{
*/
/** @def IN_GVMM_R0
* Used to indicate whether we're inside the same link module as the ring 0
* part of the Global VM Manager or not.
*/
/** @def GVMMR0DECL
* Ring 0 VM export or import declaration.
* @param type The return type of the function declaration.
*/
#ifdef IN_GVMM_R0
#else
#endif
/** @def NIL_GVM_HANDLE
* The nil GVM VM handle value (VM::hSelf).
*/
#define NIL_GVM_HANDLE 0
/**
* The scheduler statistics
*/
typedef struct GVMMSTATSSCHED
{
/** The number of calls to GVMMR0SchedHalt. */
/** The number of times we did go to sleep in GVMMR0SchedHalt. */
/** The number of times we timed out in GVMMR0SchedHalt. */
/** The number of times we didn't go to sleep in GVMMR0SchedHalt. */
/** The number of wake ups done during GVMMR0SchedHalt. */
/** The number of calls to GVMMR0WakeUp. */
/** The number of times the EMT thread wasn't actually halted when GVMMR0WakeUp was called. */
/** The number of wake ups done during GVMMR0WakeUp (not counting the explicit one). */
/** The number of calls to GVMMR0SchedPoll. */
/** The number of times the EMT has halted in a GVMMR0SchedPoll call. */
/** The number of wake ups done during GVMMR0SchedPoll. */
/** Pointer to the GVMM scheduler statistics. */
typedef GVMMSTATSSCHED *PGVMMSTATSSCHED;
/**
* The GMM statistics.
*/
typedef struct GVMMSTATS
{
/** The VM statistics if a VM was specified. */
/** The sum statistics of all VMs accessible to the caller. */
/** The number of VMs accessible to the caller. */
/** Alignment padding. */
} GVMMSTATS;
/** Pointer to the GVMM statistics. */
typedef GVMMSTATS *PGVMMSTATS;
/** Const pointer to the GVMM statistics. */
typedef const GVMMSTATS *PCGVMMSTATS;
GVMMR0DECL(int) GVMMR0Init(void);
GVMMR0DECL(void) GVMMR0Term(void);
GVMMR0DECL(int) GVMMR0QueryConfig(PSUPDRVSESSION pSession, const char *pszName, uint64_t *pu64Value);
/**
* Request packet for calling GVMMR0CreateVM.
*/
typedef struct GVMMCREATEVMREQ
{
/** The request header. */
/** The support driver session. (IN) */
/** Pointer to the ring-3 mapping of the shared VM structure on return. (OUT) */
/** Pointer to the ring-0 mapping of the shared VM structure on return. (OUT) */
/** Pointer to a GVMMR0CreateVM request packet. */
typedef GVMMCREATEVMREQ *PGVMMCREATEVMREQ;
/**
* Request buffer for GVMMR0QueryStatisticsReq / VMMR0_DO_GVMM_QUERY_STATISTICS.
* @see GVMMR0QueryStatistics.
*/
typedef struct GVMMQUERYSTATISTICSSREQ
{
/** The header. */
/** The support driver session. */
/** The statistics. */
/** Pointer to a GVMMR0QueryStatisticsReq / VMMR0_DO_GVMM_QUERY_STATISTICS request buffer. */
/**
* Request buffer for GVMMR0ResetStatisticsReq / VMMR0_DO_GVMM_RESET_STATISTICS.
* @see GVMMR0ResetStatistics.
*/
typedef struct GVMMRESETSTATISTICSSREQ
{
/** The header. */
/** The support driver session. */
/** The statistics to reset.
* Any non-zero entry will be reset (if permitted). */
/** Pointer to a GVMMR0ResetStatisticsReq / VMMR0_DO_GVMM_RESET_STATISTICS request buffer. */
/** @} */
#endif