VirtualBox

source: vbox/trunk/include/VBox/vmm/nem.h@ 73768

Last change on this file since 73768 was 72917, checked in by vboxsync, 6 years ago

NEM: Stop passing pCtx around and use pVCpu->cpum.GstCtx instead. bugref:9044

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.3 KB
Line 
1/** @file
2 * NEM - The Native Execution Manager.
3 */
4
5/*
6 * Copyright (C) 2018 Oracle Corporation
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 *
16 * The contents of this file may alternatively be used under the terms
17 * of the Common Development and Distribution License Version 1.0
18 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
19 * VirtualBox OSE distribution, in which case the provisions of the
20 * CDDL are applicable instead of those of the GPL.
21 *
22 * You may elect to license modified versions of this file under the
23 * terms and conditions of either the GPL or the CDDL or both.
24 */
25
26#ifndef ___VBox_vmm_nem_h
27#define ___VBox_vmm_nem_h
28
29#include <VBox/types.h>
30#include <VBox/vmm/vmapi.h>
31#include <VBox/vmm/pgm.h>
32
33
34RT_C_DECLS_BEGIN
35
36/** @defgroup grp_nem The Native Execution Manager API
37 * @ingroup grp_vmm
38 * @{
39 */
40
41/** @defgroup grp_nem_r3 The NEM ring-3 Context API
42 * @{
43 */
44VMMR3_INT_DECL(int) NEMR3InitConfig(PVM pVM);
45VMMR3_INT_DECL(int) NEMR3Init(PVM pVM, bool fFallback, bool fForced);
46VMMR3_INT_DECL(int) NEMR3InitAfterCPUM(PVM pVM);
47#ifdef IN_RING3
48VMMR3_INT_DECL(int) NEMR3InitCompleted(PVM pVM, VMINITCOMPLETED enmWhat);
49#endif
50VMMR3_INT_DECL(int) NEMR3Term(PVM pVM);
51VMMR3DECL(bool) NEMR3IsEnabled(PUVM pVM);
52VMMR3_INT_DECL(bool) NEMR3NeedSpecialTscMode(PVM pVM);
53VMMR3_INT_DECL(void) NEMR3Reset(PVM pVM);
54VMMR3_INT_DECL(void) NEMR3ResetCpu(PVMCPU pVCpu, bool fInitIpi);
55VMMR3DECL(const char *) NEMR3GetExitName(uint32_t uExit);
56VMMR3_INT_DECL(VBOXSTRICTRC) NEMR3RunGC(PVM pVM, PVMCPU pVCpu);
57VMMR3_INT_DECL(bool) NEMR3CanExecuteGuest(PVM pVM, PVMCPU pVCpu);
58VMMR3_INT_DECL(bool) NEMR3SetSingleInstruction(PVM pVM, PVMCPU pVCpu, bool fEnable);
59VMMR3_INT_DECL(void) NEMR3NotifyFF(PVM pVM, PVMCPU pVCpu, uint32_t fFlags);
60
61VMMR3_INT_DECL(int) NEMR3NotifyPhysRamRegister(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cb);
62VMMR3_INT_DECL(int) NEMR3NotifyPhysMmioExMap(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cb, uint32_t fFlags, void *pvMmio2);
63VMMR3_INT_DECL(int) NEMR3NotifyPhysMmioExUnmap(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cb, uint32_t fFlags);
64/** @name Flags for NEMR3NotifyPhysMmioExMap and NEMR3NotifyPhysMmioExUnmap.
65 * @{ */
66/** Set if it's MMIO2 being mapped or unmapped. */
67#define NEM_NOTIFY_PHYS_MMIO_EX_F_MMIO2 RT_BIT(0)
68/** Set if the range is replacing RAM rather that unused space. */
69#define NEM_NOTIFY_PHYS_MMIO_EX_F_REPLACE RT_BIT(1)
70/** @} */
71
72VMMR3_INT_DECL(int) NEMR3NotifyPhysRomRegisterEarly(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cb, uint32_t fFlags);
73VMMR3_INT_DECL(int) NEMR3NotifyPhysRomRegisterLate(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cb, uint32_t fFlags);
74/** @name Flags for NEMR3NotifyPhysRomRegisterEarly and NEMR3NotifyPhysRomRegisterLate.
75 * @{ */
76/** Set if the range is replacing RAM rather that unused space. */
77#define NEM_NOTIFY_PHYS_ROM_F_REPLACE RT_BIT(1)
78/** Set if it's MMIO2 being mapped or unmapped. */
79#define NEM_NOTIFY_PHYS_ROM_F_SHADOW RT_BIT(2)
80/** @} */
81
82VMMR3_INT_DECL(void) NEMR3NotifySetA20(PVMCPU pVCpu, bool fEnabled);
83/** @} */
84
85
86/** @defgroup grp_nem_r0 The NEM ring-0 Context API
87 * @{ */
88VMMR0_INT_DECL(int) NEMR0InitVM(PGVM pGVM, PVM pVM);
89VMMR0_INT_DECL(int) NEMR0InitVMPart2(PGVM pGVM, PVM pVM);
90VMMR0_INT_DECL(void) NEMR0CleanupVM(PGVM pGVM);
91VMMR0_INT_DECL(int) NEMR0MapPages(PGVM pGVM, PVM pVM, VMCPUID idCpu);
92VMMR0_INT_DECL(int) NEMR0UnmapPages(PGVM pGVM, PVM pVM, VMCPUID idCpu);
93VMMR0_INT_DECL(int) NEMR0ExportState(PGVM pGVM, PVM pVM, VMCPUID idCpu);
94VMMR0_INT_DECL(int) NEMR0ImportState(PGVM pGVM, PVM pVM, VMCPUID idCpu, uint64_t fWhat);
95VMMR0_INT_DECL(int) NEMR0QueryCpuTick(PGVM pGVM, PVM pVM, VMCPUID idCpu);
96VMMR0_INT_DECL(int) NEMR0ResumeCpuTickOnAll(PGVM pGVM, PVM pVM, VMCPUID idCpu, uint64_t uPausedTscValue);
97VMMR0_INT_DECL(VBOXSTRICTRC) NEMR0RunGuestCode(PGVM pGVM, VMCPUID idCpu);
98VMMR0_INT_DECL(int) NEMR0UpdateStatistics(PGVM pGVM, PVM pVM, VMCPUID idCpu);
99VMMR0_INT_DECL(int) NEMR0DoExperiment(PGVM pGVM, PVM pVM, VMCPUID idCpu, uint64_t u64Arg);
100/** @} */
101
102
103/** @defgroup grp_nem_hc The NEM Host Context API
104 * @{
105 */
106VMM_INT_DECL(bool) NEMHCIsLongModeAllowed(PVM pVM);
107VMM_INT_DECL(int) NEMImportStateOnDemand(PVMCPU pVCpu, uint64_t fWhat);
108
109VMM_INT_DECL(void) NEMHCNotifyHandlerPhysicalRegister(PVM pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhys, RTGCPHYS cb);
110VMM_INT_DECL(void) NEMHCNotifyHandlerPhysicalDeregister(PVM pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhys, RTGCPHYS cb,
111 int fRestoreAsRAM, bool fRestoreAsRAM2);
112VMM_INT_DECL(void) NEMHCNotifyHandlerPhysicalModify(PVM pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhysOld,
113 RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fRestoreAsRAM);
114
115VMM_INT_DECL(int) NEMHCNotifyPhysPageAllocated(PVM pVM, RTGCPHYS GCPhys, RTHCPHYS HCPhys, uint32_t fPageProt,
116 PGMPAGETYPE enmType, uint8_t *pu2State);
117VMM_INT_DECL(void) NEMHCNotifyPhysPageProtChanged(PVM pVM, RTGCPHYS GCPhys, RTHCPHYS HCPhys, uint32_t fPageProt,
118 PGMPAGETYPE enmType, uint8_t *pu2State);
119VMM_INT_DECL(void) NEMHCNotifyPhysPageChanged(PVM pVM, RTGCPHYS GCPhys, RTHCPHYS HCPhysPrev, RTHCPHYS HCPhysNew,
120 uint32_t fPageProt, PGMPAGETYPE enmType, uint8_t *pu2State);
121/** @name NEM_PAGE_PROT_XXX - Page protection
122 * @{ */
123#define NEM_PAGE_PROT_NONE UINT32_C(0) /**< All access causes VM exits. */
124#define NEM_PAGE_PROT_READ RT_BIT(0) /**< Read access. */
125#define NEM_PAGE_PROT_EXECUTE RT_BIT(1) /**< Execute access. */
126#define NEM_PAGE_PROT_WRITE RT_BIT(2) /**< write access. */
127/** @} */
128
129VMM_INT_DECL(int) NEMHCQueryCpuTick(PVMCPU pVCpu, uint64_t *pcTicks, uint32_t *puAux);
130VMM_INT_DECL(int) NEMHCResumeCpuTickOnAll(PVM pVM, PVMCPU pVCpu, uint64_t uPausedTscValue);
131
132/** @} */
133
134/** @} */
135RT_C_DECLS_END
136
137
138#endif
139
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use