vbox的更動 55029 路徑 trunk/src/recompiler
- 時間撮記:
- 2015-3-31 下午01:08:19 (10 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/recompiler/VBoxRecompiler.c
r54898 r55029 50 50 51 51 #include <VBox/log.h> 52 #include <iprt/alloca.h> 52 53 #include <iprt/semaphore.h> 53 54 #include <iprt/asm.h> … … 1389 1390 if (HMIsEnabled(env->pVM)) 1390 1391 { 1392 #ifdef RT_OS_WINDOWS 1393 PCPUMCTX pCtx = alloca(sizeof(*pCtx)); 1394 #else 1391 1395 CPUMCTX Ctx; 1396 PCPUMCTX pCtx = &Ctx; 1397 #endif 1392 1398 1393 1399 env->state |= CPU_RAW_HM; … … 1402 1408 * Create partial context for HMR3CanExecuteGuest 1403 1409 */ 1404 Ctx.cr0 = env->cr[0];1405 Ctx.cr3 = env->cr[3];1406 Ctx.cr4 = env->cr[4];1407 1408 Ctx.tr.Sel = env->tr.selector;1409 Ctx.tr.ValidSel = env->tr.selector;1410 Ctx.tr.fFlags = CPUMSELREG_FLAGS_VALID;1411 Ctx.tr.u64Base = env->tr.base;1412 Ctx.tr.u32Limit = env->tr.limit;1413 Ctx.tr.Attr.u = (env->tr.flags >> SEL_FLAGS_SHIFT) & SEL_FLAGS_SMASK;1414 1415 Ctx.ldtr.Sel = env->ldt.selector;1416 Ctx.ldtr.ValidSel = env->ldt.selector;1417 Ctx.ldtr.fFlags = CPUMSELREG_FLAGS_VALID;1418 Ctx.ldtr.u64Base = env->ldt.base;1419 Ctx.ldtr.u32Limit = env->ldt.limit;1420 Ctx.ldtr.Attr.u = (env->ldt.flags >> SEL_FLAGS_SHIFT) & SEL_FLAGS_SMASK;1421 1422 Ctx.idtr.cbIdt = env->idt.limit;1423 Ctx.idtr.pIdt = env->idt.base;1424 1425 Ctx.gdtr.cbGdt = env->gdt.limit;1426 Ctx.gdtr.pGdt = env->gdt.base;1427 1428 Ctx.rsp = env->regs[R_ESP];1429 Ctx.rip = env->eip;1430 1431 Ctx.eflags.u32 = env->eflags;1432 1433 Ctx.cs.Sel = env->segs[R_CS].selector;1434 Ctx.cs.ValidSel = env->segs[R_CS].selector;1435 Ctx.cs.fFlags = CPUMSELREG_FLAGS_VALID;1436 Ctx.cs.u64Base = env->segs[R_CS].base;1437 Ctx.cs.u32Limit = env->segs[R_CS].limit;1438 Ctx.cs.Attr.u = (env->segs[R_CS].flags >> SEL_FLAGS_SHIFT) & SEL_FLAGS_SMASK;1439 1440 Ctx.ds.Sel = env->segs[R_DS].selector;1441 Ctx.ds.ValidSel = env->segs[R_DS].selector;1442 Ctx.ds.fFlags = CPUMSELREG_FLAGS_VALID;1443 Ctx.ds.u64Base = env->segs[R_DS].base;1444 Ctx.ds.u32Limit = env->segs[R_DS].limit;1445 Ctx.ds.Attr.u = (env->segs[R_DS].flags >> SEL_FLAGS_SHIFT) & SEL_FLAGS_SMASK;1446 1447 Ctx.es.Sel = env->segs[R_ES].selector;1448 Ctx.es.ValidSel = env->segs[R_ES].selector;1449 Ctx.es.fFlags = CPUMSELREG_FLAGS_VALID;1450 Ctx.es.u64Base = env->segs[R_ES].base;1451 Ctx.es.u32Limit = env->segs[R_ES].limit;1452 Ctx.es.Attr.u = (env->segs[R_ES].flags >> SEL_FLAGS_SHIFT) & SEL_FLAGS_SMASK;1453 1454 Ctx.fs.Sel = env->segs[R_FS].selector;1455 Ctx.fs.ValidSel = env->segs[R_FS].selector;1456 Ctx.fs.fFlags = CPUMSELREG_FLAGS_VALID;1457 Ctx.fs.u64Base = env->segs[R_FS].base;1458 Ctx.fs.u32Limit = env->segs[R_FS].limit;1459 Ctx.fs.Attr.u = (env->segs[R_FS].flags >> SEL_FLAGS_SHIFT) & SEL_FLAGS_SMASK;1460 1461 Ctx.gs.Sel = env->segs[R_GS].selector;1462 Ctx.gs.ValidSel = env->segs[R_GS].selector;1463 Ctx.gs.fFlags = CPUMSELREG_FLAGS_VALID;1464 Ctx.gs.u64Base = env->segs[R_GS].base;1465 Ctx.gs.u32Limit = env->segs[R_GS].limit;1466 Ctx.gs.Attr.u = (env->segs[R_GS].flags >> SEL_FLAGS_SHIFT) & SEL_FLAGS_SMASK;1467 1468 Ctx.ss.Sel = env->segs[R_SS].selector;1469 Ctx.ss.ValidSel = env->segs[R_SS].selector;1470 Ctx.ss.fFlags = CPUMSELREG_FLAGS_VALID;1471 Ctx.ss.u64Base = env->segs[R_SS].base;1472 Ctx.ss.u32Limit = env->segs[R_SS].limit;1473 Ctx.ss.Attr.u = (env->segs[R_SS].flags >> SEL_FLAGS_SHIFT) & SEL_FLAGS_SMASK;1474 1475 Ctx.msrEFER = env->efer;1410 pCtx->cr0 = env->cr[0]; 1411 pCtx->cr3 = env->cr[3]; 1412 pCtx->cr4 = env->cr[4]; 1413 1414 pCtx->tr.Sel = env->tr.selector; 1415 pCtx->tr.ValidSel = env->tr.selector; 1416 pCtx->tr.fFlags = CPUMSELREG_FLAGS_VALID; 1417 pCtx->tr.u64Base = env->tr.base; 1418 pCtx->tr.u32Limit = env->tr.limit; 1419 pCtx->tr.Attr.u = (env->tr.flags >> SEL_FLAGS_SHIFT) & SEL_FLAGS_SMASK; 1420 1421 pCtx->ldtr.Sel = env->ldt.selector; 1422 pCtx->ldtr.ValidSel = env->ldt.selector; 1423 pCtx->ldtr.fFlags = CPUMSELREG_FLAGS_VALID; 1424 pCtx->ldtr.u64Base = env->ldt.base; 1425 pCtx->ldtr.u32Limit = env->ldt.limit; 1426 pCtx->ldtr.Attr.u = (env->ldt.flags >> SEL_FLAGS_SHIFT) & SEL_FLAGS_SMASK; 1427 1428 pCtx->idtr.cbIdt = env->idt.limit; 1429 pCtx->idtr.pIdt = env->idt.base; 1430 1431 pCtx->gdtr.cbGdt = env->gdt.limit; 1432 pCtx->gdtr.pGdt = env->gdt.base; 1433 1434 pCtx->rsp = env->regs[R_ESP]; 1435 pCtx->rip = env->eip; 1436 1437 pCtx->eflags.u32 = env->eflags; 1438 1439 pCtx->cs.Sel = env->segs[R_CS].selector; 1440 pCtx->cs.ValidSel = env->segs[R_CS].selector; 1441 pCtx->cs.fFlags = CPUMSELREG_FLAGS_VALID; 1442 pCtx->cs.u64Base = env->segs[R_CS].base; 1443 pCtx->cs.u32Limit = env->segs[R_CS].limit; 1444 pCtx->cs.Attr.u = (env->segs[R_CS].flags >> SEL_FLAGS_SHIFT) & SEL_FLAGS_SMASK; 1445 1446 pCtx->ds.Sel = env->segs[R_DS].selector; 1447 pCtx->ds.ValidSel = env->segs[R_DS].selector; 1448 pCtx->ds.fFlags = CPUMSELREG_FLAGS_VALID; 1449 pCtx->ds.u64Base = env->segs[R_DS].base; 1450 pCtx->ds.u32Limit = env->segs[R_DS].limit; 1451 pCtx->ds.Attr.u = (env->segs[R_DS].flags >> SEL_FLAGS_SHIFT) & SEL_FLAGS_SMASK; 1452 1453 pCtx->es.Sel = env->segs[R_ES].selector; 1454 pCtx->es.ValidSel = env->segs[R_ES].selector; 1455 pCtx->es.fFlags = CPUMSELREG_FLAGS_VALID; 1456 pCtx->es.u64Base = env->segs[R_ES].base; 1457 pCtx->es.u32Limit = env->segs[R_ES].limit; 1458 pCtx->es.Attr.u = (env->segs[R_ES].flags >> SEL_FLAGS_SHIFT) & SEL_FLAGS_SMASK; 1459 1460 pCtx->fs.Sel = env->segs[R_FS].selector; 1461 pCtx->fs.ValidSel = env->segs[R_FS].selector; 1462 pCtx->fs.fFlags = CPUMSELREG_FLAGS_VALID; 1463 pCtx->fs.u64Base = env->segs[R_FS].base; 1464 pCtx->fs.u32Limit = env->segs[R_FS].limit; 1465 pCtx->fs.Attr.u = (env->segs[R_FS].flags >> SEL_FLAGS_SHIFT) & SEL_FLAGS_SMASK; 1466 1467 pCtx->gs.Sel = env->segs[R_GS].selector; 1468 pCtx->gs.ValidSel = env->segs[R_GS].selector; 1469 pCtx->gs.fFlags = CPUMSELREG_FLAGS_VALID; 1470 pCtx->gs.u64Base = env->segs[R_GS].base; 1471 pCtx->gs.u32Limit = env->segs[R_GS].limit; 1472 pCtx->gs.Attr.u = (env->segs[R_GS].flags >> SEL_FLAGS_SHIFT) & SEL_FLAGS_SMASK; 1473 1474 pCtx->ss.Sel = env->segs[R_SS].selector; 1475 pCtx->ss.ValidSel = env->segs[R_SS].selector; 1476 pCtx->ss.fFlags = CPUMSELREG_FLAGS_VALID; 1477 pCtx->ss.u64Base = env->segs[R_SS].base; 1478 pCtx->ss.u32Limit = env->segs[R_SS].limit; 1479 pCtx->ss.Attr.u = (env->segs[R_SS].flags >> SEL_FLAGS_SHIFT) & SEL_FLAGS_SMASK; 1480 1481 pCtx->msrEFER = env->efer; 1476 1482 1477 1483 /* Hardware accelerated raw-mode: … … 1479 1485 * Typically only 32-bits protected mode, with paging enabled, code is allowed here. 1480 1486 */ 1481 if (HMR3CanExecuteGuest(env->pVM, &Ctx) == true)1487 if (HMR3CanExecuteGuest(env->pVM, pCtx) == true) 1482 1488 { 1483 1489 *piException = EXCP_EXECUTE_HM;
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器