Changeset 12970 in vbox for trunk/src/VBox/VMM/PDMDevice.cpp
- Timestamp:
- Oct 3, 2008 7:04:11 AM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 37403
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PDMDevice.cpp
r12807 r12970 80 80 /* VSlick regex: 81 81 search : \om/\*\*.+?\*\/\nDECLCALLBACKMEMBER\(([^,]*), *pfn([^)]*)\)\( 82 replace: \/\*\* @copydoc PDMDEVHLP ::pfn\2 \*\/\nstatic DECLCALLBACK\(\1\) pdmR3DevHlp_\2\(82 replace: \/\*\* @copydoc PDMDEVHLPR3::pfn\2 \*\/\nstatic DECLCALLBACK\(\1\) pdmR3DevHlp_\2\( 83 83 */ 84 84 … … 298 298 * The device helper structure for trusted devices. 299 299 */ 300 const PDMDEVHLP g_pdmR3DevHlpTrusted =300 const PDMDEVHLPR3 g_pdmR3DevHlpTrusted = 301 301 { 302 302 PDM_DEVHLP_VERSION, … … 394 394 * The device helper structure for non-trusted devices. 395 395 */ 396 const PDMDEVHLP g_pdmR3DevHlpUnTrusted =396 const PDMDEVHLPR3 g_pdmR3DevHlpUnTrusted = 397 397 { 398 398 PDM_DEVHLP_VERSION, … … 601 601 602 602 /* 603 * Get the GC & R0 devhlps and create the devhlp R3 task queue.604 */ 605 RCPTRTYPE(PCPDMDEVHLPGC) pDevHlpGC;606 int rc = PDMR3GetSymbolGC(pVM, NULL, "g_pdm GCDevHlp", &pDevHlpGC);603 * Get the RC & R0 devhlps and create the devhlp R3 task queue. 604 */ 605 PCPDMDEVHLPRC pDevHlpRC; 606 int rc = PDMR3GetSymbolGC(pVM, NULL, "g_pdmRCDevHlp", &pDevHlpRC); 607 607 AssertReleaseRCReturn(rc, rc); 608 608 609 R0PTRTYPE(PCPDMDEVHLPR0)pDevHlpR0;609 PCPDMDEVHLPR0 pDevHlpR0; 610 610 rc = PDMR3GetSymbolR0(pVM, NULL, "g_pdmR0DevHlp", &pDevHlpR0); 611 611 AssertReleaseRCReturn(rc, rc); … … 883 883 */ 884 884 pDevIns->u32Version = PDM_DEVINS_VERSION; 885 //pDevIns->Internal.s.pNextHC = NULL; 886 //pDevIns->Internal.s.pPerDeviceNextHC = NULL; 887 pDevIns->Internal.s.pDevHC = paDevs[i].pDev; 888 pDevIns->Internal.s.pVMHC = pVM; 889 pDevIns->Internal.s.pVMGC = pVM->pVMGC; 890 //pDevIns->Internal.s.pLunsHC = NULL; 885 //pDevIns->Internal.s.pNextR3 = NULL; 886 //pDevIns->Internal.s.pPerDeviceNextR3 = NULL; 887 pDevIns->Internal.s.pDevR3 = paDevs[i].pDev; 888 pDevIns->Internal.s.pVMR3 = pVM; 889 pDevIns->Internal.s.pVMR0 = pVM->pVMR0; 890 pDevIns->Internal.s.pVMRC = pVM->pVMRC; 891 //pDevIns->Internal.s.pLunsR3 = NULL; 891 892 pDevIns->Internal.s.pCfgHandle = paDevs[i].pNode; 892 //pDevIns->Internal.s.pPciDevice = NULL; 893 //pDevIns->Internal.s.pPciBus = NULL; /** @todo pci bus selection. (in 2008 perhaps) */ 894 pDevIns->pDevHlp = fTrusted ? &g_pdmR3DevHlpTrusted : &g_pdmR3DevHlpUnTrusted; 895 pDevIns->pDevHlpGC = pDevHlpGC; 893 //pDevIns->Internal.s.pPciDeviceR3 = NULL; 894 //pDevIns->Internal.s.pPciBusR3 = NULL; /** @todo pci bus selection. (in 2008 perhaps) */ 895 //pDevIns->Internal.s.pPciDeviceR0 = 0; 896 //pDevIns->Internal.s.pPciBusR0 = 0; 897 //pDevIns->Internal.s.pPciDeviceRC = 0; 898 //pDevIns->Internal.s.pPciBusRC = 0; 899 pDevIns->pDevHlpR3 = fTrusted ? &g_pdmR3DevHlpTrusted : &g_pdmR3DevHlpUnTrusted; 900 pDevIns->pDevHlpRC = pDevHlpRC; 896 901 pDevIns->pDevHlpR0 = pDevHlpR0; 897 902 pDevIns->pDevReg = paDevs[i].pDev->pDevReg; … … 899 904 pDevIns->iInstance = paDevs[i].iInstance; 900 905 pDevIns->pvInstanceDataR3 = &pDevIns->achInstanceData[0]; 901 pDevIns->pvInstanceData GC =pDevIns->pDevReg->fFlags & PDM_DEVREG_FLAGS_GC902 ? MMHyperHC2GC(pVM, pDevIns->pvInstanceDataR3) : 0;903 pDevIns->pvInstanceDataR0 = 904 ? MMHyperR3ToR0(pVM, pDevIns->pvInstanceDataR3) : 0;906 pDevIns->pvInstanceDataRC = pDevIns->pDevReg->fFlags & PDM_DEVREG_FLAGS_GC 907 ? MMHyperR3ToRC(pVM, pDevIns->pvInstanceDataR3) : NIL_RTRCPTR; 908 pDevIns->pvInstanceDataR0 = pDevIns->pDevReg->fFlags & PDM_DEVREG_FLAGS_R0 909 ? MMHyperR3ToR0(pVM, pDevIns->pvInstanceDataR3) : NIL_RTR0PTR; 905 910 906 911 /* … … 913 918 else 914 919 { 915 while (pPrev1->Internal.s.pNext HC)916 pPrev1 = pPrev1->Internal.s.pNext HC;917 pPrev1->Internal.s.pNext HC= pDevIns;920 while (pPrev1->Internal.s.pNextR3) 921 pPrev1 = pPrev1->Internal.s.pNextR3; 922 pPrev1->Internal.s.pNextR3 = pDevIns; 918 923 } 919 924 … … 924 929 else 925 930 { 926 while (pPrev2->Internal.s.pPerDeviceNext HC)927 pPrev2 = pPrev2->Internal.s.pPerDeviceNext HC;928 pPrev2->Internal.s.pPerDeviceNext HC= pDevIns;931 while (pPrev2->Internal.s.pPerDeviceNextR3) 932 pPrev2 = pPrev2->Internal.s.pPerDeviceNextR3; 933 pPrev2->Internal.s.pPerDeviceNextR3 = pDevIns; 929 934 } 930 935 … … 967 972 } 968 973 969 for (PPDMDEVINS pDevIns = pVM->pdm.s.pDevInstances; pDevIns; pDevIns = pDevIns->Internal.s.pNext HC)974 for (PPDMDEVINS pDevIns = pVM->pdm.s.pDevInstances; pDevIns; pDevIns = pDevIns->Internal.s.pNextR3) 970 975 { 971 976 if (pDevIns->pDevReg->pfnInitComplete) … … 1222 1227 1223 1228 1224 /** @copydoc PDMDEVHLP ::pfnIOPortRegister */1229 /** @copydoc PDMDEVHLPR3::pfnIOPortRegister */ 1225 1230 static DECLCALLBACK(int) pdmR3DevHlp_IOPortRegister(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTHCPTR pvUser, PFNIOMIOPORTOUT pfnOut, PFNIOMIOPORTIN pfnIn, 1226 1231 PFNIOMIOPORTOUTSTRING pfnOutStr, PFNIOMIOPORTINSTRING pfnInStr, const char *pszDesc) … … 1229 1234 LogFlow(("pdmR3DevHlp_IOPortRegister: caller='%s'/%d: Port=%#x cPorts=%#x pvUser=%p pfnOut=%p pfnIn=%p pfnOutStr=%p pfnInStr=%p p32_tszDesc=%p:{%s}\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, 1230 1235 Port, cPorts, pvUser, pfnOut, pfnIn, pfnOutStr, pfnInStr, pszDesc, pszDesc)); 1231 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);1232 1233 int rc = IOMR3IOPortRegisterR3(pDevIns->Internal.s.pVM HC, pDevIns, Port, cPorts, pvUser, pfnOut, pfnIn, pfnOutStr, pfnInStr, pszDesc);1236 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 1237 1238 int rc = IOMR3IOPortRegisterR3(pDevIns->Internal.s.pVMR3, pDevIns, Port, cPorts, pvUser, pfnOut, pfnIn, pfnOutStr, pfnInStr, pszDesc); 1234 1239 1235 1240 LogFlow(("pdmR3DevHlp_IOPortRegister: caller='%s'/%d: returns %Vrc\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc)); … … 1238 1243 1239 1244 1240 /** @copydoc PDMDEVHLP ::pfnIOPortRegisterGC */1245 /** @copydoc PDMDEVHLPR3::pfnIOPortRegisterGC */ 1241 1246 static DECLCALLBACK(int) pdmR3DevHlp_IOPortRegisterGC(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTRCPTR pvUser, 1242 1247 const char *pszOut, const char *pszIn, … … 1244 1249 { 1245 1250 PDMDEV_ASSERT_DEVINS(pDevIns); 1246 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);1251 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 1247 1252 LogFlow(("pdmR3DevHlp_IOPortRegister: caller='%s'/%d: Port=%#x cPorts=%#x pvUser=%p pszOut=%p:{%s} pszIn=%p:{%s} pszOutStr=%p:{%s} pszInStr=%p:{%s} pszDesc=%p:{%s}\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, 1248 1253 Port, cPorts, pvUser, pszOut, pszOut, pszIn, pszIn, pszOutStr, pszOutStr, pszInStr, pszInStr, pszDesc, pszDesc)); … … 1258 1263 if (pszIn) 1259 1264 { 1260 rc = PDMR3GetSymbolGCLazy(pDevIns->Internal.s.pVM HC, pDevIns->pDevReg->szGCMod, pszIn, &GCPtrIn);1265 rc = PDMR3GetSymbolGCLazy(pDevIns->Internal.s.pVMR3, pDevIns->pDevReg->szGCMod, pszIn, &GCPtrIn); 1261 1266 AssertMsgRC(rc, ("Failed to resolve %s.%s (pszIn)\n", pDevIns->pDevReg->szGCMod, pszIn)); 1262 1267 } … … 1264 1269 if (pszOut && VBOX_SUCCESS(rc)) 1265 1270 { 1266 rc = PDMR3GetSymbolGCLazy(pDevIns->Internal.s.pVM HC, pDevIns->pDevReg->szGCMod, pszOut, &GCPtrOut);1271 rc = PDMR3GetSymbolGCLazy(pDevIns->Internal.s.pVMR3, pDevIns->pDevReg->szGCMod, pszOut, &GCPtrOut); 1267 1272 AssertMsgRC(rc, ("Failed to resolve %s.%s (pszOut)\n", pDevIns->pDevReg->szGCMod, pszOut)); 1268 1273 } … … 1270 1275 if (pszInStr && VBOX_SUCCESS(rc)) 1271 1276 { 1272 rc = PDMR3GetSymbolGCLazy(pDevIns->Internal.s.pVM HC, pDevIns->pDevReg->szGCMod, pszInStr, &GCPtrInStr);1277 rc = PDMR3GetSymbolGCLazy(pDevIns->Internal.s.pVMR3, pDevIns->pDevReg->szGCMod, pszInStr, &GCPtrInStr); 1273 1278 AssertMsgRC(rc, ("Failed to resolve %s.%s (pszInStr)\n", pDevIns->pDevReg->szGCMod, pszInStr)); 1274 1279 } … … 1276 1281 if (pszOutStr && VBOX_SUCCESS(rc)) 1277 1282 { 1278 rc = PDMR3GetSymbolGCLazy(pDevIns->Internal.s.pVM HC, pDevIns->pDevReg->szGCMod, pszOutStr, &GCPtrOutStr);1283 rc = PDMR3GetSymbolGCLazy(pDevIns->Internal.s.pVMR3, pDevIns->pDevReg->szGCMod, pszOutStr, &GCPtrOutStr); 1279 1284 AssertMsgRC(rc, ("Failed to resolve %s.%s (pszOutStr)\n", pDevIns->pDevReg->szGCMod, pszOutStr)); 1280 1285 } 1281 1286 1282 1287 if (VBOX_SUCCESS(rc)) 1283 rc = IOMR3IOPortRegisterRC(pDevIns->Internal.s.pVM HC, pDevIns, Port, cPorts, pvUser, GCPtrOut, GCPtrIn, GCPtrOutStr, GCPtrInStr, pszDesc);1288 rc = IOMR3IOPortRegisterRC(pDevIns->Internal.s.pVMR3, pDevIns, Port, cPorts, pvUser, GCPtrOut, GCPtrIn, GCPtrOutStr, GCPtrInStr, pszDesc); 1284 1289 } 1285 1290 else … … 1294 1299 1295 1300 1296 /** @copydoc PDMDEVHLP ::pfnIOPortRegisterR0 */1301 /** @copydoc PDMDEVHLPR3::pfnIOPortRegisterR0 */ 1297 1302 static DECLCALLBACK(int) pdmR3DevHlp_IOPortRegisterR0(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTR0PTR pvUser, 1298 1303 const char *pszOut, const char *pszIn, … … 1300 1305 { 1301 1306 PDMDEV_ASSERT_DEVINS(pDevIns); 1302 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);1307 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 1303 1308 LogFlow(("pdmR3DevHlp_IOPortRegisterR0: caller='%s'/%d: Port=%#x cPorts=%#x pvUser=%p pszOut=%p:{%s} pszIn=%p:{%s} pszOutStr=%p:{%s} pszInStr=%p:{%s} pszDesc=%p:{%s}\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, 1304 1309 Port, cPorts, pvUser, pszOut, pszOut, pszIn, pszIn, pszOutStr, pszOutStr, pszInStr, pszInStr, pszDesc, pszDesc)); … … 1314 1319 if (pszIn) 1315 1320 { 1316 rc = PDMR3GetSymbolR0Lazy(pDevIns->Internal.s.pVM HC, pDevIns->pDevReg->szR0Mod, pszIn, &pfnR0PtrIn);1321 rc = PDMR3GetSymbolR0Lazy(pDevIns->Internal.s.pVMR3, pDevIns->pDevReg->szR0Mod, pszIn, &pfnR0PtrIn); 1317 1322 AssertMsgRC(rc, ("Failed to resolve %s.%s (pszIn)\n", pDevIns->pDevReg->szR0Mod, pszIn)); 1318 1323 } … … 1320 1325 if (pszOut && VBOX_SUCCESS(rc)) 1321 1326 { 1322 rc = PDMR3GetSymbolR0Lazy(pDevIns->Internal.s.pVM HC, pDevIns->pDevReg->szR0Mod, pszOut, &pfnR0PtrOut);1327 rc = PDMR3GetSymbolR0Lazy(pDevIns->Internal.s.pVMR3, pDevIns->pDevReg->szR0Mod, pszOut, &pfnR0PtrOut); 1323 1328 AssertMsgRC(rc, ("Failed to resolve %s.%s (pszOut)\n", pDevIns->pDevReg->szR0Mod, pszOut)); 1324 1329 } … … 1326 1331 if (pszInStr && VBOX_SUCCESS(rc)) 1327 1332 { 1328 rc = PDMR3GetSymbolR0Lazy(pDevIns->Internal.s.pVM HC, pDevIns->pDevReg->szR0Mod, pszInStr, &pfnR0PtrInStr);1333 rc = PDMR3GetSymbolR0Lazy(pDevIns->Internal.s.pVMR3, pDevIns->pDevReg->szR0Mod, pszInStr, &pfnR0PtrInStr); 1329 1334 AssertMsgRC(rc, ("Failed to resolve %s.%s (pszInStr)\n", pDevIns->pDevReg->szR0Mod, pszInStr)); 1330 1335 } … … 1332 1337 if (pszOutStr && VBOX_SUCCESS(rc)) 1333 1338 { 1334 rc = PDMR3GetSymbolR0Lazy(pDevIns->Internal.s.pVM HC, pDevIns->pDevReg->szR0Mod, pszOutStr, &pfnR0PtrOutStr);1339 rc = PDMR3GetSymbolR0Lazy(pDevIns->Internal.s.pVMR3, pDevIns->pDevReg->szR0Mod, pszOutStr, &pfnR0PtrOutStr); 1335 1340 AssertMsgRC(rc, ("Failed to resolve %s.%s (pszOutStr)\n", pDevIns->pDevReg->szR0Mod, pszOutStr)); 1336 1341 } 1337 1342 1338 1343 if (VBOX_SUCCESS(rc)) 1339 rc = IOMR3IOPortRegisterR0(pDevIns->Internal.s.pVM HC, pDevIns, Port, cPorts, pvUser, pfnR0PtrOut, pfnR0PtrIn, pfnR0PtrOutStr, pfnR0PtrInStr, pszDesc);1344 rc = IOMR3IOPortRegisterR0(pDevIns->Internal.s.pVMR3, pDevIns, Port, cPorts, pvUser, pfnR0PtrOut, pfnR0PtrIn, pfnR0PtrOutStr, pfnR0PtrInStr, pszDesc); 1340 1345 } 1341 1346 else … … 1350 1355 1351 1356 1352 /** @copydoc PDMDEVHLP ::pfnIOPortDeregister */1357 /** @copydoc PDMDEVHLPR3::pfnIOPortDeregister */ 1353 1358 static DECLCALLBACK(int) pdmR3DevHlp_IOPortDeregister(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts) 1354 1359 { 1355 1360 PDMDEV_ASSERT_DEVINS(pDevIns); 1356 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);1361 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 1357 1362 LogFlow(("pdmR3DevHlp_IOPortDeregister: caller='%s'/%d: Port=%#x cPorts=%#x\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, 1358 1363 Port, cPorts)); 1359 1364 1360 int rc = IOMR3IOPortDeregister(pDevIns->Internal.s.pVM HC, pDevIns, Port, cPorts);1365 int rc = IOMR3IOPortDeregister(pDevIns->Internal.s.pVMR3, pDevIns, Port, cPorts); 1361 1366 1362 1367 LogFlow(("pdmR3DevHlp_IOPortDeregister: caller='%s'/%d: returns %Vrc\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc)); … … 1365 1370 1366 1371 1367 /** @copydoc PDMDEVHLP ::pfnMMIORegister */1372 /** @copydoc PDMDEVHLPR3::pfnMMIORegister */ 1368 1373 static DECLCALLBACK(int) pdmR3DevHlp_MMIORegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser, 1369 1374 PFNIOMMMIOWRITE pfnWrite, PFNIOMMMIOREAD pfnRead, PFNIOMMMIOFILL pfnFill, … … 1371 1376 { 1372 1377 PDMDEV_ASSERT_DEVINS(pDevIns); 1373 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);1378 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 1374 1379 LogFlow(("pdmR3DevHlp_MMIORegister: caller='%s'/%d: GCPhysStart=%VGp cbRange=%#x pvUser=%p pfnWrite=%p pfnRead=%p pfnFill=%p pszDesc=%p:{%s}\n", 1375 1380 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, GCPhysStart, cbRange, pvUser, pfnWrite, pfnRead, pfnFill, pszDesc, pszDesc)); 1376 1381 1377 int rc = IOMR3MMIORegisterR3(pDevIns->Internal.s.pVM HC, pDevIns, GCPhysStart, cbRange, pvUser, pfnWrite, pfnRead, pfnFill, pszDesc);1382 int rc = IOMR3MMIORegisterR3(pDevIns->Internal.s.pVMR3, pDevIns, GCPhysStart, cbRange, pvUser, pfnWrite, pfnRead, pfnFill, pszDesc); 1378 1383 1379 1384 LogFlow(("pdmR3DevHlp_MMIORegister: caller='%s'/%d: returns %Vrc\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc)); … … 1382 1387 1383 1388 1384 /** @copydoc PDMDEVHLP ::pfnMMIORegisterGC */1389 /** @copydoc PDMDEVHLPR3::pfnMMIORegisterGC */ 1385 1390 static DECLCALLBACK(int) pdmR3DevHlp_MMIORegisterGC(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTGCPTR pvUser, 1386 1391 const char *pszWrite, const char *pszRead, const char *pszFill, … … 1388 1393 { 1389 1394 PDMDEV_ASSERT_DEVINS(pDevIns); 1390 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);1395 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 1391 1396 LogFlow(("pdmR3DevHlp_MMIORegisterGC: caller='%s'/%d: GCPhysStart=%VGp cbRange=%#x pvUser=%p pszWrite=%p:{%s} pszRead=%p:{%s} pszFill=%p:{%s}\n", 1392 1397 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, GCPhysStart, cbRange, pvUser, pszWrite, pszWrite, pszRead, pszRead, pszFill, pszFill)); … … 1402 1407 RTGCPTR32 GCPtrWrite = 0; 1403 1408 if (pszWrite) 1404 rc = PDMR3GetSymbolGCLazy(pDevIns->Internal.s.pVM HC, pDevIns->pDevReg->szGCMod, pszWrite, &GCPtrWrite);1409 rc = PDMR3GetSymbolGCLazy(pDevIns->Internal.s.pVMR3, pDevIns->pDevReg->szGCMod, pszWrite, &GCPtrWrite); 1405 1410 RTGCPTR32 GCPtrRead = 0; 1406 1411 int rc2 = VINF_SUCCESS; 1407 1412 if (pszRead) 1408 rc2 = PDMR3GetSymbolGCLazy(pDevIns->Internal.s.pVM HC, pDevIns->pDevReg->szGCMod, pszRead, &GCPtrRead);1413 rc2 = PDMR3GetSymbolGCLazy(pDevIns->Internal.s.pVMR3, pDevIns->pDevReg->szGCMod, pszRead, &GCPtrRead); 1409 1414 RTGCPTR32 GCPtrFill = 0; 1410 1415 int rc3 = VINF_SUCCESS; 1411 1416 if (pszFill) 1412 rc3 = PDMR3GetSymbolGCLazy(pDevIns->Internal.s.pVM HC, pDevIns->pDevReg->szGCMod, pszFill, &GCPtrFill);1417 rc3 = PDMR3GetSymbolGCLazy(pDevIns->Internal.s.pVMR3, pDevIns->pDevReg->szGCMod, pszFill, &GCPtrFill); 1413 1418 if (VBOX_SUCCESS(rc) && VBOX_SUCCESS(rc2) && VBOX_SUCCESS(rc3)) 1414 rc = IOMR3MMIORegisterRC(pDevIns->Internal.s.pVM HC, pDevIns, GCPhysStart, cbRange, pvUser, GCPtrWrite, GCPtrRead, GCPtrFill);1419 rc = IOMR3MMIORegisterRC(pDevIns->Internal.s.pVMR3, pDevIns, GCPhysStart, cbRange, pvUser, GCPtrWrite, GCPtrRead, GCPtrFill); 1415 1420 else 1416 1421 { … … 1434 1439 } 1435 1440 1436 /** @copydoc PDMDEVHLP ::pfnMMIORegisterR0 */1441 /** @copydoc PDMDEVHLPR3::pfnMMIORegisterR0 */ 1437 1442 static DECLCALLBACK(int) pdmR3DevHlp_MMIORegisterR0(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser, 1438 1443 const char *pszWrite, const char *pszRead, const char *pszFill, … … 1440 1445 { 1441 1446 PDMDEV_ASSERT_DEVINS(pDevIns); 1442 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);1447 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 1443 1448 LogFlow(("pdmR3DevHlp_MMIORegisterHC: caller='%s'/%d: GCPhysStart=%VGp cbRange=%#x pvUser=%p pszWrite=%p:{%s} pszRead=%p:{%s} pszFill=%p:{%s}\n", 1444 1449 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, GCPhysStart, cbRange, pvUser, pszWrite, pszWrite, pszRead, pszRead, pszFill, pszFill)); … … 1454 1459 R0PTRTYPE(PFNIOMMMIOWRITE) pfnR0PtrWrite = 0; 1455 1460 if (pszWrite) 1456 rc = PDMR3GetSymbolR0Lazy(pDevIns->Internal.s.pVM HC, pDevIns->pDevReg->szR0Mod, pszWrite, &pfnR0PtrWrite);1461 rc = PDMR3GetSymbolR0Lazy(pDevIns->Internal.s.pVMR3, pDevIns->pDevReg->szR0Mod, pszWrite, &pfnR0PtrWrite); 1457 1462 R0PTRTYPE(PFNIOMMMIOREAD) pfnR0PtrRead = 0; 1458 1463 int rc2 = VINF_SUCCESS; 1459 1464 if (pszRead) 1460 rc2 = PDMR3GetSymbolR0Lazy(pDevIns->Internal.s.pVM HC, pDevIns->pDevReg->szR0Mod, pszRead, &pfnR0PtrRead);1465 rc2 = PDMR3GetSymbolR0Lazy(pDevIns->Internal.s.pVMR3, pDevIns->pDevReg->szR0Mod, pszRead, &pfnR0PtrRead); 1461 1466 R0PTRTYPE(PFNIOMMMIOFILL) pfnR0PtrFill = 0; 1462 1467 int rc3 = VINF_SUCCESS; 1463 1468 if (pszFill) 1464 rc3 = PDMR3GetSymbolR0Lazy(pDevIns->Internal.s.pVM HC, pDevIns->pDevReg->szR0Mod, pszFill, &pfnR0PtrFill);1469 rc3 = PDMR3GetSymbolR0Lazy(pDevIns->Internal.s.pVMR3, pDevIns->pDevReg->szR0Mod, pszFill, &pfnR0PtrFill); 1465 1470 if (VBOX_SUCCESS(rc) && VBOX_SUCCESS(rc2) && VBOX_SUCCESS(rc3)) 1466 rc = IOMR3MMIORegisterR0(pDevIns->Internal.s.pVM HC, pDevIns, GCPhysStart, cbRange, pvUser, pfnR0PtrWrite, pfnR0PtrRead, pfnR0PtrFill);1471 rc = IOMR3MMIORegisterR0(pDevIns->Internal.s.pVMR3, pDevIns, GCPhysStart, cbRange, pvUser, pfnR0PtrWrite, pfnR0PtrRead, pfnR0PtrFill); 1467 1472 else 1468 1473 { … … 1487 1492 1488 1493 1489 /** @copydoc PDMDEVHLP ::pfnMMIODeregister */1494 /** @copydoc PDMDEVHLPR3::pfnMMIODeregister */ 1490 1495 static DECLCALLBACK(int) pdmR3DevHlp_MMIODeregister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange) 1491 1496 { 1492 1497 PDMDEV_ASSERT_DEVINS(pDevIns); 1493 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);1498 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 1494 1499 LogFlow(("pdmR3DevHlp_MMIODeregister: caller='%s'/%d: GCPhysStart=%VGp cbRange=%#x\n", 1495 1500 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, GCPhysStart, cbRange)); 1496 1501 1497 int rc = IOMR3MMIODeregister(pDevIns->Internal.s.pVM HC, pDevIns, GCPhysStart, cbRange);1502 int rc = IOMR3MMIODeregister(pDevIns->Internal.s.pVMR3, pDevIns, GCPhysStart, cbRange); 1498 1503 1499 1504 LogFlow(("pdmR3DevHlp_MMIODeregister: caller='%s'/%d: returns %Vrc\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc)); … … 1502 1507 1503 1508 1504 /** @copydoc PDMDEVHLP ::pfnROMRegister */1509 /** @copydoc PDMDEVHLPR3::pfnROMRegister */ 1505 1510 static DECLCALLBACK(int) pdmR3DevHlp_ROMRegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, const void *pvBinary, bool fShadow, const char *pszDesc) 1506 1511 { 1507 1512 PDMDEV_ASSERT_DEVINS(pDevIns); 1508 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);1513 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 1509 1514 LogFlow(("pdmR3DevHlp_ROMRegister: caller='%s'/%d: GCPhysStart=%VGp cbRange=%#x pvBinary=%p fShadow=%RTbool pszDesc=%p:{%s}\n", 1510 1515 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, GCPhysStart, cbRange, pvBinary, fShadow, pszDesc, pszDesc)); 1511 1516 1512 int rc = MMR3PhysRomRegister(pDevIns->Internal.s.pVM HC, pDevIns, GCPhysStart, cbRange, pvBinary, fShadow, pszDesc);1517 int rc = MMR3PhysRomRegister(pDevIns->Internal.s.pVMR3, pDevIns, GCPhysStart, cbRange, pvBinary, fShadow, pszDesc); 1513 1518 1514 1519 LogFlow(("pdmR3DevHlp_ROMRegister: caller='%s'/%d: returns %Vrc\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc)); … … 1517 1522 1518 1523 1519 /** @copydoc PDMDEVHLP ::pfnSSMRegister */1524 /** @copydoc PDMDEVHLPR3::pfnSSMRegister */ 1520 1525 static DECLCALLBACK(int) pdmR3DevHlp_SSMRegister(PPDMDEVINS pDevIns, const char *pszName, uint32_t u32Instance, uint32_t u32Version, size_t cbGuess, 1521 1526 PFNSSMDEVSAVEPREP pfnSavePrep, PFNSSMDEVSAVEEXEC pfnSaveExec, PFNSSMDEVSAVEDONE pfnSaveDone, … … 1523 1528 { 1524 1529 PDMDEV_ASSERT_DEVINS(pDevIns); 1525 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);1530 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 1526 1531 LogFlow(("pdmR3DevHlp_SSMRegister: caller='%s'/%d: pszName=%p:{%s} u32Instance=%#x u32Version=#x cbGuess=%#x pfnSavePrep=%p pfnSaveExec=%p pfnSaveDone=%p pszLoadPrep=%p pfnLoadExec=%p pfnLoaddone=%p\n", 1527 1532 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pszName, pszName, u32Instance, u32Version, cbGuess, pfnSavePrep, pfnSaveExec, pfnSaveDone, pfnLoadPrep, pfnLoadExec, pfnLoadDone)); 1528 1533 1529 int rc = SSMR3Register(pDevIns->Internal.s.pVM HC, pDevIns, pszName, u32Instance, u32Version, cbGuess,1534 int rc = SSMR3Register(pDevIns->Internal.s.pVMR3, pDevIns, pszName, u32Instance, u32Version, cbGuess, 1530 1535 pfnSavePrep, pfnSaveExec, pfnSaveDone, 1531 1536 pfnLoadPrep, pfnLoadExec, pfnLoadDone); … … 1536 1541 1537 1542 1538 /** @copydoc PDMDEVHLP ::pfnTMTimerCreate */1543 /** @copydoc PDMDEVHLPR3::pfnTMTimerCreate */ 1539 1544 static DECLCALLBACK(int) pdmR3DevHlp_TMTimerCreate(PPDMDEVINS pDevIns, TMCLOCK enmClock, PFNTMTIMERDEV pfnCallback, const char *pszDesc, PPTMTIMERR3 ppTimer) 1540 1545 { 1541 1546 PDMDEV_ASSERT_DEVINS(pDevIns); 1542 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);1547 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 1543 1548 LogFlow(("pdmR3DevHlp_TMTimerCreate: caller='%s'/%d: enmClock=%d pfnCallback=%p pszDesc=%p:{%s} ppTimer=%p\n", 1544 1549 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, enmClock, pfnCallback, pszDesc, pszDesc, ppTimer)); 1545 1550 1546 int rc = TMR3TimerCreateDevice(pDevIns->Internal.s.pVM HC, pDevIns, enmClock, pfnCallback, pszDesc, ppTimer);1551 int rc = TMR3TimerCreateDevice(pDevIns->Internal.s.pVMR3, pDevIns, enmClock, pfnCallback, pszDesc, ppTimer); 1547 1552 1548 1553 LogFlow(("pdmR3DevHlp_TMTimerCreate: caller='%s'/%d: returns %Vrc\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc)); … … 1551 1556 1552 1557 1553 /** @copydoc PDMDEVHLP ::pfnTMTimerCreateExternal */1558 /** @copydoc PDMDEVHLPR3::pfnTMTimerCreateExternal */ 1554 1559 static DECLCALLBACK(PTMTIMERR3) pdmR3DevHlp_TMTimerCreateExternal(PPDMDEVINS pDevIns, TMCLOCK enmClock, PFNTMTIMEREXT pfnCallback, void *pvUser, const char *pszDesc) 1555 1560 { 1556 1561 PDMDEV_ASSERT_DEVINS(pDevIns); 1557 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);1558 1559 return TMR3TimerCreateExternal(pDevIns->Internal.s.pVM HC, enmClock, pfnCallback, pvUser, pszDesc);1560 } 1561 1562 /** @copydoc PDMDEVHLP ::pfnPCIRegister */1562 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 1563 1564 return TMR3TimerCreateExternal(pDevIns->Internal.s.pVMR3, enmClock, pfnCallback, pvUser, pszDesc); 1565 } 1566 1567 /** @copydoc PDMDEVHLPR3::pfnPCIRegister */ 1563 1568 static DECLCALLBACK(int) pdmR3DevHlp_PCIRegister(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev) 1564 1569 { 1565 1570 PDMDEV_ASSERT_DEVINS(pDevIns); 1566 PVM pVM = pDevIns->Internal.s.pVM HC;1571 PVM pVM = pDevIns->Internal.s.pVMR3; 1567 1572 VM_ASSERT_EMT(pVM); 1568 1573 LogFlow(("pdmR3DevHlp_PCIRegister: caller='%s'/%d: pPciDev=%p:{.config={%#.256Vhxs}\n", … … 1584 1589 return VERR_INVALID_PARAMETER; 1585 1590 } 1586 if (pDevIns->Internal.s.pPciDevice HC)1591 if (pDevIns->Internal.s.pPciDeviceR3) 1587 1592 { 1588 1593 /** @todo the PCI device vs. PDM device designed is a bit flawed if we have to … … 1599 1604 * already have one. If not, we'll just take the first one. 1600 1605 */ 1601 PPDMPCIBUS pBus = pDevIns->Internal.s.pPciBus HC;1606 PPDMPCIBUS pBus = pDevIns->Internal.s.pPciBusR3; 1602 1607 if (!pBus) 1603 pBus = pDevIns->Internal.s.pPciBus HC= &pVM->pdm.s.aPciBuses[0];1608 pBus = pDevIns->Internal.s.pPciBusR3 = &pVM->pdm.s.aPciBuses[0]; 1604 1609 int rc; 1605 1610 if (pBus) 1606 1611 { 1607 1612 if (pDevIns->pDevReg->fFlags & PDM_DEVREG_FLAGS_GC) 1608 pDevIns->Internal.s.pPciBusGC = MMHyperHC2GC(pVM, pDevIns->Internal.s.pPciBusHC); 1613 pDevIns->Internal.s.pPciBusR0 = MMHyperR3ToR0(pVM, pDevIns->Internal.s.pPciBusR3); 1614 else 1615 pDevIns->Internal.s.pPciBusR0 = NIL_RTR0PTR; 1616 1617 if (pDevIns->pDevReg->fFlags & PDM_DEVREG_FLAGS_GC) 1618 pDevIns->Internal.s.pPciBusRC = MMHyperR3ToRC(pVM, pDevIns->Internal.s.pPciBusR3); 1619 else 1620 pDevIns->Internal.s.pPciBusRC = NIL_RTRCPTR; 1609 1621 1610 1622 /* … … 1654 1666 if (VBOX_SUCCESS(rc)) 1655 1667 { 1656 pDevIns->Internal.s.pPciDeviceHC = pPciDev; 1668 pPciDev->pDevIns = pDevIns; 1669 1670 pDevIns->Internal.s.pPciDeviceR3 = pPciDev; 1671 if (pDevIns->pDevReg->fFlags & PDM_DEVREG_FLAGS_R0) 1672 pDevIns->Internal.s.pPciDeviceR0 = MMHyperR3ToR0(pVM, pPciDev); 1673 else 1674 pDevIns->Internal.s.pPciDeviceR0 = NIL_RTR0PTR; 1675 1657 1676 if (pDevIns->pDevReg->fFlags & PDM_DEVREG_FLAGS_GC) 1658 pDevIns->Internal.s.pPciDevice GC = MMHyperHC2GC(pVM, pPciDev);1677 pDevIns->Internal.s.pPciDeviceRC = MMHyperR3ToRC(pVM, pPciDev); 1659 1678 else 1660 pDevIns->Internal.s.pPciDevice GC = 0;1661 pPciDev->pDevIns = pDevIns; 1679 pDevIns->Internal.s.pPciDeviceRC = NIL_RTRCPTR; 1680 1662 1681 Log(("PDM: Registered device '%s'/%d as PCI device %d on bus %d\n", 1663 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pPciDev->devfn, pDevIns->Internal.s.pPciBus HC->iBus));1682 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pPciDev->devfn, pDevIns->Internal.s.pPciBusR3->iBus)); 1664 1683 } 1665 1684 } … … 1675 1694 1676 1695 1677 /** @copydoc PDMDEVHLP ::pfnPCIIORegionRegister */1696 /** @copydoc PDMDEVHLPR3::pfnPCIIORegionRegister */ 1678 1697 static DECLCALLBACK(int) pdmR3DevHlp_PCIIORegionRegister(PPDMDEVINS pDevIns, int iRegion, uint32_t cbRegion, PCIADDRESSSPACE enmType, PFNPCIIOREGIONMAP pfnCallback) 1679 1698 { 1680 1699 PDMDEV_ASSERT_DEVINS(pDevIns); 1681 PVM pVM = pDevIns->Internal.s.pVM HC;1700 PVM pVM = pDevIns->Internal.s.pVMR3; 1682 1701 VM_ASSERT_EMT(pVM); 1683 1702 LogFlow(("pdmR3DevHlp_PCIIORegionRegister: caller='%s'/%d: iRegion=%d cbRegion=%#x enmType=%d pfnCallback=%p\n", … … 1716 1735 */ 1717 1736 int rc; 1718 PPCIDEVICE pPciDev = pDevIns->Internal.s.pPciDevice HC;1737 PPCIDEVICE pPciDev = pDevIns->Internal.s.pPciDeviceR3; 1719 1738 if (pPciDev) 1720 1739 { … … 1730 1749 } 1731 1750 1732 PPDMPCIBUS pBus = pDevIns->Internal.s.pPciBus HC;1751 PPDMPCIBUS pBus = pDevIns->Internal.s.pPciBusR3; 1733 1752 Assert(pBus); 1734 1753 pdmLock(pVM); … … 1747 1766 1748 1767 1749 /** @copydoc PDMDEVHLP ::pfnPCISetConfigCallbacks */1768 /** @copydoc PDMDEVHLPR3::pfnPCISetConfigCallbacks */ 1750 1769 static DECLCALLBACK(void) pdmR3DevHlp_PCISetConfigCallbacks(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, PFNPCICONFIGREAD pfnRead, PPFNPCICONFIGREAD ppfnReadOld, 1751 1770 PFNPCICONFIGWRITE pfnWrite, PPFNPCICONFIGWRITE ppfnWriteOld) 1752 1771 { 1753 1772 PDMDEV_ASSERT_DEVINS(pDevIns); 1754 PVM pVM = pDevIns->Internal.s.pVM HC;1773 PVM pVM = pDevIns->Internal.s.pVMR3; 1755 1774 VM_ASSERT_EMT(pVM); 1756 1775 LogFlow(("pdmR3DevHlp_PCISetConfigCallbacks: caller='%s'/%d: pPciDev=%p pfnRead=%p ppfnReadOld=%p pfnWrite=%p ppfnWriteOld=%p\n", … … 1767 1786 1768 1787 if (!pPciDev) 1769 pPciDev = pDevIns->Internal.s.pPciDevice HC;1788 pPciDev = pDevIns->Internal.s.pPciDeviceR3; 1770 1789 AssertReleaseMsg(pPciDev, ("You must register your device first!\n")); 1771 PPDMPCIBUS pBus = pDevIns->Internal.s.pPciBus HC;1790 PPDMPCIBUS pBus = pDevIns->Internal.s.pPciBusR3; 1772 1791 AssertRelease(pBus); 1773 1792 AssertRelease(VMR3GetState(pVM) != VMSTATE_RUNNING); … … 1784 1803 1785 1804 1786 /** @copydoc PDMDEVHLP ::pfnPCISetIrq */1805 /** @copydoc PDMDEVHLPR3::pfnPCISetIrq */ 1787 1806 static DECLCALLBACK(void) pdmR3DevHlp_PCISetIrq(PPDMDEVINS pDevIns, int iIrq, int iLevel) 1788 1807 { … … 1798 1817 * Must have a PCI device registered! 1799 1818 */ 1800 PPCIDEVICE pPciDev = pDevIns->Internal.s.pPciDevice HC;1819 PPCIDEVICE pPciDev = pDevIns->Internal.s.pPciDeviceR3; 1801 1820 if (pPciDev) 1802 1821 { 1803 PPDMPCIBUS pBus = pDevIns->Internal.s.pPciBus HC; /** @todo the bus should be associated with the PCI device not the PDM device. */1822 PPDMPCIBUS pBus = pDevIns->Internal.s.pPciBusR3; /** @todo the bus should be associated with the PCI device not the PDM device. */ 1804 1823 Assert(pBus); 1805 PVM pVM = pDevIns->Internal.s.pVM HC;1824 PVM pVM = pDevIns->Internal.s.pVMR3; 1806 1825 pdmLock(pVM); 1807 1826 pBus->pfnSetIrqR3(pBus->pDevInsR3, pPciDev, iIrq, iLevel); … … 1815 1834 1816 1835 1817 /** @copydoc PDMDEVHLP ::pfnPCISetIrqNoWait */1836 /** @copydoc PDMDEVHLPR3::pfnPCISetIrqNoWait */ 1818 1837 static DECLCALLBACK(void) pdmR3DevHlp_PCISetIrqNoWait(PPDMDEVINS pDevIns, int iIrq, int iLevel) 1819 1838 { … … 1822 1841 1823 1842 1824 /** @copydoc PDMDEVHLP ::pfnISASetIrq */1843 /** @copydoc PDMDEVHLPR3::pfnISASetIrq */ 1825 1844 static DECLCALLBACK(void) pdmR3DevHlp_ISASetIrq(PPDMDEVINS pDevIns, int iIrq, int iLevel) 1826 1845 { … … 1833 1852 /** @todo iIrq and iLevel checks. */ 1834 1853 1835 PVM pVM = pDevIns->Internal.s.pVM HC;1854 PVM pVM = pDevIns->Internal.s.pVMR3; 1836 1855 PDMIsaSetIrq(pVM, iIrq, iLevel); /* (The API takes the lock.) */ 1837 1856 … … 1840 1859 1841 1860 1842 /** @copydoc PDMDEVHLP ::pfnISASetIrqNoWait */1861 /** @copydoc PDMDEVHLPR3::pfnISASetIrqNoWait */ 1843 1862 static DECLCALLBACK(void) pdmR3DevHlp_ISASetIrqNoWait(PPDMDEVINS pDevIns, int iIrq, int iLevel) 1844 1863 { … … 1847 1866 1848 1867 1849 /** @copydoc PDMDEVHLP ::pfnDriverAttach */1868 /** @copydoc PDMDEVHLPR3::pfnDriverAttach */ 1850 1869 static DECLCALLBACK(int) pdmR3DevHlp_DriverAttach(PPDMDEVINS pDevIns, RTUINT iLun, PPDMIBASE pBaseInterface, PPDMIBASE *ppBaseInterface, const char *pszDesc) 1851 1870 { 1852 1871 PDMDEV_ASSERT_DEVINS(pDevIns); 1853 PVM pVM = pDevIns->Internal.s.pVM HC;1872 PVM pVM = pDevIns->Internal.s.pVMR3; 1854 1873 VM_ASSERT_EMT(pVM); 1855 1874 LogFlow(("pdmR3DevHlp_DriverAttach: caller='%s'/%d: iLun=%d pBaseInterface=%p ppBaseInterface=%p pszDesc=%p:{%s}\n", … … 1860 1879 */ 1861 1880 PPDMLUN pLunPrev = NULL; 1862 PPDMLUN pLun = pDevIns->Internal.s.pLuns HC;1881 PPDMLUN pLun = pDevIns->Internal.s.pLunsR3; 1863 1882 for (; pLun; pLunPrev = pLun, pLun = pLun->pNext) 1864 1883 if (pLun->iLun == iLun) … … 1891 1910 pLun->pBase = pBaseInterface; 1892 1911 if (!pLunPrev) 1893 pDevIns->Internal.s.pLuns HC= pLun;1912 pDevIns->Internal.s.pLunsR3 = pLun; 1894 1913 else 1895 1914 pLunPrev->pNext = pLun; … … 2018 2037 2019 2038 2020 /** @copydoc PDMDEVHLP ::pfnMMHeapAlloc */2039 /** @copydoc PDMDEVHLPR3::pfnMMHeapAlloc */ 2021 2040 static DECLCALLBACK(void *) pdmR3DevHlp_MMHeapAlloc(PPDMDEVINS pDevIns, size_t cb) 2022 2041 { … … 2024 2043 LogFlow(("pdmR3DevHlp_MMHeapAlloc: caller='%s'/%d: cb=%#x\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, cb)); 2025 2044 2026 void *pv = MMR3HeapAlloc(pDevIns->Internal.s.pVM HC, MM_TAG_PDM_DEVICE_USER, cb);2045 void *pv = MMR3HeapAlloc(pDevIns->Internal.s.pVMR3, MM_TAG_PDM_DEVICE_USER, cb); 2027 2046 2028 2047 LogFlow(("pdmR3DevHlp_MMHeapAlloc: caller='%s'/%d: returns %p\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pv)); … … 2031 2050 2032 2051 2033 /** @copydoc PDMDEVHLP ::pfnMMHeapAllocZ */2052 /** @copydoc PDMDEVHLPR3::pfnMMHeapAllocZ */ 2034 2053 static DECLCALLBACK(void *) pdmR3DevHlp_MMHeapAllocZ(PPDMDEVINS pDevIns, size_t cb) 2035 2054 { … … 2037 2056 LogFlow(("pdmR3DevHlp_MMHeapAllocZ: caller='%s'/%d: cb=%#x\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, cb)); 2038 2057 2039 void *pv = MMR3HeapAllocZ(pDevIns->Internal.s.pVM HC, MM_TAG_PDM_DEVICE_USER, cb);2058 void *pv = MMR3HeapAllocZ(pDevIns->Internal.s.pVMR3, MM_TAG_PDM_DEVICE_USER, cb); 2040 2059 2041 2060 LogFlow(("pdmR3DevHlp_MMHeapAllocZ: caller='%s'/%d: returns %p\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pv)); … … 2044 2063 2045 2064 2046 /** @copydoc PDMDEVHLP ::pfnMMHeapFree */2065 /** @copydoc PDMDEVHLPR3::pfnMMHeapFree */ 2047 2066 static DECLCALLBACK(void) pdmR3DevHlp_MMHeapFree(PPDMDEVINS pDevIns, void *pv) 2048 2067 { … … 2056 2075 2057 2076 2058 /** @copydoc PDMDEVHLP ::pfnVMSetError */2077 /** @copydoc PDMDEVHLPR3::pfnVMSetError */ 2059 2078 static DECLCALLBACK(int) pdmR3DevHlp_VMSetError(PPDMDEVINS pDevIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...) 2060 2079 { … … 2062 2081 va_list args; 2063 2082 va_start(args, pszFormat); 2064 int rc2 = VMSetErrorV(pDevIns->Internal.s.pVM HC, rc, RT_SRC_POS_ARGS, pszFormat, args); Assert(rc2 == rc); NOREF(rc2);2083 int rc2 = VMSetErrorV(pDevIns->Internal.s.pVMR3, rc, RT_SRC_POS_ARGS, pszFormat, args); Assert(rc2 == rc); NOREF(rc2); 2065 2084 va_end(args); 2066 2085 return rc; … … 2068 2087 2069 2088 2070 /** @copydoc PDMDEVHLP ::pfnVMSetErrorV */2089 /** @copydoc PDMDEVHLPR3::pfnVMSetErrorV */ 2071 2090 static DECLCALLBACK(int) pdmR3DevHlp_VMSetErrorV(PPDMDEVINS pDevIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va) 2072 2091 { 2073 2092 PDMDEV_ASSERT_DEVINS(pDevIns); 2074 int rc2 = VMSetErrorV(pDevIns->Internal.s.pVM HC, rc, RT_SRC_POS_ARGS, pszFormat, va); Assert(rc2 == rc); NOREF(rc2);2075 return rc; 2076 } 2077 2078 2079 /** @copydoc PDMDEVHLP ::pfnVMSetRuntimeError */2093 int rc2 = VMSetErrorV(pDevIns->Internal.s.pVMR3, rc, RT_SRC_POS_ARGS, pszFormat, va); Assert(rc2 == rc); NOREF(rc2); 2094 return rc; 2095 } 2096 2097 2098 /** @copydoc PDMDEVHLPR3::pfnVMSetRuntimeError */ 2080 2099 static DECLCALLBACK(int) pdmR3DevHlp_VMSetRuntimeError(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, ...) 2081 2100 { … … 2083 2102 va_list args; 2084 2103 va_start(args, pszFormat); 2085 int rc = VMSetRuntimeErrorV(pDevIns->Internal.s.pVM HC, fFatal, pszErrorID, pszFormat, args);2104 int rc = VMSetRuntimeErrorV(pDevIns->Internal.s.pVMR3, fFatal, pszErrorID, pszFormat, args); 2086 2105 va_end(args); 2087 2106 return rc; … … 2089 2108 2090 2109 2091 /** @copydoc PDMDEVHLP ::pfnVMSetRuntimeErrorV */2110 /** @copydoc PDMDEVHLPR3::pfnVMSetRuntimeErrorV */ 2092 2111 static DECLCALLBACK(int) pdmR3DevHlp_VMSetRuntimeErrorV(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, va_list va) 2093 2112 { 2094 2113 PDMDEV_ASSERT_DEVINS(pDevIns); 2095 int rc = VMSetRuntimeErrorV(pDevIns->Internal.s.pVM HC, fFatal, pszErrorID, pszFormat, va);2096 return rc; 2097 } 2098 2099 2100 /** @copydoc PDMDEVHLP ::pfnAssertEMT */2114 int rc = VMSetRuntimeErrorV(pDevIns->Internal.s.pVMR3, fFatal, pszErrorID, pszFormat, va); 2115 return rc; 2116 } 2117 2118 2119 /** @copydoc PDMDEVHLPR3::pfnAssertEMT */ 2101 2120 static DECLCALLBACK(bool) pdmR3DevHlp_AssertEMT(PPDMDEVINS pDevIns, const char *pszFile, unsigned iLine, const char *pszFunction) 2102 2121 { 2103 2122 PDMDEV_ASSERT_DEVINS(pDevIns); 2104 if (VM_IS_EMT(pDevIns->Internal.s.pVM HC))2123 if (VM_IS_EMT(pDevIns->Internal.s.pVMR3)) 2105 2124 return true; 2106 2125 … … 2113 2132 2114 2133 2115 /** @copydoc PDMDEVHLP ::pfnAssertOther */2134 /** @copydoc PDMDEVHLPR3::pfnAssertOther */ 2116 2135 static DECLCALLBACK(bool) pdmR3DevHlp_AssertOther(PPDMDEVINS pDevIns, const char *pszFile, unsigned iLine, const char *pszFunction) 2117 2136 { 2118 2137 PDMDEV_ASSERT_DEVINS(pDevIns); 2119 if (!VM_IS_EMT(pDevIns->Internal.s.pVM HC))2138 if (!VM_IS_EMT(pDevIns->Internal.s.pVMR3)) 2120 2139 return true; 2121 2140 … … 2128 2147 2129 2148 2130 /** @copydoc PDMDEVHLP ::pfnDBGFStopV */2149 /** @copydoc PDMDEVHLPR3::pfnDBGFStopV */ 2131 2150 static DECLCALLBACK(int) pdmR3DevHlp_DBGFStopV(PPDMDEVINS pDevIns, const char *pszFile, unsigned iLine, const char *pszFunction, const char *pszFormat, va_list args) 2132 2151 { … … 2140 2159 #endif 2141 2160 2142 PVM pVM = pDevIns->Internal.s.pVM HC;2161 PVM pVM = pDevIns->Internal.s.pVMR3; 2143 2162 VM_ASSERT_EMT(pVM); 2144 2163 int rc = DBGFR3EventSrcV(pVM, DBGFEVENT_DEV_STOP, pszFile, iLine, pszFunction, pszFormat, args); … … 2149 2168 2150 2169 2151 /** @copydoc PDMDEVHLP ::pfnDBGFInfoRegister */2170 /** @copydoc PDMDEVHLPR3::pfnDBGFInfoRegister */ 2152 2171 static DECLCALLBACK(int) pdmR3DevHlp_DBGFInfoRegister(PPDMDEVINS pDevIns, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDEV pfnHandler) 2153 2172 { … … 2156 2175 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pszName, pszName, pszDesc, pszDesc, pfnHandler)); 2157 2176 2158 PVM pVM = pDevIns->Internal.s.pVM HC;2177 PVM pVM = pDevIns->Internal.s.pVMR3; 2159 2178 VM_ASSERT_EMT(pVM); 2160 2179 int rc = DBGFR3InfoRegisterDevice(pVM, pszName, pszDesc, pfnHandler, pDevIns); … … 2165 2184 2166 2185 2167 /** @copydoc PDMDEVHLP ::pfnSTAMRegister */2186 /** @copydoc PDMDEVHLPR3::pfnSTAMRegister */ 2168 2187 static DECLCALLBACK(void) pdmR3DevHlp_STAMRegister(PPDMDEVINS pDevIns, void *pvSample, STAMTYPE enmType, const char *pszName, STAMUNIT enmUnit, const char *pszDesc) 2169 2188 { 2170 2189 PDMDEV_ASSERT_DEVINS(pDevIns); 2171 PVM pVM = pDevIns->Internal.s.pVM HC;2190 PVM pVM = pDevIns->Internal.s.pVMR3; 2172 2191 VM_ASSERT_EMT(pVM); 2173 2192 … … 2178 2197 2179 2198 2180 /** @copydoc PDMDEVHLP ::pfnSTAMRegisterF */2199 /** @copydoc PDMDEVHLPR3::pfnSTAMRegisterF */ 2181 2200 static DECLCALLBACK(void) pdmR3DevHlp_STAMRegisterF(PPDMDEVINS pDevIns, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility, 2182 2201 STAMUNIT enmUnit, const char *pszDesc, const char *pszName, ...) 2183 2202 { 2184 2203 PDMDEV_ASSERT_DEVINS(pDevIns); 2185 PVM pVM = pDevIns->Internal.s.pVM HC;2204 PVM pVM = pDevIns->Internal.s.pVMR3; 2186 2205 VM_ASSERT_EMT(pVM); 2187 2206 … … 2196 2215 2197 2216 2198 /** @copydoc PDMDEVHLP ::pfnSTAMRegisterV */2217 /** @copydoc PDMDEVHLPR3::pfnSTAMRegisterV */ 2199 2218 static DECLCALLBACK(void) pdmR3DevHlp_STAMRegisterV(PPDMDEVINS pDevIns, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility, 2200 2219 STAMUNIT enmUnit, const char *pszDesc, const char *pszName, va_list args) 2201 2220 { 2202 2221 PDMDEV_ASSERT_DEVINS(pDevIns); 2203 PVM pVM = pDevIns->Internal.s.pVM HC;2222 PVM pVM = pDevIns->Internal.s.pVMR3; 2204 2223 VM_ASSERT_EMT(pVM); 2205 2224 … … 2211 2230 2212 2231 2213 /** @copydoc PDMDEVHLP ::pfnRTCRegister */2232 /** @copydoc PDMDEVHLPR3::pfnRTCRegister */ 2214 2233 static DECLCALLBACK(int) pdmR3DevHlp_RTCRegister(PPDMDEVINS pDevIns, PCPDMRTCREG pRtcReg, PCPDMRTCHLP *ppRtcHlp) 2215 2234 { 2216 2235 PDMDEV_ASSERT_DEVINS(pDevIns); 2217 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);2236 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 2218 2237 LogFlow(("pdmR3DevHlp_RTCRegister: caller='%s'/%d: pRtcReg=%p:{.u32Version=%#x, .pfnWrite=%p, .pfnRead=%p} ppRtcHlp=%p\n", 2219 2238 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pRtcReg, pRtcReg->u32Version, pRtcReg->pfnWrite, … … 2252 2271 * Only one DMA device. 2253 2272 */ 2254 PVM pVM = pDevIns->Internal.s.pVM HC;2273 PVM pVM = pDevIns->Internal.s.pVMR3; 2255 2274 if (pVM->pdm.s.pRtc) 2256 2275 { … … 2265 2284 */ 2266 2285 int rc = VINF_SUCCESS; 2267 PPDMRTC pRtc = (PPDMRTC)MMR3HeapAlloc(pDevIns->Internal.s.pVM HC, MM_TAG_PDM_DEVICE, sizeof(*pRtc));2286 PPDMRTC pRtc = (PPDMRTC)MMR3HeapAlloc(pDevIns->Internal.s.pVMR3, MM_TAG_PDM_DEVICE, sizeof(*pRtc)); 2268 2287 if (pRtc) 2269 2288 { … … 2286 2305 2287 2306 2288 /** @copydoc PDMDEVHLP ::pfnPDMQueueCreate */2307 /** @copydoc PDMDEVHLPR3::pfnPDMQueueCreate */ 2289 2308 static DECLCALLBACK(int) pdmR3DevHlp_PDMQueueCreate(PPDMDEVINS pDevIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval, 2290 2309 PFNPDMQUEUEDEV pfnCallback, bool fGCEnabled, PPDMQUEUE *ppQueue) … … 2294 2313 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, cbItem, cItems, cMilliesInterval, pfnCallback, fGCEnabled, ppQueue)); 2295 2314 2296 PVM pVM = pDevIns->Internal.s.pVM HC;2315 PVM pVM = pDevIns->Internal.s.pVMR3; 2297 2316 VM_ASSERT_EMT(pVM); 2298 2317 int rc = PDMR3QueueCreateDevice(pVM, pDevIns, cbItem, cItems, cMilliesInterval, pfnCallback, fGCEnabled, ppQueue); … … 2303 2322 2304 2323 2305 /** @copydoc PDMDEVHLP ::pfnCritSectInit */2324 /** @copydoc PDMDEVHLPR3::pfnCritSectInit */ 2306 2325 static DECLCALLBACK(int) pdmR3DevHlp_CritSectInit(PPDMDEVINS pDevIns, PPDMCRITSECT pCritSect, const char *pszName) 2307 2326 { … … 2310 2329 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pCritSect, pszName, pszName)); 2311 2330 2312 PVM pVM = pDevIns->Internal.s.pVM HC;2331 PVM pVM = pDevIns->Internal.s.pVMR3; 2313 2332 VM_ASSERT_EMT(pVM); 2314 2333 int rc = pdmR3CritSectInitDevice(pVM, pDevIns, pCritSect, pszName); … … 2319 2338 2320 2339 2321 /** @copydoc PDMDEVHLP ::pfnUTCNow */2340 /** @copydoc PDMDEVHLPR3::pfnUTCNow */ 2322 2341 static DECLCALLBACK(PRTTIMESPEC) pdmR3DevHlp_UTCNow(PPDMDEVINS pDevIns, PRTTIMESPEC pTime) 2323 2342 { … … 2326 2345 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pTime)); 2327 2346 2328 pTime = TMR3UTCNow(pDevIns->Internal.s.pVM HC, pTime);2347 pTime = TMR3UTCNow(pDevIns->Internal.s.pVMR3, pTime); 2329 2348 2330 2349 LogFlow(("pdmR3DevHlp_UTCNow: caller='%s'/%d: returns %RU64\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, RTTimeSpecGetNano(pTime))); … … 2333 2352 2334 2353 2335 /** @copydoc PDMDEVHLP ::pfnPDMThreadCreate */2354 /** @copydoc PDMDEVHLPR3::pfnPDMThreadCreate */ 2336 2355 static DECLCALLBACK(int) pdmR3DevHlp_PDMThreadCreate(PPDMDEVINS pDevIns, PPPDMTHREAD ppThread, void *pvUser, PFNPDMTHREADDEV pfnThread, 2337 2356 PFNPDMTHREADWAKEUPDEV pfnWakeup, size_t cbStack, RTTHREADTYPE enmType, const char *pszName) 2338 2357 { 2339 2358 PDMDEV_ASSERT_DEVINS(pDevIns); 2340 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);2359 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 2341 2360 LogFlow(("pdmR3DevHlp_PDMThreadCreate: caller='%s'/%d: ppThread=%p pvUser=%p pfnThread=%p pfnWakeup=%p cbStack=%#zx enmType=%d pszName=%p:{%s}\n", 2342 2361 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, ppThread, pvUser, pfnThread, pfnWakeup, cbStack, enmType, pszName, pszName)); 2343 2362 2344 int rc = pdmR3ThreadCreateDevice(pDevIns->Internal.s.pVM HC, pDevIns, ppThread, pvUser, pfnThread, pfnWakeup, cbStack, enmType, pszName);2363 int rc = pdmR3ThreadCreateDevice(pDevIns->Internal.s.pVMR3, pDevIns, ppThread, pvUser, pfnThread, pfnWakeup, cbStack, enmType, pszName); 2345 2364 2346 2365 LogFlow(("pdmR3DevHlp_PDMThreadCreate: caller='%s'/%d: returns %Vrc *ppThread=%RTthrd\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, … … 2350 2369 2351 2370 2352 /** @copydoc PDMDEVHLP ::pfnGetVM */2371 /** @copydoc PDMDEVHLPR3::pfnGetVM */ 2353 2372 static DECLCALLBACK(PVM) pdmR3DevHlp_GetVM(PPDMDEVINS pDevIns) 2354 2373 { 2355 2374 PDMDEV_ASSERT_DEVINS(pDevIns); 2356 LogFlow(("pdmR3DevHlp_GetVM: caller='%s'/%d: returns %p\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pDevIns->Internal.s.pVM HC));2357 return pDevIns->Internal.s.pVM HC;2358 } 2359 2360 2361 /** @copydoc PDMDEVHLP ::pfnPCIBusRegister */2375 LogFlow(("pdmR3DevHlp_GetVM: caller='%s'/%d: returns %p\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pDevIns->Internal.s.pVMR3)); 2376 return pDevIns->Internal.s.pVMR3; 2377 } 2378 2379 2380 /** @copydoc PDMDEVHLPR3::pfnPCIBusRegister */ 2362 2381 static DECLCALLBACK(int) pdmR3DevHlp_PCIBusRegister(PPDMDEVINS pDevIns, PPDMPCIBUSREG pPciBusReg, PCPDMPCIHLPR3 *ppPciHlpR3) 2363 2382 { 2364 2383 PDMDEV_ASSERT_DEVINS(pDevIns); 2365 PVM pVM = pDevIns->Internal.s.pVM HC;2384 PVM pVM = pDevIns->Internal.s.pVMR3; 2366 2385 VM_ASSERT_EMT(pVM); 2367 2386 LogFlow(("pdmR3DevHlp_PCIBusRegister: caller='%s'/%d: pPciBusReg=%p:{.u32Version=%#x, .pfnRegisterR3=%p, .pfnIORegionRegisterR3=%p, .pfnSetIrqR3=%p, " … … 2494 2513 2495 2514 2496 /** @copydoc PDMDEVHLP ::pfnPICRegister */2515 /** @copydoc PDMDEVHLPR3::pfnPICRegister */ 2497 2516 static DECLCALLBACK(int) pdmR3DevHlp_PICRegister(PPDMDEVINS pDevIns, PPDMPICREG pPicReg, PCPDMPICHLPR3 *ppPicHlpR3) 2498 2517 { 2499 2518 PDMDEV_ASSERT_DEVINS(pDevIns); 2500 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);2519 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 2501 2520 LogFlow(("pdmR3DevHlp_PICRegister: caller='%s'/%d: pPicReg=%p:{.u32Version=%#x, .pfnSetIrqR3=%p, .pfnGetInterruptR3=%p, .pszGetIrqRC=%p:{%s}, .pszGetInterruptRC=%p:{%s}, .pszGetIrqR0=%p:{%s}, .pszGetInterruptR0=%p:{%s} } ppPicHlpR3=%p\n", 2502 2521 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pPicReg, pPicReg->u32Version, pPicReg->pfnSetIrqR3, pPicReg->pfnGetInterruptR3, … … 2557 2576 * Only one PIC device. 2558 2577 */ 2559 PVM pVM = pDevIns->Internal.s.pVM HC;2578 PVM pVM = pDevIns->Internal.s.pVMR3; 2560 2579 if (pVM->pdm.s.Pic.pDevInsR3) 2561 2580 { … … 2633 2652 2634 2653 2635 /** @copydoc PDMDEVHLP ::pfnAPICRegister */2654 /** @copydoc PDMDEVHLPR3::pfnAPICRegister */ 2636 2655 static DECLCALLBACK(int) pdmR3DevHlp_APICRegister(PPDMDEVINS pDevIns, PPDMAPICREG pApicReg, PCPDMAPICHLPR3 *ppApicHlpR3) 2637 2656 { 2638 2657 PDMDEV_ASSERT_DEVINS(pDevIns); 2639 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);2658 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 2640 2659 LogFlow(("pdmR3DevHlp_APICRegister: caller='%s'/%d: pApicReg=%p:{.u32Version=%#x, .pfnGetInterruptR3=%p, .pfnSetBaseR3=%p, .pfnGetBaseR3=%p, " 2641 2660 ".pfnSetTPRR3=%p, .pfnGetTPRR3=%p, .pfnBusDeliverR3=%p, pszGetInterruptRC=%p:{%s}, pszSetBaseRC=%p:{%s}, pszGetBaseRC=%p:{%s}, " … … 2736 2755 * Only one APIC device. (malc: only in UP case actually) 2737 2756 */ 2738 PVM pVM = pDevIns->Internal.s.pVM HC;2757 PVM pVM = pDevIns->Internal.s.pVMR3; 2739 2758 if (pVM->pdm.s.Apic.pDevInsR3) 2740 2759 { … … 2877 2896 2878 2897 2879 /** @copydoc PDMDEVHLP ::pfnIOAPICRegister */2898 /** @copydoc PDMDEVHLPR3::pfnIOAPICRegister */ 2880 2899 static DECLCALLBACK(int) pdmR3DevHlp_IOAPICRegister(PPDMDEVINS pDevIns, PPDMIOAPICREG pIoApicReg, PCPDMIOAPICHLPR3 *ppIoApicHlpR3) 2881 2900 { 2882 2901 PDMDEV_ASSERT_DEVINS(pDevIns); 2883 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);2902 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 2884 2903 LogFlow(("pdmR3DevHlp_IOAPICRegister: caller='%s'/%d: pIoApicReg=%p:{.u32Version=%#x, .pfnSetIrqR3=%p, .pszSetIrqRC=%p:{%s}, .pszSetIrqR0=%p:{%s}} ppIoApicHlpR3=%p\n", 2885 2904 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pIoApicReg, pIoApicReg->u32Version, pIoApicReg->pfnSetIrqR3, … … 2926 2945 * If the I/O APIC does GC stuff so must the APIC. 2927 2946 */ 2928 PVM pVM = pDevIns->Internal.s.pVM HC;2947 PVM pVM = pDevIns->Internal.s.pVMR3; 2929 2948 if (!pVM->pdm.s.Apic.pDevInsR3) 2930 2949 { … … 3006 3025 3007 3026 3008 /** @copydoc PDMDEVHLP ::pfnDMACRegister */3027 /** @copydoc PDMDEVHLPR3::pfnDMACRegister */ 3009 3028 static DECLCALLBACK(int) pdmR3DevHlp_DMACRegister(PPDMDEVINS pDevIns, PPDMDMACREG pDmacReg, PCPDMDMACHLP *ppDmacHlp) 3010 3029 { 3011 3030 PDMDEV_ASSERT_DEVINS(pDevIns); 3012 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);3031 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 3013 3032 LogFlow(("pdmR3DevHlp_DMACRegister: caller='%s'/%d: pDmacReg=%p:{.u32Version=%#x, .pfnRun=%p, .pfnRegister=%p, .pfnReadMemory=%p, .pfnWriteMemory=%p, .pfnSetDREQ=%p, .pfnGetChannelMode=%p} ppDmacHlp=%p\n", 3014 3033 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pDmacReg, pDmacReg->u32Version, pDmacReg->pfnRun, pDmacReg->pfnRegister, … … 3055 3074 * Only one DMA device. 3056 3075 */ 3057 PVM pVM = pDevIns->Internal.s.pVM HC;3076 PVM pVM = pDevIns->Internal.s.pVMR3; 3058 3077 if (pVM->pdm.s.pDmac) 3059 3078 { … … 3068 3087 */ 3069 3088 int rc = VINF_SUCCESS; 3070 PPDMDMAC pDmac = (PPDMDMAC)MMR3HeapAlloc(pDevIns->Internal.s.pVM HC, MM_TAG_PDM_DEVICE, sizeof(*pDmac));3089 PPDMDMAC pDmac = (PPDMDMAC)MMR3HeapAlloc(pDevIns->Internal.s.pVMR3, MM_TAG_PDM_DEVICE, sizeof(*pDmac)); 3071 3090 if (pDmac) 3072 3091 { … … 3089 3108 3090 3109 3091 /** @copydoc PDMDEVHLP ::pfnPhysRead */3110 /** @copydoc PDMDEVHLPR3::pfnPhysRead */ 3092 3111 static DECLCALLBACK(void) pdmR3DevHlp_PhysRead(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead) 3093 3112 { … … 3101 3120 */ 3102 3121 #ifdef PDM_PHYS_READWRITE_FROM_ANY_THREAD 3103 PGMPhysRead(pDevIns->Internal.s.pVM HC, GCPhys, pvBuf, cbRead);3122 PGMPhysRead(pDevIns->Internal.s.pVMR3, GCPhys, pvBuf, cbRead); 3104 3123 #else 3105 if (VM_IS_EMT(pDevIns->Internal.s.pVM HC) || VMMR3LockIsOwner(pDevIns->Internal.s.pVMHC))3106 PGMPhysRead(pDevIns->Internal.s.pVM HC, GCPhys, pvBuf, cbRead);3124 if (VM_IS_EMT(pDevIns->Internal.s.pVMR3) || VMMR3LockIsOwner(pDevIns->Internal.s.pVMR3)) 3125 PGMPhysRead(pDevIns->Internal.s.pVMR3, GCPhys, pvBuf, cbRead); 3107 3126 else 3108 3127 { … … 3110 3129 PVMREQ pReq; 3111 3130 AssertCompileSize(RTGCPHYS, 4); 3112 int rc = VMR3ReqCallVoid(pDevIns->Internal.s.pVM HC, &pReq, RT_INDEFINITE_WAIT,3113 (PFNRT)PGMPhysRead, 4, pDevIns->Internal.s.pVM HC, GCPhys, pvBuf, cbRead);3131 int rc = VMR3ReqCallVoid(pDevIns->Internal.s.pVMR3, &pReq, RT_INDEFINITE_WAIT, 3132 (PFNRT)PGMPhysRead, 4, pDevIns->Internal.s.pVMR3, GCPhys, pvBuf, cbRead); 3114 3133 while (rc == VERR_TIMEOUT) 3115 3134 rc = VMR3ReqWait(pReq, RT_INDEFINITE_WAIT); … … 3122 3141 3123 3142 3124 /** @copydoc PDMDEVHLP ::pfnPhysWrite */3143 /** @copydoc PDMDEVHLPR3::pfnPhysWrite */ 3125 3144 static DECLCALLBACK(void) pdmR3DevHlp_PhysWrite(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite) 3126 3145 { … … 3134 3153 */ 3135 3154 #ifdef PDM_PHYS_READWRITE_FROM_ANY_THREAD 3136 PGMPhysWrite(pDevIns->Internal.s.pVM HC, GCPhys, pvBuf, cbWrite);3155 PGMPhysWrite(pDevIns->Internal.s.pVMR3, GCPhys, pvBuf, cbWrite); 3137 3156 #else 3138 if (VM_IS_EMT(pDevIns->Internal.s.pVM HC) || VMMR3LockIsOwner(pDevIns->Internal.s.pVMHC))3139 PGMPhysWrite(pDevIns->Internal.s.pVM HC, GCPhys, pvBuf, cbWrite);3157 if (VM_IS_EMT(pDevIns->Internal.s.pVMR3) || VMMR3LockIsOwner(pDevIns->Internal.s.pVMR3)) 3158 PGMPhysWrite(pDevIns->Internal.s.pVMR3, GCPhys, pvBuf, cbWrite); 3140 3159 else 3141 3160 { … … 3143 3162 PVMREQ pReq; 3144 3163 AssertCompileSize(RTGCPHYS, 4); 3145 int rc = VMR3ReqCallVoid(pDevIns->Internal.s.pVM HC, &pReq, RT_INDEFINITE_WAIT,3146 (PFNRT)PGMPhysWrite, 4, pDevIns->Internal.s.pVM HC, GCPhys, pvBuf, cbWrite);3164 int rc = VMR3ReqCallVoid(pDevIns->Internal.s.pVMR3, &pReq, RT_INDEFINITE_WAIT, 3165 (PFNRT)PGMPhysWrite, 4, pDevIns->Internal.s.pVMR3, GCPhys, pvBuf, cbWrite); 3147 3166 while (rc == VERR_TIMEOUT) 3148 3167 rc = VMR3ReqWait(pReq, RT_INDEFINITE_WAIT); … … 3155 3174 3156 3175 3157 /** @copydoc PDMDEVHLP ::pfnPhysReadGCVirt */3176 /** @copydoc PDMDEVHLPR3::pfnPhysReadGCVirt */ 3158 3177 static DECLCALLBACK(int) pdmR3DevHlp_PhysReadGCVirt(PPDMDEVINS pDevIns, void *pvDst, RTGCPTR GCVirtSrc, size_t cb) 3159 3178 { 3160 3179 PDMDEV_ASSERT_DEVINS(pDevIns); 3161 PVM pVM = pDevIns->Internal.s.pVM HC;3180 PVM pVM = pDevIns->Internal.s.pVMR3; 3162 3181 VM_ASSERT_EMT(pVM); 3163 3182 LogFlow(("pdmR3DevHlp_PhysReadGCVirt: caller='%s'/%d: pvDst=%p GCVirt=%VGv cb=%#x\n", … … 3175 3194 3176 3195 3177 /** @copydoc PDMDEVHLP ::pfnPhysWriteGCVirt */3196 /** @copydoc PDMDEVHLPR3::pfnPhysWriteGCVirt */ 3178 3197 static DECLCALLBACK(int) pdmR3DevHlp_PhysWriteGCVirt(PPDMDEVINS pDevIns, RTGCPTR GCVirtDst, const void *pvSrc, size_t cb) 3179 3198 { 3180 3199 PDMDEV_ASSERT_DEVINS(pDevIns); 3181 PVM pVM = pDevIns->Internal.s.pVM HC;3200 PVM pVM = pDevIns->Internal.s.pVMR3; 3182 3201 VM_ASSERT_EMT(pVM); 3183 3202 LogFlow(("pdmR3DevHlp_PhysWriteGCVirt: caller='%s'/%d: GCVirtDst=%VGv pvSrc=%p cb=%#x\n", … … 3195 3214 3196 3215 3197 /** @copydoc PDMDEVHLP ::pfnPhysReserve */3216 /** @copydoc PDMDEVHLPR3::pfnPhysReserve */ 3198 3217 static DECLCALLBACK(int) pdmR3DevHlp_PhysReserve(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTUINT cbRange, const char *pszDesc) 3199 3218 { 3200 3219 PDMDEV_ASSERT_DEVINS(pDevIns); 3201 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);3220 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 3202 3221 LogFlow(("pdmR3DevHlp_PhysReserve: caller='%s'/%d: GCPhys=%VGp cbRange=%#x pszDesc=%p:{%s}\n", 3203 3222 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, GCPhys, cbRange, pszDesc, pszDesc)); 3204 3223 3205 int rc = MMR3PhysReserve(pDevIns->Internal.s.pVM HC, GCPhys, cbRange, pszDesc);3224 int rc = MMR3PhysReserve(pDevIns->Internal.s.pVMR3, GCPhys, cbRange, pszDesc); 3206 3225 3207 3226 LogFlow(("pdmR3DevHlp_PhysReserve: caller='%s'/%d: returns %Vrc\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc)); … … 3211 3230 3212 3231 3213 /** @copydoc PDMDEVHLP ::pfnPhysGCPtr2GCPhys */3232 /** @copydoc PDMDEVHLPR3::pfnPhysGCPtr2GCPhys */ 3214 3233 static DECLCALLBACK(int) pdmR3DevHlp_PhysGCPtr2GCPhys(PPDMDEVINS pDevIns, RTGCPTR GCPtr, PRTGCPHYS pGCPhys) 3215 3234 { 3216 3235 PDMDEV_ASSERT_DEVINS(pDevIns); 3217 PVM pVM = pDevIns->Internal.s.pVM HC;3236 PVM pVM = pDevIns->Internal.s.pVMR3; 3218 3237 VM_ASSERT_EMT(pVM); 3219 3238 LogFlow(("pdmR3DevHlp_PhysGCPtr2GCPhys: caller='%s'/%d: GCPtr=%VGv pGCPhys=%p\n", … … 3231 3250 3232 3251 3233 /** @copydoc PDMDEVHLP ::pfnVMState */3252 /** @copydoc PDMDEVHLPR3::pfnVMState */ 3234 3253 static DECLCALLBACK(VMSTATE) pdmR3DevHlp_VMState(PPDMDEVINS pDevIns) 3235 3254 { 3236 3255 PDMDEV_ASSERT_DEVINS(pDevIns); 3237 3256 3238 VMSTATE enmVMState = VMR3GetState(pDevIns->Internal.s.pVM HC);3257 VMSTATE enmVMState = VMR3GetState(pDevIns->Internal.s.pVMR3); 3239 3258 3240 3259 LogFlow(("pdmR3DevHlp_VMState: caller='%s'/%d: returns %d (%s)\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, … … 3244 3263 3245 3264 3246 /** @copydoc PDMDEVHLP ::pfnA20IsEnabled */3265 /** @copydoc PDMDEVHLPR3::pfnA20IsEnabled */ 3247 3266 static DECLCALLBACK(bool) pdmR3DevHlp_A20IsEnabled(PPDMDEVINS pDevIns) 3248 3267 { 3249 3268 PDMDEV_ASSERT_DEVINS(pDevIns); 3250 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);3251 3252 bool fRc = PGMPhysIsA20Enabled(pDevIns->Internal.s.pVM HC);3269 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 3270 3271 bool fRc = PGMPhysIsA20Enabled(pDevIns->Internal.s.pVMR3); 3253 3272 3254 3273 LogFlow(("pdmR3DevHlp_A20IsEnabled: caller='%s'/%d: returns %d\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, fRc)); … … 3257 3276 3258 3277 3259 /** @copydoc PDMDEVHLP ::pfnA20Set */3278 /** @copydoc PDMDEVHLPR3::pfnA20Set */ 3260 3279 static DECLCALLBACK(void) pdmR3DevHlp_A20Set(PPDMDEVINS pDevIns, bool fEnable) 3261 3280 { 3262 3281 PDMDEV_ASSERT_DEVINS(pDevIns); 3263 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);3282 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 3264 3283 LogFlow(("pdmR3DevHlp_A20Set: caller='%s'/%d: fEnable=%d\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, fEnable)); 3265 3284 //Assert(*(unsigned *)&fEnable <= 1); 3266 PGMR3PhysSetA20(pDevIns->Internal.s.pVM HC, fEnable);3267 } 3268 3269 3270 /** @copydoc PDMDEVHLP ::pfnVMReset */3285 PGMR3PhysSetA20(pDevIns->Internal.s.pVMR3, fEnable); 3286 } 3287 3288 3289 /** @copydoc PDMDEVHLPR3::pfnVMReset */ 3271 3290 static DECLCALLBACK(int) pdmR3DevHlp_VMReset(PPDMDEVINS pDevIns) 3272 3291 { 3273 3292 PDMDEV_ASSERT_DEVINS(pDevIns); 3274 PVM pVM = pDevIns->Internal.s.pVM HC;3293 PVM pVM = pDevIns->Internal.s.pVMR3; 3275 3294 VM_ASSERT_EMT(pVM); 3276 3295 LogFlow(("pdmR3DevHlp_VMReset: caller='%s'/%d: VM_FF_RESET %d -> 1\n", … … 3300 3319 3301 3320 3302 /** @copydoc PDMDEVHLP ::pfnVMSuspend */3321 /** @copydoc PDMDEVHLPR3::pfnVMSuspend */ 3303 3322 static DECLCALLBACK(int) pdmR3DevHlp_VMSuspend(PPDMDEVINS pDevIns) 3304 3323 { 3305 3324 PDMDEV_ASSERT_DEVINS(pDevIns); 3306 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);3325 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 3307 3326 LogFlow(("pdmR3DevHlp_VMSuspend: caller='%s'/%d:\n", 3308 3327 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance)); 3309 3328 3310 int rc = VMR3Suspend(pDevIns->Internal.s.pVM HC);3329 int rc = VMR3Suspend(pDevIns->Internal.s.pVMR3); 3311 3330 3312 3331 LogFlow(("pdmR3DevHlp_VMSuspend: caller='%s'/%d: returns %Vrc\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc)); … … 3315 3334 3316 3335 3317 /** @copydoc PDMDEVHLP ::pfnVMPowerOff */3336 /** @copydoc PDMDEVHLPR3::pfnVMPowerOff */ 3318 3337 static DECLCALLBACK(int) pdmR3DevHlp_VMPowerOff(PPDMDEVINS pDevIns) 3319 3338 { 3320 3339 PDMDEV_ASSERT_DEVINS(pDevIns); 3321 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);3340 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 3322 3341 LogFlow(("pdmR3DevHlp_VMPowerOff: caller='%s'/%d:\n", 3323 3342 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance)); 3324 3343 3325 int rc = VMR3PowerOff(pDevIns->Internal.s.pVM HC);3344 int rc = VMR3PowerOff(pDevIns->Internal.s.pVMR3); 3326 3345 3327 3346 LogFlow(("pdmR3DevHlp_VMPowerOff: caller='%s'/%d: returns %Vrc\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc)); … … 3330 3349 3331 3350 3332 /** @copydoc PDMDEVHLP ::pfnLockVM */3351 /** @copydoc PDMDEVHLPR3::pfnLockVM */ 3333 3352 static DECLCALLBACK(int) pdmR3DevHlp_LockVM(PPDMDEVINS pDevIns) 3334 3353 { 3335 return VMMR3Lock(pDevIns->Internal.s.pVM HC);3336 } 3337 3338 3339 /** @copydoc PDMDEVHLP ::pfnUnlockVM */3354 return VMMR3Lock(pDevIns->Internal.s.pVMR3); 3355 } 3356 3357 3358 /** @copydoc PDMDEVHLPR3::pfnUnlockVM */ 3340 3359 static DECLCALLBACK(int) pdmR3DevHlp_UnlockVM(PPDMDEVINS pDevIns) 3341 3360 { 3342 return VMMR3Unlock(pDevIns->Internal.s.pVM HC);3343 } 3344 3345 3346 /** @copydoc PDMDEVHLP ::pfnAssertVMLock */3361 return VMMR3Unlock(pDevIns->Internal.s.pVMR3); 3362 } 3363 3364 3365 /** @copydoc PDMDEVHLPR3::pfnAssertVMLock */ 3347 3366 static DECLCALLBACK(bool) pdmR3DevHlp_AssertVMLock(PPDMDEVINS pDevIns, const char *pszFile, unsigned iLine, const char *pszFunction) 3348 3367 { 3349 PVM pVM = pDevIns->Internal.s.pVM HC;3368 PVM pVM = pDevIns->Internal.s.pVMR3; 3350 3369 if (VMMR3LockIsOwner(pVM)) 3351 3370 return true; … … 3362 3381 } 3363 3382 3364 /** @copydoc PDMDEVHLP ::pfnDMARegister */3383 /** @copydoc PDMDEVHLPR3::pfnDMARegister */ 3365 3384 static DECLCALLBACK(int) pdmR3DevHlp_DMARegister(PPDMDEVINS pDevIns, unsigned uChannel, PFNDMATRANSFERHANDLER pfnTransferHandler, void *pvUser) 3366 3385 { 3367 3386 PDMDEV_ASSERT_DEVINS(pDevIns); 3368 PVM pVM = pDevIns->Internal.s.pVM HC;3387 PVM pVM = pDevIns->Internal.s.pVMR3; 3369 3388 VM_ASSERT_EMT(pVM); 3370 3389 LogFlow(("pdmR3DevHlp_DMARegister: caller='%s'/%d: uChannel=%d pfnTransferHandler=%p pvUser=%p\n", … … 3383 3402 } 3384 3403 3385 /** @copydoc PDMDEVHLP ::pfnDMAReadMemory */3404 /** @copydoc PDMDEVHLPR3::pfnDMAReadMemory */ 3386 3405 static DECLCALLBACK(int) pdmR3DevHlp_DMAReadMemory(PPDMDEVINS pDevIns, unsigned uChannel, void *pvBuffer, uint32_t off, uint32_t cbBlock, uint32_t *pcbRead) 3387 3406 { 3388 3407 PDMDEV_ASSERT_DEVINS(pDevIns); 3389 PVM pVM = pDevIns->Internal.s.pVM HC;3408 PVM pVM = pDevIns->Internal.s.pVMR3; 3390 3409 VM_ASSERT_EMT(pVM); 3391 3410 LogFlow(("pdmR3DevHlp_DMAReadMemory: caller='%s'/%d: uChannel=%d pvBuffer=%p off=%#x cbBlock=%#x pcbRead=%p\n", … … 3408 3427 } 3409 3428 3410 /** @copydoc PDMDEVHLP ::pfnDMAWriteMemory */3429 /** @copydoc PDMDEVHLPR3::pfnDMAWriteMemory */ 3411 3430 static DECLCALLBACK(int) pdmR3DevHlp_DMAWriteMemory(PPDMDEVINS pDevIns, unsigned uChannel, const void *pvBuffer, uint32_t off, uint32_t cbBlock, uint32_t *pcbWritten) 3412 3431 { 3413 3432 PDMDEV_ASSERT_DEVINS(pDevIns); 3414 PVM pVM = pDevIns->Internal.s.pVM HC;3433 PVM pVM = pDevIns->Internal.s.pVMR3; 3415 3434 VM_ASSERT_EMT(pVM); 3416 3435 LogFlow(("pdmR3DevHlp_DMAWriteMemory: caller='%s'/%d: uChannel=%d pvBuffer=%p off=%#x cbBlock=%#x pcbWritten=%p\n", … … 3433 3452 } 3434 3453 3435 /** @copydoc PDMDEVHLP ::pfnDMASetDREQ */3454 /** @copydoc PDMDEVHLPR3::pfnDMASetDREQ */ 3436 3455 static DECLCALLBACK(int) pdmR3DevHlp_DMASetDREQ(PPDMDEVINS pDevIns, unsigned uChannel, unsigned uLevel) 3437 3456 { 3438 3457 PDMDEV_ASSERT_DEVINS(pDevIns); 3439 PVM pVM = pDevIns->Internal.s.pVM HC;3458 PVM pVM = pDevIns->Internal.s.pVMR3; 3440 3459 VM_ASSERT_EMT(pVM); 3441 3460 LogFlow(("pdmR3DevHlp_DMASetDREQ: caller='%s'/%d: uChannel=%d uLevel=%d\n", … … 3454 3473 } 3455 3474 3456 /** @copydoc PDMDEVHLP ::pfnDMAGetChannelMode */3475 /** @copydoc PDMDEVHLPR3::pfnDMAGetChannelMode */ 3457 3476 static DECLCALLBACK(uint8_t) pdmR3DevHlp_DMAGetChannelMode(PPDMDEVINS pDevIns, unsigned uChannel) 3458 3477 { 3459 3478 PDMDEV_ASSERT_DEVINS(pDevIns); 3460 PVM pVM = pDevIns->Internal.s.pVM HC;3479 PVM pVM = pDevIns->Internal.s.pVMR3; 3461 3480 VM_ASSERT_EMT(pVM); 3462 3481 LogFlow(("pdmR3DevHlp_DMAGetChannelMode: caller='%s'/%d: uChannel=%d\n", … … 3475 3494 } 3476 3495 3477 /** @copydoc PDMDEVHLP ::pfnDMASchedule */3496 /** @copydoc PDMDEVHLPR3::pfnDMASchedule */ 3478 3497 static DECLCALLBACK(void) pdmR3DevHlp_DMASchedule(PPDMDEVINS pDevIns) 3479 3498 { 3480 3499 PDMDEV_ASSERT_DEVINS(pDevIns); 3481 PVM pVM = pDevIns->Internal.s.pVM HC;3500 PVM pVM = pDevIns->Internal.s.pVMR3; 3482 3501 VM_ASSERT_EMT(pVM); 3483 3502 LogFlow(("pdmR3DevHlp_DMASchedule: caller='%s'/%d: VM_FF_PDM_DMA %d -> 1\n", … … 3491 3510 3492 3511 3493 /** @copydoc PDMDEVHLP ::pfnCMOSWrite */3512 /** @copydoc PDMDEVHLPR3::pfnCMOSWrite */ 3494 3513 static DECLCALLBACK(int) pdmR3DevHlp_CMOSWrite(PPDMDEVINS pDevIns, unsigned iReg, uint8_t u8Value) 3495 3514 { 3496 3515 PDMDEV_ASSERT_DEVINS(pDevIns); 3497 PVM pVM = pDevIns->Internal.s.pVM HC;3516 PVM pVM = pDevIns->Internal.s.pVMR3; 3498 3517 VM_ASSERT_EMT(pVM); 3499 3518 … … 3512 3531 3513 3532 3514 /** @copydoc PDMDEVHLP ::pfnCMOSRead */3533 /** @copydoc PDMDEVHLPR3::pfnCMOSRead */ 3515 3534 static DECLCALLBACK(int) pdmR3DevHlp_CMOSRead(PPDMDEVINS pDevIns, unsigned iReg, uint8_t *pu8Value) 3516 3535 { 3517 3536 PDMDEV_ASSERT_DEVINS(pDevIns); 3518 PVM pVM = pDevIns->Internal.s.pVM HC;3537 PVM pVM = pDevIns->Internal.s.pVMR3; 3519 3538 VM_ASSERT_EMT(pVM); 3520 3539 … … 3533 3552 3534 3553 3535 /** @copydoc PDMDEVHLP ::pfnGetCpuId */3554 /** @copydoc PDMDEVHLPR3::pfnGetCpuId */ 3536 3555 static DECLCALLBACK(void) pdmR3DevHlp_GetCpuId(PPDMDEVINS pDevIns, uint32_t iLeaf, 3537 3556 uint32_t *pEax, uint32_t *pEbx, uint32_t *pEcx, uint32_t *pEdx) … … 3542 3561 AssertPtr(pEax); AssertPtr(pEbx); AssertPtr(pEcx); AssertPtr(pEdx); 3543 3562 3544 CPUMGetGuestCpuId(pDevIns->Internal.s.pVM HC, iLeaf, pEax, pEbx, pEcx, pEdx);3563 CPUMGetGuestCpuId(pDevIns->Internal.s.pVMR3, iLeaf, pEax, pEbx, pEcx, pEdx); 3545 3564 3546 3565 LogFlow(("pdmR3DevHlp_GetCpuId: caller='%s'/%d: returns void - *pEax=%#x *pEbx=%#x *pEcx=%#x *pEdx=%#x\n", … … 3549 3568 3550 3569 3551 /** @copydoc PDMDEVHLP ::pfnROMProtectShadow */3570 /** @copydoc PDMDEVHLPR3::pfnROMProtectShadow */ 3552 3571 static DECLCALLBACK(int) pdmR3DevHlp_ROMProtectShadow(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange) 3553 3572 { … … 3556 3575 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, GCPhysStart, cbRange)); 3557 3576 3558 int rc = MMR3PhysRomProtect(pDevIns->Internal.s.pVM HC, GCPhysStart, cbRange);3577 int rc = MMR3PhysRomProtect(pDevIns->Internal.s.pVMR3, GCPhysStart, cbRange); 3559 3578 3560 3579 LogFlow(("pdmR3DevHlp_ROMProtectShadow: caller='%s'/%d: returns %Vrc\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc)); … … 3564 3583 3565 3584 /** 3566 * @copydoc PDMDEVHLP ::pfnMMIO2Register3585 * @copydoc PDMDEVHLPR3::pfnMMIO2Register 3567 3586 */ 3568 3587 static DECLCALLBACK(int) pdmR3DevHlp_MMIO2Register(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS cb, uint32_t fFlags, void **ppv, const char *pszDesc) 3569 3588 { 3570 3589 PDMDEV_ASSERT_DEVINS(pDevIns); 3571 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);3590 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 3572 3591 LogFlow(("pdmR3DevHlp_MMIO2Register: caller='%s'/%d: iRegion=#x cb=%#RGp fFlags=%RX32 ppv=%p pszDescp=%p:{%s}\n", 3573 3592 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, iRegion, cb, fFlags, ppv, pszDesc, pszDesc)); 3574 3593 3575 int rc = PGMR3PhysMMIO2Register(pDevIns->Internal.s.pVM HC, pDevIns, iRegion, cb, fFlags, ppv, pszDesc);3594 int rc = PGMR3PhysMMIO2Register(pDevIns->Internal.s.pVMR3, pDevIns, iRegion, cb, fFlags, ppv, pszDesc); 3576 3595 3577 3596 LogFlow(("pdmR3DevHlp_MMIO2Register: caller='%s'/%d: returns %Rrc\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc)); … … 3581 3600 3582 3601 /** 3583 * @copydoc PDMDEVHLP ::pfnMMIO2Deregister3602 * @copydoc PDMDEVHLPR3::pfnMMIO2Deregister 3584 3603 */ 3585 3604 static DECLCALLBACK(int) pdmR3DevHlp_MMIO2Deregister(PPDMDEVINS pDevIns, uint32_t iRegion) 3586 3605 { 3587 3606 PDMDEV_ASSERT_DEVINS(pDevIns); 3588 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);3607 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 3589 3608 LogFlow(("pdmR3DevHlp_MMIO2Deregister: caller='%s'/%d: iRegion=#x\n", 3590 3609 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, iRegion)); … … 3592 3611 AssertReturn(iRegion == UINT32_MAX, VERR_INVALID_PARAMETER); 3593 3612 3594 int rc = PGMR3PhysMMIO2Deregister(pDevIns->Internal.s.pVM HC, pDevIns, iRegion);3613 int rc = PGMR3PhysMMIO2Deregister(pDevIns->Internal.s.pVMR3, pDevIns, iRegion); 3595 3614 3596 3615 LogFlow(("pdmR3DevHlp_MMIO2Deregister: caller='%s'/%d: returns %Rrc\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc)); … … 3600 3619 3601 3620 /** 3602 * @copydoc PDMDEVHLP ::pfnMMIO2Map3621 * @copydoc PDMDEVHLPR3::pfnMMIO2Map 3603 3622 */ 3604 3623 static DECLCALLBACK(int) pdmR3DevHlp_MMIO2Map(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS GCPhys) 3605 3624 { 3606 3625 PDMDEV_ASSERT_DEVINS(pDevIns); 3607 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);3626 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 3608 3627 LogFlow(("pdmR3DevHlp_MMIO2Map: caller='%s'/%d: iRegion=#x GCPhys=%#RGp\n", 3609 3628 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, iRegion, GCPhys)); 3610 3629 3611 int rc = PGMR3PhysMMIO2Map(pDevIns->Internal.s.pVM HC, pDevIns, iRegion, GCPhys);3630 int rc = PGMR3PhysMMIO2Map(pDevIns->Internal.s.pVMR3, pDevIns, iRegion, GCPhys); 3612 3631 3613 3632 LogFlow(("pdmR3DevHlp_MMIO2Map: caller='%s'/%d: returns %Rrc\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc)); … … 3617 3636 3618 3637 /** 3619 * @copydoc PDMDEVHLP ::pfnMMIO2Unmap3638 * @copydoc PDMDEVHLPR3::pfnMMIO2Unmap 3620 3639 */ 3621 3640 static DECLCALLBACK(int) pdmR3DevHlp_MMIO2Unmap(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS GCPhys) 3622 3641 { 3623 3642 PDMDEV_ASSERT_DEVINS(pDevIns); 3624 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);3643 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 3625 3644 LogFlow(("pdmR3DevHlp_MMIO2Unmap: caller='%s'/%d: iRegion=#x GCPhys=%#RGp\n", 3626 3645 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, iRegion, GCPhys)); 3627 3646 3628 int rc = PGMR3PhysMMIO2Unmap(pDevIns->Internal.s.pVM HC, pDevIns, iRegion, GCPhys);3647 int rc = PGMR3PhysMMIO2Unmap(pDevIns->Internal.s.pVMR3, pDevIns, iRegion, GCPhys); 3629 3648 3630 3649 LogFlow(("pdmR3DevHlp_MMIO2Unmap: caller='%s'/%d: returns %Rrc\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc)); … … 3634 3653 3635 3654 /** 3636 * @copydoc PDMDEVHLP ::pfnMMHyperMapMMIO23655 * @copydoc PDMDEVHLPR3::pfnMMHyperMapMMIO2 3637 3656 */ 3638 3657 static DECLCALLBACK(int) pdmR3DevHlp_MMHyperMapMMIO2(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS off, RTGCPHYS cb, … … 3640 3659 { 3641 3660 PDMDEV_ASSERT_DEVINS(pDevIns); 3642 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);3661 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 3643 3662 LogFlow(("pdmR3DevHlp_MMHyperMapMMIO2: caller='%s'/%d: iRegion=#x off=%RGp cb=%RGp pszDesc=%p:{%s} pRCPtr=%p\n", 3644 3663 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, iRegion, off, cb, pszDesc, pszDesc, pRCPtr)); 3645 3664 3646 int rc = MMR3HyperMapMMIO2(pDevIns->Internal.s.pVM HC, pDevIns, iRegion, off, cb, pszDesc, pRCPtr);3665 int rc = MMR3HyperMapMMIO2(pDevIns->Internal.s.pVMR3, pDevIns, iRegion, off, cb, pszDesc, pRCPtr); 3647 3666 3648 3667 LogFlow(("pdmR3DevHlp_MMHyperMapMMIO2: caller='%s'/%d: returns %Rrc *pRCPtr=%RRv\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc, *pRCPtr)); … … 3652 3671 3653 3672 /** 3654 * @copydoc PDMDEVHLP ::pfnRegisterVMMDevHeap3673 * @copydoc PDMDEVHLPR3::pfnRegisterVMMDevHeap 3655 3674 */ 3656 3675 static DECLCALLBACK(int) pdmR3DevHlp_RegisterVMMDevHeap(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTR3PTR pvHeap, unsigned cbSize) 3657 3676 { 3658 3677 PDMDEV_ASSERT_DEVINS(pDevIns); 3659 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);3660 3661 int rc = PDMR3RegisterVMMDevHeap(pDevIns->Internal.s.pVM HC, GCPhys, pvHeap, cbSize);3678 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 3679 3680 int rc = PDMR3RegisterVMMDevHeap(pDevIns->Internal.s.pVMR3, GCPhys, pvHeap, cbSize); 3662 3681 return rc; 3663 3682 } … … 3665 3684 3666 3685 /** 3667 * @copydoc PDMDEVHLP ::pfnUnregisterVMMDevHeap3686 * @copydoc PDMDEVHLPR3::pfnUnregisterVMMDevHeap 3668 3687 */ 3669 3688 static DECLCALLBACK(int) pdmR3DevHlp_UnregisterVMMDevHeap(PPDMDEVINS pDevIns, RTGCPHYS GCPhys) 3670 3689 { 3671 3690 PDMDEV_ASSERT_DEVINS(pDevIns); 3672 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);3673 3674 int rc = PDMR3UnregisterVMMDevHeap(pDevIns->Internal.s.pVM HC, GCPhys);3675 return rc; 3676 } 3677 3678 3679 3680 3681 3682 /** @copydoc PDMDEVHLP ::pfnGetVM */3691 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 3692 3693 int rc = PDMR3UnregisterVMMDevHeap(pDevIns->Internal.s.pVMR3, GCPhys); 3694 return rc; 3695 } 3696 3697 3698 3699 3700 3701 /** @copydoc PDMDEVHLPR3::pfnGetVM */ 3683 3702 static DECLCALLBACK(PVM) pdmR3DevHlp_Untrusted_GetVM(PPDMDEVINS pDevIns) 3684 3703 { … … 3689 3708 3690 3709 3691 /** @copydoc PDMDEVHLP ::pfnPCIBusRegister */3710 /** @copydoc PDMDEVHLPR3::pfnPCIBusRegister */ 3692 3711 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_PCIBusRegister(PPDMDEVINS pDevIns, PPDMPCIBUSREG pPciBusReg, PCPDMPCIHLPR3 *ppPciHlpR3) 3693 3712 { … … 3700 3719 3701 3720 3702 /** @copydoc PDMDEVHLP ::pfnPICRegister */3721 /** @copydoc PDMDEVHLPR3::pfnPICRegister */ 3703 3722 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_PICRegister(PPDMDEVINS pDevIns, PPDMPICREG pPicReg, PCPDMPICHLPR3 *ppPicHlpR3) 3704 3723 { … … 3711 3730 3712 3731 3713 /** @copydoc PDMDEVHLP ::pfnAPICRegister */3732 /** @copydoc PDMDEVHLPR3::pfnAPICRegister */ 3714 3733 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_APICRegister(PPDMDEVINS pDevIns, PPDMAPICREG pApicReg, PCPDMAPICHLPR3 *ppApicHlpR3) 3715 3734 { … … 3722 3741 3723 3742 3724 /** @copydoc PDMDEVHLP ::pfnIOAPICRegister */3743 /** @copydoc PDMDEVHLPR3::pfnIOAPICRegister */ 3725 3744 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_IOAPICRegister(PPDMDEVINS pDevIns, PPDMIOAPICREG pIoApicReg, PCPDMIOAPICHLPR3 *ppIoApicHlpR3) 3726 3745 { … … 3733 3752 3734 3753 3735 /** @copydoc PDMDEVHLP ::pfnDMACRegister */3754 /** @copydoc PDMDEVHLPR3::pfnDMACRegister */ 3736 3755 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_DMACRegister(PPDMDEVINS pDevIns, PPDMDMACREG pDmacReg, PCPDMDMACHLP *ppDmacHlp) 3737 3756 { … … 3744 3763 3745 3764 3746 /** @copydoc PDMDEVHLP ::pfnPhysRead */3765 /** @copydoc PDMDEVHLPR3::pfnPhysRead */ 3747 3766 static DECLCALLBACK(void) pdmR3DevHlp_Untrusted_PhysRead(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead) 3748 3767 { … … 3755 3774 3756 3775 3757 /** @copydoc PDMDEVHLP ::pfnPhysWrite */3776 /** @copydoc PDMDEVHLPR3::pfnPhysWrite */ 3758 3777 static DECLCALLBACK(void) pdmR3DevHlp_Untrusted_PhysWrite(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite) 3759 3778 { … … 3766 3785 3767 3786 3768 /** @copydoc PDMDEVHLP ::pfnPhysReadGCVirt */3787 /** @copydoc PDMDEVHLPR3::pfnPhysReadGCVirt */ 3769 3788 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_PhysReadGCVirt(PPDMDEVINS pDevIns, void *pvDst, RTGCPTR GCVirtSrc, size_t cb) 3770 3789 { … … 3778 3797 3779 3798 3780 /** @copydoc PDMDEVHLP ::pfnPhysWriteGCVirt */3799 /** @copydoc PDMDEVHLPR3::pfnPhysWriteGCVirt */ 3781 3800 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_PhysWriteGCVirt(PPDMDEVINS pDevIns, RTGCPTR GCVirtDst, const void *pvSrc, size_t cb) 3782 3801 { … … 3790 3809 3791 3810 3792 /** @copydoc PDMDEVHLP ::pfnPhysReserve */3811 /** @copydoc PDMDEVHLPR3::pfnPhysReserve */ 3793 3812 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_PhysReserve(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTUINT cbRange, const char *pszDesc) 3794 3813 { … … 3801 3820 3802 3821 3803 /** @copydoc PDMDEVHLP ::pfnObsoletePhys2HCVirt */3822 /** @copydoc PDMDEVHLPR3::pfnObsoletePhys2HCVirt */ 3804 3823 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_Obsolete_Phys2HCVirt(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTUINT cbRange, PRTHCPTR ppvHC) 3805 3824 { … … 3813 3832 3814 3833 3815 /** @copydoc PDMDEVHLP ::pfnObsoletePhysGCPtr2HCPtr */3834 /** @copydoc PDMDEVHLPR3::pfnObsoletePhysGCPtr2HCPtr */ 3816 3835 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_Obsolete_PhysGCPtr2HCPtr(PPDMDEVINS pDevIns, RTGCPTR GCPtr, PRTHCPTR pHCPtr) 3817 3836 { … … 3824 3843 3825 3844 3826 /** @copydoc PDMDEVHLP ::pfnA20IsEnabled */3845 /** @copydoc PDMDEVHLPR3::pfnA20IsEnabled */ 3827 3846 static DECLCALLBACK(bool) pdmR3DevHlp_Untrusted_A20IsEnabled(PPDMDEVINS pDevIns) 3828 3847 { … … 3833 3852 3834 3853 3835 /** @copydoc PDMDEVHLP ::pfnA20Set */3854 /** @copydoc PDMDEVHLPR3::pfnA20Set */ 3836 3855 static DECLCALLBACK(void) pdmR3DevHlp_Untrusted_A20Set(PPDMDEVINS pDevIns, bool fEnable) 3837 3856 { … … 3842 3861 3843 3862 3844 /** @copydoc PDMDEVHLP ::pfnVMReset */3863 /** @copydoc PDMDEVHLPR3::pfnVMReset */ 3845 3864 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_VMReset(PPDMDEVINS pDevIns) 3846 3865 { … … 3851 3870 3852 3871 3853 /** @copydoc PDMDEVHLP ::pfnVMSuspend */3872 /** @copydoc PDMDEVHLPR3::pfnVMSuspend */ 3854 3873 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_VMSuspend(PPDMDEVINS pDevIns) 3855 3874 { … … 3860 3879 3861 3880 3862 /** @copydoc PDMDEVHLP ::pfnVMPowerOff */3881 /** @copydoc PDMDEVHLPR3::pfnVMPowerOff */ 3863 3882 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_VMPowerOff(PPDMDEVINS pDevIns) 3864 3883 { … … 3869 3888 3870 3889 3871 /** @copydoc PDMDEVHLP ::pfnLockVM */3890 /** @copydoc PDMDEVHLPR3::pfnLockVM */ 3872 3891 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_LockVM(PPDMDEVINS pDevIns) 3873 3892 { … … 3878 3897 3879 3898 3880 /** @copydoc PDMDEVHLP ::pfnUnlockVM */3899 /** @copydoc PDMDEVHLPR3::pfnUnlockVM */ 3881 3900 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_UnlockVM(PPDMDEVINS pDevIns) 3882 3901 { … … 3887 3906 3888 3907 3889 /** @copydoc PDMDEVHLP ::pfnAssertVMLock */3908 /** @copydoc PDMDEVHLPR3::pfnAssertVMLock */ 3890 3909 static DECLCALLBACK(bool) pdmR3DevHlp_Untrusted_AssertVMLock(PPDMDEVINS pDevIns, const char *pszFile, unsigned iLine, const char *pszFunction) 3891 3910 { … … 3896 3915 3897 3916 3898 /** @copydoc PDMDEVHLP ::pfnDMARegister */3917 /** @copydoc PDMDEVHLPR3::pfnDMARegister */ 3899 3918 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_DMARegister(PPDMDEVINS pDevIns, unsigned uChannel, PFNDMATRANSFERHANDLER pfnTransferHandler, void *pvUser) 3900 3919 { … … 3905 3924 3906 3925 3907 /** @copydoc PDMDEVHLP ::pfnDMAReadMemory */3926 /** @copydoc PDMDEVHLPR3::pfnDMAReadMemory */ 3908 3927 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_DMAReadMemory(PPDMDEVINS pDevIns, unsigned uChannel, void *pvBuffer, uint32_t off, uint32_t cbBlock, uint32_t *pcbRead) 3909 3928 { … … 3916 3935 3917 3936 3918 /** @copydoc PDMDEVHLP ::pfnDMAWriteMemory */3937 /** @copydoc PDMDEVHLPR3::pfnDMAWriteMemory */ 3919 3938 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_DMAWriteMemory(PPDMDEVINS pDevIns, unsigned uChannel, const void *pvBuffer, uint32_t off, uint32_t cbBlock, uint32_t *pcbWritten) 3920 3939 { … … 3927 3946 3928 3947 3929 /** @copydoc PDMDEVHLP ::pfnDMASetDREQ */3948 /** @copydoc PDMDEVHLPR3::pfnDMASetDREQ */ 3930 3949 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_DMASetDREQ(PPDMDEVINS pDevIns, unsigned uChannel, unsigned uLevel) 3931 3950 { … … 3936 3955 3937 3956 3938 /** @copydoc PDMDEVHLP ::pfnDMAGetChannelMode */3957 /** @copydoc PDMDEVHLPR3::pfnDMAGetChannelMode */ 3939 3958 static DECLCALLBACK(uint8_t) pdmR3DevHlp_Untrusted_DMAGetChannelMode(PPDMDEVINS pDevIns, unsigned uChannel) 3940 3959 { … … 3945 3964 3946 3965 3947 /** @copydoc PDMDEVHLP ::pfnDMASchedule */3966 /** @copydoc PDMDEVHLPR3::pfnDMASchedule */ 3948 3967 static DECLCALLBACK(void) pdmR3DevHlp_Untrusted_DMASchedule(PPDMDEVINS pDevIns) 3949 3968 { … … 3953 3972 3954 3973 3955 /** @copydoc PDMDEVHLP ::pfnCMOSWrite */3974 /** @copydoc PDMDEVHLPR3::pfnCMOSWrite */ 3956 3975 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_CMOSWrite(PPDMDEVINS pDevIns, unsigned iReg, uint8_t u8Value) 3957 3976 { … … 3962 3981 3963 3982 3964 /** @copydoc PDMDEVHLP ::pfnCMOSRead */3983 /** @copydoc PDMDEVHLPR3::pfnCMOSRead */ 3965 3984 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_CMOSRead(PPDMDEVINS pDevIns, unsigned iReg, uint8_t *pu8Value) 3966 3985 { … … 3971 3990 3972 3991 3973 /** @copydoc PDMDEVHLP ::pfnGetCpuId */3992 /** @copydoc PDMDEVHLPR3::pfnGetCpuId */ 3974 3993 static DECLCALLBACK(void) pdmR3DevHlp_Untrusted_GetCpuId(PPDMDEVINS pDevIns, uint32_t iLeaf, 3975 3994 uint32_t *pEax, uint32_t *pEbx, uint32_t *pEcx, uint32_t *pEdx) … … 3980 3999 3981 4000 3982 /** @copydoc PDMDEVHLP ::pfnROMProtectShadow */4001 /** @copydoc PDMDEVHLPR3::pfnROMProtectShadow */ 3983 4002 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_ROMProtectShadow(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange) 3984 4003 { … … 3989 4008 3990 4009 3991 /** @copydoc PDMDEVHLP ::pfnMMIO2Register */4010 /** @copydoc PDMDEVHLPR3::pfnMMIO2Register */ 3992 4011 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_MMIO2Register(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS cb, uint32_t fFlags, void **ppv, const char *pszDesc) 3993 4012 { … … 3998 4017 3999 4018 4000 /** @copydoc PDMDEVHLP ::pfnMMIO2Deregister */4019 /** @copydoc PDMDEVHLPR3::pfnMMIO2Deregister */ 4001 4020 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_MMIO2Deregister(PPDMDEVINS pDevIns, uint32_t iRegion) 4002 4021 { … … 4007 4026 4008 4027 4009 /** @copydoc PDMDEVHLP ::pfnMMIO2Map */4028 /** @copydoc PDMDEVHLPR3::pfnMMIO2Map */ 4010 4029 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_MMIO2Map(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS GCPhys) 4011 4030 { … … 4016 4035 4017 4036 4018 /** @copydoc PDMDEVHLP ::pfnMMIO2Unmap */4037 /** @copydoc PDMDEVHLPR3::pfnMMIO2Unmap */ 4019 4038 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_MMIO2Unmap(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS GCPhys) 4020 4039 { … … 4025 4044 4026 4045 4027 /** @copydoc PDMDEVHLP ::pfnMMHyperMapMMIO2 */4046 /** @copydoc PDMDEVHLPR3::pfnMMHyperMapMMIO2 */ 4028 4047 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_MMHyperMapMMIO2(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS off, RTGCPHYS cb, const char *pszDesc, PRTRCPTR pRCPtr) 4029 4048 { … … 4034 4053 4035 4054 4036 /** @copydoc PDMDEVHLP ::pfnRegisterVMMDevHeap */4055 /** @copydoc PDMDEVHLPR3::pfnRegisterVMMDevHeap */ 4037 4056 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_RegisterVMMDevHeap(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTR3PTR pvHeap, unsigned cbSize) 4038 4057 { … … 4043 4062 4044 4063 4045 /** @copydoc PDMDEVHLP ::pfnUnregisterVMMDevHeap */4064 /** @copydoc PDMDEVHLPR3::pfnUnregisterVMMDevHeap */ 4046 4065 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_UnregisterVMMDevHeap(PPDMDEVINS pDevIns, RTGCPHYS GCPhys) 4047 4066 { … … 4059 4078 { 4060 4079 PDMDEV_ASSERT_DEVINS(pDevIns); 4061 PVM pVM = pDevIns->Internal.s.pVM HC;4080 PVM pVM = pDevIns->Internal.s.pVMR3; 4062 4081 LogFlow(("pdmR3PicHlp_SetInterruptFF: caller='%s'/%d: VM_FF_INTERRUPT_PIC %d -> 1\n", 4063 4082 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, VMCPU_FF_ISSET(pVM, 0, VM_FF_INTERRUPT_PIC))); … … 4074 4093 PDMDEV_ASSERT_DEVINS(pDevIns); 4075 4094 LogFlow(("pdmR3PicHlp_ClearInterruptFF: caller='%s'/%d: VM_FF_INTERRUPT_PIC %d -> 0\n", 4076 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, VMCPU_FF_ISSET(pDevIns->Internal.s.pVM HC, 0, VM_FF_INTERRUPT_PIC)));4095 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, VMCPU_FF_ISSET(pDevIns->Internal.s.pVMR3, 0, VM_FF_INTERRUPT_PIC))); 4077 4096 /* for PIC we always deliver to CPU 0, MP use APIC */ 4078 VMCPU_FF_CLEAR(pDevIns->Internal.s.pVM HC, 0, VM_FF_INTERRUPT_PIC);4079 REMR3NotifyInterruptClear(pDevIns->Internal.s.pVM HC);4097 VMCPU_FF_CLEAR(pDevIns->Internal.s.pVMR3, 0, VM_FF_INTERRUPT_PIC); 4098 REMR3NotifyInterruptClear(pDevIns->Internal.s.pVMR3); 4080 4099 } 4081 4100 … … 4085 4104 { 4086 4105 PDMDEV_ASSERT_DEVINS(pDevIns); 4087 return pdmLockEx(pDevIns->Internal.s.pVM HC, rc);4106 return pdmLockEx(pDevIns->Internal.s.pVMR3, rc); 4088 4107 } 4089 4108 … … 4093 4112 { 4094 4113 PDMDEV_ASSERT_DEVINS(pDevIns); 4095 pdmUnlock(pDevIns->Internal.s.pVM HC);4114 pdmUnlock(pDevIns->Internal.s.pVMR3); 4096 4115 } 4097 4116 … … 4101 4120 { 4102 4121 PDMDEV_ASSERT_DEVINS(pDevIns); 4103 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);4122 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 4104 4123 RTRCPTR pRCHelpers = 0; 4105 int rc = PDMR3GetSymbolGC(pDevIns->Internal.s.pVM HC, NULL, "g_pdmRCPicHlp", &pRCHelpers);4124 int rc = PDMR3GetSymbolGC(pDevIns->Internal.s.pVMR3, NULL, "g_pdmRCPicHlp", &pRCHelpers); 4106 4125 AssertReleaseRC(rc); 4107 4126 AssertRelease(pRCHelpers); … … 4116 4135 { 4117 4136 PDMDEV_ASSERT_DEVINS(pDevIns); 4118 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);4137 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 4119 4138 PCPDMPICHLPR0 pR0Helpers = 0; 4120 int rc = PDMR3GetSymbolR0(pDevIns->Internal.s.pVM HC, NULL, "g_pdmR0PicHlp", &pR0Helpers);4139 int rc = PDMR3GetSymbolR0(pDevIns->Internal.s.pVMR3, NULL, "g_pdmR0PicHlp", &pR0Helpers); 4121 4140 AssertReleaseRC(rc); 4122 4141 AssertRelease(pR0Helpers); … … 4131 4150 { 4132 4151 PDMDEV_ASSERT_DEVINS(pDevIns); 4133 PVM pVM = pDevIns->Internal.s.pVM HC;4152 PVM pVM = pDevIns->Internal.s.pVMR3; 4134 4153 LogFlow(("pdmR3ApicHlp_SetInterruptFF: caller='%s'/%d: VM_FF_INTERRUPT %d -> 1\n", 4135 4154 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, VMCPU_FF_ISSET(pVM, idCpu, VM_FF_INTERRUPT_APIC))); … … 4145 4164 PDMDEV_ASSERT_DEVINS(pDevIns); 4146 4165 LogFlow(("pdmR3ApicHlp_ClearInterruptFF: caller='%s'/%d: VM_FF_INTERRUPT %d -> 0\n", 4147 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, VMCPU_FF_ISSET(pDevIns->Internal.s.pVM HC, idCpu, VM_FF_INTERRUPT_APIC)));4148 VMCPU_FF_CLEAR(pDevIns->Internal.s.pVM HC, idCpu, VM_FF_INTERRUPT_APIC);4149 REMR3NotifyInterruptClear(pDevIns->Internal.s.pVM HC);4166 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, VMCPU_FF_ISSET(pDevIns->Internal.s.pVMR3, idCpu, VM_FF_INTERRUPT_APIC))); 4167 VMCPU_FF_CLEAR(pDevIns->Internal.s.pVMR3, idCpu, VM_FF_INTERRUPT_APIC); 4168 REMR3NotifyInterruptClear(pDevIns->Internal.s.pVMR3); 4150 4169 } 4151 4170 … … 4158 4177 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, fEnabled)); 4159 4178 if (fEnabled) 4160 CPUMSetGuestCpuIdFeature(pDevIns->Internal.s.pVM HC, CPUMCPUIDFEATURE_APIC);4179 CPUMSetGuestCpuIdFeature(pDevIns->Internal.s.pVMR3, CPUMCPUIDFEATURE_APIC); 4161 4180 else 4162 CPUMClearGuestCpuIdFeature(pDevIns->Internal.s.pVM HC, CPUMCPUIDFEATURE_APIC);4181 CPUMClearGuestCpuIdFeature(pDevIns->Internal.s.pVMR3, CPUMCPUIDFEATURE_APIC); 4163 4182 } 4164 4183 … … 4167 4186 { 4168 4187 PDMDEV_ASSERT_DEVINS(pDevIns); 4169 return pdmLockEx(pDevIns->Internal.s.pVM HC, rc);4188 return pdmLockEx(pDevIns->Internal.s.pVMR3, rc); 4170 4189 } 4171 4190 … … 4175 4194 { 4176 4195 PDMDEV_ASSERT_DEVINS(pDevIns); 4177 pdmUnlock(pDevIns->Internal.s.pVM HC);4196 pdmUnlock(pDevIns->Internal.s.pVMR3); 4178 4197 } 4179 4198 … … 4183 4202 { 4184 4203 PDMDEV_ASSERT_DEVINS(pDevIns); 4185 return VMMGetCpuId(pDevIns->Internal.s.pVM HC);4204 return VMMGetCpuId(pDevIns->Internal.s.pVMR3); 4186 4205 } 4187 4206 … … 4191 4210 { 4192 4211 PDMDEV_ASSERT_DEVINS(pDevIns); 4193 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);4212 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 4194 4213 RTRCPTR pRCHelpers = 0; 4195 int rc = PDMR3GetSymbolGC(pDevIns->Internal.s.pVM HC, NULL, "g_pdmRCApicHlp", &pRCHelpers);4214 int rc = PDMR3GetSymbolGC(pDevIns->Internal.s.pVMR3, NULL, "g_pdmRCApicHlp", &pRCHelpers); 4196 4215 AssertReleaseRC(rc); 4197 4216 AssertRelease(pRCHelpers); … … 4206 4225 { 4207 4226 PDMDEV_ASSERT_DEVINS(pDevIns); 4208 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);4227 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 4209 4228 PCPDMAPICHLPR0 pR0Helpers = 0; 4210 int rc = PDMR3GetSymbolR0(pDevIns->Internal.s.pVM HC, NULL, "g_pdmR0ApicHlp", &pR0Helpers);4229 int rc = PDMR3GetSymbolR0(pDevIns->Internal.s.pVMR3, NULL, "g_pdmR0ApicHlp", &pR0Helpers); 4211 4230 AssertReleaseRC(rc); 4212 4231 AssertRelease(pR0Helpers); … … 4222 4241 { 4223 4242 PDMDEV_ASSERT_DEVINS(pDevIns); 4224 PVM pVM = pDevIns->Internal.s.pVM HC;4243 PVM pVM = pDevIns->Internal.s.pVMR3; 4225 4244 LogFlow(("pdmR3IoApicHlp_ApicBusDeliver: caller='%s'/%d: u8Dest=%RX8 u8DestMode=%RX8 u8DeliveryMode=%RX8 iVector=%RX8 u8Polarity=%RX8 u8TriggerMode=%RX8\n", 4226 4245 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, u8Dest, u8DestMode, u8DeliveryMode, iVector, u8Polarity, u8TriggerMode)); … … 4234 4253 { 4235 4254 PDMDEV_ASSERT_DEVINS(pDevIns); 4236 return pdmLockEx(pDevIns->Internal.s.pVM HC, rc);4255 return pdmLockEx(pDevIns->Internal.s.pVMR3, rc); 4237 4256 } 4238 4257 … … 4242 4261 { 4243 4262 PDMDEV_ASSERT_DEVINS(pDevIns); 4244 pdmUnlock(pDevIns->Internal.s.pVM HC);4263 pdmUnlock(pDevIns->Internal.s.pVMR3); 4245 4264 } 4246 4265 … … 4250 4269 { 4251 4270 PDMDEV_ASSERT_DEVINS(pDevIns); 4252 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);4271 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 4253 4272 RTRCPTR pRCHelpers = 0; 4254 int rc = PDMR3GetSymbolGC(pDevIns->Internal.s.pVM HC, NULL, "g_pdmRCIoApicHlp", &pRCHelpers);4273 int rc = PDMR3GetSymbolGC(pDevIns->Internal.s.pVMR3, NULL, "g_pdmRCIoApicHlp", &pRCHelpers); 4255 4274 AssertReleaseRC(rc); 4256 4275 AssertRelease(pRCHelpers); … … 4265 4284 { 4266 4285 PDMDEV_ASSERT_DEVINS(pDevIns); 4267 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);4286 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 4268 4287 PCPDMIOAPICHLPR0 pR0Helpers = 0; 4269 int rc = PDMR3GetSymbolR0(pDevIns->Internal.s.pVM HC, NULL, "g_pdmR0IoApicHlp", &pR0Helpers);4288 int rc = PDMR3GetSymbolR0(pDevIns->Internal.s.pVMR3, NULL, "g_pdmR0IoApicHlp", &pR0Helpers); 4270 4289 AssertReleaseRC(rc); 4271 4290 AssertRelease(pR0Helpers); … … 4281 4300 PDMDEV_ASSERT_DEVINS(pDevIns); 4282 4301 Log4(("pdmR3PciHlp_IsaSetIrq: iIrq=%d iLevel=%d\n", iIrq, iLevel)); 4283 PDMIsaSetIrq(pDevIns->Internal.s.pVM HC, iIrq, iLevel);4302 PDMIsaSetIrq(pDevIns->Internal.s.pVMR3, iIrq, iLevel); 4284 4303 } 4285 4304 … … 4290 4309 PDMDEV_ASSERT_DEVINS(pDevIns); 4291 4310 Log4(("pdmR3PciHlp_IsaSetIrq: iIrq=%d iLevel=%d\n", iIrq, iLevel)); 4292 PDMIoApicSetIrq(pDevIns->Internal.s.pVM HC, iIrq, iLevel);4311 PDMIoApicSetIrq(pDevIns->Internal.s.pVMR3, iIrq, iLevel); 4293 4312 } 4294 4313 … … 4298 4317 { 4299 4318 PDMDEV_ASSERT_DEVINS(pDevIns); 4300 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);4301 bool fRc = PGMR3PhysMMIO2IsBase(pDevIns->Internal.s.pVM HC, pOwner, GCPhys);4319 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 4320 bool fRc = PGMR3PhysMMIO2IsBase(pDevIns->Internal.s.pVMR3, pOwner, GCPhys); 4302 4321 Log4(("pdmR3PciHlp_IsMMIO2Base: pOwner=%p GCPhys=%RGp -> %RTbool\n", pOwner, GCPhys, fRc)); 4303 4322 return fRc; … … 4309 4328 { 4310 4329 PDMDEV_ASSERT_DEVINS(pDevIns); 4311 return pdmLockEx(pDevIns->Internal.s.pVM HC, rc);4330 return pdmLockEx(pDevIns->Internal.s.pVMR3, rc); 4312 4331 } 4313 4332 … … 4317 4336 { 4318 4337 PDMDEV_ASSERT_DEVINS(pDevIns); 4319 pdmUnlock(pDevIns->Internal.s.pVM HC);4338 pdmUnlock(pDevIns->Internal.s.pVMR3); 4320 4339 } 4321 4340 … … 4325 4344 { 4326 4345 PDMDEV_ASSERT_DEVINS(pDevIns); 4327 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);4346 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 4328 4347 RTRCPTR pRCHelpers = 0; 4329 int rc = PDMR3GetSymbolGC(pDevIns->Internal.s.pVM HC, NULL, "g_pdmRCPciHlp", &pRCHelpers);4348 int rc = PDMR3GetSymbolGC(pDevIns->Internal.s.pVMR3, NULL, "g_pdmRCPciHlp", &pRCHelpers); 4330 4349 AssertReleaseRC(rc); 4331 4350 AssertRelease(pRCHelpers); … … 4340 4359 { 4341 4360 PDMDEV_ASSERT_DEVINS(pDevIns); 4342 VM_ASSERT_EMT(pDevIns->Internal.s.pVM HC);4361 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 4343 4362 PCPDMPCIHLPR0 pR0Helpers = 0; 4344 int rc = PDMR3GetSymbolR0(pDevIns->Internal.s.pVM HC, NULL, "g_pdmR0PciHlp", &pR0Helpers);4363 int rc = PDMR3GetSymbolR0(pDevIns->Internal.s.pVMR3, NULL, "g_pdmR0PciHlp", &pR0Helpers); 4345 4364 AssertReleaseRC(rc); 4346 4365 AssertRelease(pR0Helpers); … … 4376 4395 * Iterate device instances. 4377 4396 */ 4378 for (PPDMDEVINS pDevIns = pDev->pInstances; pDevIns; pDevIns = pDevIns->Internal.s.pPerDeviceNext HC)4397 for (PPDMDEVINS pDevIns = pDev->pInstances; pDevIns; pDevIns = pDevIns->Internal.s.pPerDeviceNextR3) 4379 4398 { 4380 4399 if (pDevIns->iInstance == iInstance) … … 4383 4402 * Iterate luns. 4384 4403 */ 4385 for (PPDMLUN pLun = pDevIns->Internal.s.pLuns HC; pLun; pLun = pLun->pNext)4404 for (PPDMLUN pLun = pDevIns->Internal.s.pLunsR3; pLun; pLun = pLun->pNext) 4386 4405 { 4387 4406 if (pLun->iLun == iLun)
Note:
See TracChangeset
for help on using the changeset viewer.