Changeset 15633 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Dec 17, 2008 3:08:11 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 41155
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/EMInternal.h
r13742 r15633 148 148 STAMCOUNTER StatRZLmsw; 149 149 STAMCOUNTER StatR3Lmsw; 150 STAMCOUNTER StatRZSmsw; 151 STAMCOUNTER StatR3Smsw; 150 152 151 153 STAMCOUNTER StatRZInterpretFailed; … … 200 202 STAMCOUNTER StatRZFailedLmsw; 201 203 STAMCOUNTER StatR3FailedLmsw; 204 STAMCOUNTER StatRZFailedSmsw; 205 STAMCOUNTER StatR3FailedSmsw; 202 206 203 207 STAMCOUNTER StatRZFailedAdd; -
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r15632 r15633 2214 2214 return EMInterpretLMSW(pVM, pRegFrame, val); 2215 2215 } 2216 2217 #ifdef EM_EMULATE_SMSW 2218 /** 2219 * SMSW Emulation. 2220 */ 2221 static int emInterpretSmsw(PVM pVM, PDISCPUSTATE pCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, uint32_t *pcbSize) 2222 { 2223 OP_PARAMVAL param1; 2224 uint64_t cr0 = CPUMGetGuestCR0(pVM); 2225 2226 int rc = DISQueryParamVal(pRegFrame, pCpu, &pCpu->param1, ¶m1, PARAM_SOURCE); 2227 if(RT_FAILURE(rc)) 2228 return VERR_EM_INTERPRETER; 2229 2230 switch(param1.type) 2231 { 2232 case PARMTYPE_IMMEDIATE: 2233 if(!(param1.flags & PARAM_VAL16)) 2234 return VERR_EM_INTERPRETER; 2235 rc = DISWriteReg16(pRegFrame, pCpu->param1.base.reg_gen, cr0); 2236 break; 2237 2238 case PARMTYPE_ADDRESS: 2239 { 2240 RTGCPTR pParam1; 2241 2242 /* Actually forced to 16 bits regardless of the operand size. */ 2243 if(!(param1.flags & PARAM_VAL16)) 2244 return VERR_EM_INTERPRETER; 2245 2246 pParam1 = (RTGCPTR)param1.val.val64; 2247 pParam1 = emConvertToFlatAddr(pVM, pRegFrame, pCpu, &pCpu->param1, pParam1); 2248 2249 rc = emRamWrite(pVM, pParam1, &cr0, sizeof(uint16_t)); 2250 if (RT_FAILURE(rc)) 2251 { 2252 AssertMsgFailed(("emRamWrite %RGv size=%d failed with %Rrc\n", pParam1, param1.size, rc)); 2253 return VERR_EM_INTERPRETER; 2254 } 2255 break; 2256 } 2257 2258 default: 2259 return VERR_EM_INTERPRETER; 2260 } 2261 2262 LogFlow(("emInterpretSmsw %x\n", cr0)); 2263 return rc; 2264 } 2265 #endif 2216 2266 2217 2267 /** … … 3097 3147 #endif 3098 3148 INTERPRET_CASE(OP_LMSW,Lmsw); 3149 #ifdef EM_EMULATE_SMSW 3150 INTERPRET_CASE(OP_SMSW,Smsw); 3151 #endif 3099 3152 INTERPRET_CASE(OP_CLTS,Clts); 3100 3153 INTERPRET_CASE(OP_MONITOR, Monitor);
Note:
See TracChangeset
for help on using the changeset viewer.