VirtualBox

source: vbox/trunk/include/VBox/hwaccm.h@ 17246

Last change on this file since 17246 was 17246, checked in by vboxsync, 16 years ago

Allow mixing of VT-x and software virtualization. (untested so far)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.7 KB
Line 
1/** @file
2 * HWACCM - Intel/AMD VM Hardware Support Manager
3 */
4
5/*
6 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
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 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
26 * Clara, CA 95054 USA or visit http://www.sun.com if you need
27 * additional information or have any questions.
28 */
29
30#ifndef ___VBox_hwaccm_h
31#define ___VBox_hwaccm_h
32
33#include <VBox/cdefs.h>
34#include <VBox/types.h>
35#include <VBox/pgm.h>
36#include <iprt/mp.h>
37
38
39/** @defgroup grp_hwaccm The VM Hardware Manager API
40 * @{
41 */
42
43/**
44 * HWACCM state
45 */
46typedef enum HWACCMSTATE
47{
48 /* Not yet set */
49 HWACCMSTATE_UNINITIALIZED = 0,
50 /* Enabled */
51 HWACCMSTATE_ENABLED,
52 /* Disabled */
53 HWACCMSTATE_DISABLED,
54 /** The usual 32-bit hack. */
55 HWACCMSTATE_32BIT_HACK = 0x7fffffff
56} HWACCMSTATE;
57
58__BEGIN_DECLS
59
60/**
61 * Query HWACCM state (enabled/disabled)
62 *
63 * @returns 0 - disabled, 1 - enabled
64 * @param pVM The VM to operate on.
65 */
66#define HWACCMIsEnabled(pVM) ((pVM)->fHWACCMEnabled)
67
68VMMDECL(int) HWACCMInvalidatePage(PVM pVM, RTGCPTR GCVirt);
69VMMDECL(bool) HWACCMHasPendingIrq(PVM pVM);
70
71#ifndef IN_RC
72VMMDECL(int) HWACCMFlushTLB(PVM pVM);
73VMMDECL(int) HWACCMInvalidatePhysPage(PVM pVM, RTGCPHYS GCPhys);
74VMMDECL(bool) HWACCMIsNestedPagingActive(PVM pVM);
75VMMDECL(PGMMODE) HWACCMGetShwPagingMode(PVM pVM);
76VMMDECL(RTCPUID) HWACCMGetVMCPUId(PVM pVM);
77#else
78/* Nop in GC */
79# define HWACCMFlushTLB(pVM) do { } while (0)
80# define HWACCMIsNestedPagingActive(pVM) false
81#endif
82
83#ifdef IN_RING0
84/** @defgroup grp_hwaccm_r0 The VM Hardware Manager API
85 * @ingroup grp_hwaccm
86 * @{
87 */
88VMMR0DECL(int) HWACCMR0Init(void);
89VMMR0DECL(int) HWACCMR0Term(void);
90VMMR0DECL(int) HWACCMR0InitVM(PVM pVM);
91VMMR0DECL(int) HWACCMR0TermVM(PVM pVM);
92VMMR0DECL(int) HWACCMR0EnableAllCpus(PVM pVM);
93VMMR0DECL(int) HWACCMR0EnterSwitcher(PVM pVM, bool *pfVTxDisabled);
94VMMR0DECL(int) HWACCMR0LeaveSwitcher(PVM pVM, bool fVTxDisabled);
95/** @} */
96#endif /* IN_RING0 */
97
98
99#ifdef IN_RING3
100/** @defgroup grp_hwaccm_r3 The VM Hardware Manager API
101 * @ingroup grp_hwaccm
102 * @{
103 */
104VMMR3DECL(bool) HWACCMR3IsEventPending(PVM pVM);
105VMMR3DECL(int) HWACCMR3Init(PVM pVM);
106VMMR3DECL(int) HWACCMR3InitCPU(PVM pVM);
107VMMR3DECL(int) HWACCMR3InitFinalizeR0(PVM pVM);
108VMMR3DECL(void) HWACCMR3Relocate(PVM pVM);
109VMMR3DECL(int) HWACCMR3Term(PVM pVM);
110VMMR3DECL(int) HWACCMR3TermCPU(PVM pVM);
111VMMR3DECL(void) HWACCMR3Reset(PVM pVM);
112VMMR3DECL(void) HWACCMR3CheckError(PVM pVM, int iStatusCode);
113VMMR3DECL(bool) HWACCMR3CanExecuteGuest(PVM pVM, PCPUMCTX pCtx);
114VMMR3DECL(void) HWACCMR3NotifyScheduled(PVMCPU pVCpu);
115VMMR3DECL(void) HWACCMR3NotifyEmulated(PVMCPU pVCpu);
116VMMR3DECL(bool) HWACCMR3IsActive(PVM pVM);
117VMMR3DECL(bool) HWACCMR3IsNestedPagingActive(PVM pVM);
118VMMR3DECL(bool) HWACCMR3IsAllowed(PVM pVM);
119VMMR3DECL(void) HWACCMR3PagingModeChanged(PVM pVM, PGMMODE enmShadowMode, PGMMODE enmGuestMode);
120VMMR3DECL(bool) HWACCMR3IsVPIDActive(PVM pVM);
121VMMR3DECL(int) HWACCMR3InjectNMI(PVM pVM);
122
123/** @} */
124#endif /* IN_RING3 */
125
126#ifdef IN_RING0
127/** @addtogroup grp_hwaccm_r0
128 * @{
129 */
130VMMR0DECL(int) HWACCMR0SetupVM(PVM pVM);
131VMMR0DECL(int) HWACCMR0RunGuestCode(PVM pVM, PVMCPU pVCpu);
132VMMR0DECL(int) HWACCMR0Enter(PVM pVM, PVMCPU pVCpu);
133VMMR0DECL(int) HWACCMR0Leave(PVM pVM, PVMCPU pVCpu);
134VMMR0DECL(int) HWACCMR0InvalidatePage(PVM pVM, PVMCPU pVCpu);
135VMMR0DECL(int) HWACCMR0FlushTLB(PVM pVM);
136VMMR0DECL(bool) HWACCMR0SuspendPending();
137
138# if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS)
139VMMR0DECL(int) HWACCMR0SaveFPUState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
140VMMR0DECL(int) HWACCMR0SaveDebugState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
141VMMR0DECL(int) HWACCMR0TestSwitcher3264(PVM pVM);
142# endif
143
144/** @} */
145#endif /* IN_RING0 */
146
147
148/** @} */
149__END_DECLS
150
151
152#endif
153
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette