VirtualBox

source: vbox/trunk/include/VBox/vmm/vmapi.h@ 78976

Last change on this file since 78976 was 76585, checked in by vboxsync, 6 years ago

*: scm --fix-header-guard-endif

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 21.3 KB
Line 
1/** @file
2 * VM - The Virtual Machine, API.
3 */
4
5/*
6 * Copyright (C) 2006-2019 Oracle Corporation
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 *
16 * The contents of this file may alternatively be used under the terms
17 * of the Common Development and Distribution License Version 1.0
18 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
19 * VirtualBox OSE distribution, in which case the provisions of the
20 * CDDL are applicable instead of those of the GPL.
21 *
22 * You may elect to license modified versions of this file under the
23 * terms and conditions of either the GPL or the CDDL or both.
24 */
25
26#ifndef VBOX_INCLUDED_vmm_vmapi_h
27#define VBOX_INCLUDED_vmm_vmapi_h
28#ifndef RT_WITHOUT_PRAGMA_ONCE
29# pragma once
30#endif
31
32#include <VBox/types.h>
33#include <VBox/vmm/stam.h>
34#include <VBox/vmm/cfgm.h>
35
36#include <iprt/stdarg.h>
37
38RT_C_DECLS_BEGIN
39
40/** @defgroup grp_vm_apis VM All Contexts API
41 * @ingroup grp_vm
42 * @{ */
43
44/** @name VM_EXEC_ENGINE_XXX - VM::bMainExecutionEngine values.
45 * @sa EMR3QueryMainExecutionEngine, VM_IS_RAW_MODE_ENABLED, VM_IS_HM_ENABLED,
46 * VM_IS_HM_OR_NEM_ENABLED, VM_IS_NEM_ENABLED, VM_SET_MAIN_EXECUTION_ENGINE
47 * @{ */
48/** Has not yet been set. */
49#define VM_EXEC_ENGINE_NOT_SET UINT8_C(0)
50/** Raw-mode. */
51#define VM_EXEC_ENGINE_RAW_MODE UINT8_C(1)
52/** Hardware assisted virtualization thru HM. */
53#define VM_EXEC_ENGINE_HW_VIRT UINT8_C(2)
54/** Hardware assisted virtualization thru native API (NEM). */
55#define VM_EXEC_ENGINE_NATIVE_API UINT8_C(3)
56/** @} */
57
58
59/** @def VM_RC_ADDR
60 * Converts a current context address of data within the VM structure to the equivalent
61 * raw-mode address.
62 *
63 * @returns raw-mode virtual address.
64 * @param pVM The cross context VM structure.
65 * @param pvInVM CC Pointer within the VM.
66 */
67#ifdef IN_RING3
68# define VM_RC_ADDR(pVM, pvInVM) ( (RTRCPTR)((RTRCUINTPTR)pVM->pVMRC + (uint32_t)((uintptr_t)(pvInVM) - (uintptr_t)pVM->pVMR3)) )
69#elif defined(IN_RING0)
70# define VM_RC_ADDR(pVM, pvInVM) ( (RTRCPTR)((RTRCUINTPTR)pVM->pVMRC + (uint32_t)((uintptr_t)(pvInVM) - (uintptr_t)pVM->pVMR0)) )
71#else
72# define VM_RC_ADDR(pVM, pvInVM) ( (RTRCPTR)(pvInVM) )
73#endif
74
75/** @def VM_R3_ADDR
76 * Converts a current context address of data within the VM structure to the equivalent
77 * ring-3 host address.
78 *
79 * @returns host virtual address.
80 * @param pVM The cross context VM structure.
81 * @param pvInVM CC pointer within the VM.
82 */
83#ifdef IN_RC
84# define VM_R3_ADDR(pVM, pvInVM) ( (RTR3PTR)((RTR3UINTPTR)pVM->pVMR3 + (uint32_t)((uintptr_t)(pvInVM) - (uintptr_t)pVM->pVMRC)) )
85#elif defined(IN_RING0)
86# define VM_R3_ADDR(pVM, pvInVM) ( (RTR3PTR)((RTR3UINTPTR)pVM->pVMR3 + (uint32_t)((uintptr_t)(pvInVM) - (uintptr_t)pVM->pVMR0)) )
87#else
88# define VM_R3_ADDR(pVM, pvInVM) ( (RTR3PTR)(pvInVM) )
89#endif
90
91
92/** @def VM_R0_ADDR
93 * Converts a current context address of data within the VM structure to the equivalent
94 * ring-0 host address.
95 *
96 * @returns host virtual address.
97 * @param pVM The cross context VM structure.
98 * @param pvInVM CC pointer within the VM.
99 */
100#ifdef IN_RC
101# define VM_R0_ADDR(pVM, pvInVM) ( (RTR0PTR)((RTR0UINTPTR)pVM->pVMR0 + (uint32_t)((uintptr_t)(pvInVM) - (uintptr_t)pVM->pVMRC)) )
102#elif defined(IN_RING3)
103# define VM_R0_ADDR(pVM, pvInVM) ( (RTR0PTR)((RTR0UINTPTR)pVM->pVMR0 + (uint32_t)((uintptr_t)(pvInVM) - (uintptr_t)pVM->pVMR3)) )
104#else
105# define VM_R0_ADDR(pVM, pvInVM) ( (RTR0PTR)(pvInVM) )
106#endif
107
108
109
110/**
111 * VM error callback function.
112 *
113 * @param pUVM The user mode VM handle. Can be NULL if an error
114 * occurred before successfully creating a VM.
115 * @param pvUser The user argument.
116 * @param rc VBox status code.
117 * @param SRC_POS The source position arguments. See RT_SRC_POS and RT_SRC_POS_ARGS.
118 * @param pszFormat Error message format string.
119 * @param args Error message arguments.
120 */
121typedef DECLCALLBACK(void) FNVMATERROR(PUVM pUVM, void *pvUser, int rc, RT_SRC_POS_DECL, const char *pszError, va_list args);
122/** Pointer to a VM error callback. */
123typedef FNVMATERROR *PFNVMATERROR;
124
125VMMDECL(int) VMSetError(PVM pVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(6, 7);
126VMMDECL(int) VMSetErrorV(PVM pVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list args) RT_IPRT_FORMAT_ATTR(6, 7);
127
128/** @def VM_SET_ERROR
129 * Macro for setting a simple VM error message.
130 * Don't use '%' in the message!
131 *
132 * @returns rc. Meaning you can do:
133 * @code
134 * return VM_SET_ERROR(pVM, VERR_OF_YOUR_CHOICE, "descriptive message");
135 * @endcode
136 * @param pVM The cross context VM structure.
137 * @param rc VBox status code.
138 * @param pszMessage Error message string.
139 * @thread Any
140 */
141#define VM_SET_ERROR(pVM, rc, pszMessage) (VMSetError(pVM, rc, RT_SRC_POS, pszMessage))
142
143/** @def VM_SET_ERROR
144 * Macro for setting a simple VM error message.
145 * Don't use '%' in the message!
146 *
147 * @returns rc. Meaning you can do:
148 * @code
149 * return VM_SET_ERROR(pVM, VERR_OF_YOUR_CHOICE, "descriptive message");
150 * @endcode
151 * @param pVM The cross context VM structure.
152 * @param rc VBox status code.
153 * @param pszMessage Error message string.
154 * @thread Any
155 */
156#define VM_SET_ERROR_U(a_pUVM, a_rc, a_pszMessage) (VMR3SetError(a_pUVM, a_rc, RT_SRC_POS, a_pszMessage))
157
158
159/**
160 * VM runtime error callback function.
161 *
162 * See VMSetRuntimeError for the detailed description of parameters.
163 *
164 * @param pUVM The user mode VM handle.
165 * @param pvUser The user argument.
166 * @param fFlags The error flags.
167 * @param pszErrorId Error ID string.
168 * @param pszFormat Error message format string.
169 * @param va Error message arguments.
170 */
171typedef DECLCALLBACK(void) FNVMATRUNTIMEERROR(PUVM pUVM, void *pvUser, uint32_t fFlags, const char *pszErrorId,
172 const char *pszFormat, va_list va) RT_IPRT_FORMAT_ATTR(5, 0);
173/** Pointer to a VM runtime error callback. */
174typedef FNVMATRUNTIMEERROR *PFNVMATRUNTIMEERROR;
175
176VMMDECL(int) VMSetRuntimeError(PVM pVM, uint32_t fFlags, const char *pszErrorId,
177 const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(4, 5);
178VMMDECL(int) VMSetRuntimeErrorV(PVM pVM, uint32_t fFlags, const char *pszErrorId,
179 const char *pszFormat, va_list args) RT_IPRT_FORMAT_ATTR(4, 0);
180
181/** @name VMSetRuntimeError fFlags
182 * When no flags are given the VM will continue running and it's up to the front
183 * end to take action on the error condition.
184 *
185 * @{ */
186/** The error is fatal.
187 * The VM is not in a state where it can be saved and will enter a state
188 * where it can no longer execute code. The caller <b>must</b> propagate status
189 * codes. */
190#define VMSETRTERR_FLAGS_FATAL RT_BIT_32(0)
191/** Suspend the VM after, or if possible before, raising the error on EMT. The
192 * caller <b>must</b> propagate status codes. */
193#define VMSETRTERR_FLAGS_SUSPEND RT_BIT_32(1)
194/** Don't wait for the EMT to handle the request.
195 * Only valid when on a worker thread and there is a high risk of a dead
196 * lock. Be careful not to flood the user with errors. */
197#define VMSETRTERR_FLAGS_NO_WAIT RT_BIT_32(2)
198/** @} */
199
200/**
201 * VM state change callback function.
202 *
203 * You are not allowed to call any function which changes the VM state from a
204 * state callback, except VMR3Destroy().
205 *
206 * @param pUVM The user mode VM handle.
207 * @param enmState The new state.
208 * @param enmOldState The old state.
209 * @param pvUser The user argument.
210 */
211typedef DECLCALLBACK(void) FNVMATSTATE(PUVM pUVM, VMSTATE enmState, VMSTATE enmOldState, void *pvUser);
212/** Pointer to a VM state callback. */
213typedef FNVMATSTATE *PFNVMATSTATE;
214
215VMMDECL(const char *) VMGetStateName(VMSTATE enmState);
216
217VMMDECL(uint32_t) VMGetResetCount(PVM pVM);
218VMMDECL(uint32_t) VMGetSoftResetCount(PVM pVM);
219VMMDECL(uint32_t) VMGetHardResetCount(PVM pVM);
220
221
222/**
223 * Request type.
224 */
225typedef enum VMREQTYPE
226{
227 /** Invalid request. */
228 VMREQTYPE_INVALID = 0,
229 /** VM: Internal. */
230 VMREQTYPE_INTERNAL,
231 /** Maximum request type (exclusive). Used for validation. */
232 VMREQTYPE_MAX
233} VMREQTYPE;
234
235/**
236 * Request state.
237 */
238typedef enum VMREQSTATE
239{
240 /** The state is invalid. */
241 VMREQSTATE_INVALID = 0,
242 /** The request have been allocated and is in the process of being filed. */
243 VMREQSTATE_ALLOCATED,
244 /** The request is queued by the requester. */
245 VMREQSTATE_QUEUED,
246 /** The request is begin processed. */
247 VMREQSTATE_PROCESSING,
248 /** The request is completed, the requester is begin notified. */
249 VMREQSTATE_COMPLETED,
250 /** The request packet is in the free chain. (The requester */
251 VMREQSTATE_FREE
252} VMREQSTATE;
253
254/**
255 * Request flags.
256 */
257typedef enum VMREQFLAGS
258{
259 /** The request returns a VBox status code. */
260 VMREQFLAGS_VBOX_STATUS = 0,
261 /** The request is a void request and have no status code. */
262 VMREQFLAGS_VOID = 1,
263 /** Return type mask. */
264 VMREQFLAGS_RETURN_MASK = 1,
265 /** Caller does not wait on the packet, EMT will free it. */
266 VMREQFLAGS_NO_WAIT = 2,
267 /** Poke the destination EMT(s) if executing guest code. Use with care. */
268 VMREQFLAGS_POKE = 4,
269 /** Priority request that can safely be processed while doing async
270 * suspend and power off. */
271 VMREQFLAGS_PRIORITY = 8
272} VMREQFLAGS;
273
274
275/**
276 * VM Request packet.
277 *
278 * This is used to request an action in the EMT. Usually the requester is
279 * another thread, but EMT can also end up being the requester in which case
280 * it's carried out synchronously.
281 */
282typedef struct VMREQ
283{
284 /** Pointer to the next request in the chain. */
285 struct VMREQ * volatile pNext;
286 /** Pointer to ring-3 VM structure which this request belongs to. */
287 PUVM pUVM;
288 /** Request state. */
289 volatile VMREQSTATE enmState;
290 /** VBox status code for the completed request. */
291 volatile int32_t iStatus;
292 /** Requester event sem.
293 * The request can use this event semaphore to wait/poll for completion
294 * of the request.
295 */
296 RTSEMEVENT EventSem;
297 /** Set if the event semaphore is clear. */
298 volatile bool fEventSemClear;
299 /** Flags, VMR3REQ_FLAGS_*. */
300 unsigned fFlags;
301 /** Request type. */
302 VMREQTYPE enmType;
303 /** Request destination. */
304 VMCPUID idDstCpu;
305 /** Request specific data. */
306 union VMREQ_U
307 {
308 /** VMREQTYPE_INTERNAL. */
309 struct
310 {
311 /** Pointer to the function to be called. */
312 PFNRT pfn;
313 /** Number of arguments. */
314 unsigned cArgs;
315 /** Array of arguments. */
316 uintptr_t aArgs[64];
317 } Internal;
318 } u;
319} VMREQ;
320/** Pointer to a VM request packet. */
321typedef VMREQ *PVMREQ;
322
323/** @} */
324
325
326#ifndef IN_RC
327/** @defgroup grp_vmm_apis_hc VM Host Context API
328 * @ingroup grp_vm
329 * @{ */
330
331/** @} */
332#endif
333
334
335#ifdef IN_RING3
336/** @defgroup grp_vmm_apis_r3 VM Host Context Ring 3 API
337 * This interface is a _draft_!
338 * @ingroup grp_vm
339 * @{ */
340
341/**
342 * Completion notification codes.
343 */
344typedef enum VMINITCOMPLETED
345{
346 /** The ring-3 init is completed. */
347 VMINITCOMPLETED_RING3 = 1,
348 /** The ring-0 init is completed. */
349 VMINITCOMPLETED_RING0,
350 /** The hardware accelerated virtualization init is completed.
351 * Used to make decisision depending on HM* bits being completely
352 * initialized. */
353 VMINITCOMPLETED_HM,
354 /** The RC init is completed. */
355 VMINITCOMPLETED_RC
356} VMINITCOMPLETED;
357
358
359/** Reason for VM resume. */
360typedef enum VMRESUMEREASON
361{
362 VMRESUMEREASON_INVALID = 0,
363 /** User decided to do so. */
364 VMRESUMEREASON_USER,
365 /** VM reconfiguration (like changing DVD). */
366 VMRESUMEREASON_RECONFIG,
367 /** The host resumed. */
368 VMRESUMEREASON_HOST_RESUME,
369 /** Restored state. */
370 VMRESUMEREASON_STATE_RESTORED,
371 /** Snapshot / saved state. */
372 VMRESUMEREASON_STATE_SAVED,
373 /** Teleported to a new box / instance. */
374 VMRESUMEREASON_TELEPORTED,
375 /** Teleportation failed. */
376 VMRESUMEREASON_TELEPORT_FAILED,
377 /** FTM temporarily suspended the VM. */
378 VMRESUMEREASON_FTM_SYNC,
379 /** End of valid reasons. */
380 VMRESUMEREASON_END,
381 /** Blow the type up to 32-bits. */
382 VMRESUMEREASON_32BIT_HACK = 0x7fffffff
383} VMRESUMEREASON;
384
385/** Reason for VM suspend. */
386typedef enum VMSUSPENDREASON
387{
388 VMSUSPENDREASON_INVALID = 0,
389 /** User decided to do so. */
390 VMSUSPENDREASON_USER,
391 /** VM reconfiguration (like changing DVD). */
392 VMSUSPENDREASON_RECONFIG,
393 /** The VM is suspending itself. */
394 VMSUSPENDREASON_VM,
395 /** The Vm is suspending because of a runtime error. */
396 VMSUSPENDREASON_RUNTIME_ERROR,
397 /** The host was suspended. */
398 VMSUSPENDREASON_HOST_SUSPEND,
399 /** The host is running low on battery power. */
400 VMSUSPENDREASON_HOST_BATTERY_LOW,
401 /** FTM is temporarily suspending the VM. */
402 VMSUSPENDREASON_FTM_SYNC,
403 /** End of valid reasons. */
404 VMSUSPENDREASON_END,
405 /** Blow the type up to 32-bits. */
406 VMSUSPENDREASON_32BIT_HACK = 0x7fffffff
407} VMSUSPENDREASON;
408
409
410/**
411 * Progress callback.
412 *
413 * This will report the completion percentage of an operation.
414 *
415 * @returns VINF_SUCCESS.
416 * @returns Error code to cancel the operation with.
417 * @param pUVM The user mode VM handle.
418 * @param uPercent Completion percentage (0-100).
419 * @param pvUser User specified argument.
420 */
421typedef DECLCALLBACK(int) FNVMPROGRESS(PUVM pUVM, unsigned uPercent, void *pvUser);
422/** Pointer to a FNVMPROGRESS function. */
423typedef FNVMPROGRESS *PFNVMPROGRESS;
424
425
426VMMR3DECL(int) VMR3Create(uint32_t cCpus, PCVMM2USERMETHODS pVm2UserCbs,
427 PFNVMATERROR pfnVMAtError, void *pvUserVM,
428 PFNCFGMCONSTRUCTOR pfnCFGMConstructor, void *pvUserCFGM,
429 PVM *ppVM, PUVM *ppUVM);
430VMMR3DECL(int) VMR3PowerOn(PUVM pUVM);
431VMMR3DECL(int) VMR3Suspend(PUVM pUVM, VMSUSPENDREASON enmReason);
432VMMR3DECL(VMSUSPENDREASON) VMR3GetSuspendReason(PUVM);
433VMMR3DECL(int) VMR3Resume(PUVM pUVM, VMRESUMEREASON enmReason);
434VMMR3DECL(VMRESUMEREASON) VMR3GetResumeReason(PUVM);
435VMMR3DECL(int) VMR3Reset(PUVM pUVM);
436VMMR3_INT_DECL(VBOXSTRICTRC) VMR3ResetFF(PVM pVM);
437VMMR3_INT_DECL(VBOXSTRICTRC) VMR3ResetTripleFault(PVM pVM);
438VMMR3DECL(int) VMR3Save(PUVM pUVM, const char *pszFilename, bool fContinueAfterwards, PFNVMPROGRESS pfnProgress, void *pvUser, bool *pfSuspended);
439VMMR3_INT_DECL(int) VMR3SaveFT(PUVM pUVM, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser, bool *pfSuspended, bool fSkipStateChanges);
440VMMR3DECL(int) VMR3Teleport(PUVM pUVM, uint32_t cMsDowntime, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser, PFNVMPROGRESS pfnProgress, void *pvProgressUser, bool *pfSuspended);
441VMMR3DECL(int) VMR3LoadFromFile(PUVM pUVM, const char *pszFilename, PFNVMPROGRESS pfnProgress, void *pvUser);
442VMMR3DECL(int) VMR3LoadFromStream(PUVM pUVM, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser,
443 PFNVMPROGRESS pfnProgress, void *pvProgressUser);
444VMMR3_INT_DECL(int) VMR3LoadFromStreamFT(PUVM pUVM, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser);
445
446VMMR3DECL(int) VMR3PowerOff(PUVM pUVM);
447VMMR3DECL(int) VMR3Destroy(PUVM pUVM);
448VMMR3_INT_DECL(void) VMR3Relocate(PVM pVM, RTGCINTPTR offDelta);
449
450VMMR3DECL(PVM) VMR3GetVM(PUVM pUVM);
451VMMR3DECL(PUVM) VMR3GetUVM(PVM pVM);
452VMMR3DECL(uint32_t) VMR3RetainUVM(PUVM pUVM);
453VMMR3DECL(uint32_t) VMR3ReleaseUVM(PUVM pUVM);
454VMMR3DECL(const char *) VMR3GetName(PUVM pUVM);
455VMMR3DECL(PRTUUID) VMR3GetUuid(PUVM pUVM, PRTUUID pUuid);
456VMMR3DECL(VMSTATE) VMR3GetState(PVM pVM);
457VMMR3DECL(VMSTATE) VMR3GetStateU(PUVM pUVM);
458VMMR3DECL(const char *) VMR3GetStateName(VMSTATE enmState);
459VMMR3DECL(int) VMR3AtStateRegister(PUVM pUVM, PFNVMATSTATE pfnAtState, void *pvUser);
460VMMR3DECL(int) VMR3AtStateDeregister(PUVM pUVM, PFNVMATSTATE pfnAtState, void *pvUser);
461VMMR3_INT_DECL(bool) VMR3SetGuruMeditation(PVM pVM);
462VMMR3_INT_DECL(bool) VMR3TeleportedAndNotFullyResumedYet(PVM pVM);
463VMMR3DECL(int) VMR3AtErrorRegister(PUVM pUVM, PFNVMATERROR pfnAtError, void *pvUser);
464VMMR3DECL(int) VMR3AtErrorDeregister(PUVM pUVM, PFNVMATERROR pfnAtError, void *pvUser);
465VMMR3DECL(int) VMR3SetError(PUVM pUVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(6, 7);
466VMMR3DECL(int) VMR3SetErrorV(PUVM pUVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va) RT_IPRT_FORMAT_ATTR(6, 0);
467VMMR3_INT_DECL(void) VMR3SetErrorWorker(PVM pVM);
468VMMR3_INT_DECL(uint32_t) VMR3GetErrorCount(PUVM pUVM);
469VMMR3DECL(int) VMR3AtRuntimeErrorRegister(PUVM pUVM, PFNVMATRUNTIMEERROR pfnAtRuntimeError, void *pvUser);
470VMMR3DECL(int) VMR3AtRuntimeErrorDeregister(PUVM pUVM, PFNVMATRUNTIMEERROR pfnAtRuntimeError, void *pvUser);
471VMMR3_INT_DECL(int) VMR3SetRuntimeErrorWorker(PVM pVM);
472VMMR3_INT_DECL(uint32_t) VMR3GetRuntimeErrorCount(PUVM pUVM);
473
474VMMR3DECL(int) VMR3ReqCallU(PUVM pUVM, VMCPUID idDstCpu, PVMREQ *ppReq, RTMSINTERVAL cMillies, uint32_t fFlags, PFNRT pfnFunction, unsigned cArgs, ...);
475VMMR3DECL(int) VMR3ReqCallVU(PUVM pUVM, VMCPUID idDstCpu, PVMREQ *ppReq, RTMSINTERVAL cMillies, uint32_t fFlags, PFNRT pfnFunction, unsigned cArgs, va_list Args);
476VMMR3_INT_DECL(int) VMR3ReqCallWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
477VMMR3DECL(int) VMR3ReqCallWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
478VMMR3DECL(int) VMR3ReqCallNoWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
479VMMR3DECL(int) VMR3ReqCallNoWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
480VMMR3_INT_DECL(int) VMR3ReqCallVoidWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
481VMMR3DECL(int) VMR3ReqCallVoidWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
482VMMR3DECL(int) VMR3ReqCallVoidNoWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
483VMMR3DECL(int) VMR3ReqPriorityCallWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
484VMMR3DECL(int) VMR3ReqPriorityCallWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
485VMMR3DECL(int) VMR3ReqPriorityCallVoidWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
486VMMR3DECL(int) VMR3ReqAlloc(PUVM pUVM, PVMREQ *ppReq, VMREQTYPE enmType, VMCPUID idDstCpu);
487VMMR3DECL(int) VMR3ReqFree(PVMREQ pReq);
488VMMR3DECL(int) VMR3ReqQueue(PVMREQ pReq, RTMSINTERVAL cMillies);
489VMMR3DECL(int) VMR3ReqWait(PVMREQ pReq, RTMSINTERVAL cMillies);
490VMMR3_INT_DECL(int) VMR3ReqProcessU(PUVM pUVM, VMCPUID idDstCpu, bool fPriorityOnly);
491
492/** @name Flags for VMR3NotifyCpuFFU and VMR3NotifyGlobalFFU.
493 * @{ */
494/** Whether we've done REM or not. */
495#define VMNOTIFYFF_FLAGS_DONE_REM RT_BIT_32(0)
496/** Whether we should poke the CPU if it's executing guest code. */
497#define VMNOTIFYFF_FLAGS_POKE RT_BIT_32(1)
498/** @} */
499VMMR3_INT_DECL(void) VMR3NotifyGlobalFFU(PUVM pUVM, uint32_t fFlags);
500VMMR3_INT_DECL(void) VMR3NotifyCpuFFU(PUVMCPU pUVMCpu, uint32_t fFlags);
501VMMR3DECL(int) VMR3NotifyCpuDeviceReady(PVM pVM, VMCPUID idCpu);
502VMMR3_INT_DECL(int) VMR3WaitHalted(PVM pVM, PVMCPU pVCpu, bool fIgnoreInterrupts);
503VMMR3_INT_DECL(int) VMR3WaitU(PUVMCPU pUVMCpu);
504VMMR3DECL(int) VMR3WaitForDeviceReady(PVM pVM, VMCPUID idCpu);
505VMMR3_INT_DECL(int) VMR3AsyncPdmNotificationWaitU(PUVMCPU pUVCpu);
506VMMR3_INT_DECL(void) VMR3AsyncPdmNotificationWakeupU(PUVM pUVM);
507VMMR3_INT_DECL(RTCPUID) VMR3GetVMCPUId(PVM pVM);
508VMMR3_INT_DECL(bool) VMR3IsLongModeAllowed(PVM pVM);
509VMMR3_INT_DECL(RTTHREAD) VMR3GetThreadHandle(PUVMCPU pUVCpu);
510VMMR3DECL(RTTHREAD) VMR3GetVMCPUThread(PUVM pUVM);
511VMMR3DECL(RTNATIVETHREAD) VMR3GetVMCPUNativeThread(PVM pVM);
512VMMR3DECL(RTNATIVETHREAD) VMR3GetVMCPUNativeThreadU(PUVM pUVM);
513VMMR3DECL(int) VMR3GetCpuCoreAndPackageIdFromCpuId(PUVM pUVM, VMCPUID idCpu, uint32_t *pidCpuCore, uint32_t *pidCpuPackage);
514VMMR3_INT_DECL(uint32_t) VMR3GetActiveEmts(PUVM pUVM);
515VMMR3DECL(int) VMR3HotUnplugCpu(PUVM pUVM, VMCPUID idCpu);
516VMMR3DECL(int) VMR3HotPlugCpu(PUVM pUVM, VMCPUID idCpu);
517VMMR3DECL(int) VMR3SetCpuExecutionCap(PUVM pUVM, uint32_t uCpuExecutionCap);
518VMMR3DECL(int) VMR3SetPowerOffInsteadOfReset(PUVM pUVM, bool fPowerOffInsteadOfReset);
519/** @} */
520#endif /* IN_RING3 */
521
522
523#ifdef IN_RC
524/** @defgroup grp_vmm_apis_gc VM Guest Context APIs
525 * @ingroup grp_vm
526 * @{ */
527
528/** @} */
529#endif
530
531RT_C_DECLS_END
532
533/** @} */
534
535#endif /* !VBOX_INCLUDED_vmm_vmapi_h */
536
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette