Index: /trunk/include/VBox/err.h
===================================================================
--- /trunk/include/VBox/err.h	(revision 41824)
+++ /trunk/include/VBox/err.h	(revision 41825)
@@ -569,4 +569,8 @@
 /** PCI passthru is not supported by this build. */
 #define VERR_PGM_PCI_PASSTHRU_MISCONFIG         (-1682)
+/** PCI physical read with bus mastering disabled. */
+#define VINF_PGM_PCI_PHYS_READ_BM_DISABLED      (1683)
+/** PCI physical write with bus mastering disabled. */
+#define VINF_PGM_PCI_PHYS_WRITE_BM_DISABLED     (1684)
 /** @} */
 
Index: /trunk/include/VBox/pci.h
===================================================================
--- /trunk/include/VBox/pci.h	(revision 41824)
+++ /trunk/include/VBox/pci.h	(revision 41825)
@@ -538,9 +538,4 @@
 } PCIDEVICE;
 
-#ifdef IN_RING3
-int PCIDevPhysRead(PPCIDEVICE pPciDev, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead);
-int PCIDevPhysWrite(PPCIDEVICE pPciDev, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite);
-#endif
-
 /* @todo: handle extended space access */
 DECLINLINE(void)     PCIDevSetByte(PPCIDEVICE pPciDev, uint32_t uOffset, uint8_t u8Value)
Index: /trunk/include/VBox/vmm/pdmdev.h
===================================================================
--- /trunk/include/VBox/vmm/pdmdev.h	(revision 41824)
+++ /trunk/include/VBox/vmm/pdmdev.h	(revision 41825)
@@ -1300,8 +1300,8 @@
     /**
      * Calculates an IRQ tag for a timer, IPI or similar event.
-     *  
-     * @returns The IRQ tag. 
-     * @param   pDevIns         Device instance of the APIC. 
-     * @param   u8Level         PDM_IRQ_LEVEL_HIGH or PDM_IRQ_LEVEL_FLIP_FLOP. 
+     *
+     * @returns The IRQ tag.
+     * @param   pDevIns         Device instance of the APIC.
+     * @param   u8Level         PDM_IRQ_LEVEL_HIGH or PDM_IRQ_LEVEL_FLIP_FLOP.
      */
     DECLRCCALLBACKMEMBER(uint32_t, pfnCalcIrqTag,(PPDMDEVINS pDevIns, uint8_t u8Level));
@@ -1379,8 +1379,8 @@
     /**
      * Calculates an IRQ tag for a timer, IPI or similar event.
-     *  
-     * @returns The IRQ tag. 
-     * @param   pDevIns         Device instance of the APIC. 
-     * @param   u8Level         PDM_IRQ_LEVEL_HIGH or PDM_IRQ_LEVEL_FLIP_FLOP. 
+     *
+     * @returns The IRQ tag.
+     * @param   pDevIns         Device instance of the APIC.
+     * @param   u8Level         PDM_IRQ_LEVEL_HIGH or PDM_IRQ_LEVEL_FLIP_FLOP.
      */
     DECLR0CALLBACKMEMBER(uint32_t, pfnCalcIrqTag,(PPDMDEVINS pDevIns, uint8_t u8Level));
@@ -1457,8 +1457,8 @@
     /**
      * Calculates an IRQ tag for a timer, IPI or similar event.
-     *  
-     * @returns The IRQ tag. 
-     * @param   pDevIns         Device instance of the APIC. 
-     * @param   u8Level         PDM_IRQ_LEVEL_HIGH or PDM_IRQ_LEVEL_FLIP_FLOP. 
+     *
+     * @returns The IRQ tag.
+     * @param   pDevIns         Device instance of the APIC.
+     * @param   u8Level         PDM_IRQ_LEVEL_HIGH or PDM_IRQ_LEVEL_FLIP_FLOP.
      */
     DECLR3CALLBACKMEMBER(uint32_t, pfnCalcIrqTag,(PPDMDEVINS pDevIns, uint8_t u8Level));
@@ -4614,5 +4614,4 @@
 }
 
