EMInternal.h revision 17ba03925269c071aa1567eb8c5a49c37a65f62f
/* $Id$ */
/** @file
* EM - Internal header file.
*/
/*
* Copyright (C) 2006-2007 innotek GmbH
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License as published by the Free Software Foundation,
* in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
* distribution. VirtualBox OSE is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY of any kind.
*
* If you received this file as part of a commercial VirtualBox
* distribution, then only the terms of your commercial VirtualBox
* license agreement apply instead of the previous paragraph.
*/
#ifndef ___EMInternal_h
#define ___EMInternal_h
#include <setjmp.h>
/** @defgroup grp_em_int Internal
* @ingroup grp_em
* @internal
* @{
*/
/** The saved state version. */
#define EM_SAVED_STATE_VERSION 2
/** Enable for tracing in raw mode.
* @remark SvL: debugging help primarily for myself. */
#define DEBUG_TRACING_ENABLED
/**
* Converts a EM pointer into a VM pointer.
* @returns Pointer to the VM structure the EM is part of.
* @param pEM Pointer to EM instance data.
*/
/**
* Cli node structure
*/
typedef struct CLISTAT
{
/** The key is the cli address. */
/** Occurrences. */
/**
* Excessive EM statistics.
*/
typedef struct EMSTATS
{
/** GC: Profiling of EMInterpretInstruction(). */
/** HC: Profiling of EMInterpretInstruction(). */
/** @name Interpreter Instruction statistics.
* @{
*/
/** @} */
/** @name Privileged Instructions Ending Up In HC.
* @{ */
/** @} */
/**
* EM VM Instance data.
* Changes to this must checked against the padding of the cfgm union in VM!
*/
typedef struct EM
{
/** Offset to the VM structure.
* See EM2VM(). */
/** Execution Manager State. */
/** Force raw-mode execution.
* This is used to prevent REM from trying to execute patch code.
* The flag is cleared upon entering emR3RawExecute() and updated in certain return paths. */
bool fForceRAW;
#ifdef DEBUG_TRACING_ENABLED
/** @see DEBUG_TRACING_ENABLED */
bool fTracing;
#endif
/** Inhibit interrupts for this instruction. Valid only when VM_FF_INHIBIT_INTERRUPTS is set. */
/** Pointer to the PATM status structure. (HC Ptr) */
/** Pointer to the guest CPUM state. (HC Ptr) */
union
{
/** Padding used in the other rings.
* This must be larger than jmp_buf on any supported platform. */
#ifdef IN_RING3
/** Long buffer jump for fatal VM errors.
* It will jump to before the outer EM loop is entered. */
#endif
} u;
/** @name Execution profiling.
* @{ */
/** @} */
/** HC: Profiling of emR3RawExecuteIOInstruction. */
/** HC: Profiling of emR3RawPrivileged. */
/** HC: Profiling of emR3RawExecuteInstruction. */
/** @todo r=bird: Are any of these actually used? */
/** More statistics (HC). */
/** More statistics (GC). */
#endif
/** Tree for keeping track of cli occurances (debug only). */
#if 0
/** 64-bit Visual C++ rounds the struct size up to 16 byte. */
#endif
} EM;
/** Pointer to EM VM instance data. */
/** @} */
#endif