summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/VBox/vmm/apic.h6
-rw-r--r--include/VBox/vmm/pdmdev.h8
-rw-r--r--src/VBox/VMM/VMMAll/HMSVMAll.cpp2
-rw-r--r--src/VBox/VMM/VMMR0/HMSVMR0.cpp1
-rw-r--r--src/VBox/VMM/VMMR3/APIC.cpp11
-rw-r--r--src/VBox/VMM/VMMR3/EM.cpp1
-rw-r--r--src/VBox/VMM/VMMR3/GIMHv.cpp2
-rw-r--r--src/VBox/VMM/VMMR3/PDMDevice.cpp6
-rw-r--r--src/VBox/VMM/include/APICInternal.h1
9 files changed, 26 insertions, 12 deletions
diff --git a/include/VBox/vmm/apic.h b/include/VBox/vmm/apic.h
index 59b12bcc26c..290faa99d17 100644
--- a/include/VBox/vmm/apic.h
+++ b/include/VBox/vmm/apic.h
@@ -26,8 +26,8 @@
#ifndef ___VBox_vmm_apic_h
#define ___VBox_vmm_apic_h
-#include <VBox/vmm/pdmins.h>
-#include <VBox/vmm/pdmdev.h>
+#include <VBox/types.h>
+struct PDMDEVREGCB;
/** @defgroup grp_apic The local APIC VMM API
* @ingroup grp_vmm
@@ -157,6 +157,7 @@ RT_C_DECLS_BEGIN
/** @defgroup grp_apic_r3 The APIC Host Context Ring-3 API
* @{
*/
+VMMR3_INT_DECL(int) APICR3RegisterDevice(struct PDMDEVREGCB *pCallbacks);
VMMR3_INT_DECL(void) APICR3InitIpi(PVMCPU pVCpu);
VMMR3_INT_DECL(void) APICR3HvEnable(PVM pVM);
/** @} */
@@ -200,7 +201,6 @@ VMM_INT_DECL(VBOXSTRICTRC) APICHvSetEoi(PVMCPU pVCpu, uint32_t uEoi);
RT_C_DECLS_END
-extern const PDMDEVREG g_DeviceAPIC;
/** @} */
#endif
diff --git a/include/VBox/vmm/pdmdev.h b/include/VBox/vmm/pdmdev.h
index 3ee347732e7..d25f48226d7 100644
--- a/include/VBox/vmm/pdmdev.h
+++ b/include/VBox/vmm/pdmdev.h
@@ -28,7 +28,9 @@
#include <VBox/vmm/pdmqueue.h>
#include <VBox/vmm/pdmcritsect.h>
-#include <VBox/vmm/pdmthread.h>
+#ifdef IN_RING3
+# include <VBox/vmm/pdmthread.h>
+#endif
#include <VBox/vmm/pdmifs.h>
#include <VBox/vmm/pdmins.h>
#include <VBox/vmm/pdmcommon.h>
@@ -38,9 +40,7 @@
#include <VBox/vmm/ssm.h>
#include <VBox/vmm/cfgm.h>
#include <VBox/vmm/dbgf.h>
-#include <VBox/err.h>
-#include <VBox/pci.h>
-#include <VBox/sup.h>
+#include <VBox/err.h> /* VINF_EM_DBG_STOP */
#include <iprt/stdarg.h>
diff --git a/src/VBox/VMM/VMMAll/HMSVMAll.cpp b/src/VBox/VMM/VMMAll/HMSVMAll.cpp
index 54bfba49e1d..73ed1ba346a 100644
--- a/src/VBox/VMM/VMMAll/HMSVMAll.cpp
+++ b/src/VBox/VMM/VMMAll/HMSVMAll.cpp
@@ -27,6 +27,8 @@
#include <VBox/vmm/iem.h>
#include <VBox/vmm/vm.h>
+#include <VBox/err.h>
+
#ifndef IN_RC
diff --git a/src/VBox/VMM/VMMR0/HMSVMR0.cpp b/src/VBox/VMM/VMMR0/HMSVMR0.cpp
index dc7412cf412..e0ec13cf42b 100644
--- a/src/VBox/VMM/VMMR0/HMSVMR0.cpp
+++ b/src/VBox/VMM/VMMR0/HMSVMR0.cpp
@@ -34,6 +34,7 @@
#include <VBox/vmm/apic.h>
#include "HMInternal.h"
#include <VBox/vmm/vm.h>
+#include <VBox/err.h>
#include "HMSVMR0.h"
#include "dtrace/VBoxVMM.h"
diff --git a/src/VBox/VMM/VMMR3/APIC.cpp b/src/VBox/VMM/VMMR3/APIC.cpp
index 3e82dcf5fa2..a2cb4a40ca7 100644
--- a/src/VBox/VMM/VMMR3/APIC.cpp
+++ b/src/VBox/VMM/VMMR3/APIC.cpp
@@ -1669,7 +1669,7 @@ static DECLCALLBACK(int) apicR3Construct(PPDMDEVINS pDevIns, int iInstance, PCFG
/**
* APIC device registration structure.
*/
-const PDMDEVREG g_DeviceAPIC =
+static const PDMDEVREG g_DeviceAPIC =
{
/* u32Version */
PDM_DEVREG_VERSION,
@@ -1722,5 +1722,14 @@ const PDMDEVREG g_DeviceAPIC =
PDM_DEVREG_VERSION
};
+
+/**
+ * Called by PDM to register the APIC device.
+ */
+VMMR3_INT_DECL(int) APICR3RegisterDevice(PPDMDEVREGCB pCallbacks)
+{
+ return pCallbacks->pfnRegister(pCallbacks, &g_DeviceAPIC);
+}
+
#endif /* !VBOX_DEVICE_STRUCT_TESTCASE */
diff --git a/src/VBox/VMM/VMMR3/EM.cpp b/src/VBox/VMM/VMMR3/EM.cpp
index 1c93e9b3dea..425117a4435 100644
--- a/src/VBox/VMM/VMMR3/EM.cpp
+++ b/src/VBox/VMM/VMMR3/EM.cpp
@@ -66,6 +66,7 @@
#include <VBox/vmm/cpumdis.h>
#include <VBox/dis.h>
#include <VBox/disopcode.h>
+#include <VBox/err.h>
#include "VMMTracing.h"
#include <iprt/asm.h>
diff --git a/src/VBox/VMM/VMMR3/GIMHv.cpp b/src/VBox/VMM/VMMR3/GIMHv.cpp
index 43bca3fab61..d0a1fed4fc8 100644
--- a/src/VBox/VMM/VMMR3/GIMHv.cpp
+++ b/src/VBox/VMM/VMMR3/GIMHv.cpp
@@ -31,10 +31,10 @@
#include "GIMInternal.h"
#include <VBox/vmm/vm.h>
+#include <VBox/err.h>
#include <VBox/version.h>
#include <iprt/assert.h>
-#include <iprt/err.h>
#include <iprt/string.h>
#include <iprt/mem.h>
#include <iprt/semaphore.h>
diff --git a/src/VBox/VMM/VMMR3/PDMDevice.cpp b/src/VBox/VMM/VMMR3/PDMDevice.cpp
index 1287739c5c4..005a5d55391 100644
--- a/src/VBox/VMM/VMMR3/PDMDevice.cpp
+++ b/src/VBox/VMM/VMMR3/PDMDevice.cpp
@@ -494,15 +494,15 @@ static int pdmR3DevLoadModules(PVM pVM)
/*
* Load the internal VMM APIC device.
*/
- int rc2 = pdmR3DevReg_Register(&RegCB.Core, &g_DeviceAPIC);
- AssertRCReturn(rc2, rc2);
+ int rc = APICR3RegisterDevice(&RegCB.Core);
+ AssertRCReturn(rc, rc);
/*
* Load the builtin module.
*/
PCFGMNODE pDevicesNode = CFGMR3GetChild(CFGMR3GetRoot(pVM), "PDM/Devices");
bool fLoadBuiltin;
- int rc = CFGMR3QueryBool(pDevicesNode, "LoadBuiltin", &fLoadBuiltin);
+ rc = CFGMR3QueryBool(pDevicesNode, "LoadBuiltin", &fLoadBuiltin);
if (rc == VERR_CFGM_VALUE_NOT_FOUND || rc == VERR_CFGM_NO_PARENT)
fLoadBuiltin = true;
else if (RT_FAILURE(rc))
diff --git a/src/VBox/VMM/include/APICInternal.h b/src/VBox/VMM/include/APICInternal.h
index 04723dfcad5..ec19789e501 100644
--- a/src/VBox/VMM/include/APICInternal.h
+++ b/src/VBox/VMM/include/APICInternal.h
@@ -21,6 +21,7 @@
#include <VBox/sup.h>
#include <VBox/types.h>
#include <VBox/vmm/apic.h>
+#include <VBox/vmm/pdmdev.h>
/** @defgroup grp_apic_int Internal
* @ingroup grp_apic