vbox的更動 62287 路徑 trunk/src/recompiler
- 時間撮記:
- 2016-7-15 下午06:44:49 (8 年 以前)
- 位置:
- trunk/src/recompiler
- 檔案:
-
- 修改 3 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/recompiler/VBoxREM.def
r44528 r62287 5 5 6 6 ; 7 ; Copyright (C) 2006-201 1Oracle Corporation7 ; Copyright (C) 2006-2016 Oracle Corporation 8 8 ; 9 9 ; This file is part of VirtualBox Open Source Edition (OSE), as … … 48 48 REMR3NotifyCodePageChanged 49 49 REMR3IsPageAccessHandled 50 REMR3NotifyPendingInterrupt51 REMR3QueryPendingInterrupt52 50 -
trunk/src/recompiler/VBoxREMWrapper.cpp
r60804 r62287 5 5 */ 6 6 /* 7 * Copyright (C) 2006-201 3Oracle Corporation7 * Copyright (C) 2006-2016 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 376 376 static DECLCALLBACKPTR(void, pfnREMR3NotifyFF)(PVM); 377 377 static DECLCALLBACKPTR(int, pfnREMR3NotifyCodePageChanged)(PVM, PVMCPU, RTGCPTR); 378 static DECLCALLBACKPTR(void, pfnREMR3NotifyPendingInterrupt)(PVM, PVMCPU, uint8_t);379 static DECLCALLBACKPTR(uint32_t, pfnREMR3QueryPendingInterrupt)(PVM, PVMCPU);380 378 static DECLCALLBACKPTR(int, pfnREMR3DisasEnableStepping)(PVM, bool); 381 379 static DECLCALLBACKPTR(bool, pfnREMR3IsPageAccessHandled)(PVM, RTGCPHYS); … … 1200 1198 { "REMR3NotifyFF", (void *)&pfnREMR3NotifyFF, &g_aArgsVM[0], RT_ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_VOID, 0, NULL }, 1201 1199 { "REMR3NotifyCodePageChanged", (void *)&pfnREMR3NotifyCodePageChanged, &g_aArgsNotifyCodePageChanged[0], RT_ELEMENTS(g_aArgsNotifyCodePageChanged), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 1202 { "REMR3NotifyPendingInterrupt", (void *)&pfnREMR3NotifyPendingInterrupt, &g_aArgsNotifyPendingInterrupt[0], RT_ELEMENTS(g_aArgsNotifyPendingInterrupt), REMFNDESC_FLAGS_RET_VOID, 0, NULL },1203 { "REMR3QueryPendingInterrupt", (void *)&pfnREMR3QueryPendingInterrupt, &g_aArgsVMandVMCPU[0], RT_ELEMENTS(g_aArgsVMandVMCPU), REMFNDESC_FLAGS_RET_INT, sizeof(uint32_t), NULL },1204 1200 { "REMR3DisasEnableStepping", (void *)&pfnREMR3DisasEnableStepping, &g_aArgsDisasEnableStepping[0], RT_ELEMENTS(g_aArgsDisasEnableStepping), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 1205 1201 { "REMR3IsPageAccessHandled", (void *)&pfnREMR3IsPageAccessHandled, &g_aArgsIsPageAccessHandled[0], RT_ELEMENTS(g_aArgsIsPageAccessHandled), REMFNDESC_FLAGS_RET_INT, sizeof(bool), NULL } … … 2448 2444 } 2449 2445 2450 REMR3DECL(void) REMR3NotifyPendingInterrupt(PVM pVM, PVMCPU pVCpu, uint8_t u8Interrupt)2451 {2452 #ifndef USE_REM_STUBS2453 Assert(VALID_PTR(pfnREMR3NotifyPendingInterrupt));2454 pfnREMR3NotifyPendingInterrupt(pVM, pVCpu, u8Interrupt);2455 #endif2456 }2457 2458 REMR3DECL(uint32_t) REMR3QueryPendingInterrupt(PVM pVM, PVMCPU pVCpu)2459 {2460 #ifdef USE_REM_STUBS2461 return REM_NO_PENDING_IRQ;2462 #else2463 Assert(VALID_PTR(pfnREMR3QueryPendingInterrupt));2464 return pfnREMR3QueryPendingInterrupt(pVM, pVCpu);2465 #endif2466 }2467 2468 2446 REMR3DECL(void) REMR3NotifyInterruptSet(PVM pVM, PVMCPU pVCpu) 2469 2447 { -
trunk/src/recompiler/VBoxRecompiler.c
r62286 r62287 5 5 6 6 /* 7 * Copyright (C) 2006-201 3Oracle Corporation7 * Copyright (C) 2006-2016 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 112 112 static DECLCALLBACK(int) remR3Save(PVM pVM, PSSMHANDLE pSSM); 113 113 static DECLCALLBACK(int) remR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass); 114 static DECLCALLBACK(int) remR3LoadDone(PVM pVM, PSSMHANDLE pSSM); 114 115 static void remR3StateUpdate(PVM pVM, PVMCPU pVCpu); 115 116 static int remR3InitPhysRamSizeAndDirtyMap(PVM pVM, bool fGuarded); … … 352 353 353 354 /* Nothing is pending by default */ 354 pVM->rem.s.u 32PendingInterrupt = REM_NO_PENDING_IRQ;355 pVM->rem.s.uStateLoadPendingInterrupt = REM_NO_PENDING_IRQ; 355 356 356 357 /* … … 372 373 NULL, NULL, NULL, 373 374 NULL, remR3Save, NULL, 374 NULL, remR3Load, NULL);375 NULL, remR3Load, remR3LoadDone); 375 376 if (RT_FAILURE(rc)) 376 377 return rc; … … 637 638 /* Remember if we've entered raw mode (vital for ring 1 checks in e.g. iret emulation). */ 638 639 SSMR3PutU32(pSSM, !!(pRem->Env.state & CPU_RAW_RING0)); 639 SSMR3PutU32(pSSM, pVM->rem.s.u32PendingInterrupt);640 SSMR3PutU32(pSSM, REM_NO_PENDING_IRQ); 640 641 641 642 return SSMR3PutU32(pSSM, ~0); /* terminator */ … … 732 733 } 733 734 734 rc = SSMR3GetUInt(pSSM, &pVM->rem.s.u32PendingInterrupt); 735 if (RT_FAILURE(rc)) 736 return rc; 735 rc = SSMR3GetUInt(pSSM, &pVM->rem.s.uStateLoadPendingInterrupt); 736 AssertRCReturn(rc, rc); 737 AssertLogRelMsgReturn( pVM->rem.s.uStateLoadPendingInterrupt == REM_NO_PENDING_IRQ 738 || pVM->rem.s.uStateLoadPendingInterrupt < 256, 739 ("uStateLoadPendingInterrupt=%#x\n", pVM->rem.s.uStateLoadPendingInterrupt), 740 VERR_SSM_UNEXPECTED_DATA); 737 741 738 742 /* check the terminator. */ … … 769 773 } 770 774 775 776 /** 777 * @callback_method_impl{FNSSMINTLOADDONE, 778 * For pushing misdesigned pending-interrupt mess to TRPM where it belongs. } 779 */ 780 static DECLCALLBACK(int) remR3LoadDone(PVM pVM, PSSMHANDLE pSSM) 781 { 782 if (pVM->rem.s.uStateLoadPendingInterrupt != REM_NO_PENDING_IRQ) 783 { 784 int rc = TRPMAssertTrap(&pVM->aCpus[0], pVM->rem.s.uStateLoadPendingInterrupt, TRPM_HARDWARE_INT); 785 AssertLogRelMsgReturn(rc, ("uStateLoadPendingInterrupt=%#x rc=%Rrc\n", pVM->rem.s.uStateLoadPendingInterrupt, rc), rc); 786 pVM->rem.s.uStateLoadPendingInterrupt = REM_NO_PENDING_IRQ; 787 } 788 return VINF_SUCCESS; 789 } 771 790 772 791 … … 1119 1138 pVM->rem.s.Env.interrupt_request = CPU_INTERRUPT_SINGLE_INSTR; 1120 1139 #endif 1121 if ( VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_UPDATE_APIC | VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC) 1122 || pVM->rem.s.u32PendingInterrupt != REM_NO_PENDING_IRQ) 1140 if (VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_UPDATE_APIC | VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC)) 1123 1141 pVM->rem.s.Env.interrupt_request |= CPU_INTERRUPT_HARD; 1124 1142 RTLogPrintf("remR3RunLoggingStep: interrupt_request=%#x halted=%d exception_index=%#x\n", … … 2520 2538 APICUpdatePendingInterrupts(pVCpu); 2521 2539 #endif 2522 if ( pVM->rem.s.u32PendingInterrupt != REM_NO_PENDING_IRQ 2523 || VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC)) 2524 { 2540 if (VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC)) 2525 2541 pVM->rem.s.Env.interrupt_request |= CPU_INTERRUPT_HARD; 2526 }2527 2542 2528 2543 /* … … 4242 4257 4243 4258 /* -+- FF notifications -+- */ 4244 4245 4246 /**4247 * Notification about a pending interrupt.4248 *4249 * @param pVM VM Handle.4250 * @param pVCpu VMCPU Handle.4251 * @param u8Interrupt Interrupt4252 * @thread The emulation thread.4253 */4254 REMR3DECL(void) REMR3NotifyPendingInterrupt(PVM pVM, PVMCPU pVCpu, uint8_t u8Interrupt)4255 {4256 Assert(pVM->rem.s.u32PendingInterrupt == REM_NO_PENDING_IRQ);4257 pVM->rem.s.u32PendingInterrupt = u8Interrupt;4258 }4259 4260 /**4261 * Notification about a pending interrupt.4262 *4263 * @returns Pending interrupt or REM_NO_PENDING_IRQ4264 * @param pVM VM Handle.4265 * @param pVCpu VMCPU Handle.4266 * @thread The emulation thread.4267 */4268 REMR3DECL(uint32_t) REMR3QueryPendingInterrupt(PVM pVM, PVMCPU pVCpu)4269 {4270 return pVM->rem.s.u32PendingInterrupt;4271 }4272 4259 4273 4260 /** … … 4521 4508 */ 4522 4509 /* Note! We assume we will go directly to the recompiler to handle the pending interrupt! */ 4523 /** @todo r=bird: In the long run we should just do the interrupt handling in EM/CPUM/TRPM/somewhere and 4524 * if we cannot execute the interrupt handler in raw-mode just reschedule to REM. Once that is done we 4525 * remove this kludge. */ 4526 if (env->pVM->rem.s.u32PendingInterrupt != REM_NO_PENDING_IRQ) 4527 { 4528 rc = VINF_SUCCESS; 4529 Assert(env->pVM->rem.s.u32PendingInterrupt <= 255); 4530 u8Interrupt = env->pVM->rem.s.u32PendingInterrupt; 4531 env->pVM->rem.s.u32PendingInterrupt = REM_NO_PENDING_IRQ; 4532 } 4533 else 4534 rc = PDMGetInterrupt(env->pVCpu, &u8Interrupt); 4535 4510 rc = PDMGetInterrupt(env->pVCpu, &u8Interrupt); 4536 4511 LogFlow(("cpu_get_pic_interrupt: u8Interrupt=%d rc=%Rrc pc=%04x:%08llx ~flags=%08llx\n", 4537 4512 u8Interrupt, rc, env->segs[R_CS].selector, (uint64_t)env->eip, (uint64_t)env->eflags));
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器