Changeset 7731 in vbox for trunk/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp
- Timestamp:
- Apr 3, 2008 5:05:29 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp
r7723 r7731 159 159 * @warning VBOX_SUCCESS(rc=VINF_IOM_HC_MMIO_WRITE) is TRUE! 160 160 */ 161 DECLINLINE(int) iomMMIODoWrite(PVM pVM, CTXALLSUFF(PIOMMMIORANGE) pRange, RTGCPHYS GCPhysFault, const void *pvData, unsigned cb Size)161 DECLINLINE(int) iomMMIODoWrite(PVM pVM, CTXALLSUFF(PIOMMMIORANGE) pRange, RTGCPHYS GCPhysFault, const void *pvData, unsigned cb) 162 162 { 163 163 #ifdef VBOX_WITH_STATISTICS 164 if (pRange->cb Size<= PAGE_SIZE)164 if (pRange->cb <= PAGE_SIZE) 165 165 { 166 166 PIOMMMIOSTATS pStats = iomMMIOGetStats(&pVM->iom.s, GCPhysFault); … … 168 168 return VINF_IOM_HC_MMIO_WRITE; 169 169 170 int rc = pRange->pfnWriteCallback(pRange->pDevIns, pRange->pvUser, GCPhysFault, (void *)pvData, cb Size); /* @todo fix const!! */170 int rc = pRange->pfnWriteCallback(pRange->pDevIns, pRange->pvUser, GCPhysFault, (void *)pvData, cb); /* @todo fix const!! */ 171 171 if (rc != VINF_IOM_HC_MMIO_WRITE) 172 172 STAM_COUNTER_INC(&pStats->WriteGC); … … 174 174 } 175 175 #endif 176 return pRange->pfnWriteCallback(pRange->pDevIns, pRange->pvUser, GCPhysFault, (void *)pvData, cb Size);176 return pRange->pfnWriteCallback(pRange->pDevIns, pRange->pvUser, GCPhysFault, (void *)pvData, cb); 177 177 } 178 178 … … 180 180 * Wrapper which does the read and updates range statistics when such are enabled. 181 181 */ 182 DECLINLINE(int) iomMMIODoRead(PVM pVM, CTXALLSUFF(PIOMMMIORANGE) pRange, RTGCPHYS GCPhysFault, void *pvData, unsigned cb Size)182 DECLINLINE(int) iomMMIODoRead(PVM pVM, CTXALLSUFF(PIOMMMIORANGE) pRange, RTGCPHYS GCPhysFault, void *pvData, unsigned cb) 183 183 { 184 184 #ifdef VBOX_WITH_STATISTICS 185 if (pRange->cb Size<= PAGE_SIZE)185 if (pRange->cb <= PAGE_SIZE) 186 186 { 187 187 PIOMMMIOSTATS pStats = iomMMIOGetStats(&pVM->iom.s, GCPhysFault); … … 189 189 return VINF_IOM_HC_MMIO_READ; 190 190 191 int rc = pRange->pfnReadCallback(pRange->pDevIns, pRange->pvUser, GCPhysFault, pvData, cb Size);191 int rc = pRange->pfnReadCallback(pRange->pDevIns, pRange->pvUser, GCPhysFault, pvData, cb); 192 192 if (rc != VINF_IOM_HC_MMIO_READ) 193 193 STAM_COUNTER_INC(&pStats->ReadGC); … … 195 195 } 196 196 #endif 197 return pRange->pfnReadCallback(pRange->pDevIns, pRange->pvUser, GCPhysFault, pvData, cb Size);197 return pRange->pfnReadCallback(pRange->pDevIns, pRange->pvUser, GCPhysFault, pvData, cb); 198 198 } 199 199 … … 373 373 * and call the handler function to get the data. 374 374 */ 375 unsigned cb Size= DISGetParamSize(pCpu, &pCpu->param2);376 AssertMsg(cb Size > 0 && cbSize <= sizeof(uint32_t), ("cbSize=%d\n", cbSize));375 unsigned cb = DISGetParamSize(pCpu, &pCpu->param2); 376 AssertMsg(cb > 0 && cb <= sizeof(uint32_t), ("cb=%d\n", cb)); 377 377 378 378 uint32_t u32Data = 0; 379 int rc = iomMMIODoRead(pVM, pRange, GCPhysFault, &u32Data, cb Size);379 int rc = iomMMIODoRead(pVM, pRange, GCPhysFault, &u32Data, cb); 380 380 if (rc == VINF_SUCCESS) 381 381 { … … 386 386 if (pCpu->pCurInstr->opcode == OP_MOVSX) 387 387 { 388 if (cb Size== 1)388 if (cb == 1) 389 389 { 390 390 /* DWORD <- BYTE */ … … 408 408 409 409 if (rc == VINF_SUCCESS) 410 iomMMIOStatLength(pVM, cb Size);410 iomMMIOStatLength(pVM, cb); 411 411 return rc; 412 412 } … … 436 436 * and call the callback to write it. 437 437 */ 438 unsigned cb Size= 0;438 unsigned cb = 0; 439 439 uint32_t u32Data = 0; 440 bool fRc = iomGetRegImmData(pCpu, &pCpu->param2, pRegFrame, &u32Data, &cb Size);440 bool fRc = iomGetRegImmData(pCpu, &pCpu->param2, pRegFrame, &u32Data, &cb); 441 441 AssertMsg(fRc, ("Failed to get reg/imm port number!\n")); NOREF(fRc); 442 442 443 int rc = iomMMIODoWrite(pVM, pRange, GCPhysFault, &u32Data, cb Size);443 int rc = iomMMIODoWrite(pVM, pRange, GCPhysFault, &u32Data, cb); 444 444 if (rc == VINF_SUCCESS) 445 iomMMIOStatLength(pVM, cb Size);445 iomMMIOStatLength(pVM, cb); 446 446 return rc; 447 447 } … … 523 523 * Get data size. 524 524 */ 525 unsigned cb Size= DISGetParamSize(pCpu, &pCpu->param1);526 Assert(cb Size);527 int offIncrement = pRegFrame->eflags.Bits.u1DF ? -(signed)cb Size : (signed)cbSize;525 unsigned cb = DISGetParamSize(pCpu, &pCpu->param1); 526 Assert(cb); 527 int offIncrement = pRegFrame->eflags.Bits.u1DF ? -(signed)cb : (signed)cb; 528 528 529 529 #ifdef VBOX_WITH_STATISTICS 530 if (pVM->iom.s.cMovsMaxBytes < (cTransfers << SIZE_2_SHIFT(cb Size)))531 pVM->iom.s.cMovsMaxBytes = cTransfers << SIZE_2_SHIFT(cb Size);530 if (pVM->iom.s.cMovsMaxBytes < (cTransfers << SIZE_2_SHIFT(cb))) 531 pVM->iom.s.cMovsMaxBytes = cTransfers << SIZE_2_SHIFT(cb); 532 532 #endif 533 533 … … 558 558 559 559 /* Access verification first; we currently can't recover properly from traps inside this instruction */ 560 rc = PGMVerifyAccess(pVM, pu8Virt, cTransfers * cb Size, (cpl == 3) ? X86_PTE_US : 0);560 rc = PGMVerifyAccess(pVM, pu8Virt, cTransfers * cb, (cpl == 3) ? X86_PTE_US : 0); 561 561 if (rc != VINF_SUCCESS) 562 562 { … … 574 574 { 575 575 uint32_t u32Data = 0; 576 rc = iomRamRead(pVM, &u32Data, (RTGCPTR)pu8Virt, cb Size);576 rc = iomRamRead(pVM, &u32Data, (RTGCPTR)pu8Virt, cb); 577 577 if (rc != VINF_SUCCESS) 578 578 break; 579 rc = iomMMIODoWrite(pVM, pRange, Phys, &u32Data, cb Size);579 rc = iomMMIODoWrite(pVM, pRange, Phys, &u32Data, cb); 580 580 if (rc != VINF_SUCCESS) 581 581 break; … … 642 642 { 643 643 uint32_t u32Data; 644 rc = iomMMIODoRead(pVM, pRange, Phys, &u32Data, cb Size);644 rc = iomMMIODoRead(pVM, pRange, Phys, &u32Data, cb); 645 645 if (rc != VINF_SUCCESS) 646 646 break; 647 rc = iomMMIODoWrite(pVM, pMMIODst, PhysDst, &u32Data, cb Size);647 rc = iomMMIODoWrite(pVM, pMMIODst, PhysDst, &u32Data, cb); 648 648 if (rc != VINF_SUCCESS) 649 649 break; … … 666 666 667 667 /* Access verification first; we currently can't recover properly from traps inside this instruction */ 668 rc = PGMVerifyAccess(pVM, pu8Virt, cTransfers * cb Size, X86_PTE_RW | ((cpl == 3) ? X86_PTE_US : 0));668 rc = PGMVerifyAccess(pVM, pu8Virt, cTransfers * cb, X86_PTE_RW | ((cpl == 3) ? X86_PTE_US : 0)); 669 669 if (rc != VINF_SUCCESS) 670 670 { … … 681 681 { 682 682 uint32_t u32Data; 683 rc = iomMMIODoRead(pVM, pRange, Phys, &u32Data, cb Size);683 rc = iomMMIODoRead(pVM, pRange, Phys, &u32Data, cb); 684 684 if (rc != VINF_SUCCESS) 685 685 break; 686 rc = iomRamWrite(pVM, (RTGCPTR)pu8Virt, &u32Data, cb Size);686 rc = iomRamWrite(pVM, (RTGCPTR)pu8Virt, &u32Data, cb); 687 687 if (rc != VINF_SUCCESS) 688 688 { 689 Log(("iomRamWrite %08X size=%d failed with %d\n", pu8Virt, cb Size, rc));689 Log(("iomRamWrite %08X size=%d failed with %d\n", pu8Virt, cb, rc)); 690 690 break; 691 691 } … … 712 712 { 713 713 STAM_PROFILE_STOP(&pVM->iom.s.StatGCInstMovs, a); 714 iomMMIOStatLength(pVM, cb Size);714 iomMMIOStatLength(pVM, cb); 715 715 } 716 716 return rc; … … 763 763 * Get data size. 764 764 */ 765 unsigned cb Size= DISGetParamSize(pCpu, &pCpu->param1);766 Assert(cb Size);767 int offIncrement = pRegFrame->eflags.Bits.u1DF ? -(signed)cb Size : (signed)cbSize;765 unsigned cb = DISGetParamSize(pCpu, &pCpu->param1); 766 Assert(cb); 767 int offIncrement = pRegFrame->eflags.Bits.u1DF ? -(signed)cb : (signed)cb; 768 768 769 769 #ifdef VBOX_WITH_STATISTICS 770 if (pVM->iom.s.cStosMaxBytes < (cTransfers << SIZE_2_SHIFT(cb Size)))771 pVM->iom.s.cStosMaxBytes = cTransfers << SIZE_2_SHIFT(cb Size);770 if (pVM->iom.s.cStosMaxBytes < (cTransfers << SIZE_2_SHIFT(cb))) 771 pVM->iom.s.cStosMaxBytes = cTransfers << SIZE_2_SHIFT(cb); 772 772 #endif 773 773 … … 785 785 { 786 786 /* addr++ variant. */ 787 rc = pRange->pfnFillCallback(pRange->pDevIns, pRange->pvUser, Phys, u32Data, cb Size, cTransfers);787 rc = pRange->pfnFillCallback(pRange->pDevIns, pRange->pvUser, Phys, u32Data, cb, cTransfers); 788 788 if (rc == VINF_SUCCESS) 789 789 { 790 790 /* Update registers. */ 791 pRegFrame->edi += cTransfers << SIZE_2_SHIFT(cb Size);791 pRegFrame->edi += cTransfers << SIZE_2_SHIFT(cb); 792 792 if (pCpu->prefix & PREFIX_REP) 793 793 pRegFrame->ecx = 0; … … 797 797 { 798 798 /* addr-- variant. */ 799 rc = pRange->pfnFillCallback(pRange->pDevIns, pRange->pvUser, (Phys - (cTransfers - 1)) << SIZE_2_SHIFT(cb Size), u32Data, cbSize, cTransfers);799 rc = pRange->pfnFillCallback(pRange->pDevIns, pRange->pvUser, (Phys - (cTransfers - 1)) << SIZE_2_SHIFT(cb), u32Data, cb, cTransfers); 800 800 if (rc == VINF_SUCCESS) 801 801 { 802 802 /* Update registers. */ 803 pRegFrame->edi -= cTransfers << SIZE_2_SHIFT(cb Size);803 pRegFrame->edi -= cTransfers << SIZE_2_SHIFT(cb); 804 804 if (pCpu->prefix & PREFIX_REP) 805 805 pRegFrame->ecx = 0; … … 819 819 do 820 820 { 821 rc = iomMMIODoWrite(pVM, pRange, Phys, &u32Data, cb Size);821 rc = iomMMIODoWrite(pVM, pRange, Phys, &u32Data, cb); 822 822 if (rc != VINF_SUCCESS) 823 823 break; … … 839 839 { 840 840 STAM_PROFILE_STOP(&pVM->iom.s.StatGCInstStos, a); 841 iomMMIOStatLength(pVM, cb Size);841 iomMMIOStatLength(pVM, cb); 842 842 } 843 843 return rc; … … 878 878 * Get data size. 879 879 */ 880 unsigned cb Size= DISGetParamSize(pCpu, &pCpu->param2);881 Assert(cb Size);882 int offIncrement = pRegFrame->eflags.Bits.u1DF ? -(signed)cb Size : (signed)cbSize;880 unsigned cb = DISGetParamSize(pCpu, &pCpu->param2); 881 Assert(cb); 882 int offIncrement = pRegFrame->eflags.Bits.u1DF ? -(signed)cb : (signed)cb; 883 883 884 884 /* 885 885 * Perform read. 886 886 */ 887 int rc = iomMMIODoRead(pVM, pRange, GCPhysFault, &pRegFrame->eax, cb Size);887 int rc = iomMMIODoRead(pVM, pRange, GCPhysFault, &pRegFrame->eax, cb); 888 888 if (rc == VINF_SUCCESS) 889 889 pRegFrame->esi += offIncrement; … … 895 895 { 896 896 STAM_PROFILE_STOP(&pVM->iom.s.StatGCInstLods, a1); 897 iomMMIOStatLength(pVM, cb Size);897 iomMMIOStatLength(pVM, cb); 898 898 } 899 899 return rc; … … 927 927 * Get the operands. 928 928 */ 929 unsigned cb Size= 0;929 unsigned cb = 0; 930 930 uint32_t uData1; 931 931 uint32_t uData2; 932 932 int rc; 933 if (iomGetRegImmData(pCpu, &pCpu->param1, pRegFrame, &uData1, &cb Size))933 if (iomGetRegImmData(pCpu, &pCpu->param1, pRegFrame, &uData1, &cb)) 934 934 /* cmp reg, [MMIO]. */ 935 rc = iomMMIODoRead(pVM, pRange, GCPhysFault, &uData2, cb Size);936 else if (iomGetRegImmData(pCpu, &pCpu->param2, pRegFrame, &uData2, &cb Size))935 rc = iomMMIODoRead(pVM, pRange, GCPhysFault, &uData2, cb); 936 else if (iomGetRegImmData(pCpu, &pCpu->param2, pRegFrame, &uData2, &cb)) 937 937 /* cmp [MMIO], reg|imm. */ 938 rc = iomMMIODoRead(pVM, pRange, GCPhysFault, &uData1, cb Size);938 rc = iomMMIODoRead(pVM, pRange, GCPhysFault, &uData1, cb); 939 939 else 940 940 { … … 946 946 { 947 947 /* Emulate CMP and update guest flags. */ 948 uint32_t eflags = EMEmulateCmp(uData1, uData2, cb Size);948 uint32_t eflags = EMEmulateCmp(uData1, uData2, cb); 949 949 pRegFrame->eflags.u32 = (pRegFrame->eflags.u32 & ~(X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_ZF | X86_EFL_SF | X86_EFL_OF)) 950 950 | (eflags & (X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_ZF | X86_EFL_SF | X86_EFL_OF)); 951 951 952 952 STAM_PROFILE_STOP(&pVM->iom.s.StatGCInstCmp, a1); 953 iomMMIOStatLength(pVM, cb Size);953 iomMMIOStatLength(pVM, cb); 954 954 } 955 955 … … 979 979 /* Check read callback. */ 980 980 981 unsigned cb Size= 0;981 unsigned cb = 0; 982 982 uint32_t uData1; 983 983 uint32_t uData2; 984 984 bool fAndWrite; 985 985 int rc; 986 if (iomGetRegImmData(pCpu, &pCpu->param1, pRegFrame, &uData1, &cb Size))986 if (iomGetRegImmData(pCpu, &pCpu->param1, pRegFrame, &uData1, &cb)) 987 987 { 988 988 /* and reg, [MMIO]. */ 989 989 fAndWrite = false; 990 990 if (pRange->pfnReadCallback) 991 rc = iomMMIODoRead(pVM, pRange, GCPhysFault, &uData2, cb Size);991 rc = iomMMIODoRead(pVM, pRange, GCPhysFault, &uData2, cb); 992 992 else 993 993 rc = VINF_IOM_HC_MMIO_READ; 994 994 } 995 else if (iomGetRegImmData(pCpu, &pCpu->param2, pRegFrame, &uData2, &cb Size))995 else if (iomGetRegImmData(pCpu, &pCpu->param2, pRegFrame, &uData2, &cb)) 996 996 { 997 997 /* and [MMIO], reg|imm. */ 998 998 fAndWrite = true; 999 999 if (pRange->pfnReadCallback && pRange->pfnWriteCallback) 1000 rc = iomMMIODoRead(pVM, pRange, GCPhysFault, &uData1, cb Size);1000 rc = iomMMIODoRead(pVM, pRange, GCPhysFault, &uData1, cb); 1001 1001 else 1002 1002 rc = VINF_IOM_HC_MMIO_READ_WRITE; … … 1011 1011 { 1012 1012 /* Emulate AND and update guest flags. */ 1013 uint32_t eflags = EMEmulateAnd(&uData1, uData2, cb Size);1013 uint32_t eflags = EMEmulateAnd(&uData1, uData2, cb); 1014 1014 if (fAndWrite) 1015 1015 /* Store result to MMIO. */ 1016 rc = iomMMIODoWrite(pVM, pRange, GCPhysFault, &uData1, cb Size);1016 rc = iomMMIODoWrite(pVM, pRange, GCPhysFault, &uData1, cb); 1017 1017 else 1018 1018 { … … 1027 1027 | (eflags & (X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_ZF | X86_EFL_SF | X86_EFL_OF)); 1028 1028 STAM_PROFILE_STOP(&pVM->iom.s.StatGCInstAnd, a1); 1029 iomMMIOStatLength(pVM, cb Size);1029 iomMMIOStatLength(pVM, cb); 1030 1030 } 1031 1031 } … … 1057 1057 /* Check read callback. */ 1058 1058 1059 unsigned cb Size= 0;1059 unsigned cb = 0; 1060 1060 uint32_t uData1; 1061 1061 uint32_t uData2; 1062 1062 int rc; 1063 1063 1064 if (iomGetRegImmData(pCpu, &pCpu->param1, pRegFrame, &uData1, &cb Size))1064 if (iomGetRegImmData(pCpu, &pCpu->param1, pRegFrame, &uData1, &cb)) 1065 1065 { 1066 1066 /* and test, [MMIO]. */ 1067 1067 if (pRange->pfnReadCallback) 1068 rc = iomMMIODoRead(pVM, pRange, GCPhysFault, &uData2, cb Size);1068 rc = iomMMIODoRead(pVM, pRange, GCPhysFault, &uData2, cb); 1069 1069 else 1070 1070 rc = VINF_IOM_HC_MMIO_READ; 1071 1071 } 1072 else if (iomGetRegImmData(pCpu, &pCpu->param2, pRegFrame, &uData2, &cb Size))1072 else if (iomGetRegImmData(pCpu, &pCpu->param2, pRegFrame, &uData2, &cb)) 1073 1073 { 1074 1074 /* test [MMIO], reg|imm. */ 1075 1075 if (pRange->pfnReadCallback) 1076 rc = iomMMIODoRead(pVM, pRange, GCPhysFault, &uData1, cb Size);1076 rc = iomMMIODoRead(pVM, pRange, GCPhysFault, &uData1, cb); 1077 1077 else 1078 1078 rc = VINF_IOM_HC_MMIO_READ; … … 1087 1087 { 1088 1088 /* Emulate TEST (=AND without write back) and update guest EFLAGS. */ 1089 uint32_t eflags = EMEmulateAnd(&uData1, uData2, cb Size);1089 uint32_t eflags = EMEmulateAnd(&uData1, uData2, cb); 1090 1090 pRegFrame->eflags.u32 = (pRegFrame->eflags.u32 & ~(X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_ZF | X86_EFL_SF | X86_EFL_OF)) 1091 1091 | (eflags & (X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_ZF | X86_EFL_SF | X86_EFL_OF)); 1092 1092 STAM_PROFILE_STOP(&pVM->iom.s.StatGCInstTest, a1); 1093 iomMMIOStatLength(pVM, cb Size);1093 iomMMIOStatLength(pVM, cb); 1094 1094 } 1095 1095 … … 1117 1117 1118 1118 /* Check read callback. */ 1119 unsigned cb Size= 0;1119 unsigned cb = 0; 1120 1120 uint32_t uData1; 1121 1121 uint32_t uData2; … … 1128 1128 } 1129 1129 1130 if (iomGetRegImmData(pCpu, &pCpu->param1, pRegFrame, &uData1, &cb Size))1130 if (iomGetRegImmData(pCpu, &pCpu->param1, pRegFrame, &uData1, &cb)) 1131 1131 { 1132 1132 /* xchg reg, [MMIO]. */ 1133 rc = iomMMIODoRead(pVM, pRange, GCPhysFault, &uData2, cb Size);1133 rc = iomMMIODoRead(pVM, pRange, GCPhysFault, &uData2, cb); 1134 1134 if (rc == VINF_SUCCESS) 1135 1135 { 1136 1136 /* Store result to MMIO. */ 1137 rc = iomMMIODoWrite(pVM, pRange, GCPhysFault, &uData1, cb Size);1137 rc = iomMMIODoWrite(pVM, pRange, GCPhysFault, &uData1, cb); 1138 1138 1139 1139 if (rc == VINF_SUCCESS) … … 1150 1150 } 1151 1151 else 1152 if (iomGetRegImmData(pCpu, &pCpu->param2, pRegFrame, &uData2, &cb Size))1152 if (iomGetRegImmData(pCpu, &pCpu->param2, pRegFrame, &uData2, &cb)) 1153 1153 { 1154 1154 /* xchg [MMIO], reg. */ 1155 rc = iomMMIODoRead(pVM, pRange, GCPhysFault, &uData1, cb Size);1155 rc = iomMMIODoRead(pVM, pRange, GCPhysFault, &uData1, cb); 1156 1156 if (rc == VINF_SUCCESS) 1157 1157 { 1158 1158 /* Store result to MMIO. */ 1159 rc = iomMMIODoWrite(pVM, pRange, GCPhysFault, &uData2, cb Size);1159 rc = iomMMIODoWrite(pVM, pRange, GCPhysFault, &uData2, cb); 1160 1160 1161 1161 if (rc == VINF_SUCCESS) … … 1412 1412 #ifdef VBOX_WITH_STATISTICS 1413 1413 PIOMMMIOSTATS pStats = iomMMIOGetStats(&pVM->iom.s, GCPhys); 1414 if (!pStats && (!pRange || pRange->cb Size<= PAGE_SIZE))1414 if (!pStats && (!pRange || pRange->cb <= PAGE_SIZE)) 1415 1415 # ifdef IN_RING3 1416 1416 pStats = iomR3MMIOStatsCreate(pVM, GCPhys, pRange ? pRange->pszDesc : NULL); … … 1513 1513 #ifdef VBOX_WITH_STATISTICS 1514 1514 PIOMMMIOSTATS pStats = iomMMIOGetStats(&pVM->iom.s, GCPhys); 1515 if (!pStats && (!pRange || pRange->cb Size<= PAGE_SIZE))1515 if (!pStats && (!pRange || pRange->cb <= PAGE_SIZE)) 1516 1516 # ifdef IN_RING3 1517 1517 pStats = iomR3MMIOStatsCreate(pVM, GCPhys, pRange ? pRange->pszDesc : NULL); … … 1707 1707 * disassembler). And get the I/O register size from the opcode / prefix. 1708 1708 */ 1709 uint32_t uPort = pRegFrame->edx & 0xffff;1710 unsigned cb Size= 0;1709 RTIOPORT Port = pRegFrame->edx & 0xffff; 1710 unsigned cb = 0; 1711 1711 if (pCpu->pCurInstr->opcode == OP_INSB) 1712 cb Size= 1;1712 cb = 1; 1713 1713 else 1714 cb Size= pCpu->opmode == CPUMODE_32BIT ? 4 : 2;1715 1716 int rc = IOMInterpretCheckPortIOAccess(pVM, pRegFrame, uPort, cbSize);1714 cb = pCpu->opmode == CPUMODE_32BIT ? 4 : 2; 1715 1716 int rc = IOMInterpretCheckPortIOAccess(pVM, pRegFrame, Port, cb); 1717 1717 if (RT_UNLIKELY(rc != VINF_SUCCESS)) 1718 1718 { … … 1721 1721 } 1722 1722 1723 return IOMInterpretINSEx(pVM, pRegFrame, uPort, pCpu->prefix, cbSize);1723 return IOMInterpretINSEx(pVM, pRegFrame, Port, pCpu->prefix, cb); 1724 1724 } 1725 1725 … … 1865 1865 * And get the I/O register size from the opcode / prefix. 1866 1866 */ 1867 uint32_t uPort = 0;1868 unsigned cb Size= 0;1869 bool fRc = iomGetRegImmData(pCpu, &pCpu->param1, pRegFrame, & uPort, &cbSize);1867 uint32_t Port = 0; 1868 unsigned cb = 0; 1869 bool fRc = iomGetRegImmData(pCpu, &pCpu->param1, pRegFrame, &Port, &cb); 1870 1870 AssertMsg(fRc, ("Failed to get reg/imm port number!\n")); NOREF(fRc); 1871 1871 if (pCpu->pCurInstr->opcode == OP_OUTSB) 1872 cb Size= 1;1872 cb = 1; 1873 1873 else 1874 cb Size= (pCpu->opmode == CPUMODE_32BIT) ? 4 : 2;1875 1876 int rc = IOMInterpretCheckPortIOAccess(pVM, pRegFrame, uPort, cbSize);1874 cb = (pCpu->opmode == CPUMODE_32BIT) ? 4 : 2; 1875 1876 int rc = IOMInterpretCheckPortIOAccess(pVM, pRegFrame, Port, cb); 1877 1877 if (RT_UNLIKELY(rc != VINF_SUCCESS)) 1878 1878 { … … 1881 1881 } 1882 1882 1883 return IOMInterpretOUTSEx(pVM, pRegFrame, uPort, pCpu->prefix, cbSize);1884 } 1885 1883 return IOMInterpretOUTSEx(pVM, pRegFrame, Port, pCpu->prefix, cb); 1884 } 1885
Note:
See TracChangeset
for help on using the changeset viewer.