VirtualBox

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

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

#1865: HWACCM - alignment fix+check for 32-bit gcc, doxygen.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.0 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(a) (a->fHWACCMEnabled)
67
68HWACCMDECL(int) HWACCMInvalidatePage(PVM pVM, RTGCPTR GCVirt);
69HWACCMDECL(bool) HWACCMHasPendingIrq(PVM pVM);
70
71#ifndef IN_GC
72HWACCMDECL(int) HWACCMFlushTLB(PVM pVM);
73HWACCMDECL(int) HWACCMInvalidatePhysPage(PVM pVM, RTGCPHYS GCPhys);
74HWACCMDECL(bool) HWACCMIsNestedPagingActive(PVM pVM);
75HWACCMDECL(PGMMODE) HWACCMGetPagingMode(PVM pVM);
76#else
77/* Nop in GC */
78# define HWACCMFlushTLB(pVM) do { } while (0)
79# define HWACCMIsNestedPagingActive(pVM) false
80#endif
81
82#ifdef IN_RING0
83/** @defgroup grp_hwaccm_r0 The VM Hardware Manager API
84 * @ingroup grp_hwaccm
85 * @{
86 */
87HWACCMR0DECL(int) HWACCMR0Init(void);
88HWACCMR0DECL(int) HWACCMR0Term(void);
89HWACCMR0DECL(int) HWACCMR0InitVM(PVM pVM);
90HWACCMR0DECL(int) HWACCMR0TermVM(PVM pVM);
91HWACCMR0DECL(int) HWACCMR0EnableAllCpus(PVM pVM, HWACCMSTATE enmNewHwAccmState);
92/** @} */
93#endif /* IN_RING0 */
94
95
96#ifdef IN_RING3
97/** @defgroup grp_hwaccm_r3 The VM Hardware Manager API
98 * @ingroup grp_hwaccm
99 * @{
100 */
101HWACCMR3DECL(bool) HWACCMR3IsEventPending(PVM pVM);
102HWACCMR3DECL(int) HWACCMR3Init(PVM pVM);
103HWACCMR3DECL(int) HWACCMR3InitFinalizeR0(PVM pVM);
104HWACCMR3DECL(void) HWACCMR3Relocate(PVM pVM);
105HWACCMR3DECL(int) HWACCMR3Term(PVM pVM);
106HWACCMR3DECL(void) HWACCMR3Reset(PVM pVM);
107HWACCMR3DECL(void) HWACCMR3CheckError(PVM pVM, int iStatusCode);
108HWACCMR3DECL(bool) HWACCMR3CanExecuteGuest(PVM pVM, PCPUMCTX pCtx);
109HWACCMR3DECL(bool) HWACCMR3IsActive(PVM pVM);
110HWACCMR3DECL(bool) HWACCMR3IsNestedPagingActive(PVM pVM);
111HWACCMR3DECL(bool) HWACCMR3IsAllowed(PVM pVM);
112HWACCMR3DECL(void) HWACCMR3PagingModeChanged(PVM pVM, PGMMODE enmShadowMode);
113/** @} */
114#endif /* IN_RING3 */
115
116#ifdef IN_RING0
117/** @addtogroup grp_hwaccm_r0
118 * @{
119 */
120HWACCMR0DECL(int) HWACCMR0SetupVM(PVM pVM);
121HWACCMR0DECL(int) HWACCMR0RunGuestCode(PVM pVM);
122HWACCMR0DECL(int) HWACCMR0Enter(PVM pVM);
123HWACCMR0DECL(int) HWACCMR0Leave(PVM pVM);
124HWACCMR0DECL(int) HWACCMR0InvalidatePage(PVM pVM, RTGCPTR GCVirt);
125HWACCMR0DECL(int) HWACCMR0FlushTLB(PVM pVM);
126/** @} */
127#endif /* IN_RING0 */
128
129
130/** @} */
131__END_DECLS
132
133
134#endif
135
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