Changeset 93652 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Feb 8, 2022 11:26:14 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/PDMDriver.cpp
r93628 r93652 704 704 size_t cb = RT_UOFFSETOF_DYN(PDMDRVINS, achInstanceData[pDrv->pReg->cbInstance]); 705 705 cb = RT_ALIGN_Z(cb, 16); 706 PPDMDRVINS pNew; 707 #undef PDM_WITH_RING0_DRIVERS 708 #ifdef PDM_WITH_RING0_DRIVERS 706 709 bool const fHyperHeap = !!(pDrv->pReg->fFlags & (PDM_DRVREG_FLAGS_R0 | PDM_DRVREG_FLAGS_RC)); 707 PPDMDRVINS pNew;708 710 if (fHyperHeap) 709 711 rc = MMHyperAlloc(pVM, cb, 64, MM_TAG_PDM_DRIVER, (void **)&pNew); 710 712 else 713 #endif 711 714 rc = MMR3HeapAllocZEx(pVM, MM_TAG_PDM_DRIVER, cb, (void **)&pNew); 712 715 if (RT_SUCCESS(rc)) … … 722 725 pNew->Internal.s.pDrv = pDrv; 723 726 pNew->Internal.s.pVMR3 = pVM; 727 #ifdef PDM_WITH_RING0_DRIVERS 724 728 pNew->Internal.s.pVMR0 = pDrv->pReg->fFlags & PDM_DRVREG_FLAGS_R0 ? pVM->pVMR0ForCall : NIL_RTR0PTR; 725 729 pNew->Internal.s.pVMRC = pDrv->pReg->fFlags & PDM_DRVREG_FLAGS_RC ? pVM->pVMRC : NIL_RTRCPTR; 730 #endif 726 731 //pNew->Internal.s.fDetaching = false; 727 732 pNew->Internal.s.fVMSuspended = true; /** @todo should be 'false', if driver is attached at runtime. */ 728 733 //pNew->Internal.s.fVMReset = false; 734 #ifdef PDM_WITH_RING0_DRIVERS 729 735 pNew->Internal.s.fHyperHeap = fHyperHeap; 736 #endif 730 737 //pNew->Internal.s.pfnAsyncNotify = NULL; 731 738 pNew->Internal.s.pCfgHandle = pNode; … … 740 747 pNew->pHlpR3 = &g_pdmR3DrvHlp; 741 748 pNew->pvInstanceDataR3 = &pNew->achInstanceData[0]; 749 #ifdef PDM_WITH_RING0_DRIVERS 742 750 if (pDrv->pReg->fFlags & PDM_DRVREG_FLAGS_R0) 743 751 { … … 746 754 AssertReleaseRCReturn(rc, rc); 747 755 } 748 # ifdef VBOX_WITH_RAW_MODE_KEEP756 # ifdef VBOX_WITH_RAW_MODE_KEEP 749 757 if ( (pDrv->pReg->fFlags & PDM_DRVREG_FLAGS_RC) 750 758 && VM_IS_RAW_MODE_ENABLED(pVM)) … … 754 762 AssertReleaseRCReturn(rc, rc); 755 763 } 764 # endif 756 765 #endif 757 766 … … 996 1005 997 1006 /* Finally, the driver it self. */ 998 bool fHyperHeap = pCur->Internal.s.fHyperHeap; 1007 #ifdef PDM_WITH_RING0_DRIVERS 1008 bool const fHyperHeap = pCur->Internal.s.fHyperHeap; 1009 #endif 999 1010 ASMMemFill32(pCur, RT_UOFFSETOF_DYN(PDMDRVINS, achInstanceData[pCur->pReg->cbInstance]), 0xdeadd0d0); 1011 #ifdef PDM_WITH_RING0_DRIVERS 1000 1012 if (fHyperHeap) 1001 1013 MMHyperFree(pVM, pCur); 1002 1014 else 1015 #endif 1003 1016 MMR3HeapFree(pCur); 1004 1017 … … 1339 1352 AssertReturn(!(fFlags & TMTIMER_FLAGS_NO_RING0), VERR_INVALID_FLAGS); 1340 1353 Assert(pDrvIns->Internal.s.pDrv->pReg->fFlags & PDM_DRVREG_FLAGS_R0); 1341 /* if (!(pDrvIns->Internal.s.fIntFlags & PDMDRVINSINT_FLAGS_R0_ENABLED)) */ /** @todo PDMDRVINSINT_FLAGS_R0_ENABLED? */ 1354 #ifdef PDM_WITH_RING0_DRIVERS 1355 if (!(pDrvIns->Internal.s.fIntFlags & PDMDRVINSINT_FLAGS_R0_ENABLED)) /** @todo PDMDRVINSINT_FLAGS_R0_ENABLED? */ 1356 #endif 1342 1357 fFlags = (fFlags & ~TMTIMER_FLAGS_RING0) | TMTIMER_FLAGS_NO_RING0; 1343 1358 } … … 1743 1758 { 1744 1759 if (pDrvIns->pReg->fFlags & PDM_DRVREG_FLAGS_RC) 1760 #ifdef PDM_WITH_RING0_DRIVERS 1745 1761 rc = PDMR3LdrGetInterfaceSymbols(pDrvIns->Internal.s.pVMR3, 1746 1762 pvInterface, cbInterface, … … 1748 1764 pszSymPrefix, pszSymList, 1749 1765 false /*fRing0OrRC*/); 1766 #else 1767 { 1768 AssertLogRelMsgFailed(("ring-0 drivers are not supported in this VBox version!\n")); 1769 rc = VERR_NOT_SUPPORTED; 1770 } 1771 #endif 1750 1772 else 1751 1773 { … … 1781 1803 { 1782 1804 if (pDrvIns->pReg->fFlags & PDM_DRVREG_FLAGS_R0) 1805 #ifdef PDM_WITH_RING0_DRIVERS 1783 1806 rc = PDMR3LdrGetInterfaceSymbols(pDrvIns->Internal.s.pVMR3, 1784 1807 pvInterface, cbInterface, … … 1786 1809 pszSymPrefix, pszSymList, 1787 1810 true /*fRing0OrRC*/); 1811 #else 1812 { 1813 AssertLogRelMsgFailed(("ring-0 drivers are not supported in this VBox version!\n")); 1814 rc = VERR_NOT_SUPPORTED; 1815 } 1816 #endif 1788 1817 else 1789 1818 {
Note:
See TracChangeset
for help on using the changeset viewer.