em.h revision 196f5d54f710d2479d74f17c81a49562cc74f9a1
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes/** @file
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * EM - Execution Monitor.
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes/*
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * Copyright (C) 2006-2010 Oracle Corporation
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes *
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * This file is part of VirtualBox Open Source Edition (OSE), as
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * available from http://www.virtualbox.org. This file is free software;
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * you can redistribute it and/or modify it under the terms of the GNU
0662ed52e814f8f08ef0e09956413a792584eddffuankg * General Public License (GPL) as published by the Free Software
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * Foundation, in version 2 as it comes in the "COPYING" file of the
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes *
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * The contents of this file may alternatively be used under the terms
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * of the Common Development and Distribution License Version 1.0
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
70953fb44a7140fe206c3a5f011e24209c8c5c6abnicholes * VirtualBox OSE distribution, in which case the provisions of the
70953fb44a7140fe206c3a5f011e24209c8c5c6abnicholes * CDDL are applicable instead of those of the GPL.
44f575c8cb19a7a5cd61664a7848be6bc197df02fuankg *
16b55a35cff91315d261d1baa776138af465c4e4fuankg * You may elect to license modified versions of this file under the
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * terms and conditions of either the GPL or the CDDL or both.
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes#ifndef ___VBox_vmm_em_h
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes#define ___VBox_vmm_em_h
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes#include <VBox/types.h>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes#include <VBox/vmm/trpm.h>
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesRT_C_DECLS_BEGIN
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes/** @defgroup grp_em The Execution Monitor / Manager API
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * @{
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes/** Enable to allow V86 code to run in raw mode. */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes#define VBOX_RAW_V86
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes/**
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * The Execution Manager State.
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholestypedef enum EMSTATE
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes{
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes /** Not yet started. */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes EMSTATE_NONE = 1,
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes /** Raw-mode execution. */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes EMSTATE_RAW,
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes /** Hardware accelerated raw-mode execution. */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes EMSTATE_HWACC,
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes /** Recompiled mode execution. */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes EMSTATE_REM,
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes /** Execution is halted. (waiting for interrupt) */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes EMSTATE_HALTED,
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes /** Application processor execution is halted. (waiting for startup IPI (SIPI)) */
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg EMSTATE_WAIT_SIPI,
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes /** Execution is suspended. */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes EMSTATE_SUSPENDED,
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes /** The VM is terminating. */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes EMSTATE_TERMINATING,
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes /** Guest debug event from raw-mode is being processed. */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes EMSTATE_DEBUG_GUEST_RAW,
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes /** Guest debug event from hardware accelerated mode is being processed. */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes EMSTATE_DEBUG_GUEST_HWACC,
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes /** Guest debug event from recompiled-mode is being processed. */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes EMSTATE_DEBUG_GUEST_REM,
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes /** Hypervisor debug event being processed. */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes EMSTATE_DEBUG_HYPER,
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes /** The VM has encountered a fatal error. (And everyone is panicing....) */
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg EMSTATE_GURU_MEDITATION,
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes /** Just a hack to ensure that we get a 32-bit integer. */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes EMSTATE_MAKE_32BIT_HACK = 0x7fffffff
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes} EMSTATE;
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes/**
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * EMInterpretInstructionCPUEx execution modes.
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholestypedef enum
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes{
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes /** Only supervisor code (CPL=0). */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes EMCODETYPE_SUPERVISOR,
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes /** User-level code only. */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes EMCODETYPE_USER,
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes /** Supervisor and user-level code (use with great care!). */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes EMCODETYPE_ALL,
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes /** Just a hack to ensure that we get a 32-bit integer. */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes EMCODETYPE_32BIT_HACK = 0x7fffffff
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes} EMCODETYPE;
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(EMSTATE) EMGetState(PVMCPU pVCpu);
ac7985784d08a3655291f24f711812b4d8b1cbcffuankgVMMDECL(void) EMSetState(PVMCPU pVCpu, EMSTATE enmNewState);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes/** @name Callback handlers for instruction emulation functions.
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg * These are placed here because IOM wants to use them as well.
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * @{
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes */
0a39e7683f6611d66c55712f50bb240428d832a1bnicholestypedef DECLCALLBACK(uint32_t) FNEMULATEPARAM2UINT32(void *pvParam1, uint64_t val2);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholestypedef FNEMULATEPARAM2UINT32 *PFNEMULATEPARAM2UINT32;
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholestypedef DECLCALLBACK(uint32_t) FNEMULATEPARAM2(void *pvParam1, size_t val2);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholestypedef FNEMULATEPARAM2 *PFNEMULATEPARAM2;
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholestypedef DECLCALLBACK(uint32_t) FNEMULATEPARAM3(void *pvParam1, uint64_t val2, size_t val3);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholestypedef FNEMULATEPARAM3 *PFNEMULATEPARAM3;
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholestypedef DECLCALLBACK(int) FNEMULATELOCKPARAM2(void *pvParam1, uint64_t val2, RTGCUINTREG32 *pf);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholestypedef FNEMULATELOCKPARAM2 *PFNEMULATELOCKPARAM2;
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholestypedef DECLCALLBACK(int) FNEMULATELOCKPARAM3(void *pvParam1, uint64_t val2, size_t cb, RTGCUINTREG32 *pf);
ac7985784d08a3655291f24f711812b4d8b1cbcffuankgtypedef FNEMULATELOCKPARAM3 *PFNEMULATELOCKPARAM3;
0662ed52e814f8f08ef0e09956413a792584eddffuankg/** @} */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes/**
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * Checks if raw ring-3 execute mode is enabled.
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes *
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * @returns true if enabled.
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * @returns false if disabled.
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * @param pVM The VM to operate on.
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes#define EMIsRawRing3Enabled(pVM) (!(pVM)->fRecompileUser)
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes/**
0662ed52e814f8f08ef0e09956413a792584eddffuankg * Checks if raw ring-0 execute mode is enabled.
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes *
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * @returns true if enabled.
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * @returns false if disabled.
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * @param pVM The VM to operate on.
0662ed52e814f8f08ef0e09956413a792584eddffuankg */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes#define EMIsRawRing0Enabled(pVM) (!(pVM)->fRecompileSupervisor)
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(void) EMSetInhibitInterruptsPC(PVMCPU pVCpu, RTGCUINTPTR PC);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(RTGCUINTPTR) EMGetInhibitInterruptsPC(PVMCPU pVCpu);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(int) EMInterpretDisasOne(PVM pVM, PVMCPU pVCpu, PCCPUMCTXCORE pCtxCore, PDISCPUSTATE pCpu, unsigned *pcbInstr);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(int) EMInterpretDisasOneEx(PVM pVM, PVMCPU pVCpu, RTGCUINTPTR GCPtrInstr, PCCPUMCTXCORE pCtxCore,
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes PDISCPUSTATE pDISState, unsigned *pcbInstr);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(VBOXSTRICTRC) EMInterpretInstruction(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, uint32_t *pcbSize);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(VBOXSTRICTRC) EMInterpretInstructionCPU(PVM pVM, PVMCPU pVCpu, PDISCPUSTATE pDISState, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, EMCODETYPE enmCodeType, uint32_t *pcbSize);
0662ed52e814f8f08ef0e09956413a792584eddffuankgVMMDECL(int) EMInterpretCpuId(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(int) EMInterpretRdtsc(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(int) EMInterpretRdpmc(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);
ac7985784d08a3655291f24f711812b4d8b1cbcffuankgVMMDECL(int) EMInterpretRdtscp(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(VBOXSTRICTRC) EMInterpretInvlpg(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pAddrGC);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(int) EMInterpretIret(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(VBOXSTRICTRC) EMInterpretMWait(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);
ac7985784d08a3655291f24f711812b4d8b1cbcffuankgVMMDECL(int) EMInterpretMonitor(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(int) EMInterpretDRxWrite(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, uint32_t DestRegDrx, uint32_t SrcRegGen);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(int) EMInterpretDRxRead(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, uint32_t DestRegGen, uint32_t SrcRegDrx);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(int) EMInterpretCRxWrite(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, uint32_t DestRegCrx, uint32_t SrcRegGen);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(int) EMInterpretCRxRead(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, uint32_t DestRegGen, uint32_t SrcRegCrx);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(int) EMInterpretLMSW(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, uint16_t u16Data);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(int) EMInterpretCLTS(PVM pVM, PVMCPU pVCpu);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(VBOXSTRICTRC) EMInterpretPortIO(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pCtxCore, PDISCPUSTATE pCpu, uint32_t cbOp);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(int) EMInterpretRdmsr(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(int) EMInterpretWrmsr(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(bool) EMShouldContinueAfterHalt(PVMCPU pVCpu, PCPUMCTX pCtx);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes/** @name Assembly routines
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * @{ */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(uint32_t) EMEmulateCmp(uint32_t u32Param1, uint64_t u64Param2, size_t cb);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(uint32_t) EMEmulateAnd(void *pvParam1, uint64_t u64Param2, size_t cb);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(uint32_t) EMEmulateInc(void *pvParam1, size_t cb);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(uint32_t) EMEmulateDec(void *pvParam1, size_t cb);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(uint32_t) EMEmulateOr(void *pvParam1, uint64_t u64Param2, size_t cb);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(int) EMEmulateLockOr(void *pvParam1, uint64_t u64Param2, size_t cbSize, RTGCUINTREG32 *pf);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(uint32_t) EMEmulateXor(void *pvParam1, uint64_t u64Param2, size_t cb);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(int) EMEmulateLockXor(void *pvParam1, uint64_t u64Param2, size_t cbSize, RTGCUINTREG32 *pf);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(uint32_t) EMEmulateAdd(void *pvParam1, uint64_t u64Param2, size_t cb);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(int) EMEmulateLockAnd(void *pvParam1, uint64_t u64Param2, size_t cbSize, RTGCUINTREG32 *pf);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(uint32_t) EMEmulateSub(void *pvParam1, uint64_t u64Param2, size_t cb);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(uint32_t) EMEmulateAdcWithCarrySet(void *pvParam1, uint64_t u64Param2, size_t cb);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(uint32_t) EMEmulateBtr(void *pvParam1, uint64_t u64Param2);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(int) EMEmulateLockBtr(void *pvParam1, uint64_t u64Param2, RTGCUINTREG32 *pf);
cf7ca2f9eaa6523fefcccba4287b91637391fb51fuankgVMMDECL(uint32_t) EMEmulateBts(void *pvParam1, uint64_t u64Param2);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(uint32_t) EMEmulateBtc(void *pvParam1, uint64_t u64Param2);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(uint32_t) EMEmulateCmpXchg(void *pvParam1, uint64_t *pu32Param2, uint64_t u32Param3, size_t cbSize);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(uint32_t) EMEmulateLockCmpXchg(void *pvParam1, uint64_t *pu64Param2, uint64_t u64Param3, size_t cbSize);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(uint32_t) EMEmulateCmpXchg8b(void *pu32Param1, uint32_t *pEAX, uint32_t *pEDX, uint32_t uEBX, uint32_t uECX);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(uint32_t) EMEmulateLockCmpXchg8b(void *pu32Param1, uint32_t *pEAX, uint32_t *pEDX, uint32_t uEBX, uint32_t uECX);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(uint32_t) EMEmulateXAdd(void *pvParam1, void *pvParam2, size_t cbOp);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(uint32_t) EMEmulateLockXAdd(void *pvParam1, void *pvParam2, size_t cbOp);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes/** @} */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes/** @name REM locking routines
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * @{ */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(void) EMRemUnlock(PVM pVM);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(void) EMRemLock(PVM pVM);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(bool) EMRemIsLockOwner(PVM pVM);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMDECL(int) EMRemTryLock(PVM pVM);
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg/** @} */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes#ifdef IN_RING3
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes/** @defgroup grp_em_r3 The EM Host Context Ring-3 API
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * @ingroup grp_em
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * @{
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMR3DECL(int) EMR3Init(PVM pVM);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMR3DECL(void) EMR3Relocate(PVM pVM);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMR3DECL(void) EMR3ResetCpu(PVMCPU pVCpu);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMR3DECL(void) EMR3Reset(PVM pVM);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMR3DECL(int) EMR3Term(PVM pVM);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMR3DECL(DECLNORETURN(void)) EMR3FatalError(PVMCPU pVCpu, int rc);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMR3DECL(int) EMR3ExecuteVM(PVM pVM, PVMCPU pVCpu);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMR3DECL(int) EMR3CheckRawForcedActions(PVM pVM, PVMCPU pVCpu);
8ffac2c334103c0336602aaede650cb578611151fuankgVMMR3DECL(int) EMR3Interpret(PVM pVM);
8ffac2c334103c0336602aaede650cb578611151fuankg
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes/**
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * Command argument for EMR3RawSetMode().
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg *
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg * It's possible to extend this interface to change several
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * execution modes at once should the need arise.
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholestypedef enum EMEXECPOLICY
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes{
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes /** The customary invalid zero entry. */
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg EMEXECPOLICY_INVALID = 0,
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg /** Whether to recompile ring-0 code or execute it in raw/hm. */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes EMEXECPOLICY_RECOMPILE_RING0,
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes /** Whether to recompile ring-3 code or execute it in raw/hm. */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes EMEXECPOLICY_RECOMPILE_RING3,
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes /** End of valid value (not included). */
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg EMEXECPOLICY_END,
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes /** The customary 32-bit type blowup. */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes EMEXECPOLICY_32BIT_HACK = 0x7fffffff
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes} EMEXECPOLICY;
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMR3DECL(int) EMR3SetExecutionPolicy(PVM pVM, EMEXECPOLICY enmPolicy, bool fEnforce);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes/** @} */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes#endif /* IN_RING3 */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes#ifdef IN_RC
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg/** @defgroup grp_em_gc The EM Guest Context API
0662ed52e814f8f08ef0e09956413a792584eddffuankg * @ingroup grp_em
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes * @{
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesVMMRCDECL(int) EMGCTrap(PVM pVM, unsigned uTrap, PCPUMCTXCORE pRegFrame);
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes/** @} */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes#endif /* IN_RC */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes/** @} */
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholesRT_C_DECLS_END
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes#endif
3c937b528ca923d5b51e63def9f888af4a77bb40bnicholes
0662ed52e814f8f08ef0e09956413a792584eddffuankg