Changeset 37527 in vbox for trunk/src/VBox/VMM/include/TMInternal.h
- Timestamp:
- Jun 17, 2011 10:18:02 AM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 72361
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/include/TMInternal.h
r37517 r37527 722 722 typedef TMCPU *PTMCPU; 723 723 724 #if 0 /* enable this to rule out locking bugs on single cpu guests. */725 # define tmTimerLock(pVM) VINF_SUCCESS726 # define tmTimerTryLock(pVM) VINF_SUCCESS727 # define tmTimerUnlock(pVM) ((void)0)728 # define tmVirtualSyncLock(pVM) VINF_SUCCESS729 # define tmVirtualSyncTryLock(pVM) VINF_SUCCESS730 # define tmVirtualSyncUnlock(pVM) ((void)0)731 # define TM_ASSERT_LOCK(pVM) VM_ASSERT_EMT(pVM)732 #else733 int tmTimerLock(PVM pVM);734 int tmTimerTryLock(PVM pVM);735 void tmTimerUnlock(PVM pVM);736 /** Checks that the caller owns the timer lock. */737 #define TM_ASSERT_LOCK(pVM) Assert(PDMCritSectIsOwner(&pVM->tm.s.TimerCritSect))738 int tmVirtualSyncLock(PVM pVM);739 int tmVirtualSyncTryLock(PVM pVM);740 void tmVirtualSyncUnlock(PVM pVM);741 #endif742 743 724 const char *tmTimerState(TMTIMERSTATE enmState); 744 725 void tmTimerQueueSchedule(PVM pVM, PTMTIMERQUEUE pQueue); … … 756 737 757 738 739 /** 740 * Try take the timer lock, wait in ring-3 return VERR_SEM_BUSY in R0/RC. 741 * 742 * @retval VINF_SUCCESS on success (always in ring-3). 743 * @retval VERR_SEM_BUSY in RC and R0 if the semaphore is busy. 744 * 745 * @param a_pVM The VM handle. 746 * 747 * @remarks The virtual sync timer queue requires the virtual sync lock. 748 */ 749 #define TM_LOCK_TIMERS(a_pVM) PDMCritSectEnter(&(a_pVM)->tm.s.TimerCritSect, VERR_SEM_BUSY) 750 751 /** 752 * Try take the timer lock, no waiting. 753 * 754 * @retval VINF_SUCCESS on success. 755 * @retval VERR_SEM_BUSY if busy. 756 * 757 * @param a_pVM The VM handle. 758 * 759 * @remarks The virtual sync timer queue requires the virtual sync lock. 760 */ 761 #define TM_TRY_LOCK_TIMERS(a_pVM) PDMCritSectTryEnter(&(a_pVM)->tm.s.TimerCritSect) 762 763 /** Lock the timers (sans the virtual sync queue). */ 764 #define TM_UNLOCK_TIMERS(a_pVM) do { PDMCritSectLeave(&(a_pVM)->tm.s.TimerCritSect); } while (0) 765 766 /** Checks that the caller owns the timer lock. */ 767 #define TM_ASSERT_TIMER_LOCK_OWNERSHIP(a_pVM) \ 768 Assert(PDMCritSectIsOwner(&(a_pVM)->tm.s.TimerCritSect)) 769 770 758 771 /** @} */ 759 772
Note:
See TracChangeset
for help on using the changeset viewer.