VirtualBox

source: vbox/trunk/src/VBox/VMM/VMMAll/AllPdbTypeHack.cpp

Last change on this file was 108132, checked in by vboxsync, 8 weeks ago

VMM/PGM: Merge and deduplicate code targeting x86 & amd64 in PGM.cpp. Don't bother compiling pool stuff on arm and darwin.amd64. jiraref:VBP-1531

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.3 KB
Line 
1/* $Id: AllPdbTypeHack.cpp 108132 2025-02-10 11:05:23Z vboxsync $ */
2/** @file
3 * Debug info hack for the VM and VMCPU structures.
4 */
5
6/*
7 * Copyright (C) 2016-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
29/*********************************************************************************************************************************
30* Header Files *
31*********************************************************************************************************************************/
32#ifdef VBOX_VMM_TARGET_AGNOSTIC
33# ifdef RT_ARCH_AMD64
34# define VBOX_VMM_TARGET_X86
35# elif defined(RT_ARCH_ARM64)
36# define VBOX_VMM_TARGET_ARMV8
37# else
38# error "port me"
39# endif
40#endif
41#include <VBox/vmm/cfgm.h>
42#include <VBox/vmm/cpum.h>
43#include <VBox/vmm/mm.h>
44#include <VBox/vmm/pgm.h>
45#include <VBox/vmm/selm.h>
46#include <VBox/vmm/trpm.h>
47#include <VBox/vmm/vmm.h>
48#include <VBox/vmm/stam.h>
49#include "../include/PDMInternal.h"
50#include <VBox/vmm/pdm.h>
51#if !defined(VBOX_WITH_MINIMAL_R0) || !defined(IN_RING0)
52# include "../include/CPUMInternal.h"
53# include "../include/CFGMInternal.h"
54# include "../include/MMInternal.h"
55# include "../include/PGMInternal.h"
56# include "../include/SELMInternal.h"
57# include "../include/TRPMInternal.h"
58# include "../include/TMInternal.h"
59# include "../include/IOMInternal.h"
60#endif
61#ifdef IN_RING3
62# include "../include/SSMInternal.h"
63#endif
64#include "../include/VMMInternal.h"
65#if !defined(VBOX_WITH_MINIMAL_R0) || !defined(IN_RING0)
66# include "../include/HMInternal.h"
67# include "../include/DBGFInternal.h"
68# include "../include/GIMInternal.h"
69# include "../include/APICInternal.h"
70# include "../include/STAMInternal.h"
71# include "../include/IEMInternal.h"
72# include "../include/NEMInternal.h"
73# include "../VMMR0/GMMR0Internal.h"
74# include "../include/EMInternal.h"
75#endif
76#include "../include/VMInternal.h"
77#include "../VMMR0/GVMMR0Internal.h"
78#include <VBox/vmm/vmcc.h>
79#ifdef IN_RING3
80# include <VBox/vmm/uvm.h>
81#endif
82#include <VBox/vmm/gvm.h>
83
84
85extern "C" {
86
87/* Global pointer variables as an alternative to the parameter list. Just to ensure the precense of the types. */
88PVM g_PdbTypeHack1 = NULL;
89PVMCPU g_PdbTypeHack2 = NULL;
90PPDMCRITSECT g_PdbTypeHack3 = NULL;
91PPDMCRITSECTRW g_PdbTypeHack4 = NULL;
92PPDMDEVINS g_PdbTypeHack5 = NULL;
93PPDMDRVINS g_PdbTypeHack6 = NULL;
94PPDMUSBINS g_PdbTypeHack7 = NULL;
95PCVMCPU g_PdbTypeHack8 = NULL;
96CTX_SUFF(PVM) g_PdbTypeHack9 = NULL;
97CTX_SUFF(PVMCPU) g_PdbTypeHack10 = NULL;
98
99DECLEXPORT(uint32_t) PdbTypeHack(PVM pVM, PVMCPU pVCpu, PPDMCRITSECT pCs1, PPDMCRITSECTRW pCs2);
100}
101
102DECLEXPORT(uint32_t) PdbTypeHack(PVM pVM, PVMCPU pVCpu, PPDMCRITSECT pCs1, PPDMCRITSECTRW pCs2)
103{
104 /* Just some dummy operations accessing each type. Probably not necessary, but
105 helps making sure we've included all we need to get at the internal stuff.. */
106 return pVM->fGlobalForcedActions
107 | (pVM == g_PdbTypeHack1)
108 | (pVM == g_PdbTypeHack9)
109 | pVCpu->fLocalForcedActions
110 | (pVCpu == g_PdbTypeHack2)
111 | (pVCpu == g_PdbTypeHack8)
112 | (pVCpu == g_PdbTypeHack10)
113 | pCs1->s.Core.fFlags
114 | (pCs1 == g_PdbTypeHack3)
115 | pCs2->s.Core.fFlags
116 | (pCs2 == g_PdbTypeHack4)
117 | g_PdbTypeHack5->Internal.s.idxR0Device
118 | (g_PdbTypeHack5 != NULL)
119 | (uint32_t)g_PdbTypeHack6->Internal.s.fDetaching
120 | (g_PdbTypeHack6 != NULL)
121 | (uint32_t)g_PdbTypeHack7->Internal.s.fVMSuspended
122 | (g_PdbTypeHack7 != NULL);
123}
124
Note: See TracBrowser for help on using the repository browser.

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