Changeset 87814 in vbox
- Timestamp:
- Feb 19, 2021 10:03:56 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 142875
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/TMAll.cpp
r87813 r87814 358 358 * Schedule the queue which was changed. 359 359 */ 360 DECLINLINE(void) tmSchedule(PVMCC pVM, PTMTIMER pTimer) 361 { 362 TMCLOCK const enmClock = pTimer->enmClock; 363 AssertReturnVoid((unsigned)enmClock < TMCLOCK_MAX); 364 PTMTIMERQUEUE const pQueue = &pVM->tm.s.aTimerQueues[enmClock]; 365 PTMTIMERQUEUECC const pQueueCC = TM_GET_TIMER_QUEUE_CC(pVM, enmClock, pQueue); 366 360 DECLINLINE(void) tmSchedule(PVMCC pVM, PTMTIMERQUEUECC pQueueCC, PTMTIMERQUEUE pQueue, PTMTIMER pTimer) 361 { 367 362 if (VM_IS_EMT(pVM)) /** @todo drop EMT requirement here. */ 368 363 { … … 440 435 * 441 436 * @returns Success indicator. 442 * @param pVM The cross context VM structure. 443 * @param pTimer Timer in question. 444 * @param enmStateNew The new timer state. 445 * @param enmStateOld The old timer state. 446 */ 447 DECLINLINE(bool) tmTimerTryWithLink(PVMCC pVM, PTMTIMER pTimer, TMTIMERSTATE enmStateNew, TMTIMERSTATE enmStateOld) 448 { 449 TMCLOCK const enmClock = pTimer->enmClock; 450 AssertReturn((unsigned)enmClock < TMCLOCK_MAX, false); 437 * @param pQueueCC The current context queue (same as @a pQueue for 438 * ring-3). 439 * @param pQueue The shared queue data. 440 * @param pTimer Timer in question. 441 * @param enmStateNew The new timer state. 442 * @param enmStateOld The old timer state. 443 */ 444 DECLINLINE(bool) tmTimerTryWithLink(PTMTIMERQUEUECC pQueueCC, PTMTIMERQUEUE pQueue, PTMTIMER pTimer, 445 TMTIMERSTATE enmStateNew, TMTIMERSTATE enmStateOld) 446 { 451 447 if (tmTimerTry(pTimer, enmStateNew, enmStateOld)) 452 448 { 453 PTMTIMERQUEUE const pQueue = &pVM->tm.s.aTimerQueues[enmClock]; 454 tmTimerLinkSchedule(TM_GET_TIMER_QUEUE_CC(pVM, enmClock, pQueue), pQueue, pTimer); 449 tmTimerLinkSchedule(pQueueCC, pQueue, pTimer); 455 450 return true; 456 451 } … … 476 471 Assert(pTimer->idxNext == UINT32_MAX); 477 472 Assert(pTimer->idxPrev == UINT32_MAX); 478 Assert(pTimer->enmState == TMTIMERSTATE_ACTIVE || p Timer->enmClock != TMCLOCK_VIRTUAL_SYNC); /* (active is not a stable state) */473 Assert(pTimer->enmState == TMTIMERSTATE_ACTIVE || pQueue->enmClock != TMCLOCK_VIRTUAL_SYNC); /* (active is not a stable state) */ 479 474 RT_NOREF(pVM); 480 475 … … 648 643 */ 649 644 Log2(("tmTimerQueueSchedule: %p:{.enmState=%s, .enmClock=%d, .enmType=%d, .szName=%s}\n", 650 pTimer, tmTimerState(pTimer->enmState), p Timer->enmClock, pTimer->enmType, pTimer->szName));645 pTimer, tmTimerState(pTimer->enmState), pQueue->enmClock, pTimer->enmType, pTimer->szName)); 651 646 tmTimerQueueScheduleOne(pVM, pQueueCC, pQueue, pTimer); 652 647 Log2(("tmTimerQueueSchedule: %p: new %s\n", pTimer, tmTimerState(pTimer->enmState))); … … 683 678 pPrev = pCur, pCur = tmTimerGetNext(pQueueCC, pCur)) 684 679 { 685 AssertMsg(pCur->enmClock == (TMCLOCK)idxQueue, ("%s: %d != %u\n", pszWhere, pCur->enmClock, idxQueue));686 680 AssertMsg(tmTimerGetPrev(pQueueCC, pCur) == pPrev, ("%s: %p != %p\n", pszWhere, tmTimerGetPrev(pQueueCC, pCur), pPrev)); 687 681 TMTIMERSTATE enmState = pCur->enmState; … … 1377 1371 case TMTIMERSTATE_EXPIRED_DELIVER: 1378 1372 case TMTIMERSTATE_STOPPED: 1379 if (tmTimerTryWithLink(p VM, pTimer, TMTIMERSTATE_PENDING_SCHEDULE_SET_EXPIRE, enmState))1373 if (tmTimerTryWithLink(pQueueCC, pQueue, pTimer, TMTIMERSTATE_PENDING_SCHEDULE_SET_EXPIRE, enmState)) 1380 1374 { 1381 1375 Assert(pTimer->idxPrev == UINT32_MAX); … … 1383 1377 pTimer->u64Expire = u64Expire; 1384 1378 TM_SET_STATE(pTimer, TMTIMERSTATE_PENDING_SCHEDULE); 1385 tmSchedule(pVM, p Timer);1379 tmSchedule(pVM, pQueueCC, pQueue, pTimer); 1386 1380 STAM_PROFILE_STOP(&pVM->tm.s.CTX_SUFF_Z(StatTimerSet), a); 1387 1381 return VINF_SUCCESS; … … 1395 1389 pTimer->u64Expire = u64Expire; 1396 1390 TM_SET_STATE(pTimer, TMTIMERSTATE_PENDING_SCHEDULE); 1397 tmSchedule(pVM, p Timer);1391 tmSchedule(pVM, pQueueCC, pQueue, pTimer); 1398 1392 STAM_PROFILE_STOP(&pVM->tm.s.CTX_SUFF_Z(StatTimerSet), a); 1399 1393 return VINF_SUCCESS; … … 1403 1397 1404 1398 case TMTIMERSTATE_ACTIVE: 1405 if (tmTimerTryWithLink(p VM, pTimer, TMTIMERSTATE_PENDING_RESCHEDULE_SET_EXPIRE, enmState))1399 if (tmTimerTryWithLink(pQueueCC, pQueue, pTimer, TMTIMERSTATE_PENDING_RESCHEDULE_SET_EXPIRE, enmState)) 1406 1400 { 1407 1401 pTimer->u64Expire = u64Expire; 1408 1402 TM_SET_STATE(pTimer, TMTIMERSTATE_PENDING_RESCHEDULE); 1409 tmSchedule(pVM, p Timer);1403 tmSchedule(pVM, pQueueCC, pQueue, pTimer); 1410 1404 STAM_PROFILE_STOP(&pVM->tm.s.CTX_SUFF_Z(StatTimerSet), a); 1411 1405 return VINF_SUCCESS; … … 1419 1413 pTimer->u64Expire = u64Expire; 1420 1414 TM_SET_STATE(pTimer, TMTIMERSTATE_PENDING_RESCHEDULE); 1421 tmSchedule(pVM, p Timer);1415 tmSchedule(pVM, pQueueCC, pQueue, pTimer); 1422 1416 STAM_PROFILE_STOP(&pVM->tm.s.CTX_SUFF_Z(StatTimerSet), a); 1423 1417 return VINF_SUCCESS; … … 1498 1492 * @param pu64Now Where to return the current time stamp used. 1499 1493 * Optional. 1500 * @param pQueue Pointer to the shared timer queue data. 1501 * @param idxQueue The queue index. 1494 * @param pQueueCC The context specific queue data (same as @a pQueue 1495 * for ring-3). 1496 * @param pQueue The shared queue data. 1502 1497 */ 1503 1498 static int tmTimerSetRelativeOptimizedStart(PVMCC pVM, PTMTIMER pTimer, uint64_t cTicksToNext, uint64_t *pu64Now, 1504 PTMTIMERQUEUE pQueue, uint32_t idxQueue)1499 PTMTIMERQUEUECC pQueueCC, PTMTIMERQUEUE pQueue) 1505 1500 { 1506 1501 Assert(pTimer->idxPrev == UINT32_MAX); … … 1519 1514 */ 1520 1515 DBGFTRACE_U64_TAG2(pVM, u64Expire, "tmTimerSetRelativeOptimizedStart", pTimer->szName); 1521 tmTimerQueueLinkActive(pVM, TM_GET_TIMER_QUEUE_CC(pVM, idxQueue, pQueue), pQueue, pTimer, u64Expire);1516 tmTimerQueueLinkActive(pVM, pQueueCC, pQueue, pTimer, u64Expire); 1522 1517 1523 1518 STAM_COUNTER_INC(&pVM->tm.s.StatTimerSetRelativeOpt); 1524 RT_NOREF(idxQueue);1525 1519 return VINF_SUCCESS; 1526 1520 } … … 1614 1608 * @param pu64Now Where to return the current time stamp used. 1615 1609 * Optional. 1610 * @param pQueueCC The context specific queue data (same as @a pQueue 1611 * for ring-3). 1612 * @param pQueue The shared queue data. 1613 * @param idxQueue The queue index. 1616 1614 */ 1617 1615 static int tmTimerSetRelative(PVMCC pVM, PTMTIMER pTimer, uint64_t cTicksToNext, uint64_t *pu64Now, 1618 PTMTIMERQUEUE pQueue, uint32_t idxQueue)1616 PTMTIMERQUEUECC pQueueCC, PTMTIMERQUEUE pQueue) 1619 1617 { 1620 1618 STAM_COUNTER_INC(&pTimer->StatSetRelative); 1621 1619 1622 1620 /* Treat virtual sync timers specially. */ 1623 if ( idxQueue== TMCLOCK_VIRTUAL_SYNC)1621 if (pQueue->enmClock == TMCLOCK_VIRTUAL_SYNC) 1624 1622 return tmTimerVirtualSyncSetRelative(pVM, pTimer, cTicksToNext, pu64Now); 1625 1623 … … 1671 1669 && tmTimerTry(pTimer, TMTIMERSTATE_ACTIVE, enmState))) 1672 1670 { 1673 tmTimerSetRelativeOptimizedStart(pVM, pTimer, cTicksToNext, pu64Now, pQueue , idxQueue);1671 tmTimerSetRelativeOptimizedStart(pVM, pTimer, cTicksToNext, pu64Now, pQueueCC, pQueue); 1674 1672 STAM_PROFILE_STOP(&pVM->tm.s.CTX_SUFF_Z(StatTimerSetRelative), a); 1675 1673 PDMCritSectLeave(&pQueue->TimerLock); … … 1704 1702 RT_FALL_THRU(); 1705 1703 case TMTIMERSTATE_EXPIRED_DELIVER: 1706 if (tmTimerTryWithLink(p VM, pTimer, TMTIMERSTATE_PENDING_SCHEDULE_SET_EXPIRE, enmState))1704 if (tmTimerTryWithLink(pQueueCC, pQueue, pTimer, TMTIMERSTATE_PENDING_SCHEDULE_SET_EXPIRE, enmState)) 1707 1705 { 1708 1706 Assert(pTimer->idxPrev == UINT32_MAX); … … 1712 1710 pTimer, tmTimerState(enmState), pTimer->szName, pTimer->u64Expire, cRetries)); 1713 1711 TM_SET_STATE(pTimer, TMTIMERSTATE_PENDING_SCHEDULE); 1714 tmSchedule(pVM, p Timer);1712 tmSchedule(pVM, pQueueCC, pQueue, pTimer); 1715 1713 rc = VINF_SUCCESS; 1716 1714 break; … … 1727 1725 pTimer, tmTimerState(enmState), pTimer->szName, pTimer->u64Expire, cRetries)); 1728 1726 TM_SET_STATE(pTimer, TMTIMERSTATE_PENDING_SCHEDULE); 1729 tmSchedule(pVM, p Timer);1727 tmSchedule(pVM, pQueueCC, pQueue, pTimer); 1730 1728 rc = VINF_SUCCESS; 1731 1729 break; … … 1736 1734 1737 1735 case TMTIMERSTATE_ACTIVE: 1738 if (tmTimerTryWithLink(p VM, pTimer, TMTIMERSTATE_PENDING_RESCHEDULE_SET_EXPIRE, enmState))1736 if (tmTimerTryWithLink(pQueueCC, pQueue, pTimer, TMTIMERSTATE_PENDING_RESCHEDULE_SET_EXPIRE, enmState)) 1739 1737 { 1740 1738 pTimer->u64Expire = cTicksToNext + tmTimerSetRelativeNowWorker(pVM, pQueue->enmClock, pu64Now); … … 1742 1740 pTimer, tmTimerState(enmState), pTimer->szName, pTimer->u64Expire, cRetries)); 1743 1741 TM_SET_STATE(pTimer, TMTIMERSTATE_PENDING_RESCHEDULE); 1744 tmSchedule(pVM, p Timer);1742 tmSchedule(pVM, pQueueCC, pQueue, pTimer); 1745 1743 rc = VINF_SUCCESS; 1746 1744 break; … … 1757 1755 pTimer, tmTimerState(enmState), pTimer->szName, pTimer->u64Expire, cRetries)); 1758 1756 TM_SET_STATE(pTimer, TMTIMERSTATE_PENDING_RESCHEDULE); 1759 tmSchedule(pVM, p Timer);1757 tmSchedule(pVM, pQueueCC, pQueue, pTimer); 1760 1758 rc = VINF_SUCCESS; 1761 1759 break; … … 1841 1839 { 1842 1840 TMTIMER_HANDLE_TO_VARS_RETURN(pVM, hTimer); /* => pTimer, pQueueCC, pQueue, idxTimer, idxQueue */ 1843 return tmTimerSetRelative(pVM, pTimer, cTicksToNext, pu64Now, pQueue , idxQueue);1841 return tmTimerSetRelative(pVM, pTimer, cTicksToNext, pu64Now, pQueueCC, pQueue); 1844 1842 } 1845 1843 … … 2007 2005 if (tmTimerTry(pTimer, TMTIMERSTATE_PENDING_STOP_SCHEDULE, enmState)) 2008 2006 { 2009 tmSchedule(pVM, p Timer);2007 tmSchedule(pVM, pQueueCC, pQueue, pTimer); 2010 2008 STAM_PROFILE_STOP(&pVM->tm.s.CTX_SUFF_Z(StatTimerStop), a); 2011 2009 return VINF_SUCCESS; … … 2016 2014 if (tmTimerTry(pTimer, TMTIMERSTATE_PENDING_STOP, enmState)) 2017 2015 { 2018 tmSchedule(pVM, p Timer);2016 tmSchedule(pVM, pQueueCC, pQueue, pTimer); 2019 2017 STAM_PROFILE_STOP(&pVM->tm.s.CTX_SUFF_Z(StatTimerStop), a); 2020 2018 return VINF_SUCCESS; … … 2023 2021 2024 2022 case TMTIMERSTATE_ACTIVE: 2025 if (tmTimerTryWithLink(p VM, pTimer, TMTIMERSTATE_PENDING_STOP, enmState))2023 if (tmTimerTryWithLink(pQueueCC, pQueue, pTimer, TMTIMERSTATE_PENDING_STOP, enmState)) 2026 2024 { 2027 tmSchedule(pVM, p Timer);2025 tmSchedule(pVM, pQueueCC, pQueue, pTimer); 2028 2026 STAM_PROFILE_STOP(&pVM->tm.s.CTX_SUFF_Z(StatTimerStop), a); 2029 2027 return VINF_SUCCESS; … … 2252 2250 case TMCLOCK_VIRTUAL: 2253 2251 AssertCompile(TMCLOCK_FREQ_VIRTUAL == 1000000000); 2254 return tmTimerSetRelative(pVM, pTimer, cMilliesToNext * UINT64_C(1000000), NULL, pQueue , idxQueue);2252 return tmTimerSetRelative(pVM, pTimer, cMilliesToNext * UINT64_C(1000000), NULL, pQueueCC, pQueue); 2255 2253 2256 2254 case TMCLOCK_VIRTUAL_SYNC: 2257 2255 AssertCompile(TMCLOCK_FREQ_VIRTUAL == 1000000000); 2258 return tmTimerSetRelative(pVM, pTimer, cMilliesToNext * UINT64_C(1000000), NULL, pQueue , idxQueue);2256 return tmTimerSetRelative(pVM, pTimer, cMilliesToNext * UINT64_C(1000000), NULL, pQueueCC, pQueue); 2259 2257 2260 2258 case TMCLOCK_REAL: 2261 2259 AssertCompile(TMCLOCK_FREQ_REAL == 1000); 2262 return tmTimerSetRelative(pVM, pTimer, cMilliesToNext, NULL, pQueue , idxQueue);2260 return tmTimerSetRelative(pVM, pTimer, cMilliesToNext, NULL, pQueueCC, pQueue); 2263 2261 2264 2262 default: … … 2284 2282 case TMCLOCK_VIRTUAL: 2285 2283 AssertCompile(TMCLOCK_FREQ_VIRTUAL == 1000000000); 2286 return tmTimerSetRelative(pVM, pTimer, cMicrosToNext * 1000, NULL, pQueue , idxQueue);2284 return tmTimerSetRelative(pVM, pTimer, cMicrosToNext * 1000, NULL, pQueueCC, pQueue); 2287 2285 2288 2286 case TMCLOCK_VIRTUAL_SYNC: 2289 2287 AssertCompile(TMCLOCK_FREQ_VIRTUAL == 1000000000); 2290 return tmTimerSetRelative(pVM, pTimer, cMicrosToNext * 1000, NULL, pQueue , idxQueue);2288 return tmTimerSetRelative(pVM, pTimer, cMicrosToNext * 1000, NULL, pQueueCC, pQueue); 2291 2289 2292 2290 case TMCLOCK_REAL: 2293 2291 AssertCompile(TMCLOCK_FREQ_REAL == 1000); 2294 return tmTimerSetRelative(pVM, pTimer, cMicrosToNext / 1000, NULL, pQueue , idxQueue);2292 return tmTimerSetRelative(pVM, pTimer, cMicrosToNext / 1000, NULL, pQueueCC, pQueue); 2295 2293 2296 2294 default: … … 2312 2310 { 2313 2311 TMTIMER_HANDLE_TO_VARS_RETURN(pVM, hTimer); /* => pTimer, pQueueCC, pQueue, idxTimer, idxQueue */ 2314 switch (p Timer->enmClock)2312 switch (pQueue->enmClock) 2315 2313 { 2316 2314 case TMCLOCK_VIRTUAL: 2317 2315 AssertCompile(TMCLOCK_FREQ_VIRTUAL == 1000000000); 2318 return tmTimerSetRelative(pVM, pTimer, cNanosToNext, NULL, pQueue , idxQueue);2316 return tmTimerSetRelative(pVM, pTimer, cNanosToNext, NULL, pQueueCC, pQueue); 2319 2317 2320 2318 case TMCLOCK_VIRTUAL_SYNC: 2321 2319 AssertCompile(TMCLOCK_FREQ_VIRTUAL == 1000000000); 2322 return tmTimerSetRelative(pVM, pTimer, cNanosToNext, NULL, pQueue , idxQueue);2320 return tmTimerSetRelative(pVM, pTimer, cNanosToNext, NULL, pQueueCC, pQueue); 2323 2321 2324 2322 case TMCLOCK_REAL: 2325 2323 AssertCompile(TMCLOCK_FREQ_REAL == 1000); 2326 return tmTimerSetRelative(pVM, pTimer, cNanosToNext / 1000000, NULL, pQueue , idxQueue);2324 return tmTimerSetRelative(pVM, pTimer, cNanosToNext / 1000000, NULL, pQueueCC, pQueue); 2327 2325 2328 2326 default: 2329 AssertMsgFailed(("Invalid enmClock=%d\n", p Timer->enmClock));2327 AssertMsgFailed(("Invalid enmClock=%d\n", pQueue->enmClock)); 2330 2328 return VERR_TM_TIMER_BAD_CLOCK; 2331 2329 } -
trunk/src/VBox/VMM/VMMR0/TMR0.cpp
r87796 r87814 139 139 { 140 140 paTimers[i].u64Expire = UINT64_MAX; 141 paTimers[i].enmClock = TMCLOCK_MAX;142 141 paTimers[i].enmType = TMTIMERTYPE_INVALID; 143 142 paTimers[i].enmState = TMTIMERSTATE_FREE; -
trunk/src/VBox/VMM/VMMR3/TM.cpp
r87813 r87814 1515 1515 1516 1516 #ifdef VBOX_WITH_STATISTICS 1517 /** Names the clock of the timer. */1518 static const char *tmR3TimerClockName(PTMTIMERR3 pTimer)1519 {1520 switch (pTimer->enmClock)1521 {1522 case TMCLOCK_VIRTUAL: return "virtual";1523 case TMCLOCK_VIRTUAL_SYNC: return "virtual-sync";1524 case TMCLOCK_REAL: return "real";1525 case TMCLOCK_TSC: return "tsc";1526 case TMCLOCK_MAX: break;1527 }1528 return "corrupt clock value";1529 }1530 #endif1531 1532 1533 #ifdef VBOX_WITH_STATISTICS1534 1517 1535 1518 /** … … 1537 1520 * 1538 1521 * @param pVM The cross context VM structure. 1522 * @param pQueue The queue the timer belongs to. 1539 1523 * @param pTimer The timer to register statistics for. 1540 1524 */ 1541 static void tmR3TimerRegisterStats(PVM pVM, PTMTIMER pTimer)1525 static void tmR3TimerRegisterStats(PVM pVM, PTMTIMERQUEUE pQueue, PTMTIMER pTimer) 1542 1526 { 1543 1527 STAMR3RegisterF(pVM, &pTimer->StatTimer, STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_TICKS_PER_CALL, 1544 tmR3TimerClockName(pTimer), "/TM/Timers/%s", pTimer->szName);1528 pQueue->szName, "/TM/Timers/%s", pTimer->szName); 1545 1529 STAMR3RegisterF(pVM, &pTimer->StatCritSectEnter, STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_TICKS_PER_CALL, 1546 1530 "", "/TM/Timers/%s/CritSectEnter", pTimer->szName); … … 1584 1568 TMTIMERSTATE enmState = pTimer->enmState; 1585 1569 if (enmState > TMTIMERSTATE_INVALID && enmState < TMTIMERSTATE_DESTROY) 1586 tmR3TimerRegisterStats(pVM, p Timer);1570 tmR3TimerRegisterStats(pVM, pQueue, pTimer); 1587 1571 } 1588 1572 } … … 1684 1668 1685 1669 pTimer->u64Expire = 0; 1686 pTimer->enmClock = enmClock;1687 1670 pTimer->enmState = TMTIMERSTATE_STOPPED; 1688 1671 pTimer->idxScheduleNext = UINT32_MAX; … … 1707 1690 */ 1708 1691 if (pQueue->fCannotGrow) 1709 tmR3TimerRegisterStats(pVM, p Timer);1692 tmR3TimerRegisterStats(pVM, pQueue, pTimer); 1710 1693 #endif 1711 1694 … … 2436 2419 } 2437 2420 Log2(("tmR3TimerQueueRun: %p:{.enmState=%s, .enmClock=%d, .enmType=%d, u64Expire=%llx (now=%llx) .szName='%s'}\n", 2438 pTimer, tmTimerState(pTimer->enmState), p Timer->enmClock, pTimer->enmType, pTimer->u64Expire, u64Now, pTimer->szName));2421 pTimer, tmTimerState(pTimer->enmState), pQueue->enmClock, pTimer->enmType, pTimer->u64Expire, u64Now, pTimer->szName)); 2439 2422 bool fRc; 2440 2423 TM_TRY_SET_STATE(pTimer, TMTIMERSTATE_EXPIRED_GET_UNLINK, TMTIMERSTATE_ACTIVE, fRc); … … 2629 2612 2630 2613 Log2(("tmR3TimerQueueRun: %p:{.enmState=%s, .enmClock=%d, .enmType=%d, u64Expire=%llx (now=%llx) .szName='%s'}\n", 2631 pTimer, tmTimerState(pTimer->enmState), p Timer->enmClock, pTimer->enmType, pTimer->u64Expire, u64Now, pTimer->szName));2614 pTimer, tmTimerState(pTimer->enmState), pQueue->enmClock, pTimer->enmType, pTimer->u64Expire, u64Now, pTimer->szName)); 2632 2615 2633 2616 /* Advance the clock - don't permit timers to be out of order or armed … … 3849 3832 for (uint32_t idxQueue = 0; idxQueue < RT_ELEMENTS(pVM->tm.s.aTimerQueues); idxQueue++) 3850 3833 { 3851 PTMTIMERQUEUE pQueue = &pVM->tm.s.aTimerQueues[idxQueue]; 3834 PTMTIMERQUEUE const pQueue = &pVM->tm.s.aTimerQueues[idxQueue]; 3835 const char * const pszClock = tmR3Get5CharClockName(pQueue->enmClock); 3852 3836 PDMCritSectRwEnterShared(&pQueue->AllocLock, VERR_IGNORED); 3853 3837 for (uint32_t idxTimer = 0; idxTimer < pQueue->cTimersAlloc; idxTimer++) … … 3862 3846 pTimer->idxPrev, 3863 3847 pTimer->idxScheduleNext, 3864 tmR3Get5CharClockName(pTimer->enmClock),3848 pszClock, 3865 3849 TMTimerGet(pVM, pTimer->hSelf), 3866 3850 pTimer->u64Expire, … … 3898 3882 for (uint32_t idxQueue = 0; idxQueue < RT_ELEMENTS(pVM->tm.s.aTimerQueues); idxQueue++) 3899 3883 { 3900 PTMTIMERQUEUE pQueue = &pVM->tm.s.aTimerQueues[idxQueue]; 3884 PTMTIMERQUEUE const pQueue = &pVM->tm.s.aTimerQueues[idxQueue]; 3885 const char * const pszClock = tmR3Get5CharClockName(pQueue->enmClock); 3901 3886 PDMCritSectRwEnterShared(&pQueue->AllocLock, VERR_IGNORED); 3902 3887 PDMCritSectEnter(&pQueue->TimerLock, VERR_IGNORED); … … 3912 3897 pTimer->idxPrev, 3913 3898 pTimer->idxScheduleNext, 3914 tmR3Get5CharClockName(pTimer->enmClock),3899 pszClock, 3915 3900 TMTimerGet(pVM, pTimer->hSelf), 3916 3901 pTimer->u64Expire, -
trunk/src/VBox/VMM/include/TMInline.h
r87813 r87814 141 141 #ifdef VBOX_STRICT 142 142 TMTIMERSTATE const enmState = pTimer->enmState; 143 Assert( p Timer->enmClock == TMCLOCK_VIRTUAL_SYNC143 Assert( pQueue->enmClock == TMCLOCK_VIRTUAL_SYNC 144 144 ? enmState == TMTIMERSTATE_ACTIVE 145 145 : enmState == TMTIMERSTATE_PENDING_SCHEDULE || enmState == TMTIMERSTATE_PENDING_STOP_SCHEDULE); -
trunk/src/VBox/VMM/include/TMInternal.h
r87813 r87814 136 136 /** Expire time. */ 137 137 volatile uint64_t u64Expire; 138 /** Clock to apply to u64Expire. */ 139 TMCLOCK enmClock; 138 139 /** Timer state. */ 140 volatile TMTIMERSTATE enmState; 141 /** The index of the next next timer in the schedule list. */ 142 uint32_t volatile idxScheduleNext; 143 144 /** The index of the next timer in the chain. */ 145 uint32_t idxNext; 146 /** The index of the previous timer in the chain. */ 147 uint32_t idxPrev; 148 149 /** The timer frequency hint. This is 0 if not hint was given. */ 150 uint32_t volatile uHzHint; 140 151 /** Timer callback type. */ 141 152 TMTIMERTYPE enmType; 153 154 /** It's own handle value. */ 155 TMTIMERHANDLE hSelf; 156 /** TMTIMER_FLAGS_XXX. */ 157 uint32_t fFlags; 158 /** Explicit alignment padding. */ 159 uint32_t u32Alignment; 160 161 /** User argument. */ 162 RTR3PTR pvUser; 163 /** The critical section associated with the lock. */ 164 R3PTRTYPE(PPDMCRITSECT) pCritSect; 165 166 /* new cache line (64-bit / 64 bytes) */ 167 142 168 /** Type specific data. */ 143 169 union … … 178 204 } u; 179 205 180 /** Timer state. */181 volatile TMTIMERSTATE enmState;182 /** The index of the next next timer in the schedule list. */183 uint32_t volatile idxScheduleNext;184 185 /** The index of the next timer in the chain. */186 uint32_t idxNext;187 /** The index of the previous timer in the chain. */188 uint32_t idxPrev;189 190 /** It's own handle value. */191 TMTIMERHANDLE hSelf;192 /** TMTIMER_FLAGS_XXX. */193 uint32_t fFlags;194 /** The timer frequency hint. This is 0 if not hint was given. */195 uint32_t volatile uHzHint;196 197 /** User argument. */198 RTR3PTR pvUser;199 /** The critical section associated with the lock. */200 R3PTRTYPE(PPDMCRITSECT) pCritSect;201 202 206 /** The timer name. */ 203 207 char szName[32]; 204 208 205 #ifdef VBOX_WITH_STATISTICS 209 /** @todo think of two useful release statistics counters here to fill up the 210 * cache line. */ 211 #ifndef VBOX_WITH_STATISTICS 212 uint64_t auAlignment2[2]; 213 #else 206 214 STAMPROFILE StatTimer; 207 215 STAMPROFILE StatCritSectEnter; … … 210 218 STAMCOUNTER StatSetRelative; 211 219 STAMCOUNTER StatStop; 220 uint64_t auAlignment2[6]; 212 221 #endif 213 222 } TMTIMER; 223 AssertCompileMemberSize(TMTIMER, u64Expire, sizeof(uint64_t)); 214 224 AssertCompileMemberSize(TMTIMER, enmState, sizeof(uint32_t)); 225 AssertCompileSizeAlignment(TMTIMER, 64); 215 226 216 227
Note:
See TracChangeset
for help on using the changeset viewer.