VirtualBox

Changeset 2202 in vbox for trunk


Ignore:
Timestamp:
Apr 19, 2007 8:58:33 AM (18 years ago)
Author:
vboxsync
Message:

Cleaned up.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMGC/IOMGC.cpp

    r2201 r2202  
    4646
    4747
    48 /** @def IOMGC_MOVS_SUPPORT
    49  * Define IOMGC_MOVS_SUPPORT for movsb/w/d support in GC.
    50  */
    51 #define IOMGC_MOVS_SUPPORT
    52 
    53 
    5448/*******************************************************************************
    5549*   Internal Functions                                                         *
    5650*******************************************************************************/
    57 #if 0
    58 static bool iomGCCalcParamEA(PDISCPUSTATE pCpu, POP_PARAMETER pParam, PCPUMCTXCORE pRegFrame, void **ppAddr);
    59 #endif
    6051static unsigned iomGCGetRegSize(PDISCPUSTATE pCpu, PCOP_PARAMETER pParam);
    6152static bool iomGCGetRegImmData(PDISCPUSTATE pCpu, PCOP_PARAMETER pParam, PCPUMCTXCORE pRegFrame, uint32_t *pu32Data, unsigned *pcbSize);
     
    8778 */
    8879#define SIZE2SHIFT(cb) (g_aSize2Shift[cb])
    89 
    90 
    91 #if 0
    92 /**
    93  * Calculates effective address (offset from current segment register) for
    94  * instruction parameter, i.e. [eax + esi*4 + 1234h] -> virtual address.
    95  *
    96  * @returns true on success.
    97  * @param   pCpu                Pointer to current disassembler context.
    98  * @param   pParam              Pointer to parameter of instruction to calc EA.
    99  * @param   pRegFrame           Pointer to CPUMCTXCORE guest structure.
    100  * @param   ppAddr              Where to store result address.
    101  */
    102 static bool iomGCCalcParamEA(PDISCPUSTATE pCpu, POP_PARAMETER pParam, PCPUMCTXCORE pRegFrame, void **ppAddr)
    103 {
    104     uint8_t *pAddr = 0;
    105 
    106     if (pCpu->addrmode == CPUMODE_32BIT)
    107     {
    108         /* 32-bit addressing. */
    109         if (pParam->flags & USE_BASE)
    110             pAddr += ACCESS_REG32(pRegFrame, pParam->base.reg_gen32);
    111         if (pParam->flags & USE_INDEX)
    112         {
    113             unsigned i = ACCESS_REG32(pRegFrame, pParam->index.reg_gen);
    114             if (pParam->flags & USE_SCALE)
    115                 i *= pParam->scale;
    116             pAddr += i;
    117         }
    118         if (pParam->flags & USE_DISPLACEMENT8)
    119             pAddr += pParam->disp8;
    120         else
    121             if (pParam->flags & USE_DISPLACEMENT16)
    122             pAddr += pParam->disp16;
    123         else
    124             if (pParam->flags & USE_DISPLACEMENT32)
    125             pAddr += pParam->disp32;
    126 
    127         if (pParam->flags & (USE_BASE | USE_INDEX | USE_DISPLACEMENT8 | USE_DISPLACEMENT16 | USE_DISPLACEMENT32))
    128         {
    129             /* EA present in parameter. */
    130             *ppAddr = pAddr;
    131             return true;
    132         }
    133     }
    134     else
    135     {
    136         /* 16-bit addressing. */
    137         if (pParam->flags & USE_BASE)
    138             pAddr += ACCESS_REG16(pRegFrame, pParam->base.reg_gen16);
    139         if (pParam->flags & USE_INDEX)
    140             pAddr += ACCESS_REG16(pRegFrame, pParam->index.reg_gen);
    141         if (pParam->flags & USE_DISPLACEMENT8)
    142             pAddr += pParam->disp8;
    143         else
    144             if (pParam->flags & USE_DISPLACEMENT16)
    145             pAddr += pParam->disp16;
    146 
    147         if (pParam->flags & (USE_BASE | USE_INDEX | USE_DISPLACEMENT8 | USE_DISPLACEMENT16))
    148         {
    149             /* EA present in parameter. */
    150             *ppAddr = pAddr;
    151             return true;
    152         }
    153     }
    154 
    155     /* Error exit. */
    156     return false;
    157 }
    158 #endif
    15980
    16081/**
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