-
 /**
  * @copydoc PDMDEVHLPR3::pfnPCISetConfigCallbacks
@@ -4622,4 +4621,52 @@
 {
     pDevIns->pHlpR3->pfnPCISetConfigCallbacks(pDevIns, pPciDev, pfnRead, ppfnReadOld, pfnWrite, ppfnWriteOld);
+}
+
+/**
+ * Reads data via bus mastering, if enabled. If no bus mastering is available,
+ * this function does nothing and returns VINF_NOT_SUPPORTED.
+ *
+ * @return  IPRT status code.
+ */
+DECLINLINE(int) PDMDevHlpPCIDevPhysRead(PPCIDEVICE pPciDev, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead)
+{
+    AssertPtrReturn(pPciDev, VERR_INVALID_POINTER);
+    AssertPtrReturn(pvBuf, VERR_INVALID_POINTER);
+    AssertReturn(cbRead, VERR_INVALID_PARAMETER);
+
+    if (!PCIDevIsBusmaster(pPciDev))
+    {
+#ifdef DEBUG
+        Log2(("%s: %RU16:%RU16: No bus master (anymore), skipping read %p (%z)\n", __FUNCTION__,
+              PCIDevGetVendorId(pPciDev), PCIDevGetDeviceId(pPciDev), pvBuf, cbRead));
+#endif
+        return VINF_PGM_PCI_PHYS_READ_BM_DISABLED;
+    }
+
+    return PDMDevHlpPhysRead(pPciDev->pDevIns, GCPhys, pvBuf, cbRead);
+}
+
+/**
+ * Writes data via bus mastering, if enabled. If no bus mastering is available,
+ * this function does nothing and returns VINF_NOT_SUPPORTED.
+ *
+ * @return  IPRT status code.
+ */
+DECLINLINE(int) PDMDevHlpPCIDevPhysWrite(PPCIDEVICE pPciDev, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite)
+{
+    AssertPtrReturn(pPciDev, VERR_INVALID_POINTER);
+    AssertPtrReturn(pvBuf, VERR_INVALID_POINTER);
+    AssertReturn(cbWrite, VERR_INVALID_PARAMETER);
+
+    if (!PCIDevIsBusmaster(pPciDev))
+    {
+#ifdef DEBUG
+        Log2(("%s: %RU16:%RU16: No bus master (anymore), skipping write %p (%z)\n", __FUNCTION__,
+              PCIDevGetVendorId(pPciDev), PCIDevGetDeviceId(pPciDev), pvBuf, cbWrite));
+#endif
+        return VINF_PGM_PCI_PHYS_WRITE_BM_DISABLED;
+    }
+
+    return PDMDevHlpPhysWrite(pPciDev->pDevIns, GCPhys, pvBuf, cbWrite);
 }
 
Index: /trunk/src/VBox/Devices/Bus/DevPCI.cpp
===================================================================
--- /trunk/src/VBox/Devices/Bus/DevPCI.cpp	(revision 41824)
+++ /trunk/src/VBox/Devices/Bus/DevPCI.cpp	(revision 41825)
@@ -242,52 +242,4 @@
 
 #ifdef IN_RING3
-/**
- * Reads data via bus mastering, if enabled. If no bus mastering is available,
- * this function does nothing and returns VINF_NOT_SUPPORTED.
- *
- * @return  IPRT status code.
- */
-int PCIDevPhysRead(PPCIDEVICE pPciDev, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead)
-{
-    AssertPtrReturn(pPciDev, VERR_INVALID_POINTER);
-    AssertPtrReturn(pvBuf, VERR_INVALID_POINTER);
-    AssertReturn(cbRead, VERR_INVALID_PARAMETER);
-
-    if (!PCIDevIsBusmaster(pPciDev))
-    {
-#ifdef DEBUG
-        Log2(("%s: %RU16:%RU16: No bus master (anymore), skipping read %p (%z)\n", __FUNCTION__,
-              PCIDevGetVendorId(pPciDev), PCIDevGetDeviceId(pPciDev), pvBuf, cbRead));
-#endif
-        return VINF_NOT_SUPPORTED;
-    }
-
-    return PDMDevHlpPhysRead(pPciDev->pDevIns, GCPhys, pvBuf, cbRead);
-}
-
-/**
- * Writes data via bus mastering, if enabled. If no bus mastering is available,
- * this function does nothing and returns VINF_NOT_SUPPORTED.
- *
- * @return  IPRT status code.
- */
-int PCIDevPhysWrite(PPCIDEVICE pPciDev, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite)
-{
-    AssertPtrReturn(pPciDev, VERR_INVALID_POINTER);
-    AssertPtrReturn(pvBuf, VERR_INVALID_POINTER);
-    AssertReturn(cbWrite, VERR_INVALID_PARAMETER);
-
-    if (!PCIDevIsBusmaster(pPciDev))
-    {
-#ifdef DEBUG
-        Log2(("%s: %RU16:%RU16: No bus master (anymore), skipping write %p (%z)\n", __FUNCTION__,
-              PCIDevGetVendorId(pPciDev), PCIDevGetDeviceId(pPciDev), pvBuf, cbWrite));
-#endif
-        return VINF_NOT_SUPPORTED;
-    }
-
-    return PDMDevHlpPhysWrite(pPciDev->pDevIns, GCPhys, pvBuf, cbWrite);
-}
-
 static void pci_update_mappings(PCIDevice *d)
 {
Index: /trunk/src/VBox/Devices/Storage/DevATA.cpp
===================================================================
--- /trunk/src/VBox/Devices/Storage/DevATA.cpp	(revision 41824)
+++ /trunk/src/VBox/Devices/Storage/DevATA.cpp	(revision 41825)
@@ -5017,7 +5017,7 @@
                 AssertPtr(pATAState);
                 if (uTxDir == PDMBLOCKTXDIR_FROM_DEVICE)
-                    PCIDevPhysWrite(&pATAState->dev, pBuffer, s->CTX_SUFF(pbIOBuffer) + iIOBufferCur, dmalen);
+                    PDMDevHlpPCIDevPhysWrite(&pATAState->dev, pBuffer, s->CTX_SUFF(pbIOBuffer) + iIOBufferCur, dmalen);
                 else
-                    PCIDevPhysRead(&pATAState->dev, pBuffer, s->CTX_SUFF(pbIOBuffer) + iIOBufferCur, dmalen);
+                    PDMDevHlpPCIDevPhysRead(&pATAState->dev, pBuffer, s->CTX_SUFF(pbIOBuffer) + iIOBufferCur, dmalen);
 
                 iIOBufferCur += dmalen;
