rem.h revision c1d279fc0865b91a40b30eda02ed14f6533fe1a4
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync/** @file
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * REM - The Recompiled Execution Manager.
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync */
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync/*
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * Copyright (C) 2006-2015 Oracle Corporation
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync *
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * available from http://www.virtualbox.org. This file is free software;
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * you can redistribute it and/or modify it under the terms of the GNU
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * General Public License (GPL) as published by the Free Software
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync *
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * The contents of this file may alternatively be used under the terms
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * of the Common Development and Distribution License Version 1.0
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * VirtualBox OSE distribution, in which case the provisions of the
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * CDDL are applicable instead of those of the GPL.
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync *
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * You may elect to license modified versions of this file under the
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * terms and conditions of either the GPL or the CDDL or both.
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync */
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync#ifndef ___VBox_vmm_rem_h
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync#define ___VBox_vmm_rem_h
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync#include <VBox/types.h>
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync#include <VBox/vmm/pgm.h>
7e960d3a0a8a3a84d7aba2cca45d72b1c31cc97bvboxsync#include <VBox/vmm/vmapi.h>
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync
d31ded334a29f575e23dc889b603b1a586759348vboxsyncRT_C_DECLS_BEGIN
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync
d31ded334a29f575e23dc889b603b1a586759348vboxsync/** @defgroup grp_rem The Recompiled Execution Manager API
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * @{
61fa69e2bc9fc9e7490feed1c020273f3ddb238dvboxsync */
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync/** No pending interrupt. */
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync#define REM_NO_PENDING_IRQ (~(uint32_t)0)
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync
b74ca013e5f201a2dd371e6c438433ceac12af30vboxsync
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync#if defined(IN_RING0) || defined(IN_RC)
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsyncVMMDECL(void) REMNotifyInvalidatePage(PVM pVM, RTGCPTR GCPtrPage);
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsyncVMMDECL(void) REMNotifyHandlerPhysicalRegister(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhys, RTGCPHYS cb, bool fHasHCHandler);
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsyncVMMDECL(void) REMNotifyHandlerPhysicalDeregister(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhys, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM);
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsyncVMMDECL(void) REMNotifyHandlerPhysicalModify(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhysOld, RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM);
590bfe12ce22cd3716448fbb9f4dc51664bfe5e2vboxsync#endif /* IN_RING0 || IN_RC */
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync#ifdef IN_RC
223cf005b18af2c21352a70693ebaf0582f68ebcvboxsyncVMMDECL(void) REMNotifyHandlerPhysicalFlushIfAlmostFull(PVM pVM, PVMCPU pVCpu);
223cf005b18af2c21352a70693ebaf0582f68ebcvboxsync#endif
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsyncVMMDECL(void) REMFlushTBs(PVM pVM);
afed5ab737f4aacfae3fe73776f40e989190a7cavboxsync
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync#ifdef IN_RING3
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync/** @defgroup grp_rem_r3 REM Host Context Ring 3 API
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * @{
0174432b2b1a760b89840ba696f7ba51def65dddvboxsync */
2daaccf68be3773aee600c5c3e48bcf5401418a6vboxsyncREMR3DECL(int) REMR3Init(PVM pVM);
0174432b2b1a760b89840ba696f7ba51def65dddvboxsyncREMR3DECL(int) REMR3InitFinalize(PVM pVM);
614cbe11a7e5588dc8d369e223174b1441a09359vboxsyncREMR3DECL(int) REMR3Term(PVM pVM);
614cbe11a7e5588dc8d369e223174b1441a09359vboxsyncREMR3DECL(void) REMR3Reset(PVM pVM);
614cbe11a7e5588dc8d369e223174b1441a09359vboxsyncREMR3DECL(int) REMR3Run(PVM pVM, PVMCPU pVCpu);
7666082b743c5e146a8cee6cc794ff4bc3fd0ffdvboxsyncREMR3DECL(int) REMR3EmulateInstruction(PVM pVM, PVMCPU pVCpu);
7666082b743c5e146a8cee6cc794ff4bc3fd0ffdvboxsyncREMR3DECL(int) REMR3Step(PVM pVM, PVMCPU pVCpu);
7666082b743c5e146a8cee6cc794ff4bc3fd0ffdvboxsyncREMR3DECL(int) REMR3BreakpointSet(PVM pVM, RTGCUINTPTR Address);
7666082b743c5e146a8cee6cc794ff4bc3fd0ffdvboxsyncREMR3DECL(int) REMR3BreakpointClear(PVM pVM, RTGCUINTPTR Address);
7666082b743c5e146a8cee6cc794ff4bc3fd0ffdvboxsyncREMR3DECL(int) REMR3State(PVM pVM, PVMCPU pVCpu);
7666082b743c5e146a8cee6cc794ff4bc3fd0ffdvboxsyncREMR3DECL(int) REMR3StateBack(PVM pVM, PVMCPU pVCpu);
590bfe12ce22cd3716448fbb9f4dc51664bfe5e2vboxsyncREMR3DECL(void) REMR3StateUpdate(PVM pVM, PVMCPU pVCpu);
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsyncREMR3DECL(void) REMR3A20Set(PVM pVM, PVMCPU pVCpu, bool fEnable);
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsyncREMR3DECL(int) REMR3DisasEnableStepping(PVM pVM, bool fEnable);
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsyncREMR3DECL(void) REMR3ReplayHandlerNotifications(PVM pVM);
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsyncREMR3DECL(int) REMR3NotifyCodePageChanged(PVM pVM, PVMCPU pVCpu, RTGCPTR pvCodePage);
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsyncREMR3DECL(void) REMR3NotifyPhysRamRegister(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cb, unsigned fFlags);
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync/** @name Flags for REMR3NotifyPhysRamRegister.
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * @{ */
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync#define REM_NOTIFY_PHYS_RAM_FLAGS_RAM RT_BIT(16)
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync#define REM_NOTIFY_PHYS_RAM_FLAGS_MMIO2 RT_BIT(17)
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync/** @} */
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsyncREMR3DECL(void) REMR3NotifyPhysRomRegister(PVM pVM, RTGCPHYS GCPhys, RTUINT cb, void *pvCopy, bool fShadow);
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsyncREMR3DECL(void) REMR3NotifyPhysRamDeregister(PVM pVM, RTGCPHYS GCPhys, RTUINT cb);
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsyncREMR3DECL(void) REMR3NotifyHandlerPhysicalRegister(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhys, RTGCPHYS cb, bool fHasHCHandler);
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsyncREMR3DECL(void) REMR3NotifyHandlerPhysicalDeregister(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhys, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM);
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsyncREMR3DECL(void) REMR3NotifyHandlerPhysicalModify(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhysOld, RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM);
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsyncREMR3DECL(void) REMR3NotifyPendingInterrupt(PVM pVM, PVMCPU pVCpu, uint8_t u8Interrupt);
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsyncREMR3DECL(uint32_t) REMR3QueryPendingInterrupt(PVM pVM, PVMCPU pVCpu);
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsyncREMR3DECL(void) REMR3NotifyInterruptSet(PVM pVM, PVMCPU pVCpu);
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsyncREMR3DECL(void) REMR3NotifyInterruptClear(PVM pVM, PVMCPU pVCpu);
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsyncREMR3DECL(void) REMR3NotifyTimerPending(PVM pVM, PVMCPU pVCpuDst);
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsyncREMR3DECL(void) REMR3NotifyDmaPending(PVM pVM);
22e281e75ed636601178296c6daebda8f1d17c59vboxsyncREMR3DECL(void) REMR3NotifyQueuePending(PVM pVM);
22e281e75ed636601178296c6daebda8f1d17c59vboxsyncREMR3DECL(void) REMR3NotifyFF(PVM pVM);
22e281e75ed636601178296c6daebda8f1d17c59vboxsyncREMR3DECL(bool) REMR3IsPageAccessHandled(PVM pVM, RTGCPHYS GCPhys);
22e281e75ed636601178296c6daebda8f1d17c59vboxsync/** @} */
22e281e75ed636601178296c6daebda8f1d17c59vboxsync#endif /* IN_RING3 */
22e281e75ed636601178296c6daebda8f1d17c59vboxsync
22e281e75ed636601178296c6daebda8f1d17c59vboxsync
22e281e75ed636601178296c6daebda8f1d17c59vboxsync/** @} */
22e281e75ed636601178296c6daebda8f1d17c59vboxsyncRT_C_DECLS_END
22e281e75ed636601178296c6daebda8f1d17c59vboxsync
22e281e75ed636601178296c6daebda8f1d17c59vboxsync
22e281e75ed636601178296c6daebda8f1d17c59vboxsync#endif
22e281e75ed636601178296c6daebda8f1d17c59vboxsync
22e281e75ed636601178296c6daebda8f1d17c59vboxsync