Changeset 56416 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Jun 14, 2015 12:26:09 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllCImplStrInstr.cpp.h
r56287 r56416 1141 1141 && uAddrReg + (cLeftPage * (OP_SIZE / 8)) <= pCtx->es.u32Limit) 1142 1142 ) 1143 && !IEM_VERIFICATION_ENABLED(pIemCpu) 1143 1144 ) 1144 1145 { … … 1149 1150 1150 1151 /* 1151 * If we can map the page without trouble, we would've liked to use 1152 * an string I/O method to do the work, but the current IOM 1153 * interface doesn't match our current approach. So, do a regular 1154 * loop instead. 1152 * If we can map the page without trouble, use the IOM 1153 * string I/O interface to do the work. 1155 1154 */ 1156 /** @todo Change the I/O manager interface to make use of1157 * mapped buffers instead of leaving those bits to the1158 * device implementation! */1159 1155 PGMPAGEMAPLOCK PgLockMem; 1160 1156 OP_TYPE *puMem; … … 1162 1158 if (rcStrict == VINF_SUCCESS) 1163 1159 { 1164 uint32_t off = 0; 1165 while (off < cLeftPage) 1160 uint32_t cTransfers = cLeftPage; 1161 rcStrict = IOMIOPortReadString(pVM, pVCpu, u16Port, puMem, &cTransfers, OP_SIZE / 8); 1162 1163 uint32_t cActualTransfers = cLeftPage - cTransfers; 1164 Assert(cActualTransfers <= cLeftPage); 1165 pCtx->ADDR_rDI = uAddrReg += cbIncr * cActualTransfers; 1166 pCtx->ADDR_rCX = uCounterReg -= cActualTransfers; 1167 puMem += cActualTransfers; 1168 1169 iemMemPageUnmap(pIemCpu, GCPhysMem, IEM_ACCESS_DATA_W, puMem, &PgLockMem); 1170 1171 if (rcStrict != VINF_SUCCESS) 1166 1172 { 1167 uint32_t u32Value;1168 if (!IEM_VERIFICATION_ENABLED(pIemCpu))1169 rcStrict = IOMIOPortRead(pVM, pVCpu, u16Port, &u32Value, OP_SIZE / 8);1170 else1171 rcStrict = iemVerifyFakeIOPortRead(pIemCpu, u16Port, &u32Value, OP_SIZE / 8);1172 1173 if (IOM_SUCCESS(rcStrict)) 1173 1174 { 1174 puMem[off] = (OP_TYPE)u32Value;1175 pCtx->ADDR_rDI = uAddrReg += cbIncr;1176 pCtx->ADDR_rCX = --uCounterReg;1175 rcStrict = iemSetPassUpStatus(pIemCpu, rcStrict); 1176 if (uCounterReg == 0) 1177 iemRegAddToRipAndClearRF(pIemCpu, cbInstr); 1177 1178 } 1178 if (rcStrict != VINF_SUCCESS) 1179 { 1180 if (IOM_SUCCESS(rcStrict)) 1181 { 1182 rcStrict = iemSetPassUpStatus(pIemCpu, rcStrict); 1183 if (uCounterReg == 0) 1184 iemRegAddToRipAndClearRF(pIemCpu, cbInstr); 1185 } 1186 iemMemPageUnmap(pIemCpu, GCPhysMem, IEM_ACCESS_DATA_W, puMem, &PgLockMem); 1187 return rcStrict; 1188 } 1189 off++; 1179 return rcStrict; 1190 1180 } 1191 iemMemPageUnmap(pIemCpu, GCPhysMem, IEM_ACCESS_DATA_W, puMem, &PgLockMem);1192 1181 1193 1182 /* If unaligned, we drop thru and do the page crossing access … … 1352 1341 && uAddrReg + (cLeftPage * (OP_SIZE / 8)) <= pHid->u32Limit) 1353 1342 ) 1343 && !IEM_VERIFICATION_ENABLED(pIemCpu) 1354 1344 ) 1355 1345 { … … 1360 1350 1361 1351 /* 1362 * If we can map the page without trouble, we would've liked to use 1363 * an string I/O method to do the work, but the current IOM 1364 * interface doesn't match our current approach. So, do a regular 1365 * loop instead. 1352 * If we can map the page without trouble, we use the IOM 1353 * string I/O interface to do the job. 1366 1354 */ 1367 /** @todo Change the I/O manager interface to make use of1368 * mapped buffers instead of leaving those bits to the1369 * device implementation? */1370 1355 PGMPAGEMAPLOCK PgLockMem; 1371 1356 OP_TYPE const *puMem; … … 1373 1358 if (rcStrict == VINF_SUCCESS) 1374 1359 { 1375 uint32_t off = 0; 1376 while (off < cLeftPage) 1360 uint32_t cTransfers = cLeftPage; 1361 rcStrict = IOMIOPortWriteString(pVM, pVCpu, u16Port, puMem, &cTransfers, OP_SIZE / 8); 1362 1363 uint32_t cActualTransfers = cLeftPage - cTransfers; 1364 Assert(cActualTransfers <= cLeftPage); 1365 pCtx->ADDR_rSI = uAddrReg += cbIncr * cActualTransfers; 1366 pCtx->ADDR_rCX = uCounterReg -= cActualTransfers; 1367 puMem += cActualTransfers; 1368 1369 iemMemPageUnmap(pIemCpu, GCPhysMem, IEM_ACCESS_DATA_R, puMem, &PgLockMem); 1370 1371 if (rcStrict != VINF_SUCCESS) 1377 1372 { 1378 uint32_t u32Value = *puMem++;1379 if (!IEM_VERIFICATION_ENABLED(pIemCpu))1380 rcStrict = IOMIOPortWrite(pVM, pVCpu, u16Port, u32Value, OP_SIZE / 8);1381 else1382 rcStrict = iemVerifyFakeIOPortWrite(pIemCpu, u16Port, u32Value, OP_SIZE / 8);1383 1373 if (IOM_SUCCESS(rcStrict)) 1384 1374 { 1385 pCtx->ADDR_rSI = uAddrReg += cbIncr; 1386 pCtx->ADDR_rCX = --uCounterReg; 1375 rcStrict = iemSetPassUpStatus(pIemCpu, rcStrict); 1376 if (uCounterReg == 0) 1377 iemRegAddToRipAndClearRF(pIemCpu, cbInstr); 1387 1378 } 1388 if (rcStrict != VINF_SUCCESS) 1389 { 1390 if (IOM_SUCCESS(rcStrict)) 1391 { 1392 rcStrict = iemSetPassUpStatus(pIemCpu, rcStrict); 1393 if (uCounterReg == 0) 1394 iemRegAddToRipAndClearRF(pIemCpu, cbInstr); 1395 } 1396 iemMemPageUnmap(pIemCpu, GCPhysMem, IEM_ACCESS_DATA_R, puMem, &PgLockMem); 1397 return rcStrict; 1398 } 1399 off++; 1379 return rcStrict; 1400 1380 } 1401 iemMemPageUnmap(pIemCpu, GCPhysMem, IEM_ACCESS_DATA_R, puMem, &PgLockMem);1402 1381 1403 1382 /* If unaligned, we drop thru and do the page crossing access
Note:
See TracChangeset
for help on using the changeset viewer.