VirtualBox

Changeset 41825 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Jun 19, 2012 2:14:28 PM (12 years ago)
Author:
vboxsync
Message:

PCI/DevATA: Put PCIDevPhysRead/Write into PDMDevHlpPCIDevPhysRead/Write, introduced VINF_PGM_PCI_PHYS_READ/WRITE_BM_DISABLED codes.

Location:
trunk/src/VBox/Devices
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Bus/DevPCI.cpp

    r41816 r41825  
    242242
    243243#ifdef IN_RING3
    244 /**
    245  * Reads data via bus mastering, if enabled. If no bus mastering is available,
    246  * this function does nothing and returns VINF_NOT_SUPPORTED.
    247  *
    248  * @return  IPRT status code.
    249  */
    250 int PCIDevPhysRead(PPCIDEVICE pPciDev, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead)
    251 {
    252     AssertPtrReturn(pPciDev, VERR_INVALID_POINTER);
    253     AssertPtrReturn(pvBuf, VERR_INVALID_POINTER);
    254     AssertReturn(cbRead, VERR_INVALID_PARAMETER);
    255 
    256     if (!PCIDevIsBusmaster(pPciDev))
    257     {
    258 #ifdef DEBUG
    259         Log2(("%s: %RU16:%RU16: No bus master (anymore), skipping read %p (%z)\n", __FUNCTION__,
    260               PCIDevGetVendorId(pPciDev), PCIDevGetDeviceId(pPciDev), pvBuf, cbRead));
    261 #endif
    262         return VINF_NOT_SUPPORTED;
    263     }
    264 
    265     return PDMDevHlpPhysRead(pPciDev->pDevIns, GCPhys, pvBuf, cbRead);
    266 }
    267 
    268 /**
    269  * Writes data via bus mastering, if enabled. If no bus mastering is available,
    270  * this function does nothing and returns VINF_NOT_SUPPORTED.
    271  *
    272  * @return  IPRT status code.
    273  */
    274 int PCIDevPhysWrite(PPCIDEVICE pPciDev, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite)
    275 {
    276     AssertPtrReturn(pPciDev, VERR_INVALID_POINTER);
    277     AssertPtrReturn(pvBuf, VERR_INVALID_POINTER);
    278     AssertReturn(cbWrite, VERR_INVALID_PARAMETER);
    279 
    280     if (!PCIDevIsBusmaster(pPciDev))
    281     {
    282 #ifdef DEBUG
    283         Log2(("%s: %RU16:%RU16: No bus master (anymore), skipping write %p (%z)\n", __FUNCTION__,
    284               PCIDevGetVendorId(pPciDev), PCIDevGetDeviceId(pPciDev), pvBuf, cbWrite));
    285 #endif
    286         return VINF_NOT_SUPPORTED;
    287     }
    288 
    289     return PDMDevHlpPhysWrite(pPciDev->pDevIns, GCPhys, pvBuf, cbWrite);
    290 }
    291 
    292244static void pci_update_mappings(PCIDevice *d)
    293245{
  • trunk/src/VBox/Devices/Storage/DevATA.cpp

    r41815 r41825  
    50175017                AssertPtr(pATAState);
    50185018                if (uTxDir == PDMBLOCKTXDIR_FROM_DEVICE)
    5019                     PCIDevPhysWrite(&pATAState->dev, pBuffer, s->CTX_SUFF(pbIOBuffer) + iIOBufferCur, dmalen);
     5019                    PDMDevHlpPCIDevPhysWrite(&pATAState->dev, pBuffer, s->CTX_SUFF(pbIOBuffer) + iIOBufferCur, dmalen);
    50205020                else
    5021                     PCIDevPhysRead(&pATAState->dev, pBuffer, s->CTX_SUFF(pbIOBuffer) + iIOBufferCur, dmalen);
     5021                    PDMDevHlpPCIDevPhysRead(&pATAState->dev, pBuffer, s->CTX_SUFF(pbIOBuffer) + iIOBufferCur, dmalen);
    50225022
    50235023                iIOBufferCur += dmalen;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette