VirtualBox

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


Ignore:
Timestamp:
Jun 11, 2012 10:21:44 PM (13 years ago)
Author:
vboxsync
Message:

DIS,VMM,REM,IPRT: Disassembler API adjustments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/BIOS-new/MakeDebianBiosAssembly.cpp

    r41609 r41658  
    904904
    905905/**
    906  * Disassembler callback for reading opcode bytes.
    907  *
    908  * @returns VINF_SUCCESS.
    909  * @param   uFlatAddr           The address to read at.
    910  * @param   pbDst               Where to store them.
    911  * @param   cbToRead            How many to read.
    912  * @param   pvUser              Unused.
    913  */
    914 static DECLCALLBACK(int) disReadOpcodeBytes(RTUINTPTR uFlatAddr, uint8_t *pbDst, unsigned cbToRead, void *pvUser)
    915 {
    916     if (uFlatAddr + cbToRead >= VBOX_BIOS_BASE + _64K)
     906 * @callback_method_impl{FNDISREADBYTES}
     907 *
     908 * @remarks @a uSrcAddr is the flat address.
     909 */
     910static DECLCALLBACK(int) disReadOpcodeBytes(PDISCPUSTATE pDisState, uint8_t *pbDst, RTUINTPTR uSrcAddr, uint32_t cbToRead)
     911{
     912    if (uSrcAddr + cbToRead >= VBOX_BIOS_BASE + _64K)
    917913    {
    918914        RT_BZERO(pbDst, cbToRead);
    919         if (uFlatAddr >= VBOX_BIOS_BASE + _64K)
     915        if (uSrcAddr >= VBOX_BIOS_BASE + _64K)
    920916            cbToRead = 0;
    921917        else
    922             cbToRead = VBOX_BIOS_BASE + _64K - uFlatAddr;
    923     }
    924     memcpy(pbDst, &g_pbImg[uFlatAddr - VBOX_BIOS_BASE], cbToRead);
    925     NOREF(pvUser);
     918            cbToRead = VBOX_BIOS_BASE + _64K - uSrcAddr;
     919    }
     920    memcpy(pbDst, &g_pbImg[uSrcAddr - VBOX_BIOS_BASE], cbToRead);
     921    NOREF(pDisState);
    926922    return VINF_SUCCESS;
    927923}
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