Changeset 64019 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Sep 26, 2016 4:32:53 PM (8 years ago)
- Location:
- trunk/src/VBox/Devices/Storage
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DrvDiskIntegrity.cpp
r64002 r64019 951 951 } 952 952 953 /** @interface_method_impl{PDMIMEDIA,pfnIoBufAlloc} */954 static DECLCALLBACK(int) drvdiskintIoBufAlloc(PPDMIMEDIA pInterface, size_t cb, void **ppvNew)955 {956 LogFlowFunc(("\n"));957 PDRVDISKINTEGRITY pThis = PDMIMEDIA_2_DRVDISKINTEGRITY(pInterface);958 959 return pThis->pDrvMedia->pfnIoBufAlloc(pThis->pDrvMedia, cb, ppvNew);960 }961 962 /** @interface_method_impl{PDMIMEDIA,pfnIoBufFree} */963 static DECLCALLBACK(int) drvdiskintIoBufFree(PPDMIMEDIA pInterface, void *pv, size_t cb)964 {965 LogFlowFunc(("\n"));966 PDRVDISKINTEGRITY pThis = PDMIMEDIA_2_DRVDISKINTEGRITY(pInterface);967 968 return pThis->pDrvMedia->pfnIoBufFree(pThis->pDrvMedia, pv, cb);969 }970 971 953 /** @interface_method_impl{PDMIMEDIA,pfnReadPcBios} */ 972 954 static DECLCALLBACK(int) drvdiskintReadPcBios(PPDMIMEDIA pInterface, … … 1661 1643 pThis->IMedia.pfnGetSectorSize = drvdiskintGetSectorSize; 1662 1644 pThis->IMedia.pfnGetType = drvdiskintGetType; 1663 pThis->IMedia.pfnIoBufAlloc = drvdiskintIoBufAlloc;1664 pThis->IMedia.pfnIoBufFree = drvdiskintIoBufFree;1665 1645 pThis->IMedia.pfnReadPcBios = drvdiskintReadPcBios; 1666 1646 -
trunk/src/VBox/Devices/Storage/DrvHostBase.cpp
r63482 r64019 324 324 325 325 LogFlow(("%s-%d: drvHostBaseGetUuid: returns VINF_SUCCESS *pUuid=%RTuuid\n", pThis->pDrvIns->pReg->szName, pThis->pDrvIns->iInstance, pUuid)); 326 return VINF_SUCCESS;327 }328 329 330 /** @interface_method_impl{PDMIBLOCK,pfnIoBufAlloc} */331 static DECLCALLBACK(int) drvHostBaseIoBufAlloc(PPDMIMEDIA pInterface, size_t cb, void **ppvNew)332 {333 RT_NOREF(pInterface);334 LogFlowFunc(("\n"));335 336 int rc;337 void *pvNew = RTMemAlloc(cb);338 if (RT_LIKELY(pvNew))339 {340 *ppvNew = pvNew;341 rc = VINF_SUCCESS;342 }343 else344 rc = VERR_NO_MEMORY;345 346 LogFlowFunc(("returns %Rrc\n", rc));347 return rc;348 }349 350 /** @interface_method_impl{PDMIBLOCK,pfnIoBufFree} */351 static DECLCALLBACK(int) drvHostBaseIoBufFree(PPDMIMEDIA pInterface, void *pv, size_t cb)352 {353 RT_NOREF(pInterface, cb);354 LogFlowFunc(("\n"));355 356 RTMemFree(pv);357 358 LogFlowFunc(("returns %Rrc\n", VINF_SUCCESS));359 326 return VINF_SUCCESS; 360 327 } … … 1910 1877 pThis->IMedia.pfnGetType = drvHostBaseGetType; 1911 1878 pThis->IMedia.pfnGetUuid = drvHostBaseGetUuid; 1912 pThis->IMedia.pfnIoBufAlloc = drvHostBaseIoBufAlloc;1913 pThis->IMedia.pfnIoBufFree = drvHostBaseIoBufFree;1914 1879 pThis->IMedia.pfnBiosGetPCHSGeometry = drvHostBaseGetPCHSGeometry; 1915 1880 pThis->IMedia.pfnBiosSetPCHSGeometry = drvHostBaseSetPCHSGeometry; -
trunk/src/VBox/Devices/Storage/DrvRamDisk.cpp
r64002 r64019 624 624 } 625 625 626 /** @copydoc PDMIMEDIA::pfnIoBufAlloc */627 static DECLCALLBACK(int) drvramdiskIoBufAlloc(PPDMIMEDIA pInterface, size_t cb, void **ppvNew)628 {629 RT_NOREF1(pInterface);630 631 int rc = VINF_SUCCESS;632 void *pv = RTMemAlloc(cb);633 if (pv)634 *ppvNew = pv;635 else636 rc = VERR_NO_MEMORY;637 638 return rc;639 }640 641 /** @copydoc PDMIMEDIA::pfnIoBufFree */642 static DECLCALLBACK(int) drvramdiskIoBufFree(PPDMIMEDIA pInterface, void *pv, size_t cb)643 {644 RT_NOREF2(pInterface, cb);645 RTMemFree(pv);646 return VINF_SUCCESS;647 }648 649 626 /** @copydoc PDMIMEDIA::pfnReadPcBios */ 650 627 static DECLCALLBACK(int) drvramdiskReadPcBios(PPDMIMEDIA pInterface, … … 1661 1638 pThis->IMedia.pfnGetUuid = drvramdiskGetUuid; 1662 1639 pThis->IMedia.pfnGetSectorSize = drvramdiskGetSectorSize; 1663 pThis->IMedia.pfnIoBufAlloc = drvramdiskIoBufAlloc;1664 pThis->IMedia.pfnIoBufFree = drvramdiskIoBufFree;1665 1640 pThis->IMedia.pfnReadPcBios = drvramdiskReadPcBios; 1666 1641 pThis->IMedia.pfnDiscard = drvramdiskDiscard; -
trunk/src/VBox/Devices/Storage/DrvVD.cpp
r64005 r64019 2375 2375 } 2376 2376 2377 /** @interface_method_impl{PDMIMEDIA,pfnIoBufAlloc} */2378 static DECLCALLBACK(int) drvvdIoBufAlloc(PPDMIMEDIA pInterface, size_t cb, void **ppvNew)2379 {2380 LogFlowFunc(("\n"));2381 int rc;2382 PVBOXDISK pThis = PDMIMEDIA_2_VBOXDISK(pInterface);2383 2384 /* Configured encryption requires locked down memory. */2385 if (pThis->pCfgCrypto)2386 rc = RTMemSaferAllocZEx(ppvNew, cb, RTMEMSAFER_F_REQUIRE_NOT_PAGABLE);2387 else2388 {2389 cb = RT_ALIGN_Z(cb, _4K);2390 void *pvNew = RTMemPageAlloc(cb);2391 if (RT_LIKELY(pvNew))2392 {2393 *ppvNew = pvNew;2394 rc = VINF_SUCCESS;2395 }2396 else2397 rc = VERR_NO_MEMORY;2398 }2399 2400 LogFlowFunc(("returns %Rrc\n", rc));2401 return rc;2402 }2403 2404 /** @interface_method_impl{PDMIMEDIA,pfnIoBufFree} */2405 static DECLCALLBACK(int) drvvdIoBufFree(PPDMIMEDIA pInterface, void *pv, size_t cb)2406 {2407 LogFlowFunc(("\n"));2408 int rc = VINF_SUCCESS;2409 PVBOXDISK pThis = PDMIMEDIA_2_VBOXDISK(pInterface);2410 2411 if (pThis->pCfgCrypto)2412 RTMemSaferFree(pv, cb);2413 else2414 {2415 cb = RT_ALIGN_Z(cb, _4K);2416 RTMemPageFree(pv, cb);2417 }2418 2419 LogFlowFunc(("returns %Rrc\n", rc));2420 return rc;2421 }2422 2423 2424 2377 /* -=-=-=-=- IMount -=-=-=-=- */ 2425 2378 … … 4351 4304 pThis->IMedia.pfnGetUuid = drvvdGetUuid; 4352 4305 pThis->IMedia.pfnDiscard = drvvdDiscard; 4353 pThis->IMedia.pfnIoBufAlloc = drvvdIoBufAlloc;4354 pThis->IMedia.pfnIoBufFree = drvvdIoBufFree;4355 4306 pThis->IMedia.pfnSendCmd = NULL; 4356 4307
Note:
See TracChangeset
for help on using the changeset viewer.