VirtualBox

source: vbox/trunk/src/VBox/VMM/include/PMUInternal.h@ 106683

Last change on this file since 106683 was 106476, checked in by vboxsync, 6 weeks ago

VMMArm: Skeleton of the PMU device emulation enough to make Windows/ARM boot as a guest and have it out of the NEM darwin backend, bugref:10778

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.8 KB
Line 
1/* $Id: PMUInternal.h 106476 2024-10-18 12:57:36Z vboxsync $ */
2/** @file
3 * PMU - Performance Monitoring Unit.
4 */
5
6/*
7 * Copyright (C) 2024 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28#ifndef VMM_INCLUDED_SRC_include_PMUInternal_h
29#define VMM_INCLUDED_SRC_include_PMUInternal_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34#include <VBox/vmm/pdmdev.h>
35
36
37/** @defgroup grp_pmu_int Internal
38 * @ingroup grp_pmu
39 * @internal
40 * @{
41 */
42
43
44#ifdef IN_RING3
45# define VMCPU_TO_PMU_DEVINS(a_pVCpu) ((a_pVCpu)->pVMR3->pmu.s.pDevInsR3)
46#elif defined(IN_RING0)
47# error "Not implemented!"
48#endif
49
50/**
51 * PMU PDM instance data (per-VM).
52 */
53typedef struct PMUDEV
54{
55 /** @todo */
56 uint8_t bDummy;
57
58} PMUDEV;
59/** Pointer to a PMU device. */
60typedef PMUDEV *PPMUDEV;
61/** Pointer to a const PMU device. */
62typedef PMUDEV const *PCPMUDEV;
63
64
65/**
66 * PMU VM Instance data.
67 */
68typedef struct PMU
69{
70 /** The ring-3 device instance. */
71 PPDMDEVINSR3 pDevInsR3;
72 /** Flag whether the in-kernel (KVM/Hyper-V) PMU of the NEM backend is used. */
73 bool fNemPmu;
74} PMU;
75/** Pointer to PMU VM instance data. */
76typedef PMU *PPMU;
77/** Pointer to const PMU VM instance data. */
78typedef PMU const *PCPMU;
79AssertCompileSizeAlignment(PMU, 8);
80
81/**
82 * PMU VMCPU Instance data.
83 */
84typedef struct PMUCPU
85{
86 /** @name PMU statistics.
87 * @{ */
88#ifdef VBOX_WITH_STATISTICS
89 /** Number of MSR reads in R3. */
90 STAMCOUNTER StatSysRegReadR3;
91 /** Number of MSR writes in R3. */
92 STAMCOUNTER StatSysRegWriteR3;
93#endif
94 /** @} */
95} PMUCPU;
96/** Pointer to PMU VMCPU instance data. */
97typedef PMUCPU *PPMUCPU;
98/** Pointer to a const PMU VMCPU instance data. */
99typedef PMUCPU const *PCPMUCPU;
100
101DECLCALLBACK(int) pmuR3Construct(PPDMDEVINS pDevIns, int iInstance, PCFGMNODE pCfg);
102DECLCALLBACK(int) pmuR3Destruct(PPDMDEVINS pDevIns);
103DECLCALLBACK(void) pmuR3Relocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta);
104DECLCALLBACK(void) pmuR3Reset(PPDMDEVINS pDevIns);
105
106/** @} */
107
108#endif /* !VMM_INCLUDED_SRC_include_PMUInternal_h */
109
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