vmapi.h revision 98427c0ab08697e468c26dc33ee9571308577867
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync/** @file
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync * VM - The Virtual Machine, API.
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync */
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync/*
c7814cf6e1240a519cbec0441e033d0e2470ed00vboxsync * Copyright (C) 2006-2010 Oracle Corporation
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync *
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync * available from http://www.virtualbox.org. This file is free software;
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync * you can redistribute it and/or modify it under the terms of the GNU
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync * General Public License (GPL) as published by the Free Software
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync *
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync * The contents of this file may alternatively be used under the terms
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync * of the Common Development and Distribution License Version 1.0
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync * VirtualBox OSE distribution, in which case the provisions of the
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync * CDDL are applicable instead of those of the GPL.
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync *
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync * You may elect to license modified versions of this file under the
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync * terms and conditions of either the GPL or the CDDL or both.
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync */
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync#ifndef ___VBox_vmm_vmapi_h
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync#define ___VBox_vmm_vmapi_h
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync#include <VBox/types.h>
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync#include <VBox/vmm/stam.h>
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync#include <VBox/vmm/cfgm.h>
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync#include <iprt/stdarg.h>
84c4a51d2a3c1a5c3f7d6902a8ac8c2eb267f4e0vboxsync
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsyncRT_C_DECLS_BEGIN
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync/** @defgroup grp_vmm_apis VM All Contexts API
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync * @ingroup grp_vm
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * @{ */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync/** @def VM_RC_ADDR
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * Converts a current context address of data within the VM structure to the equivalent
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * raw-mode address.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync *
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * @returns raw-mode virtual address.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * @param pVM Pointer to the VM.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * @param pvInVM CC Pointer within the VM.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync#ifdef IN_RING3
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync# define VM_RC_ADDR(pVM, pvInVM) ( (RTRCPTR)((RTRCUINTPTR)pVM->pVMRC + (uint32_t)((uintptr_t)(pvInVM) - (uintptr_t)pVM->pVMR3)) )
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync#elif defined(IN_RING0)
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync# define VM_RC_ADDR(pVM, pvInVM) ( (RTRCPTR)((RTRCUINTPTR)pVM->pVMRC + (uint32_t)((uintptr_t)(pvInVM) - (uintptr_t)pVM->pVMR0)) )
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync#else
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync# define VM_RC_ADDR(pVM, pvInVM) ( (RTRCPTR)(pvInVM) )
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync#endif
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync/** @def VM_R3_ADDR
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * Converts a current context address of data within the VM structure to the equivalent
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * ring-3 host address.
454ac5c6ef4960887035ceea6b5247789d3272davboxsync *
454ac5c6ef4960887035ceea6b5247789d3272davboxsync * @returns host virtual address.
454ac5c6ef4960887035ceea6b5247789d3272davboxsync * @param pVM Pointer to the VM.
13194d15bc799cdfb231c1ba3fa26674334601b5vboxsync * @param pvInVM CC pointer within the VM.
13194d15bc799cdfb231c1ba3fa26674334601b5vboxsync */
13194d15bc799cdfb231c1ba3fa26674334601b5vboxsync#ifdef IN_RC
13194d15bc799cdfb231c1ba3fa26674334601b5vboxsync# define VM_R3_ADDR(pVM, pvInVM) ( (RTR3PTR)((RTR3UINTPTR)pVM->pVMR3 + (uint32_t)((uintptr_t)(pvInVM) - (uintptr_t)pVM->pVMRC)) )
13194d15bc799cdfb231c1ba3fa26674334601b5vboxsync#elif defined(IN_RING0)
454ac5c6ef4960887035ceea6b5247789d3272davboxsync# define VM_R3_ADDR(pVM, pvInVM) ( (RTR3PTR)((RTR3UINTPTR)pVM->pVMR3 + (uint32_t)((uintptr_t)(pvInVM) - (uintptr_t)pVM->pVMR0)) )
13194d15bc799cdfb231c1ba3fa26674334601b5vboxsync#else
454ac5c6ef4960887035ceea6b5247789d3272davboxsync# define VM_R3_ADDR(pVM, pvInVM) ( (RTR3PTR)(pvInVM) )
13194d15bc799cdfb231c1ba3fa26674334601b5vboxsync#endif
454ac5c6ef4960887035ceea6b5247789d3272davboxsync
13194d15bc799cdfb231c1ba3fa26674334601b5vboxsync
454ac5c6ef4960887035ceea6b5247789d3272davboxsync/** @def VM_R0_ADDR
13194d15bc799cdfb231c1ba3fa26674334601b5vboxsync * Converts a current context address of data within the VM structure to the equivalent
13194d15bc799cdfb231c1ba3fa26674334601b5vboxsync * ring-0 host address.
13194d15bc799cdfb231c1ba3fa26674334601b5vboxsync *
13194d15bc799cdfb231c1ba3fa26674334601b5vboxsync * @returns host virtual address.
454ac5c6ef4960887035ceea6b5247789d3272davboxsync * @param pVM Pointer to the VM.
454ac5c6ef4960887035ceea6b5247789d3272davboxsync * @param pvInVM CC pointer within the VM.
454ac5c6ef4960887035ceea6b5247789d3272davboxsync */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync#ifdef IN_RC
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync# define VM_R0_ADDR(pVM, pvInVM) ( (RTR0PTR)((RTR0UINTPTR)pVM->pVMR0 + (uint32_t)((uintptr_t)(pvInVM) - (uintptr_t)pVM->pVMRC)) )
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync#elif defined(IN_RING3)
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync# define VM_R0_ADDR(pVM, pvInVM) ( (RTR0PTR)((RTR0UINTPTR)pVM->pVMR0 + (uint32_t)((uintptr_t)(pvInVM) - (uintptr_t)pVM->pVMR3)) )
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync#else
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync# define VM_R0_ADDR(pVM, pvInVM) ( (RTR0PTR)(pvInVM) )
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync#endif
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync/**
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * VM error callback function.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync *
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * @param pUVM The user mode VM handle. Can be NULL if an error
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * occurred before successfully creating a VM.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * @param pvUser The user argument.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * @param rc VBox status code.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * @param RT_SRC_POS_DECL The source position arguments. See RT_SRC_POS and RT_SRC_POS_ARGS.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * @param pszFormat Error message format string.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * @param args Error message arguments.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsynctypedef DECLCALLBACK(void) FNVMATERROR(PUVM pUVM, void *pvUser, int rc, RT_SRC_POS_DECL, const char *pszError, va_list args);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync/** Pointer to a VM error callback. */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsynctypedef FNVMATERROR *PFNVMATERROR;
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsyncVMMDECL(int) VMSetError(PVM pVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsyncVMMDECL(int) VMSetErrorV(PVM pVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list args);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync/** @def VM_SET_ERROR
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * Macro for setting a simple VM error message.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * Don't use '%' in the message!
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync *
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * @returns rc. Meaning you can do:
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * @code
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * return VM_SET_ERROR(pVM, VERR_OF_YOUR_CHOICE, "descriptive message");
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * @endcode
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * @param pVM VM handle.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * @param rc VBox status code.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * @param pszMessage Error message string.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * @thread Any
db22a92f701bfcc17823963d6c8b745f68d44e30vboxsync */
db22a92f701bfcc17823963d6c8b745f68d44e30vboxsync#define VM_SET_ERROR(pVM, rc, pszMessage) (VMSetError(pVM, rc, RT_SRC_POS, pszMessage))
db22a92f701bfcc17823963d6c8b745f68d44e30vboxsync
db22a92f701bfcc17823963d6c8b745f68d44e30vboxsync/** @def VM_SET_ERROR
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * Macro for setting a simple VM error message.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * Don't use '%' in the message!
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync *
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * @returns rc. Meaning you can do:
956230513f1e35e9d694c219c7009034b71bb836vboxsync * @code
956230513f1e35e9d694c219c7009034b71bb836vboxsync * return VM_SET_ERROR(pVM, VERR_OF_YOUR_CHOICE, "descriptive message");
db22a92f701bfcc17823963d6c8b745f68d44e30vboxsync * @endcode
db22a92f701bfcc17823963d6c8b745f68d44e30vboxsync * @param pVM VM handle.
956230513f1e35e9d694c219c7009034b71bb836vboxsync * @param rc VBox status code.
956230513f1e35e9d694c219c7009034b71bb836vboxsync * @param pszMessage Error message string.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * @thread Any
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync */
956230513f1e35e9d694c219c7009034b71bb836vboxsync#define VM_SET_ERROR_U(a_pUVM, a_rc, a_pszMessage) (VMR3SetError(a_pUVM, a_rc, RT_SRC_POS, a_pszMessage))
956230513f1e35e9d694c219c7009034b71bb836vboxsync
956230513f1e35e9d694c219c7009034b71bb836vboxsync
956230513f1e35e9d694c219c7009034b71bb836vboxsync/**
956230513f1e35e9d694c219c7009034b71bb836vboxsync * VM runtime error callback function.
956230513f1e35e9d694c219c7009034b71bb836vboxsync *
956230513f1e35e9d694c219c7009034b71bb836vboxsync * See VMSetRuntimeError for the detailed description of parameters.
956230513f1e35e9d694c219c7009034b71bb836vboxsync *
956230513f1e35e9d694c219c7009034b71bb836vboxsync * @param pUVM The user mode VM handle.
956230513f1e35e9d694c219c7009034b71bb836vboxsync * @param pvUser The user argument.
956230513f1e35e9d694c219c7009034b71bb836vboxsync * @param fFlags The error flags.
956230513f1e35e9d694c219c7009034b71bb836vboxsync * @param pszErrorId Error ID string.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * @param pszFormat Error message format string.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * @param va Error message arguments.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsynctypedef DECLCALLBACK(void) FNVMATRUNTIMEERROR(PUVM pUVM, void *pvUser, uint32_t fFlags, const char *pszErrorId,
db22a92f701bfcc17823963d6c8b745f68d44e30vboxsync const char *pszFormat, va_list va);
db22a92f701bfcc17823963d6c8b745f68d44e30vboxsync/** Pointer to a VM runtime error callback. */
db22a92f701bfcc17823963d6c8b745f68d44e30vboxsynctypedef FNVMATRUNTIMEERROR *PFNVMATRUNTIMEERROR;
db22a92f701bfcc17823963d6c8b745f68d44e30vboxsync
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsyncVMMDECL(int) VMSetRuntimeError(PVM pVM, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsyncVMMDECL(int) VMSetRuntimeErrorV(PVM pVM, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list args);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync/** @name VMSetRuntimeError fFlags
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * When no flags are given the VM will continue running and it's up to the front
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * end to take action on the error condition.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync *
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * @{ */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync/** The error is fatal.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * The VM is not in a state where it can be saved and will enter a state
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * where it can no longer execute code. The caller <b>must</b> propagate status
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * codes. */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync#define VMSETRTERR_FLAGS_FATAL RT_BIT_32(0)
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync/** Suspend the VM after, or if possible before, raising the error on EMT. The
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * caller <b>must</b> propagate status codes. */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync#define VMSETRTERR_FLAGS_SUSPEND RT_BIT_32(1)
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync/** Don't wait for the EMT to handle the request.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * Only valid when on a worker thread and there is a high risk of a dead
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * lock. Be careful not to flood the user with errors. */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync#define VMSETRTERR_FLAGS_NO_WAIT RT_BIT_32(2)
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync/** @} */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync/**
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * VM state change callback function.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync *
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * You are not allowed to call any function which changes the VM state from a
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * state callback, except VMR3Destroy().
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync *
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * @param pUVM The user mode VM handle.
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync * @param enmState The new state.
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync * @param enmOldState The old state.
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync * @param pvUser The user argument.
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync */
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsynctypedef DECLCALLBACK(void) FNVMATSTATE(PUVM pUVM, VMSTATE enmState, VMSTATE enmOldState, void *pvUser);
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync/** Pointer to a VM state callback. */
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsynctypedef FNVMATSTATE *PFNVMATSTATE;
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsyncVMMDECL(const char *) VMGetStateName(VMSTATE enmState);
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync/**
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync * Request type.
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync */
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsynctypedef enum VMREQTYPE
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync{
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync /** Invalid request. */
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync VMREQTYPE_INVALID = 0,
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync /** VM: Internal. */
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync VMREQTYPE_INTERNAL,
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync /** Maximum request type (exclusive). Used for validation. */
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync VMREQTYPE_MAX
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync} VMREQTYPE;
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync/**
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * Request state.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsynctypedef enum VMREQSTATE
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync{
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync /** The state is invalid. */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync VMREQSTATE_INVALID = 0,
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync /** The request have been allocated and is in the process of being filed. */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync VMREQSTATE_ALLOCATED,
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync /** The request is queued by the requester. */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync VMREQSTATE_QUEUED,
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync /** The request is begin processed. */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync VMREQSTATE_PROCESSING,
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync /** The request is completed, the requester is begin notified. */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync VMREQSTATE_COMPLETED,
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync /** The request packet is in the free chain. (The requester */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync VMREQSTATE_FREE
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync} VMREQSTATE;
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync/**
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * Request flags.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsynctypedef enum VMREQFLAGS
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync{
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync /** The request returns a VBox status code. */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync VMREQFLAGS_VBOX_STATUS = 0,
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync /** The request is a void request and have no status code. */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync VMREQFLAGS_VOID = 1,
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync /** Return type mask. */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync VMREQFLAGS_RETURN_MASK = 1,
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync /** Caller does not wait on the packet, EMT will free it. */
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync VMREQFLAGS_NO_WAIT = 2,
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync /** Poke the destination EMT(s) if executing guest code. Use with care. */
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync VMREQFLAGS_POKE = 4,
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync /** Priority request that can safely be processed while doing async
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync * suspend and power off. */
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync VMREQFLAGS_PRIORITY = 8
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync} VMREQFLAGS;
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync/**
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync * VM Request packet.
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync *
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync * This is used to request an action in the EMT. Usually the requester is
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync * another thread, but EMT can also end up being the requester in which case
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync * it's carried out synchronously.
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync */
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsynctypedef struct VMREQ
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync{
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync /** Pointer to the next request in the chain. */
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync struct VMREQ * volatile pNext;
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync /** Pointer to ring-3 VM structure which this request belongs to. */
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync PUVM pUVM;
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync /** Request state. */
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync volatile VMREQSTATE enmState;
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync /** VBox status code for the completed request. */
49bcf64aaacb2de9703cdd3633eec0a2610c3cf3vboxsync volatile int32_t iStatus;
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync /** Requester event sem.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * The request can use this event semaphore to wait/poll for completion
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * of the request.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync RTSEMEVENT EventSem;
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync /** Set if the event semaphore is clear. */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync volatile bool fEventSemClear;
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync /** Flags, VMR3REQ_FLAGS_*. */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync unsigned fFlags;
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync /** Request type. */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync VMREQTYPE enmType;
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync /** Request destination. */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync VMCPUID idDstCpu;
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync /** Request specific data. */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync union VMREQ_U
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync {
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync /** VMREQTYPE_INTERNAL. */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync struct
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync {
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync /** Pointer to the function to be called. */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync PFNRT pfn;
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync /** Number of arguments. */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync unsigned cArgs;
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync /** Array of arguments. */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync uintptr_t aArgs[64];
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync } Internal;
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync } u;
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync} VMREQ;
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync/** Pointer to a VM request packet. */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsynctypedef VMREQ *PVMREQ;
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync/** @} */
835ac9173220411ef9fe578c3d4c03e5edfa20bevboxsync
835ac9173220411ef9fe578c3d4c03e5edfa20bevboxsync
835ac9173220411ef9fe578c3d4c03e5edfa20bevboxsync#ifndef IN_RC
835ac9173220411ef9fe578c3d4c03e5edfa20bevboxsync/** @defgroup grp_vmm_apis_hc VM Host Context API
835ac9173220411ef9fe578c3d4c03e5edfa20bevboxsync * @ingroup grp_vm
835ac9173220411ef9fe578c3d4c03e5edfa20bevboxsync * @{ */
835ac9173220411ef9fe578c3d4c03e5edfa20bevboxsync
835ac9173220411ef9fe578c3d4c03e5edfa20bevboxsync/** @} */
835ac9173220411ef9fe578c3d4c03e5edfa20bevboxsync#endif
835ac9173220411ef9fe578c3d4c03e5edfa20bevboxsync
835ac9173220411ef9fe578c3d4c03e5edfa20bevboxsync
835ac9173220411ef9fe578c3d4c03e5edfa20bevboxsync#ifdef IN_RING3
835ac9173220411ef9fe578c3d4c03e5edfa20bevboxsync/** @defgroup grp_vmm_apis_r3 VM Host Context Ring 3 API
835ac9173220411ef9fe578c3d4c03e5edfa20bevboxsync * This interface is a _draft_!
835ac9173220411ef9fe578c3d4c03e5edfa20bevboxsync * @ingroup grp_vm
835ac9173220411ef9fe578c3d4c03e5edfa20bevboxsync * @{ */
835ac9173220411ef9fe578c3d4c03e5edfa20bevboxsync
835ac9173220411ef9fe578c3d4c03e5edfa20bevboxsync/**
835ac9173220411ef9fe578c3d4c03e5edfa20bevboxsync * Completion notification codes.
835ac9173220411ef9fe578c3d4c03e5edfa20bevboxsync */
835ac9173220411ef9fe578c3d4c03e5edfa20bevboxsynctypedef enum VMINITCOMPLETED
835ac9173220411ef9fe578c3d4c03e5edfa20bevboxsync{
835ac9173220411ef9fe578c3d4c03e5edfa20bevboxsync /** The ring-3 init is completed. */
835ac9173220411ef9fe578c3d4c03e5edfa20bevboxsync VMINITCOMPLETED_RING3 = 1,
835ac9173220411ef9fe578c3d4c03e5edfa20bevboxsync /** The ring-0 init is completed. */
835ac9173220411ef9fe578c3d4c03e5edfa20bevboxsync VMINITCOMPLETED_RING0,
835ac9173220411ef9fe578c3d4c03e5edfa20bevboxsync /** The hardware accelerated virtualization init is completed.
835ac9173220411ef9fe578c3d4c03e5edfa20bevboxsync * Used to make decisision depending on whether HMIsEnabled(). */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync VMINITCOMPLETED_HM,
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync /** The GC init is completed. */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync VMINITCOMPLETED_GC
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync} VMINITCOMPLETED;
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync/**
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * Progress callback.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync *
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * This will report the completion percentage of an operation.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync *
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * @returns VINF_SUCCESS.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * @returns Error code to cancel the operation with.
4d45842309f5db66367ef1c4a701fc37619b0ec0vboxsync * @param pUVM The user mode VM handle.
4d45842309f5db66367ef1c4a701fc37619b0ec0vboxsync * @param uPercent Completion percentage (0-100).
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync * @param pvUser User specified argument.
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsynctypedef DECLCALLBACK(int) FNVMPROGRESS(PUVM pUVM, unsigned uPercent, void *pvUser);
35d0bfb0c568c691325cade7618555e3d3df918avboxsync/** Pointer to a FNVMPROGRESS function. */
35d0bfb0c568c691325cade7618555e3d3df918avboxsynctypedef FNVMPROGRESS *PFNVMPROGRESS;
35d0bfb0c568c691325cade7618555e3d3df918avboxsync
35d0bfb0c568c691325cade7618555e3d3df918avboxsync
35d0bfb0c568c691325cade7618555e3d3df918avboxsyncVMMR3DECL(int) VMR3Create(uint32_t cCpus, PCVMM2USERMETHODS pVm2UserCbs,
35d0bfb0c568c691325cade7618555e3d3df918avboxsync PFNVMATERROR pfnVMAtError, void *pvUserVM,
35d0bfb0c568c691325cade7618555e3d3df918avboxsync PFNCFGMCONSTRUCTOR pfnCFGMConstructor, void *pvUserCFGM,
35d0bfb0c568c691325cade7618555e3d3df918avboxsync PVM *ppVM, PUVM *ppUVM);
35d0bfb0c568c691325cade7618555e3d3df918avboxsyncVMMR3DECL(int) VMR3PowerOn(PUVM pUVM);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsyncVMMR3DECL(int) VMR3Suspend(PUVM pUVM);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsyncVMMR3DECL(int) VMR3Resume(PUVM pUVM);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsyncVMMR3DECL(int) VMR3Reset(PUVM pUVM);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsyncVMMR3DECL(int) VMR3Save(PUVM pUVM, const char *pszFilename, bool fContinueAfterwards, PFNVMPROGRESS pfnProgress, void *pvUser, bool *pfSuspended);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsyncVMMR3_INT_DECL(int) VMR3SaveFT(PUVM pUVM, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser, bool *pfSuspended, bool fSkipStateChanges);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsyncVMMR3DECL(int) VMR3Teleport(PUVM pUVM, uint32_t cMsDowntime, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser, PFNVMPROGRESS pfnProgress, void *pvProgressUser, bool *pfSuspended);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsyncVMMR3DECL(int) VMR3LoadFromFile(PUVM pUVM, const char *pszFilename, PFNVMPROGRESS pfnProgress, void *pvUser);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsyncVMMR3DECL(int) VMR3LoadFromStream(PUVM pUVM, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser,
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync PFNVMPROGRESS pfnProgress, void *pvProgressUser);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsyncVMMR3_INT_DECL(int) VMR3LoadFromStreamFT(PUVM pUVM, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsyncVMMR3DECL(int) VMR3PowerOff(PUVM pUVM);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsyncVMMR3DECL(int) VMR3Destroy(PUVM pUVM);
a917e98de4393d1090e536fdbeb04c285f98c92evboxsyncVMMR3_INT_DECL(void) VMR3Relocate(PVM pVM, RTGCINTPTR offDelta);
a917e98de4393d1090e536fdbeb04c285f98c92evboxsync
a917e98de4393d1090e536fdbeb04c285f98c92evboxsyncVMMR3DECL(PVM) VMR3GetVM(PUVM pUVM);
a917e98de4393d1090e536fdbeb04c285f98c92evboxsyncVMMR3DECL(PUVM) VMR3GetUVM(PVM pVM);
a917e98de4393d1090e536fdbeb04c285f98c92evboxsyncVMMR3DECL(uint32_t) VMR3RetainUVM(PUVM pUVM);
a917e98de4393d1090e536fdbeb04c285f98c92evboxsyncVMMR3DECL(uint32_t) VMR3ReleaseUVM(PUVM pUVM);
a917e98de4393d1090e536fdbeb04c285f98c92evboxsyncVMMR3DECL(const char *) VMR3GetName(PUVM pUVM);
a917e98de4393d1090e536fdbeb04c285f98c92evboxsyncVMMR3DECL(PRTUUID) VMR3GetUuid(PUVM pUVM, PRTUUID pUuid);
a917e98de4393d1090e536fdbeb04c285f98c92evboxsyncVMMR3DECL(VMSTATE) VMR3GetState(PVM pVM);
a917e98de4393d1090e536fdbeb04c285f98c92evboxsyncVMMR3DECL(VMSTATE) VMR3GetStateU(PUVM pUVM);
a917e98de4393d1090e536fdbeb04c285f98c92evboxsyncVMMR3DECL(const char *) VMR3GetStateName(VMSTATE enmState);
a917e98de4393d1090e536fdbeb04c285f98c92evboxsyncVMMR3DECL(int) VMR3AtStateRegister(PUVM pUVM, PFNVMATSTATE pfnAtState, void *pvUser);
a917e98de4393d1090e536fdbeb04c285f98c92evboxsyncVMMR3DECL(int) VMR3AtStateDeregister(PUVM pUVM, PFNVMATSTATE pfnAtState, void *pvUser);
a917e98de4393d1090e536fdbeb04c285f98c92evboxsyncVMMR3_INT_DECL(bool) VMR3TeleportedAndNotFullyResumedYet(PVM pVM);
a917e98de4393d1090e536fdbeb04c285f98c92evboxsyncVMMR3DECL(int) VMR3AtErrorRegister(PUVM pUVM, PFNVMATERROR pfnAtError, void *pvUser);
a917e98de4393d1090e536fdbeb04c285f98c92evboxsyncVMMR3DECL(int) VMR3AtErrorDeregister(PUVM pUVM, PFNVMATERROR pfnAtError, void *pvUser);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsyncVMMR3DECL(int) VMR3SetError(PUVM pUVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...);
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsyncVMMR3DECL(int) VMR3SetErrorV(PUVM pUVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsyncVMMR3_INT_DECL(void) VMR3SetErrorWorker(PVM pVM);
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsyncVMMR3_INT_DECL(uint32_t) VMR3GetErrorCount(PUVM pUVM);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsyncVMMR3DECL(int) VMR3AtRuntimeErrorRegister(PUVM pUVM, PFNVMATRUNTIMEERROR pfnAtRuntimeError, void *pvUser);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsyncVMMR3DECL(int) VMR3AtRuntimeErrorDeregister(PUVM pUVM, PFNVMATRUNTIMEERROR pfnAtRuntimeError, void *pvUser);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsyncVMMR3_INT_DECL(int) VMR3SetRuntimeErrorWorker(PVM pVM);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsyncVMMR3_INT_DECL(uint32_t) VMR3GetRuntimeErrorCount(PUVM pUVM);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsync
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsyncVMMR3DECL(int) VMR3ReqCallU(PUVM pUVM, VMCPUID idDstCpu, PVMREQ *ppReq, RTMSINTERVAL cMillies, uint32_t fFlags, PFNRT pfnFunction, unsigned cArgs, ...);
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsyncVMMR3DECL(int) VMR3ReqCallVU(PUVM pUVM, VMCPUID idDstCpu, PVMREQ *ppReq, RTMSINTERVAL cMillies, uint32_t fFlags, PFNRT pfnFunction, unsigned cArgs, va_list Args);
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsyncVMMR3_INT_DECL(int) VMR3ReqCallWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsyncVMMR3DECL(int) VMR3ReqCallWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsyncVMMR3DECL(int) VMR3ReqCallNoWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsyncVMMR3DECL(int) VMR3ReqCallNoWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsyncVMMR3_INT_DECL(int) VMR3ReqCallVoidWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsyncVMMR3DECL(int) VMR3ReqCallVoidWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsyncVMMR3DECL(int) VMR3ReqCallVoidNoWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsyncVMMR3DECL(int) VMR3ReqPriorityCallWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsyncVMMR3DECL(int) VMR3ReqPriorityCallWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsyncVMMR3DECL(int) VMR3ReqPriorityCallVoidWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsyncVMMR3DECL(int) VMR3ReqAlloc(PUVM pUVM, PVMREQ *ppReq, VMREQTYPE enmType, VMCPUID idDstCpu);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsyncVMMR3DECL(int) VMR3ReqFree(PVMREQ pReq);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsyncVMMR3DECL(int) VMR3ReqQueue(PVMREQ pReq, RTMSINTERVAL cMillies);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsyncVMMR3DECL(int) VMR3ReqWait(PVMREQ pReq, RTMSINTERVAL cMillies);
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsyncVMMR3_INT_DECL(int) VMR3ReqProcessU(PUVM pUVM, VMCPUID idDstCpu, bool fPriorityOnly);
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync/** @name Flags for VMR3NotifyCpuFFU and VMR3NotifyGlobalFFU.
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync * @{ */
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync/** Whether we've done REM or not. */
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync#define VMNOTIFYFF_FLAGS_DONE_REM RT_BIT_32(0)
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync/** Whether we should poke the CPU if it's executing guest code. */
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync#define VMNOTIFYFF_FLAGS_POKE RT_BIT_32(1)
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync/** @} */
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsyncVMMR3_INT_DECL(void) VMR3NotifyGlobalFFU(PUVM pUVM, uint32_t fFlags);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsyncVMMR3_INT_DECL(void) VMR3NotifyCpuFFU(PUVMCPU pUVMCpu, uint32_t fFlags);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsyncVMMR3_INT_DECL(int) VMR3WaitHalted(PVM pVM, PVMCPU pVCpu, bool fIgnoreInterrupts);
f1f5335f9ec8e56fe0e3e27f253e24b10ff20f2evboxsyncVMMR3_INT_DECL(int) VMR3WaitU(PUVMCPU pUVMCpu);
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsyncVMMR3_INT_DECL(int) VMR3AsyncPdmNotificationWaitU(PUVMCPU pUVCpu);
84c4a51d2a3c1a5c3f7d6902a8ac8c2eb267f4e0vboxsyncVMMR3_INT_DECL(void) VMR3AsyncPdmNotificationWakeupU(PUVM pUVM);
454ac5c6ef4960887035ceea6b5247789d3272davboxsyncVMMR3_INT_DECL(RTCPUID) VMR3GetVMCPUId(PVM pVM);
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsyncVMMR3DECL(RTTHREAD) VMR3GetVMCPUThread(PUVM pUVM);
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsyncVMMR3DECL(RTNATIVETHREAD) VMR3GetVMCPUNativeThread(PVM pVM);
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsyncVMMR3DECL(RTNATIVETHREAD) VMR3GetVMCPUNativeThreadU(PUVM pUVM);
84c4a51d2a3c1a5c3f7d6902a8ac8c2eb267f4e0vboxsyncVMMR3DECL(int) VMR3GetCpuCoreAndPackageIdFromCpuId(PUVM pUVM, VMCPUID idCpu, uint32_t *pidCpuCore, uint32_t *pidCpuPackage);
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsyncVMMR3DECL(int) VMR3HotUnplugCpu(PUVM pUVM, VMCPUID idCpu);
454ac5c6ef4960887035ceea6b5247789d3272davboxsyncVMMR3DECL(int) VMR3HotPlugCpu(PUVM pUVM, VMCPUID idCpu);
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsyncVMMR3DECL(int) VMR3SetCpuExecutionCap(PUVM pUVM, uint32_t uCpuExecutionCap);
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync/** @} */
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync#endif /* IN_RING3 */
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync
510dd1bd989d25f95680fc2a3b51bf11854bc6a4vboxsync#ifdef IN_RC
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync/** @defgroup grp_vmm_apis_gc VM Guest Context APIs
ac1200e63b58a0451085add197084e5a4a1bb4cavboxsync * @ingroup grp_vm
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync * @{ */
84c4a51d2a3c1a5c3f7d6902a8ac8c2eb267f4e0vboxsync
84c4a51d2a3c1a5c3f7d6902a8ac8c2eb267f4e0vboxsync/** @} */
84c4a51d2a3c1a5c3f7d6902a8ac8c2eb267f4e0vboxsync#endif
84c4a51d2a3c1a5c3f7d6902a8ac8c2eb267f4e0vboxsync
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsyncRT_C_DECLS_END
d960e43fb3727c884b5f7eca3c920c9549839881vboxsync
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync/** @} */
c40afa339b10a23d6fffcbeb7d4572bb494685f0vboxsync
84c4a51d2a3c1a5c3f7d6902a8ac8c2eb267f4e0vboxsync#endif
84c4a51d2a3c1a5c3f7d6902a8ac8c2eb267f4e0vboxsync
84c4a51d2a3c1a5c3f7d6902a8ac8c2eb267f4e0vboxsync