VirtualBox

Changeset 41731 in vbox for trunk/src/VBox/Disassembler


Ignore:
Timestamp:
Jun 14, 2012 11:41:13 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
78539
Message:

DIS: Split up apvUserData, dropping the 3rd entry. 2nd entry (now pvUser2) is only used by CSAM. Reduces the DISCPUSTATE by another 8 bytes.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Disassembler/Disasm.cpp

    r41694 r41731  
    5858 * @param   pfnCallback     The byte fetcher callback.
    5959 * @param   pvUser          The user argument (found in
    60  *                          DISCPUSTATE::apvUserData[0]).
     60 *                          DISCPUSTATE::pvUser).
    6161 * @param   pCpu            Where to return the disassembled instruction.
    6262 * @param   pcbInstr        Where to store the size of the instruction. NULL is
  • trunk/src/VBox/Disassembler/DisasmCore.cpp

    r41728 r41731  
    227227 * @param   enmCpuMode      The CPU mode. DISCPUMODE_32BIT, DISCPUMODE_16BIT, or DISCPUMODE_64BIT.
    228228 * @param   pfnReadBytes    Callback for reading instruction bytes.
    229  * @param   pvUser          User argument for the instruction reader. (Ends up in apvUserData[0].)
     229 * @param   pvUser          User argument for the instruction reader. (Ends up in pvUser.)
    230230 * @param   pCpu            Pointer to cpu structure. Will be initialized.
    231231 * @param   pcbInstr        Where to store the size of the instruction.
     
    249249 * @param   enmCpuMode      The CPU mode. DISCPUMODE_32BIT, DISCPUMODE_16BIT, or DISCPUMODE_64BIT.
    250250 * @param   pfnReadBytes    Callback for reading instruction bytes.
    251  * @param   pvUser          User argument for the instruction reader. (Ends up in apvUserData[0].)
     251 * @param   pvUser          User argument for the instruction reader. (Ends up in pvUser.)
    252252 * @param   pCpu            Pointer to cpu structure. Will be initialized.
    253253 * @param   pcbInstr        Where to store the size of the instruction.
     
    271271 * @param   pfnReadBytes    Callback for reading instruction bytes.
    272272 * @param   fFilter         Instruction type filter.
    273  * @param   pvUser          User argument for the instruction reader. (Ends up in apvUserData[0].)
     273 * @param   pvUser          User argument for the instruction reader. (Ends up in pvUser.)
    274274 * @param   pCpu            Pointer to CPU structure. With the exception of
    275  *                          DISCPUSTATE::apvUserData[1] and
    276  *                          DISCPUSTATE::apvUserData[2], the structure will be
     275 *                          DISCPUSTATE::pvUser2, the structure will be
    277276 *                          completely initialized by this API, i.e. no input is
    278277 *                          taken from it.
     
    288287    /*
    289288     * Initialize the CPU state.
    290      * Note! The RT_BZERO make ASSUMPTIONS about the placement of apvUserData.
     289     * Note! The RT_BZERO make ASSUMPTIONS about the placement of pvUser2.
    291290     */
    292     RT_BZERO(pCpu, RT_OFFSETOF(DISCPUSTATE, apvUserData));
     291    RT_BZERO(pCpu, RT_OFFSETOF(DISCPUSTATE, pvUser2));
    293292
    294293    pCpu->mode              = enmCpuMode;
     
    312311    pCpu->rc                = VINF_SUCCESS;
    313312    pCpu->pfnReadBytes      = pfnReadBytes ? pfnReadBytes : disReadBytesDefault;
    314     pCpu->apvUserData[0]    = pvUser;
     313    pCpu->pvUser    = pvUser;
    315314
    316315    return disInstrWorker(pCpu, uInstrAddr, paOneByteMap, pcbInstr);
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