0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @file
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * VM - The Virtual Machine, API.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/*
c58f1213e628a545081c70e26c6b67a841cff880vboxsync * Copyright (C) 2006-2013 Oracle Corporation
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync *
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * available from http://www.virtualbox.org. This file is free software;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * you can redistribute it and/or modify it under the terms of the GNU
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * General Public License (GPL) as published by the Free Software
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync *
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * The contents of this file may alternatively be used under the terms
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * of the Common Development and Distribution License Version 1.0
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * VirtualBox OSE distribution, in which case the provisions of the
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * CDDL are applicable instead of those of the GPL.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync *
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * You may elect to license modified versions of this file under the
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * terms and conditions of either the GPL or the CDDL or both.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#ifndef ___VBox_vmm_vmapi_h
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#define ___VBox_vmm_vmapi_h
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#include <VBox/types.h>
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#include <VBox/vmm/stam.h>
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#include <VBox/vmm/cfgm.h>
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#include <iprt/stdarg.h>
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncRT_C_DECLS_BEGIN
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @defgroup grp_vmm_apis VM All Contexts API
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @ingroup grp_vm
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @{ */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @def VM_RC_ADDR
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Converts a current context address of data within the VM structure to the equivalent
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * raw-mode address.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync *
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @returns raw-mode virtual address.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param pVM Pointer to the VM.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param pvInVM CC Pointer within the VM.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#ifdef IN_RING3
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# define VM_RC_ADDR(pVM, pvInVM) ( (RTRCPTR)((RTRCUINTPTR)pVM->pVMRC + (uint32_t)((uintptr_t)(pvInVM) - (uintptr_t)pVM->pVMR3)) )
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#elif defined(IN_RING0)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# define VM_RC_ADDR(pVM, pvInVM) ( (RTRCPTR)((RTRCUINTPTR)pVM->pVMRC + (uint32_t)((uintptr_t)(pvInVM) - (uintptr_t)pVM->pVMR0)) )
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#else
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# define VM_RC_ADDR(pVM, pvInVM) ( (RTRCPTR)(pvInVM) )
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#endif
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @def VM_R3_ADDR
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Converts a current context address of data within the VM structure to the equivalent
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * ring-3 host address.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync *
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @returns host virtual address.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param pVM Pointer to the VM.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param pvInVM CC pointer within the VM.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#ifdef IN_RC
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# define VM_R3_ADDR(pVM, pvInVM) ( (RTR3PTR)((RTR3UINTPTR)pVM->pVMR3 + (uint32_t)((uintptr_t)(pvInVM) - (uintptr_t)pVM->pVMRC)) )
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#elif defined(IN_RING0)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# define VM_R3_ADDR(pVM, pvInVM) ( (RTR3PTR)((RTR3UINTPTR)pVM->pVMR3 + (uint32_t)((uintptr_t)(pvInVM) - (uintptr_t)pVM->pVMR0)) )
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#else
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# define VM_R3_ADDR(pVM, pvInVM) ( (RTR3PTR)(pvInVM) )
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#endif
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @def VM_R0_ADDR
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Converts a current context address of data within the VM structure to the equivalent
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * ring-0 host address.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync *
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @returns host virtual address.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param pVM Pointer to the VM.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param pvInVM CC pointer within the VM.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#ifdef IN_RC
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# define VM_R0_ADDR(pVM, pvInVM) ( (RTR0PTR)((RTR0UINTPTR)pVM->pVMR0 + (uint32_t)((uintptr_t)(pvInVM) - (uintptr_t)pVM->pVMRC)) )
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#elif defined(IN_RING3)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# define VM_R0_ADDR(pVM, pvInVM) ( (RTR0PTR)((RTR0UINTPTR)pVM->pVMR0 + (uint32_t)((uintptr_t)(pvInVM) - (uintptr_t)pVM->pVMR3)) )
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#else
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# define VM_R0_ADDR(pVM, pvInVM) ( (RTR0PTR)(pvInVM) )
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#endif
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/**
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * VM error callback function.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync *
0f81043c307886fc3e8d0479c4e4120b35c6d0b9vboxsync * @param pUVM The user mode VM handle. Can be NULL if an error
0f81043c307886fc3e8d0479c4e4120b35c6d0b9vboxsync * occurred before successfully creating a VM.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param pvUser The user argument.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param rc VBox status code.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param RT_SRC_POS_DECL The source position arguments. See RT_SRC_POS and RT_SRC_POS_ARGS.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param pszFormat Error message format string.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param args Error message arguments.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync */
0f81043c307886fc3e8d0479c4e4120b35c6d0b9vboxsynctypedef DECLCALLBACK(void) FNVMATERROR(PUVM pUVM, void *pvUser, int rc, RT_SRC_POS_DECL, const char *pszError, va_list args);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Pointer to a VM error callback. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsynctypedef FNVMATERROR *PFNVMATERROR;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
98427c0ab08697e468c26dc33ee9571308577867vboxsyncVMMDECL(int) VMSetError(PVM pVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...);
98427c0ab08697e468c26dc33ee9571308577867vboxsyncVMMDECL(int) VMSetErrorV(PVM pVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list args);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @def VM_SET_ERROR
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Macro for setting a simple VM error message.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Don't use '%' in the message!
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync *
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @returns rc. Meaning you can do:
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @code
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * return VM_SET_ERROR(pVM, VERR_OF_YOUR_CHOICE, "descriptive message");
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @endcode
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param pVM VM handle.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param rc VBox status code.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param pszMessage Error message string.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @thread Any
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#define VM_SET_ERROR(pVM, rc, pszMessage) (VMSetError(pVM, rc, RT_SRC_POS, pszMessage))
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
98427c0ab08697e468c26dc33ee9571308577867vboxsync/** @def VM_SET_ERROR
98427c0ab08697e468c26dc33ee9571308577867vboxsync * Macro for setting a simple VM error message.
98427c0ab08697e468c26dc33ee9571308577867vboxsync * Don't use '%' in the message!
98427c0ab08697e468c26dc33ee9571308577867vboxsync *
98427c0ab08697e468c26dc33ee9571308577867vboxsync * @returns rc. Meaning you can do:
98427c0ab08697e468c26dc33ee9571308577867vboxsync * @code
98427c0ab08697e468c26dc33ee9571308577867vboxsync * return VM_SET_ERROR(pVM, VERR_OF_YOUR_CHOICE, "descriptive message");
98427c0ab08697e468c26dc33ee9571308577867vboxsync * @endcode
98427c0ab08697e468c26dc33ee9571308577867vboxsync * @param pVM VM handle.
98427c0ab08697e468c26dc33ee9571308577867vboxsync * @param rc VBox status code.
98427c0ab08697e468c26dc33ee9571308577867vboxsync * @param pszMessage Error message string.
98427c0ab08697e468c26dc33ee9571308577867vboxsync * @thread Any
98427c0ab08697e468c26dc33ee9571308577867vboxsync */
98427c0ab08697e468c26dc33ee9571308577867vboxsync#define VM_SET_ERROR_U(a_pUVM, a_rc, a_pszMessage) (VMR3SetError(a_pUVM, a_rc, RT_SRC_POS, a_pszMessage))
98427c0ab08697e468c26dc33ee9571308577867vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/**
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * VM runtime error callback function.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync *
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * See VMSetRuntimeError for the detailed description of parameters.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync *
0f81043c307886fc3e8d0479c4e4120b35c6d0b9vboxsync * @param pUVM The user mode VM handle.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param pvUser The user argument.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param fFlags The error flags.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param pszErrorId Error ID string.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param pszFormat Error message format string.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param va Error message arguments.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync */
0f81043c307886fc3e8d0479c4e4120b35c6d0b9vboxsynctypedef DECLCALLBACK(void) FNVMATRUNTIMEERROR(PUVM pUVM, void *pvUser, uint32_t fFlags, const char *pszErrorId,
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync const char *pszFormat, va_list va);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Pointer to a VM runtime error callback. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsynctypedef FNVMATRUNTIMEERROR *PFNVMATRUNTIMEERROR;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) VMSetRuntimeError(PVM pVM, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(int) VMSetRuntimeErrorV(PVM pVM, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list args);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @name VMSetRuntimeError fFlags
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * When no flags are given the VM will continue running and it's up to the front
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * end to take action on the error condition.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync *
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @{ */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** The error is fatal.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * The VM is not in a state where it can be saved and will enter a state
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * where it can no longer execute code. The caller <b>must</b> propagate status
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * codes. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#define VMSETRTERR_FLAGS_FATAL RT_BIT_32(0)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Suspend the VM after, or if possible before, raising the error on EMT. The
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * caller <b>must</b> propagate status codes. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#define VMSETRTERR_FLAGS_SUSPEND RT_BIT_32(1)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Don't wait for the EMT to handle the request.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Only valid when on a worker thread and there is a high risk of a dead
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * lock. Be careful not to flood the user with errors. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#define VMSETRTERR_FLAGS_NO_WAIT RT_BIT_32(2)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @} */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/**
0f81043c307886fc3e8d0479c4e4120b35c6d0b9vboxsync * VM state change callback function.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync *
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * You are not allowed to call any function which changes the VM state from a
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * state callback, except VMR3Destroy().
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync *
0f81043c307886fc3e8d0479c4e4120b35c6d0b9vboxsync * @param pUVM The user mode VM handle.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param enmState The new state.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param enmOldState The old state.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param pvUser The user argument.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync */
0f81043c307886fc3e8d0479c4e4120b35c6d0b9vboxsynctypedef DECLCALLBACK(void) FNVMATSTATE(PUVM pUVM, VMSTATE enmState, VMSTATE enmOldState, void *pvUser);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Pointer to a VM state callback. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsynctypedef FNVMATSTATE *PFNVMATSTATE;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMDECL(const char *) VMGetStateName(VMSTATE enmState);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/**
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Request type.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsynctypedef enum VMREQTYPE
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync{
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Invalid request. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync VMREQTYPE_INVALID = 0,
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** VM: Internal. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync VMREQTYPE_INTERNAL,
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Maximum request type (exclusive). Used for validation. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync VMREQTYPE_MAX
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync} VMREQTYPE;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/**
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Request state.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsynctypedef enum VMREQSTATE
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync{
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The state is invalid. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync VMREQSTATE_INVALID = 0,
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The request have been allocated and is in the process of being filed. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync VMREQSTATE_ALLOCATED,
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The request is queued by the requester. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync VMREQSTATE_QUEUED,
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The request is begin processed. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync VMREQSTATE_PROCESSING,
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The request is completed, the requester is begin notified. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync VMREQSTATE_COMPLETED,
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The request packet is in the free chain. (The requester */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync VMREQSTATE_FREE
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync} VMREQSTATE;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/**
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Request flags.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsynctypedef enum VMREQFLAGS
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync{
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The request returns a VBox status code. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync VMREQFLAGS_VBOX_STATUS = 0,
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** The request is a void request and have no status code. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync VMREQFLAGS_VOID = 1,
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Return type mask. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync VMREQFLAGS_RETURN_MASK = 1,
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Caller does not wait on the packet, EMT will free it. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync VMREQFLAGS_NO_WAIT = 2,
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Poke the destination EMT(s) if executing guest code. Use with care. */
50f998bb47f333d10515d4c12ad01a4e92a0747bvboxsync VMREQFLAGS_POKE = 4,
50f998bb47f333d10515d4c12ad01a4e92a0747bvboxsync /** Priority request that can safely be processed while doing async
50f998bb47f333d10515d4c12ad01a4e92a0747bvboxsync * suspend and power off. */
50f998bb47f333d10515d4c12ad01a4e92a0747bvboxsync VMREQFLAGS_PRIORITY = 8
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync} VMREQFLAGS;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/**
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * VM Request packet.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync *
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * This is used to request an action in the EMT. Usually the requester is
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * another thread, but EMT can also end up being the requester in which case
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * it's carried out synchronously.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsynctypedef struct VMREQ
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync{
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Pointer to the next request in the chain. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync struct VMREQ * volatile pNext;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Pointer to ring-3 VM structure which this request belongs to. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync PUVM pUVM;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Request state. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync volatile VMREQSTATE enmState;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** VBox status code for the completed request. */
81cfcb51c89626fd5d331d92dcec81c94a5e9d2fvboxsync volatile int32_t iStatus;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Requester event sem.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * The request can use this event semaphore to wait/poll for completion
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * of the request.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync RTSEMEVENT EventSem;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Set if the event semaphore is clear. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync volatile bool fEventSemClear;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Flags, VMR3REQ_FLAGS_*. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync unsigned fFlags;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Request type. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync VMREQTYPE enmType;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Request destination. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync VMCPUID idDstCpu;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Request specific data. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync union VMREQ_U
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync {
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** VMREQTYPE_INTERNAL. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync struct
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync {
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Pointer to the function to be called. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync PFNRT pfn;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Number of arguments. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync unsigned cArgs;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** Array of arguments. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync uintptr_t aArgs[64];
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync } Internal;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync } u;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync} VMREQ;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Pointer to a VM request packet. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsynctypedef VMREQ *PVMREQ;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @} */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#ifndef IN_RC
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @defgroup grp_vmm_apis_hc VM Host Context API
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @ingroup grp_vm
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @{ */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @} */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#endif
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#ifdef IN_RING3
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @defgroup grp_vmm_apis_r3 VM Host Context Ring 3 API
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * This interface is a _draft_!
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @ingroup grp_vm
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @{ */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/**
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Completion notification codes.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsynctypedef enum VMINITCOMPLETED
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync{
e2bd93b4f9c38c9b01eb960ba7bc1fc9c4d38ce8vboxsync /** The ring-3 init is completed. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync VMINITCOMPLETED_RING3 = 1,
e2bd93b4f9c38c9b01eb960ba7bc1fc9c4d38ce8vboxsync /** The ring-0 init is completed. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync VMINITCOMPLETED_RING0,
e2bd93b4f9c38c9b01eb960ba7bc1fc9c4d38ce8vboxsync /** The hardware accelerated virtualization init is completed.
beb683ae4828ae01a388a124997a2517fbe78190vboxsync * Used to make decisision depending on HM* bits being completely
beb683ae4828ae01a388a124997a2517fbe78190vboxsync * initialized. */
f091ce66ee934d599f16056078a9a76d7286b959vboxsync VMINITCOMPLETED_HM,
beb683ae4828ae01a388a124997a2517fbe78190vboxsync /** The RC init is completed. */
beb683ae4828ae01a388a124997a2517fbe78190vboxsync VMINITCOMPLETED_RC
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync} VMINITCOMPLETED;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync/** Reason for VM resume. */
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsynctypedef enum VMRESUMEREASON
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync{
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync VMRESUMEREASON_INVALID = 0,
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync /** User decided to do so. */
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync VMRESUMEREASON_USER,
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync /** VM reconfiguration (like changing DVD). */
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync VMRESUMEREASON_RECONFIG,
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync /** The host resumed. */
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync VMRESUMEREASON_HOST_RESUME,
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync /** Restored state. */
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync VMRESUMEREASON_STATE_RESTORED,
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync /** Snapshot / saved state. */
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync VMRESUMEREASON_STATE_SAVED,
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync /** Teleported to a new box / instance. */
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync VMRESUMEREASON_TELEPORTED,
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync /** Teleportation failed. */
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync VMRESUMEREASON_TELEPORT_FAILED,
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync /** FTM temporarily suspended the VM. */
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync VMRESUMEREASON_FTM_SYNC,
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync /** End of valid reasons. */
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync VMRESUMEREASON_END,
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync /** Blow the type up to 32-bits. */
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync VMRESUMEREASON_32BIT_HACK = 0x7fffffff
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync} VMRESUMEREASON;
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync/** Reason for VM suspend. */
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsynctypedef enum VMSUSPENDREASON
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync{
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync VMSUSPENDREASON_INVALID = 0,
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync /** User decided to do so. */
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync VMSUSPENDREASON_USER,
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync /** VM reconfiguration (like changing DVD). */
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync VMSUSPENDREASON_RECONFIG,
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync /** The VM is suspending itself. */
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync VMSUSPENDREASON_VM,
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync /** The Vm is suspending because of a runtime error. */
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync VMSUSPENDREASON_RUNTIME_ERROR,
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync /** The host was suspended. */
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync VMSUSPENDREASON_HOST_SUSPEND,
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync /** The host is running low on battery power. */
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync VMSUSPENDREASON_HOST_BATTERY_LOW,
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync /** FTM is temporarily suspending the VM. */
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync VMSUSPENDREASON_FTM_SYNC,
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync /** End of valid reasons. */
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync VMSUSPENDREASON_END,
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync /** Blow the type up to 32-bits. */
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync VMSUSPENDREASON_32BIT_HACK = 0x7fffffff
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync} VMSUSPENDREASON;
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/**
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Progress callback.
0f81043c307886fc3e8d0479c4e4120b35c6d0b9vboxsync *
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * This will report the completion percentage of an operation.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync *
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @returns VINF_SUCCESS.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @returns Error code to cancel the operation with.
0f81043c307886fc3e8d0479c4e4120b35c6d0b9vboxsync * @param pUVM The user mode VM handle.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param uPercent Completion percentage (0-100).
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param pvUser User specified argument.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync */
0f81043c307886fc3e8d0479c4e4120b35c6d0b9vboxsynctypedef DECLCALLBACK(int) FNVMPROGRESS(PUVM pUVM, unsigned uPercent, void *pvUser);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Pointer to a FNVMPROGRESS function. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsynctypedef FNVMPROGRESS *PFNVMPROGRESS;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsync
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3Create(uint32_t cCpus, PCVMM2USERMETHODS pVm2UserCbs,
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsync PFNVMATERROR pfnVMAtError, void *pvUserVM,
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsync PFNCFGMCONSTRUCTOR pfnCFGMConstructor, void *pvUserCFGM,
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsync PVM *ppVM, PUVM *ppUVM);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3PowerOn(PUVM pUVM);
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsyncVMMR3DECL(int) VMR3Suspend(PUVM pUVM, VMSUSPENDREASON enmReason);
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsyncVMMR3DECL(VMSUSPENDREASON) VMR3GetSuspendReason(PUVM);
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsyncVMMR3DECL(int) VMR3Resume(PUVM pUVM, VMRESUMEREASON enmReason);
84161d024cfbfa8f0fd7e79b8c925e1f2ba77009vboxsyncVMMR3DECL(VMRESUMEREASON) VMR3GetResumeReason(PUVM);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3Reset(PUVM pUVM);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3Save(PUVM pUVM, const char *pszFilename, bool fContinueAfterwards, PFNVMPROGRESS pfnProgress, void *pvUser, bool *pfSuspended);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3_INT_DECL(int) VMR3SaveFT(PUVM pUVM, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser, bool *pfSuspended, bool fSkipStateChanges);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3Teleport(PUVM pUVM, uint32_t cMsDowntime, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser, PFNVMPROGRESS pfnProgress, void *pvProgressUser, bool *pfSuspended);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3LoadFromFile(PUVM pUVM, const char *pszFilename, PFNVMPROGRESS pfnProgress, void *pvUser);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3LoadFromStream(PUVM pUVM, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser,
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsync PFNVMPROGRESS pfnProgress, void *pvProgressUser);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3_INT_DECL(int) VMR3LoadFromStreamFT(PUVM pUVM, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsync
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3PowerOff(PUVM pUVM);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3Destroy(PUVM pUVM);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3_INT_DECL(void) VMR3Relocate(PVM pVM, RTGCINTPTR offDelta);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
d1d4bf58f99da14d0aaa7bcc728a359c8a7eb7bdvboxsyncVMMR3DECL(PVM) VMR3GetVM(PUVM pUVM);
d1d4bf58f99da14d0aaa7bcc728a359c8a7eb7bdvboxsyncVMMR3DECL(PUVM) VMR3GetUVM(PVM pVM);
d1d4bf58f99da14d0aaa7bcc728a359c8a7eb7bdvboxsyncVMMR3DECL(uint32_t) VMR3RetainUVM(PUVM pUVM);
d1d4bf58f99da14d0aaa7bcc728a359c8a7eb7bdvboxsyncVMMR3DECL(uint32_t) VMR3ReleaseUVM(PUVM pUVM);
d1d4bf58f99da14d0aaa7bcc728a359c8a7eb7bdvboxsyncVMMR3DECL(const char *) VMR3GetName(PUVM pUVM);
d1d4bf58f99da14d0aaa7bcc728a359c8a7eb7bdvboxsyncVMMR3DECL(PRTUUID) VMR3GetUuid(PUVM pUVM, PRTUUID pUuid);
d1d4bf58f99da14d0aaa7bcc728a359c8a7eb7bdvboxsyncVMMR3DECL(VMSTATE) VMR3GetState(PVM pVM);
d1d4bf58f99da14d0aaa7bcc728a359c8a7eb7bdvboxsyncVMMR3DECL(VMSTATE) VMR3GetStateU(PUVM pUVM);
d1d4bf58f99da14d0aaa7bcc728a359c8a7eb7bdvboxsyncVMMR3DECL(const char *) VMR3GetStateName(VMSTATE enmState);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3AtStateRegister(PUVM pUVM, PFNVMATSTATE pfnAtState, void *pvUser);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3AtStateDeregister(PUVM pUVM, PFNVMATSTATE pfnAtState, void *pvUser);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3_INT_DECL(bool) VMR3TeleportedAndNotFullyResumedYet(PVM pVM);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3AtErrorRegister(PUVM pUVM, PFNVMATERROR pfnAtError, void *pvUser);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3AtErrorDeregister(PUVM pUVM, PFNVMATERROR pfnAtError, void *pvUser);
98427c0ab08697e468c26dc33ee9571308577867vboxsyncVMMR3DECL(int) VMR3SetError(PUVM pUVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...);
98427c0ab08697e468c26dc33ee9571308577867vboxsyncVMMR3DECL(int) VMR3SetErrorV(PUVM pUVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3_INT_DECL(void) VMR3SetErrorWorker(PVM pVM);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3_INT_DECL(uint32_t) VMR3GetErrorCount(PUVM pUVM);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3AtRuntimeErrorRegister(PUVM pUVM, PFNVMATRUNTIMEERROR pfnAtRuntimeError, void *pvUser);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3AtRuntimeErrorDeregister(PUVM pUVM, PFNVMATRUNTIMEERROR pfnAtRuntimeError, void *pvUser);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3_INT_DECL(int) VMR3SetRuntimeErrorWorker(PVM pVM);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3_INT_DECL(uint32_t) VMR3GetRuntimeErrorCount(PUVM pUVM);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsync
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3ReqCallU(PUVM pUVM, VMCPUID idDstCpu, PVMREQ *ppReq, RTMSINTERVAL cMillies, uint32_t fFlags, PFNRT pfnFunction, unsigned cArgs, ...);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3ReqCallVU(PUVM pUVM, VMCPUID idDstCpu, PVMREQ *ppReq, RTMSINTERVAL cMillies, uint32_t fFlags, PFNRT pfnFunction, unsigned cArgs, va_list Args);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3_INT_DECL(int) VMR3ReqCallWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3ReqCallWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3ReqCallNoWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3ReqCallNoWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3_INT_DECL(int) VMR3ReqCallVoidWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3ReqCallVoidWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3ReqCallVoidNoWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3ReqPriorityCallWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3ReqPriorityCallWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3ReqPriorityCallVoidWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3ReqAlloc(PUVM pUVM, PVMREQ *ppReq, VMREQTYPE enmType, VMCPUID idDstCpu);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3ReqFree(PVMREQ pReq);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3ReqQueue(PVMREQ pReq, RTMSINTERVAL cMillies);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3ReqWait(PVMREQ pReq, RTMSINTERVAL cMillies);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3_INT_DECL(int) VMR3ReqProcessU(PUVM pUVM, VMCPUID idDstCpu, bool fPriorityOnly);
d1d4bf58f99da14d0aaa7bcc728a359c8a7eb7bdvboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @name Flags for VMR3NotifyCpuFFU and VMR3NotifyGlobalFFU.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @{ */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Whether we've done REM or not. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#define VMNOTIFYFF_FLAGS_DONE_REM RT_BIT_32(0)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Whether we should poke the CPU if it's executing guest code. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#define VMNOTIFYFF_FLAGS_POKE RT_BIT_32(1)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @} */
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3_INT_DECL(void) VMR3NotifyGlobalFFU(PUVM pUVM, uint32_t fFlags);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3_INT_DECL(void) VMR3NotifyCpuFFU(PUVMCPU pUVMCpu, uint32_t fFlags);
8fd35305fc5d142e74a3f4679aae1ae972bd4d78vboxsyncVMMR3DECL(int) VMR3NotifyCpuDeviceReady(PVM pVM, VMCPUID idCpu);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3_INT_DECL(int) VMR3WaitHalted(PVM pVM, PVMCPU pVCpu, bool fIgnoreInterrupts);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3_INT_DECL(int) VMR3WaitU(PUVMCPU pUVMCpu);
8fd35305fc5d142e74a3f4679aae1ae972bd4d78vboxsyncVMMR3DECL(int) VMR3WaitForDeviceReady(PVM pVM, VMCPUID idCpu);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMR3_INT_DECL(int) VMR3AsyncPdmNotificationWaitU(PUVMCPU pUVCpu);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMR3_INT_DECL(void) VMR3AsyncPdmNotificationWakeupU(PUVM pUVM);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3_INT_DECL(RTCPUID) VMR3GetVMCPUId(PVM pVM);
d239ea80a55b621f0f0e0710e8a1b4762ddd6d0avboxsyncVMMR3_INT_DECL(bool) VMR3IsLongModeAllowed(PVM pVM);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(RTTHREAD) VMR3GetVMCPUThread(PUVM pUVM);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMR3DECL(RTNATIVETHREAD) VMR3GetVMCPUNativeThread(PVM pVM);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncVMMR3DECL(RTNATIVETHREAD) VMR3GetVMCPUNativeThreadU(PUVM pUVM);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3GetCpuCoreAndPackageIdFromCpuId(PUVM pUVM, VMCPUID idCpu, uint32_t *pidCpuCore, uint32_t *pidCpuPackage);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3HotUnplugCpu(PUVM pUVM, VMCPUID idCpu);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3HotPlugCpu(PUVM pUVM, VMCPUID idCpu);
021c939a9e3f688c0c3bbd759354be906bb2dcabvboxsyncVMMR3DECL(int) VMR3SetCpuExecutionCap(PUVM pUVM, uint32_t uCpuExecutionCap);
aafa3e3a526c178adf4947048684ed4590a16981vboxsyncVMMR3DECL(int) VMR3SetPowerOffInsteadOfReset(PUVM pUVM, bool fPowerOffInsteadOfReset);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @} */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#endif /* IN_RING3 */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#ifdef IN_RC
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @defgroup grp_vmm_apis_gc VM Guest Context APIs
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @ingroup grp_vm
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @{ */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @} */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#endif
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncRT_C_DECLS_END
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** @} */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#endif
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync