VirtualBox

Changeset 11456 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Aug 18, 2008 9:23:18 AM (16 years ago)
Author:
vboxsync
Message:

Use DISGetParamSize instead of iomGetRegSize.

File:
1 edited

Legend:

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

    r10381 r11456  
    3838
    3939
    40 /**
    41  * Calculates the size of register parameter.
    42  *
    43  * @returns 1, 2, 4 on success.
    44  * @returns 0 if non-register parameter.
    45  * @param   pCpu                Pointer to current disassembler context.
    46  * @param   pParam              Pointer to parameter of instruction to proccess.
    47  */
    48 static unsigned iomGetRegSize(PDISCPUSTATE pCpu, PCOP_PARAMETER pParam)
    49 {
    50     if (pParam->flags & (USE_BASE | USE_INDEX | USE_SCALE | USE_DISPLACEMENT8 | USE_DISPLACEMENT16 | USE_DISPLACEMENT32 | USE_IMMEDIATE8 | USE_IMMEDIATE16 | USE_IMMEDIATE32 | USE_IMMEDIATE16_SX8 | USE_IMMEDIATE32_SX8))
    51         return 0;
    52 
    53     if (pParam->flags & USE_REG_GEN32)
    54         return 4;
    55 
    56     if (pParam->flags & USE_REG_GEN16)
    57         return 2;
    58 
    59     if (pParam->flags & USE_REG_GEN8)
    60         return 1;
    61 
    62     if (pParam->flags & USE_REG_GEN64)
    63         return 8;
    64 
    65     if (pParam->flags & USE_REG_SEG)
    66         return 2;
    67     return 0;
    68 }
    69 
    7040
    7141/**
     
    7444 * @returns true on success.
    7545 *
     46 * @todo Get rid of this code. Use DISQueryParamVal instead
     47 *
    7648 * @param   pCpu                Pointer to current disassembler context.
    7749 * @param   pParam              Pointer to parameter of instruction to proccess.
     
    884856    AssertMsg(fRc, ("Failed to get reg/imm port number!\n")); NOREF(fRc);
    885857
    886     cbSize = iomGetRegSize(pCpu, &pCpu->param1);
     858    cbSize = DISGetParamSize(pCpu, &pCpu->param1);
    887859    Assert(cbSize > 0);
    888860    int rc = IOMInterpretCheckPortIOAccess(pVM, pRegFrame, uPort, cbSize);
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