VMInternal.h revision aafa3e3a526c178adf4947048684ed4590a16981
f48205be61a214698b763ff550ab9e657525104ccasper * VM - Internal header file.
f48205be61a214698b763ff550ab9e657525104ccasper * Copyright (C) 2006-2011 Oracle Corporation
f48205be61a214698b763ff550ab9e657525104ccasper * This file is part of VirtualBox Open Source Edition (OSE), as
f48205be61a214698b763ff550ab9e657525104ccasper * available from http://www.virtualbox.org. This file is free software;
f48205be61a214698b763ff550ab9e657525104ccasper * you can redistribute it and/or modify it under the terms of the GNU
f48205be61a214698b763ff550ab9e657525104ccasper * General Public License (GPL) as published by the Free Software
f48205be61a214698b763ff550ab9e657525104ccasper * Foundation, in version 2 as it comes in the "COPYING" file of the
f48205be61a214698b763ff550ab9e657525104ccasper * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
f48205be61a214698b763ff550ab9e657525104ccasper * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States#include <iprt/assert.h>
f48205be61a214698b763ff550ab9e657525104ccasper/** @defgroup grp_vm_int Internals
f48205be61a214698b763ff550ab9e657525104ccasper * @ingroup grp_vm
f48205be61a214698b763ff550ab9e657525104ccasper * @internal
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw * VM state change callback.
f48205be61a214698b763ff550ab9e657525104ccaspertypedef struct VMATSTATE
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw /** Pointer to the next one. */
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw /** Pointer to the callback. */
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw /** The user argument. */
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw/** Pointer to a VM state change callback. */
bda89588bd7667394a834e8a9a34612cce2ae9c3jp * VM error callback.
f48205be61a214698b763ff550ab9e657525104ccaspertypedef struct VMATERROR
bda89588bd7667394a834e8a9a34612cce2ae9c3jp /** Pointer to the next one. */
bda89588bd7667394a834e8a9a34612cce2ae9c3jp /** Pointer to the callback. */
bda89588bd7667394a834e8a9a34612cce2ae9c3jp /** The user argument. */
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw/** Pointer to a VM error callback. */
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw * Chunk of memory allocated off the hypervisor heap in which
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw * we copy the error details.
c5c4113dfcabb1eed3d4bdf7609de5170027a794nwtypedef struct VMERROR
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw /** The size of the chunk. */
f48205be61a214698b763ff550ab9e657525104ccasper /** The current offset into the chunk.
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw * We start by putting the filename and function immediately
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw * after the end of the buffer. */
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw /** Offset from the start of this structure to the file name. */
c5c4113dfcabb1eed3d4bdf7609de5170027a794nw /** The line number. */
f48205be61a214698b763ff550ab9e657525104ccasper /** Offset from the start of this structure to the function name. */
f48205be61a214698b763ff550ab9e657525104ccasper /** Offset from the start of this structure to the formatted message text. */
f48205be61a214698b763ff550ab9e657525104ccasper /** The VBox status code. */
f48205be61a214698b763ff550ab9e657525104ccasper * VM runtime error callback.
f48205be61a214698b763ff550ab9e657525104ccasper /** Pointer to the next one. */
bda89588bd7667394a834e8a9a34612cce2ae9c3jp /** Pointer to the callback. */
f48205be61a214698b763ff550ab9e657525104ccasper /** The user argument. */
f48205be61a214698b763ff550ab9e657525104ccasper/** Pointer to a VM error callback. */
f48205be61a214698b763ff550ab9e657525104ccasper * Chunk of memory allocated off the hypervisor heap in which
bda89588bd7667394a834e8a9a34612cce2ae9c3jp * we copy the runtime error details.
f48205be61a214698b763ff550ab9e657525104ccaspertypedef struct VMRUNTIMEERROR
f48205be61a214698b763ff550ab9e657525104ccasper /** The size of the chunk. */
bda89588bd7667394a834e8a9a34612cce2ae9c3jp /** The current offset into the chunk.
f48205be61a214698b763ff550ab9e657525104ccasper * We start by putting the error ID immediately
f48205be61a214698b763ff550ab9e657525104ccasper * after the end of the buffer. */
f48205be61a214698b763ff550ab9e657525104ccasper /** Offset from the start of this structure to the error ID. */
f48205be61a214698b763ff550ab9e657525104ccasper /** Offset from the start of this structure to the formatted message text. */
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States /** Error flags. */
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States uint32_t fFlags;
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States} VMRUNTIMEERROR, *PVMRUNTIMEERROR;
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States/** The halt method. */
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United Statestypedef enum
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States{
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States /** The usual invalid value. */
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States VMHALTMETHOD_INVALID = 0,
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States /** Use the method used during bootstrapping. */
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States VMHALTMETHOD_BOOTSTRAP,
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States /** Use the default method. */
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States VMHALTMETHOD_DEFAULT,
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States /** The old spin/yield/block method. */
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States VMHALTMETHOD_OLD,
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States /** The first go at a block/spin method. */
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States VMHALTMETHOD_1,
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States /** The first go at a more global approach. */
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States VMHALTMETHOD_GLOBAL_1,
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States /** The end of valid methods. (not inclusive of course) */
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States VMHALTMETHOD_END,
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States /** The usual 32-bit max value. */
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States VMHALTMETHOD_32BIT_HACK = 0x7fffffff
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States} VMHALTMETHOD;
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States/**
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States * VM Internal Data (part of the VM structure).
f48205be61a214698b763ff550ab9e657525104ccasper * @todo Move this and all related things to VMM. The VM component was, to some
f48205be61a214698b763ff550ab9e657525104ccasper * extent at least, a bad ad hoc design which should all have been put in
f48205be61a214698b763ff550ab9e657525104ccasper * VMM. @see pg_vm.
f48205be61a214698b763ff550ab9e657525104ccaspertypedef struct VMINT
f48205be61a214698b763ff550ab9e657525104ccasper /** VM Error Message. */
f48205be61a214698b763ff550ab9e657525104ccasper /** VM Runtime Error Message. */
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States R3PTRTYPE(PVMRUNTIMEERROR) pRuntimeErrorR3;
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States /** The VM was/is-being teleported and has not yet been fully resumed. */
f48205be61a214698b763ff550ab9e657525104ccasper /** The VM should power off instead of reset. */
#ifdef IN_RING3
typedef struct VMINTUSERPERVM
# ifdef VBOX_WITH_STATISTICS
bool volatile fTerminateEMT;
* Can be selected by CFGM option 'VM/HaltMethod'. */
} Method12;
} Global1;
} Halt;
void *pvDBGC;
char *pszName;
# ifdef VBOX_WITH_STATISTICS
typedef struct VMINTUSERPERVMCPU
bool volatile fWait;
} Method12;
} Method34;
} Halt;
DECLCALLBACK(void) vmR3SetErrorUV(PUVM pUVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list *args);
DECLCALLBACK(int) vmR3SetRuntimeError(PVM pVM, uint32_t fFlags, const char *pszErrorId, char *pszMessage);
DECLCALLBACK(int) vmR3SetRuntimeErrorV(PVM pVM, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list *pVa);
void vmSetRuntimeErrorCopy(PVM pVM, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va);