VirtualBox

Ignore:
Timestamp:
Jun 15, 2012 3:56:20 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
78577
Message:

DIS: Chagned FNDISREADBYTES to permit reading more bytes that the immeidate request. Not using the read-ahead feature in any important code path yet, that's comming next, bit by bit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/EMAll.cpp

    r41744 r41760  
    284284 * @callback_method_impl{FNDISREADBYTES}
    285285 */
    286 static DECLCALLBACK(int) emReadBytes(PDISCPUSTATE pDisState, uint8_t *pbDst, RTUINTPTR uSrcAddr, uint32_t cbToRead)
    287 {
    288     PEMDISSTATE   pState = (PEMDISSTATE)pDisState->pvUser;
     286static DECLCALLBACK(int) emReadBytes(PDISCPUSTATE pDis, uint8_t offInstr, uint8_t cbMinRead, uint8_t cbMaxRead)
     287{
     288    PEMDISSTATE   pState = (PEMDISSTATE)pDis->pvUser;
    289289# ifndef IN_RING0
    290290    PVM           pVM    = pState->pVM;
    291291# endif
    292292    PVMCPU        pVCpu  = pState->pVCpu;
     293    /** @todo Rewrite this to make full use of the abInstr buffer and drop our extra
     294     *        caching buffer.  Just playing safe at first... */
     295    uint8_t      *pbDst    = &pDis->abInstr[offInstr];
     296    RTUINTPTR     uSrcAddr = pDis->uInstrAddr + offInstr;
     297    size_t        cbToRead = cbMinRead;
    293298
    294299# ifdef IN_RING0
    295     int rc;
     300    int           rc;
    296301
    297302    if (    pState->GCPtr
     
    303308        for (unsigned i = 0; i < cbToRead; i++)
    304309            pbDst[i] = pState->aOpcode[offset + i];
     310        pDis->cbCachedInstr = offInstr + cbToRead;
    305311        return VINF_SUCCESS;
    306312    }
     
    308314    rc = PGMPhysSimpleReadGCPtr(pVCpu, pbDst, uSrcAddr, cbToRead);
    309315    AssertMsgRC(rc, ("PGMPhysSimpleReadGCPtr failed for uSrcAddr=%RTptr cbToRead=%x rc=%d\n", uSrcAddr, cbToRead, rc));
     316
    310317# elif defined(IN_RING3)
    311318    if (!PATMIsPatchGCAddr(pVM, uSrcAddr))
     
    332339
    333340# endif /* IN_RING3 */
     341    pDis->cbCachedInstr = offInstr + cbToRead;
    334342    return VINF_SUCCESS;
    335343}
Note: See TracChangeset for help on using the changeset viewer.

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