EMInternal.h revision ab0130d1627b2b214952b929de71b89e4ba41eb1
/* $Id$ */
/** @file
* EM - Internal header file.
*/
/*
* Copyright (C) 2006-2007 Sun Microsystems, Inc.
*
* 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 (GPL) 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.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
#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
/**
* 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.
* @{ */
/** @} */
} EMSTATS;
/** Pointer to the excessive EM statistics. */
/**
* 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.
*/
/**
* 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
/* Set when the translation blocks in the recompiler cache need to be flushed. */
bool fREMFlushTBs;
/** Inhibit interrupts for this instruction. Valid only when VM_FF_INHIBIT_INTERRUPTS is set. */
/** Pointer to the PATM status structure. (R3 Ptr) */
/** Pointer to the guest CPUM state. (R3 Ptr) */
#if GC_ARCH_BITS == 64
#endif
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.
* @{ */
/** @} */
/** R3: Profiling of emR3RawExecuteIOInstruction. */
/** R3: Profiling of emR3RawPrivileged. */
/** R3: Profiling of emR3RawExecuteInstruction. */
/** R3: Number of time emR3HwAccExecute is called. */
/** More statistics (R3). */
/** More statistics (R0). */
/** More statistics (RC). */
#if HC_ARCH_BITS == 64
#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