vbox的更動 8234 路徑 trunk/src/VBox/VMM/VMMAll/IOMAll.cpp
- 時間撮記:
- 2008-4-21 下午02:29:54 (17 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/VMM/VMMAll/IOMAll.cpp
r8155 r8234 46 46 * @param pParam Pointer to parameter of instruction to proccess. 47 47 */ 48 static unsigned iomG CGetRegSize(PDISCPUSTATE pCpu, PCOP_PARAMETER pParam)48 static unsigned iomGetRegSize(PDISCPUSTATE pCpu, PCOP_PARAMETER pParam) 49 49 { 50 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)) … … 59 59 if (pParam->flags & USE_REG_GEN8) 60 60 return 1; 61 62 if (pParam->flags & USE_REG_GEN64) 63 return 8; 61 64 62 65 if (pParam->flags & USE_REG_SEG) … … 77 80 * @param pcbSize Where to store the size of data (1, 2, 4). 78 81 */ 79 static bool iomGCGetRegImmData(PDISCPUSTATE pCpu, PCOP_PARAMETER pParam, PCPUMCTXCORE pRegFrame, uint32_t *pu32Data, unsigned *pcbSize)82 bool iomGetRegImmData(PDISCPUSTATE pCpu, PCOP_PARAMETER pParam, PCPUMCTXCORE pRegFrame, uint32_t *pu32Data, unsigned *pcbSize) 80 83 { 81 84 if (pParam->flags & (USE_BASE | USE_INDEX | USE_SCALE | USE_DISPLACEMENT8 | USE_DISPLACEMENT16 | USE_DISPLACEMENT32)) … … 89 92 { 90 93 *pcbSize = 4; 91 DISFetchReg32(pRegFrame, pParam->base.reg_gen 32, pu32Data);94 DISFetchReg32(pRegFrame, pParam->base.reg_gen, pu32Data); 92 95 return true; 93 96 } … … 96 99 { 97 100 *pcbSize = 2; 98 DISFetchReg16(pRegFrame, pParam->base.reg_gen 16, (uint16_t *)pu32Data);101 DISFetchReg16(pRegFrame, pParam->base.reg_gen, (uint16_t *)pu32Data); 99 102 return true; 100 103 } … … 103 106 { 104 107 *pcbSize = 1; 105 DISFetchReg8(pRegFrame, pParam->base.reg_gen8, (uint8_t *)pu32Data); 108 DISFetchReg8(pRegFrame, pParam->base.reg_gen, (uint8_t *)pu32Data); 109 return true; 110 } 111 112 if (pParam->flags & USE_REG_GEN64) 113 { 114 AssertFailed(); 115 *pcbSize = 8; 116 ///DISFetchReg64(pRegFrame, pParam->base.reg_gen, pu32Data); 117 return true; 118 } 119 120 if (pParam->flags & (USE_IMMEDIATE64)) 121 { 122 AssertFailed(); 123 *pcbSize = 8; 124 *pu32Data = (uint32_t)pParam->parval; 106 125 return true; 107 126 } … … 110 129 { 111 130 *pcbSize = 4; 112 *pu32Data = (uint32_t)pParam->parval;131 //*pu32Data = (uint32_t)pParam->parval; 113 132 return true; 114 133 } … … 135 154 } /* Else - error. */ 136 155 156 AssertFailed(); 137 157 *pcbSize = 0; 138 158 *pu32Data = 0; … … 151 171 * @param u32Data 8/16/32 bit data to store. 152 172 */ 153 static bool iomGCSaveDataToReg(PDISCPUSTATE pCpu, PCOP_PARAMETER pParam, PCPUMCTXCORE pRegFrame, unsigned u32Data)173 bool iomSaveDataToReg(PDISCPUSTATE pCpu, PCOP_PARAMETER pParam, PCPUMCTXCORE pRegFrame, unsigned u32Data) 154 174 { 155 175 if (pParam->flags & (USE_BASE | USE_INDEX | USE_SCALE | USE_DISPLACEMENT8 | USE_DISPLACEMENT16 | USE_DISPLACEMENT32 | USE_IMMEDIATE8 | USE_IMMEDIATE16 | USE_IMMEDIATE32 | USE_IMMEDIATE32_SX8 | USE_IMMEDIATE16_SX8)) … … 160 180 if (pParam->flags & USE_REG_GEN32) 161 181 { 162 DISWriteReg32(pRegFrame, pParam->base.reg_gen 32, u32Data);182 DISWriteReg32(pRegFrame, pParam->base.reg_gen, u32Data); 163 183 return true; 164 184 } … … 166 186 if (pParam->flags & USE_REG_GEN16) 167 187 { 168 DISWriteReg16(pRegFrame, pParam->base.reg_gen 16, (uint16_t)u32Data);188 DISWriteReg16(pRegFrame, pParam->base.reg_gen, (uint16_t)u32Data); 169 189 return true; 170 190 } … … 172 192 if (pParam->flags & USE_REG_GEN8) 173 193 { 174 DISWriteReg8(pRegFrame, pParam->base.reg_gen 8, (uint8_t)u32Data);194 DISWriteReg8(pRegFrame, pParam->base.reg_gen, (uint8_t)u32Data); 175 195 return true; 176 196 } … … 189 209 * Internal - statistics only. 190 210 */ 191 DECLINLINE(void) iom GCMMIOStatLength(PVM pVM, unsigned cb)211 DECLINLINE(void) iomMMIOStatLength(PVM pVM, unsigned cb) 192 212 { 193 213 #ifdef VBOX_WITH_STATISTICS … … 857 877 uint32_t uPort = 0; 858 878 unsigned cbSize = 0; 859 bool fRc = iomG CGetRegImmData(pCpu, &pCpu->param2, pRegFrame, &uPort, &cbSize);879 bool fRc = iomGetRegImmData(pCpu, &pCpu->param2, pRegFrame, &uPort, &cbSize); 860 880 AssertMsg(fRc, ("Failed to get reg/imm port number!\n")); NOREF(fRc); 861 881 862 cbSize = iomG CGetRegSize(pCpu, &pCpu->param1);882 cbSize = iomGetRegSize(pCpu, &pCpu->param1); 863 883 Assert(cbSize > 0); 864 884 int rc = IOMInterpretCheckPortIOAccess(pVM, pRegFrame, uPort, cbSize); … … 875 895 * Store the result in the AL|AX|EAX register. 876 896 */ 877 fRc = iom GCSaveDataToReg(pCpu, &pCpu->param1, pRegFrame, u32Data);897 fRc = iomSaveDataToReg(pCpu, &pCpu->param1, pRegFrame, u32Data); 878 898 AssertMsg(fRc, ("Failed to store register value!\n")); NOREF(fRc); 879 899 } … … 916 936 uint32_t uPort = 0; 917 937 unsigned cbSize = 0; 918 bool fRc = iomG CGetRegImmData(pCpu, &pCpu->param1, pRegFrame, &uPort, &cbSize);938 bool fRc = iomGetRegImmData(pCpu, &pCpu->param1, pRegFrame, &uPort, &cbSize); 919 939 AssertMsg(fRc, ("Failed to get reg/imm port number!\n")); NOREF(fRc); 920 940 … … 923 943 { 924 944 uint32_t u32Data = 0; 925 fRc = iomG CGetRegImmData(pCpu, &pCpu->param2, pRegFrame, &u32Data, &cbSize);945 fRc = iomGetRegImmData(pCpu, &pCpu->param2, pRegFrame, &u32Data, &cbSize); 926 946 AssertMsg(fRc, ("Failed to get reg value!\n")); NOREF(fRc); 927 947
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器