summaryrefslogtreecommitdiff
path: root/src/VBox/VMM/VMMR3/PDMDriver.cpp
diff options
context:
space:
mode:
authorvboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f>2019-08-15 07:29:37 +0000
committervboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f>2019-08-15 07:29:37 +0000
commitf9e1bcf7a62595e50dd754d910890c768a574184 (patch)
treec61c7a706bfbe191d5fbaf4f92f67dbad46c5294 /src/VBox/VMM/VMMR3/PDMDriver.cpp
parent9bdb9fc969f991c54e49f3c8a874ca68699024b9 (diff)
downloadVirtualBox-svn-f9e1bcf7a62595e50dd754d910890c768a574184.tar.gz
VMM,++: Refactoring code to use VMMC & VMMCPUCC. bugref:9217
git-svn-id: https://www.virtualbox.org/svn/vbox/trunk@80281 cfe28804-0f27-0410-a406-dd0f0b0b656f
Diffstat (limited to 'src/VBox/VMM/VMMR3/PDMDriver.cpp')
-rw-r--r--src/VBox/VMM/VMMR3/PDMDriver.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/VBox/VMM/VMMR3/PDMDriver.cpp b/src/VBox/VMM/VMMR3/PDMDriver.cpp
index 9c5d075c1c8..ae52f1f68a9 100644
--- a/src/VBox/VMM/VMMR3/PDMDriver.cpp
+++ b/src/VBox/VMM/VMMR3/PDMDriver.cpp
@@ -28,7 +28,8 @@
#include <VBox/vmm/hm.h>
#include <VBox/vmm/vmm.h>
#include <VBox/sup.h>
-#include <VBox/vmm/vm.h>
+#include <VBox/vmm/vmcc.h>
+
#include <VBox/version.h>
#include <VBox/err.h>
@@ -721,7 +722,11 @@ int pdmR3DrvInstantiate(PVM pVM, PCFGMNODE pNode, PPDMIBASE pBaseInterface, PPDM
pNew->Internal.s.pLun = pLun;
pNew->Internal.s.pDrv = pDrv;
pNew->Internal.s.pVMR3 = pVM;
+#ifdef VBOX_BUGREF_9217
+ pNew->Internal.s.pVMR0 = pDrv->pReg->fFlags & PDM_DRVREG_FLAGS_R0 ? pVM->pVMR0ForCall : NIL_RTR0PTR;
+#else
pNew->Internal.s.pVMR0 = pDrv->pReg->fFlags & PDM_DRVREG_FLAGS_R0 ? pVM->pVMR0 : NIL_RTR0PTR;
+#endif
pNew->Internal.s.pVMRC = pDrv->pReg->fFlags & PDM_DRVREG_FLAGS_RC ? pVM->pVMRC : NIL_RTRCPTR;
//pNew->Internal.s.fDetaching = false;
pNew->Internal.s.fVMSuspended = true; /** @todo should be 'false', if driver is attached at runtime. */
@@ -1477,7 +1482,7 @@ static DECLCALLBACK(int) pdmR3DrvHlp_SUPCallVMMR0Ex(PPDMDRVINS pDrvIns, unsigned
int rc;
if ( uOperation >= VMMR0_DO_SRV_START
&& uOperation < VMMR0_DO_SRV_END)
- rc = SUPR3CallVMMR0Ex(pDrvIns->Internal.s.pVMR3->pVMR0, NIL_VMCPUID, uOperation, 0, (PSUPVMMR0REQHDR)pvArg);
+ rc = SUPR3CallVMMR0Ex(VMCC_GET_VMR0_FOR_CALL(pDrvIns->Internal.s.pVMR3), NIL_VMCPUID, uOperation, 0, (PSUPVMMR0REQHDR)pvArg);
else
{
AssertMsgFailed(("Invalid uOperation=%u\n", uOperation));
@@ -1763,7 +1768,7 @@ static DECLCALLBACK(int) pdmR3DrvHlp_CallR0(PPDMDRVINS pDrvIns, uint32_t uOperat
Req.uOperation = uOperation;
Req.u32Alignment = 0;
Req.u64Arg = u64Arg;
- rc = SUPR3CallVMMR0Ex(pVM->pVMR0, NIL_VMCPUID, VMMR0_DO_PDM_DRIVER_CALL_REQ_HANDLER, 0, &Req.Hdr);
+ rc = SUPR3CallVMMR0Ex(VMCC_GET_VMR0_FOR_CALL(pVM), NIL_VMCPUID, VMMR0_DO_PDM_DRIVER_CALL_REQ_HANDLER, 0, &Req.Hdr);
}
LogFlow(("pdmR3DrvHlp_CallR0: caller='%s'/%d: returns %Rrc\n", pDrvIns->pReg->szName,