VirtualBox

source: vbox/trunk/include/VBox/vmm/cpum.h@ 98989

Last change on this file since 98989 was 98972, checked in by vboxsync, 2 years ago

VMM: More ARMv8 x86/amd64 separation work, get past DBGF, bugref:10385

  • 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 * CPUM - CPU Monitor(/ Manager).
3 */
4
5/*
6 * Copyright (C) 2006-2023 Oracle and/or its affiliates.
7 *
8 * This file is part of VirtualBox base platform packages, as
9 * available from https://www.virtualbox.org.
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation, in version 3 of the
14 * License.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, see <https://www.gnu.org/licenses>.
23 *
24 * The contents of this file may alternatively be used under the terms
25 * of the Common Development and Distribution License Version 1.0
26 * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
27 * in the VirtualBox distribution, in which case the provisions of the
28 * CDDL are applicable instead of those of the GPL.
29 *
30 * You may elect to license modified versions of this file under the
31 * terms and conditions of either the GPL or the CDDL or both.
32 *
33 * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
34 */
35
36#ifndef VBOX_INCLUDED_vmm_cpum_h
37#define VBOX_INCLUDED_vmm_cpum_h
38#ifndef RT_WITHOUT_PRAGMA_ONCE
39# pragma once
40#endif
41
42#include <VBox/types.h>
43#include <VBox/vmm/cpumctx.h>
44#include <VBox/vmm/stam.h>
45#include <VBox/vmm/vmapi.h>
46#include <VBox/vmm/cpum-common.h>
47
48#ifndef VBOX_VMM_TARGET_ARMV8
49# include <VBox/vmm/cpum-x86-amd64.h>
50#else
51# include <VBox/vmm/cpum-armv8.h>
52#endif
53
54RT_C_DECLS_BEGIN
55
56/** @defgroup grp_cpum The CPU Monitor / Manager API
57 * @ingroup grp_vmm
58 * @{
59 */
60
61#ifndef VBOX_FOR_DTRACE_LIB
62
63VMMDECL(PCPUMCTX) CPUMQueryGuestCtxPtr(PVMCPU pVCpu);
64VMMDECL(CPUMMODE) CPUMGetGuestMode(PVMCPU pVCpu);
65
66/** @name Guest Register Getters.
67 * @{ */
68VMMDECL(uint64_t) CPUMGetGuestFlatPC(PVMCPU pVCpu);
69VMMDECL(uint64_t) CPUMGetGuestFlatSP(PVMCPU pVCpu);
70VMMDECL(CPUMCPUVENDOR) CPUMGetGuestCpuVendor(PVM pVM);
71VMMDECL(CPUMMICROARCH) CPUMGetGuestMicroarch(PCVM pVM);
72VMMDECL(void) CPUMGetGuestAddrWidths(PCVM pVM, uint8_t *pcPhysAddrWidth, uint8_t *pcLinearAddrWidth);
73/** @} */
74
75/** @name Misc Guest Predicate Functions.
76 * @{ */
77VMMDECL(bool) CPUMIsGuestIn64BitCode(PVMCPU pVCpu);
78/** @} */
79
80VMMDECL(CPUMCPUVENDOR) CPUMGetHostCpuVendor(PVM pVM);
81VMMDECL(CPUMMICROARCH) CPUMGetHostMicroarch(PCVM pVM);
82
83#ifdef IN_RING3
84/** @defgroup grp_cpum_r3 The CPUM ring-3 API
85 * @{
86 */
87
88VMMR3DECL(int) CPUMR3Init(PVM pVM);
89VMMR3DECL(int) CPUMR3InitCompleted(PVM pVM, VMINITCOMPLETED enmWhat);
90VMMR3DECL(void) CPUMR3LogCpuIdAndMsrFeatures(PVM pVM);
91VMMR3DECL(void) CPUMR3Relocate(PVM pVM);
92VMMR3DECL(int) CPUMR3Term(PVM pVM);
93VMMR3DECL(void) CPUMR3Reset(PVM pVM);
94VMMR3DECL(void) CPUMR3ResetCpu(PVM pVM, PVMCPU pVCpu);
95VMMDECL(bool) CPUMR3IsStateRestorePending(PVM pVM);
96VMMDECL(const char *) CPUMMicroarchName(CPUMMICROARCH enmMicroarch);
97VMMR3DECL(const char *) CPUMCpuVendorName(CPUMCPUVENDOR enmVendor);
98
99VMMR3DECL(uint32_t) CPUMR3DbGetEntries(void);
100/** Pointer to CPUMR3DbGetEntries. */
101typedef DECLCALLBACKPTR(uint32_t, PFNCPUMDBGETENTRIES, (void));
102VMMR3DECL(PCCPUMDBENTRY) CPUMR3DbGetEntryByIndex(uint32_t idxCpuDb);
103/** Pointer to CPUMR3DbGetEntryByIndex. */
104typedef DECLCALLBACKPTR(PCCPUMDBENTRY, PFNCPUMDBGETENTRYBYINDEX, (uint32_t idxCpuDb));
105VMMR3DECL(PCCPUMDBENTRY) CPUMR3DbGetEntryByName(const char *pszName);
106/** Pointer to CPUMR3DbGetEntryByName. */
107typedef DECLCALLBACKPTR(PCCPUMDBENTRY, PFNCPUMDBGETENTRYBYNAME, (const char *pszName));
108
109VMMR3_INT_DECL(void) CPUMR3NemActivateGuestDebugState(PVMCPUCC pVCpu);
110VMMR3_INT_DECL(void) CPUMR3NemActivateHyperDebugState(PVMCPUCC pVCpu);
111/** @} */
112#endif /* IN_RING3 */
113
114#endif /* !VBOX_FOR_DTRACE_LIB */
115/** @} */
116RT_C_DECLS_END
117
118
119#endif /* !VBOX_INCLUDED_vmm_cpum_h */
120
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