vbox的更動 11509 路徑 trunk/src/VBox/VMM/VMMAll/EMAll.cpp
- 時間撮記:
- 2008-8-20 上午10:58:44 (16 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r11492 r11509 1439 1439 * [LOCK] CMPXCHG emulation. 1440 1440 */ 1441 #ifdef IN_GC 1441 #ifndef IN_GC 1442 static int emInterpretCmpXchg(PVM pVM, PDISCPUSTATE pCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, uint32_t *pcbSize) 1443 { 1444 OP_PARAMVAL param1, param2; 1445 1446 #ifdef LOG_ENABLED 1447 const char *pszInstr; 1448 1449 if (pCpu->prefix & PREFIX_LOCK) 1450 pszInstr = "Lock CmpXchg"; 1451 else 1452 pszInstr = "CmpXchg"; 1453 #endif 1454 1455 /* Source to make DISQueryParamVal read the register value - ugly hack */ 1456 int rc = DISQueryParamVal(pRegFrame, pCpu, &pCpu->param1, ¶m1, PARAM_SOURCE); 1457 if(VBOX_FAILURE(rc)) 1458 return VERR_EM_INTERPRETER; 1459 1460 rc = DISQueryParamVal(pRegFrame, pCpu, &pCpu->param2, ¶m2, PARAM_SOURCE); 1461 if(VBOX_FAILURE(rc)) 1462 return VERR_EM_INTERPRETER; 1463 1464 RTGCPTR GCPtrPar1; 1465 void *pvParam1; 1466 uint64_t valpar, eflags; 1467 1468 AssertReturn(pCpu->param1.size == pCpu->param2.size, VERR_EM_INTERPRETER); 1469 switch(param1.type) 1470 { 1471 case PARMTYPE_ADDRESS: 1472 GCPtrPar1 = param1.val.val64; 1473 GCPtrPar1 = emConvertToFlatAddr(pVM, pRegFrame, pCpu, &pCpu->param1, GCPtrPar1); 1474 1475 rc = PGMPhysGCPtr2HCPtr(pVM, GCPtrPar1, &pvParam1); 1476 if (VBOX_FAILURE(rc)) 1477 { 1478 AssertRC(rc); 1479 return VERR_EM_INTERPRETER; 1480 } 1481 break; 1482 1483 default: 1484 return VERR_EM_INTERPRETER; 1485 } 1486 1487 switch(param2.type) 1488 { 1489 case PARMTYPE_IMMEDIATE: /* register actually */ 1490 valpar = param2.val.val64; 1491 break; 1492 1493 default: 1494 return VERR_EM_INTERPRETER; 1495 } 1496 1497 LogFlow(("%s %VGv rax=%RX64 %RX64\n", pszInstr, GCPtrPar1, pRegFrame->rax, valpar)); 1498 1499 if (pCpu->prefix & PREFIX_LOCK) 1500 eflags = EMEmulateLockCmpXchg(pvParam1, &pRegFrame->rax, valpar, pCpu->param2.size); 1501 else 1502 eflags = EMEmulateCmpXchg(pvParam1, &pRegFrame->rax, valpar, pCpu->param2.size); 1503 1504 LogFlow(("%s %VGv rax=%RX64 %RX64 ZF=%d\n", pszInstr, GCPtrPar1, pRegFrame->rax, valpar, !!(eflags & X86_EFL_ZF))); 1505 1506 /* Update guest's eflags and finish. */ 1507 pRegFrame->eflags.u32 = (pRegFrame->eflags.u32 & ~(X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_ZF | X86_EFL_SF | X86_EFL_OF)) 1508 | (eflags & (X86_EFL_CF | X86_EFL_PF | X86_EFL_AF | X86_EFL_ZF | X86_EFL_SF | X86_EFL_OF)); 1509 1510 *pcbSize = param2.size; 1511 return VINF_SUCCESS; 1512 } 1513 1514 #else 1442 1515 static int emInterpretCmpXchg(PVM pVM, PDISCPUSTATE pCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, uint32_t *pcbSize) 1443 1516 {
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器