VirtualBox

Ignore:
Timestamp:
Jun 15, 2012 3:56:20 PM (13 years ago)
Author:
vboxsync
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/Devices/PC/BIOS-new/MakeDebianBiosAssembly.cpp

    r41734 r41760  
    908908 * @remarks @a uSrcAddr is the flat address.
    909909 */
    910 static DECLCALLBACK(int) disReadOpcodeBytes(PDISCPUSTATE pDisState, uint8_t *pbDst, RTUINTPTR uSrcAddr, uint32_t cbToRead)
    911 {
    912     if (uSrcAddr + cbToRead >= VBOX_BIOS_BASE + _64K)
    913     {
    914         RT_BZERO(pbDst, cbToRead);
    915         if (uSrcAddr >= VBOX_BIOS_BASE + _64K)
     910static DECLCALLBACK(int) disReadOpcodeBytes(PDISCPUSTATE pDis, uint8_t offInstr, uint8_t cbMinRead, uint8_t cbMaxRead)
     911{
     912    RTUINTPTR   offBios  = pDis->uInstrAddr + offInstr - VBOX_BIOS_BASE;
     913    size_t      cbToRead = cbMaxRead;
     914    if (offBios + cbToRead > _64K)
     915    {
     916        if (offBios >= _64K)
    916917            cbToRead = 0;
    917918        else
    918             cbToRead = VBOX_BIOS_BASE + _64K - uSrcAddr;
    919     }
    920     memcpy(pbDst, &g_pbImg[uSrcAddr - VBOX_BIOS_BASE], cbToRead);
    921     NOREF(pDisState);
     919            cbToRead = _64K - offBios;
     920    }
     921    memcpy(&pDis->abInstr[offInstr], &g_pbImg[offBios], cbToRead);
     922    pDis->cbCachedInstr = offInstr + cbToRead;
    922923    return VINF_SUCCESS;
    923924}
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