Changeset 20399 in vbox
- Timestamp:
- Jun 8, 2009 1:01:44 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/em.h
r20374 r20399 185 185 VMMR3DECL(void) EMR3RemUnlock(PVM pVM); 186 186 VMMR3DECL(void) EMR3RemLock(PVM pVM); 187 VMMR3DECL(bool) EMR3RemIsLockOwner(PVM pVM); 187 188 188 189 /** -
trunk/include/VBox/vm.h
r20374 r20399 270 270 #define VM_FF_PGM_NO_MEMORY RT_BIT_32(19) 271 271 /** REM needs to be informed about handler changes. */ 272 #define VM_FF_REM_HANDLER_NOTIFY RT_BIT_32(29) 272 #define VM_FF_REM_HANDLER_NOTIFY_BIT 29 273 #define VM_FF_REM_HANDLER_NOTIFY RT_BIT_32(VM_FF_REM_HANDLER_NOTIFY_BIT) 273 274 /** Suspend the VM - debug only. */ 274 275 #define VM_FF_DEBUG_SUSPEND RT_BIT_32(31) … … 360 361 #define VM_FF_HWACCM_TO_R3_MASK (VM_FF_TM_VIRTUAL_SYNC | VM_FF_PGM_NEED_HANDY_PAGES | VM_FF_PGM_NO_MEMORY) 361 362 /** VMCPU Flags that cause the HWACCM loops to go back to ring-3. */ 362 #define VMCPU_FF_HWACCM_TO_R3_MASK 363 #define VMCPU_FF_HWACCM_TO_R3_MASK (VMCPU_FF_TO_R3 | VMCPU_FF_TIMER) 363 364 364 365 /** All the forced VM flags. */ -
trunk/src/VBox/VMM/EM.cpp
r20198 r20399 869 869 VMMR3DECL(void) EMR3RemLock(PVM pVM) 870 870 { 871 #ifdef IN_RING3872 871 if (!PDMCritSectIsInitialized(&pVM->em.s.CritSectREM)) 873 872 return; /* early init */ 874 #else 875 Assert(PDMCritSectIsInitialized(&pVM->em.s.CritSectREM)); 876 #endif 873 877 874 int rc = PDMCritSectEnter(&pVM->em.s.CritSectREM, VERR_SEM_BUSY); 878 875 AssertMsg(rc == VINF_SUCCESS, ("%Rrc\n", rc)); … … 886 883 VMMR3DECL(void) EMR3RemUnlock(PVM pVM) 887 884 { 888 #ifdef IN_RING3889 885 if (!PDMCritSectIsInitialized(&pVM->em.s.CritSectREM)) 890 886 return; /* early init */ 891 #else 892 Assert(PDMCritSectIsInitialized(&pVM->em.s.CritSectREM)); 893 #endif 887 894 888 PDMCritSectLeave(&pVM->em.s.CritSectREM); 889 } 890 891 /** 892 * Check if this VCPU currently owns the REM lock. 893 * 894 * @returns bool owner/not owner 895 * @param pVM The VM to operate on. 896 */ 897 VMMR3DECL(bool) EMR3RemIsLockOwner(PVM pVM) 898 { 899 return PDMCritSectIsOwner(&pVM->em.s.CritSectREM); 895 900 } 896 901 -
trunk/src/recompiler/VBoxRecompiler.c
r20079 r20399 2728 2728 REMR3DECL(void) REMR3ReplayHandlerNotifications(PVM pVM) 2729 2729 { 2730 Assert(EMR3RemIsLockOwner(pVM)); 2731 2730 2732 /* 2731 2733 * Replay the flushes. 2732 2734 */ 2733 RTUINT i; 2734 const RTUINT c = pVM->rem.s.cHandlerNotifications; 2735 2736 LogFlow(("REMR3ReplayInvalidatedPages:\n")); 2735 LogFlow(("REMR3ReplayHandlerNotifications:\n")); 2737 2736 VM_ASSERT_EMT(pVM); 2738 2737 2739 pVM->rem.s.cHandlerNotifications = 0; 2740 for (i = 0; i < c; i++) 2741 { 2742 PREMHANDLERNOTIFICATION pRec = &pVM->rem.s.aHandlerNotifications[i]; 2743 switch (pRec->enmKind) 2738 if (VM_FF_TESTANDCLEAR(pVM, VM_FF_REM_HANDLER_NOTIFY_BIT)) 2739 { 2740 RTUINT i; 2741 const RTUINT c = pVM->rem.s.cHandlerNotifications; 2742 2743 pVM->rem.s.cHandlerNotifications = 0; 2744 for (i = 0; i < c; i++) 2744 2745 { 2745 case REMHANDLERNOTIFICATIONKIND_PHYSICAL_REGISTER: 2746 REMR3NotifyHandlerPhysicalRegister(pVM, 2747 pRec->u.PhysicalRegister.enmType, 2748 pRec->u.PhysicalRegister.GCPhys, 2749 pRec->u.PhysicalRegister.cb, 2750 pRec->u.PhysicalRegister.fHasHCHandler); 2751 break; 2752 2753 case REMHANDLERNOTIFICATIONKIND_PHYSICAL_DEREGISTER: 2754 REMR3NotifyHandlerPhysicalDeregister(pVM, 2755 pRec->u.PhysicalDeregister.enmType, 2756 pRec->u.PhysicalDeregister.GCPhys, 2757 pRec->u.PhysicalDeregister.cb, 2758 pRec->u.PhysicalDeregister.fHasHCHandler, 2759 pRec->u.PhysicalDeregister.fRestoreAsRAM); 2760 break; 2761 2762 case REMHANDLERNOTIFICATIONKIND_PHYSICAL_MODIFY: 2763 REMR3NotifyHandlerPhysicalModify(pVM, 2764 pRec->u.PhysicalModify.enmType, 2765 pRec->u.PhysicalModify.GCPhysOld, 2766 pRec->u.PhysicalModify.GCPhysNew, 2767 pRec->u.PhysicalModify.cb, 2768 pRec->u.PhysicalModify.fHasHCHandler, 2769 pRec->u.PhysicalModify.fRestoreAsRAM); 2770 break; 2771 2772 default: 2773 AssertReleaseMsgFailed(("enmKind=%d\n", pRec->enmKind)); 2774 break; 2746 PREMHANDLERNOTIFICATION pRec = &pVM->rem.s.aHandlerNotifications[i]; 2747 switch (pRec->enmKind) 2748 { 2749 case REMHANDLERNOTIFICATIONKIND_PHYSICAL_REGISTER: 2750 REMR3NotifyHandlerPhysicalRegister(pVM, 2751 pRec->u.PhysicalRegister.enmType, 2752 pRec->u.PhysicalRegister.GCPhys, 2753 pRec->u.PhysicalRegister.cb, 2754 pRec->u.PhysicalRegister.fHasHCHandler); 2755 break; 2756 2757 case REMHANDLERNOTIFICATIONKIND_PHYSICAL_DEREGISTER: 2758 REMR3NotifyHandlerPhysicalDeregister(pVM, 2759 pRec->u.PhysicalDeregister.enmType, 2760 pRec->u.PhysicalDeregister.GCPhys, 2761 pRec->u.PhysicalDeregister.cb, 2762 pRec->u.PhysicalDeregister.fHasHCHandler, 2763 pRec->u.PhysicalDeregister.fRestoreAsRAM); 2764 break; 2765 2766 case REMHANDLERNOTIFICATIONKIND_PHYSICAL_MODIFY: 2767 REMR3NotifyHandlerPhysicalModify(pVM, 2768 pRec->u.PhysicalModify.enmType, 2769 pRec->u.PhysicalModify.GCPhysOld, 2770 pRec->u.PhysicalModify.GCPhysNew, 2771 pRec->u.PhysicalModify.cb, 2772 pRec->u.PhysicalModify.fHasHCHandler, 2773 pRec->u.PhysicalModify.fRestoreAsRAM); 2774 break; 2775 2776 default: 2777 AssertReleaseMsgFailed(("enmKind=%d\n", pRec->enmKind)); 2778 break; 2779 } 2775 2780 } 2776 2781 } 2777 VM_FF_CLEAR(pVM, VM_FF_REM_HANDLER_NOTIFY);2778 2782 } 2779 2783
Note:
See TracChangeset
for help on using the changeset viewer.