VirtualBox

Changeset 18739 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
Apr 6, 2009 9:28:14 AM (16 years ago)
Author:
vboxsync
Message:

pcnet: another correction for the physwrite hack

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DevPCNet.cpp

    r18690 r18739  
    852852        rda[1] &= ~0x80000000;
    853853        PDMDevHlpPhysWrite(pDevIns, addr+7, (uint8_t*)rda + 7, 1);
     854    }
     855}
     856
     857/**
     858 * Read+Write a TX/RX descriptor to prevent PDMDevHlpPhysWrite() allocating
     859 * pages later when we shouldn't schedule to EMT. Temporarily hack.
     860 */
     861static void pcnetDescTouch(PCNetState *pThis, RTGCPHYS32 addr)
     862{
     863    PPDMDEVINS pDevIns = PCNETSTATE_2_DEVINS(pThis);
     864
     865    if (!pThis->fPrivIfEnabled)
     866    {
     867        uint8_t aBuf[16];
     868        size_t cbDesc;
     869        if (RT_UNLIKELY(BCR_SWSTYLE(pThis) == 0))
     870            cbDesc = 8;
     871        else
     872            cbDesc = 16;
     873        PDMDevHlpPhysRead(pDevIns, addr, aBuf, cbDesc);
     874        PDMDevHlpPhysWrite(pDevIns, addr, aBuf, cbDesc);
    854875    }
    855876}
     
    15501571        RMD        rmd;
    15511572        RTGCPHYS32 rdaddr = PHYSADDR(pThis, pcnetRdraAddr(pThis, i));
     1573
     1574        pcnetDescTouch(pThis, rdaddr);
    15521575        /* At this time it is not guaranteed that the buffers are already initialized. */
    15531576        if (pcnetRmdLoad(pThis, &rmd, rdaddr, false))
     
    15631586            cbRxBuffers += cbBuf;
    15641587        }
    1565         PDMDevHlpPhysWrite(pDevIns, rdaddr, (void*)&rmd, sizeof(rmd));
    15661588    }
    15671589
     
    15701592        TMD        tmd;
    15711593        RTGCPHYS32 tdaddr = PHYSADDR(pThis, pcnetTdraAddr(pThis, i));
     1594
     1595        pcnetDescTouch(pThis, tdaddr);
    15721596        if (pcnetTmdLoad(pThis, &tmd, tdaddr, false))
    15731597        {
     
    15821606            PDMDevHlpPhysWrite(pDevIns, tbadr, aBuf, RT_MIN(sizeof(aBuf), cbBuf));
    15831607        }
    1584         PDMDevHlpPhysWrite(pDevIns, tdaddr, (void*)&tmd, sizeof(tmd));
    15851608    }
    15861609
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