Changeset 56080 in vbox for trunk/src/VBox/VMM/VMMRC
- Timestamp:
- May 26, 2015 2:36:27 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMRC/IOMRC.cpp
r56072 r56080 27 27 #include <VBox/vmm/mm.h> 28 28 #include <VBox/vmm/em.h> 29 #include <VBox/vmm/iem.h> 29 30 #include <VBox/vmm/pgm.h> 30 31 #include <VBox/vmm/trpm.h> … … 40 41 #include <iprt/asm.h> 41 42 #include <iprt/string.h> 43 44 45 #ifdef VBOX_WITH_2ND_IEM_STEP 46 /** 47 * Converts disassembler mode to IEM mode. 48 * @return IEM CPU mode. 49 * @param enmDisMode Disassembler CPU mode. 50 */ 51 DECLINLINE(IEMMODE) iomDisModeToIemMode(DISCPUMODE enmDisMode) 52 { 53 switch (enmDisMode) 54 { 55 case DISCPUMODE_16BIT: return IEMMODE_16BIT; 56 case DISCPUMODE_32BIT: return IEMMODE_32BIT; 57 case DISCPUMODE_64BIT: return IEMMODE_64BIT; 58 default: 59 AssertFailed(); 60 return IEMMODE_32BIT; 61 } 62 } 63 #endif 42 64 43 65 … … 178 200 static VBOXSTRICTRC iomRCInterpretINS(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, PDISCPUSTATE pCpu) 179 201 { 202 #ifdef VBOX_WITH_2ND_IEM_STEP 203 uint8_t cbValue = pCpu->pCurInstr->uOpcode == OP_INSB ? 1 204 : pCpu->uOpMode == DISCPUMODE_16BIT ? 2 : 4; /* dword in both 32 & 64 bits mode */ 205 return IEMExecStringIoRead(pVCpu, 206 cbValue, 207 iomDisModeToIemMode((DISCPUMODE)pCpu->uCpuMode), 208 RT_BOOL(pCpu->fPrefix & (DISPREFIX_REPNE | DISPREFIX_REP)), 209 pCpu->cbInstr); 210 #else 180 211 /* 181 212 * Get port number directly from the register (no need to bother the … … 197 228 198 229 return IOMInterpretINSEx(pVM, pVCpu, pRegFrame, Port, pCpu->fPrefix, (DISCPUMODE)pCpu->uAddrMode, cb); 230 #endif 199 231 } 200 232 … … 222 254 static VBOXSTRICTRC iomRCInterpretOUTS(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, PDISCPUSTATE pCpu) 223 255 { 256 #ifdef VBOX_WITH_2ND_IEM_STEP 257 uint8_t cbValue = pCpu->pCurInstr->uOpcode == OP_OUTSB ? 1 258 : pCpu->uOpMode == DISCPUMODE_16BIT ? 2 : 4; /* dword in both 32 & 64 bits mode */ 259 return IEMExecStringIoWrite(pVCpu, 260 cbValue, 261 iomDisModeToIemMode((DISCPUMODE)pCpu->uCpuMode), 262 RT_BOOL(pCpu->fPrefix & (DISPREFIX_REPNE | DISPREFIX_REP)), 263 pCpu->cbInstr, 264 pCpu->fPrefix & DISPREFIX_SEG ? pCpu->idxSegPrefix : X86_SREG_DS); 265 #else 224 266 /* 225 267 * Get port number from the first parameter. … … 227 269 */ 228 270 uint64_t Port = 0; 229 unsigned cb;230 271 bool fRc = iomGetRegImmData(pCpu, &pCpu->Param1, pRegFrame, &Port, &cb); 231 272 AssertMsg(fRc, ("Failed to get reg/imm port number!\n")); NOREF(fRc); 273 unsigned cb; 232 274 if (pCpu->pCurInstr->uOpcode == OP_OUTSB) 233 275 cb = 1; … … 243 285 244 286 return IOMInterpretOUTSEx(pVM, pVCpu, pRegFrame, Port, pCpu->fPrefix, (DISCPUMODE)pCpu->uAddrMode, cb); 287 #endif 245 288 } 246 289
Note:
See TracChangeset
for help on using the changeset viewer.