VirtualBox

Ignore:
Timestamp:
Feb 19, 2021 9:40:11 PM (4 years ago)
Author:
vboxsync
Message:

VMM/TM: TMTIMER_HANDLE_TO_PTR_RETURN* -> TMTIMER_HANDLE_TO_VARS_RETURN*. bugref:9943

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/TMAll.cpp

    r87812 r87813  
    11471147VMMDECL(int) TMTimerLock(PVMCC pVM, TMTIMERHANDLE hTimer, int rcBusy)
    11481148{
    1149     PTMTIMER pTimer;
    1150     TMTIMER_HANDLE_TO_PTR_RETURN(pVM, hTimer, pTimer);
    1151     AssertPtr(pTimer);
    1152     AssertReturn(pTimer->enmClock == TMCLOCK_VIRTUAL_SYNC, VERR_NOT_SUPPORTED);
     1149    TMTIMER_HANDLE_TO_VARS_RETURN(pVM, hTimer); /* => pTimer, pQueueCC, pQueue, idxTimer, idxQueue */
     1150    AssertReturn(idxQueue == TMCLOCK_VIRTUAL_SYNC, VERR_NOT_SUPPORTED);
    11531151    return PDMCritSectEnter(&pVM->tm.s.VirtualSyncLock, rcBusy);
    11541152}
     
    11631161VMMDECL(void) TMTimerUnlock(PVMCC pVM, TMTIMERHANDLE hTimer)
    11641162{
    1165     PTMTIMER pTimer;
    1166     TMTIMER_HANDLE_TO_PTR_RETURN_VOID(pVM, hTimer, pTimer);
    1167     AssertReturnVoid(pTimer->enmClock == TMCLOCK_VIRTUAL_SYNC);
     1163    TMTIMER_HANDLE_TO_VARS_RETURN_VOID(pVM, hTimer); /* => pTimer, pQueueCC, pQueue, idxTimer, idxQueue */
     1164    AssertReturnVoid(idxQueue == TMCLOCK_VIRTUAL_SYNC);
    11681165    PDMCritSectLeave(&pVM->tm.s.VirtualSyncLock);
    11691166}
     
    11791176VMMDECL(bool) TMTimerIsLockOwner(PVMCC pVM, TMTIMERHANDLE hTimer)
    11801177{
    1181     PTMTIMER pTimer;
    1182     TMTIMER_HANDLE_TO_PTR_RETURN_EX(pVM, hTimer, false, pTimer);
    1183     AssertPtr(pTimer);
    1184     AssertReturn(pTimer->enmClock == TMCLOCK_VIRTUAL_SYNC, false);
     1178    TMTIMER_HANDLE_TO_VARS_RETURN_EX(pVM, hTimer, false); /* => pTimer, pQueueCC, pQueue, idxTimer, idxQueue */
     1179    AssertReturn(idxQueue == TMCLOCK_VIRTUAL_SYNC, false);
    11851180    return PDMCritSectIsOwner(&pVM->tm.s.VirtualSyncLock);
    11861181}
     
    11961191 * @param   u64Expire       The new expire time.
    11971192 * @param   pQueue          Pointer to the shared timer queue data.
    1198  * @param   enmClock        The sanitized clock.
    1199  */
    1200 static int tmTimerSetOptimizedStart(PVMCC pVM, PTMTIMER pTimer, uint64_t u64Expire, PTMTIMERQUEUE pQueue, TMCLOCK enmClock)
     1193 * @param   idxQueue        The queue index.
     1194 */
     1195static int tmTimerSetOptimizedStart(PVMCC pVM, PTMTIMER pTimer, uint64_t u64Expire, PTMTIMERQUEUE pQueue, uint32_t idxQueue)
    12011196{
    12021197    Assert(pTimer->idxPrev == UINT32_MAX);
     
    12071202     * Calculate and set the expiration time.
    12081203     */
    1209     if (enmClock == TMCLOCK_VIRTUAL_SYNC)
     1204    if (idxQueue == TMCLOCK_VIRTUAL_SYNC)
    12101205    {
    12111206        uint64_t u64Last = ASMAtomicReadU64(&pVM->tm.s.u64VirtualSync);
     
    12201215     * Link the timer into the active list.
    12211216     */
    1222     tmTimerQueueLinkActive(pVM, TM_GET_TIMER_QUEUE_CC(pVM, enmClock, pQueue), pQueue, pTimer, u64Expire);
     1217    tmTimerQueueLinkActive(pVM, TM_GET_TIMER_QUEUE_CC(pVM, idxQueue, pQueue), pQueue, pTimer, u64Expire);
    12231218
    12241219    STAM_COUNTER_INC(&pVM->tm.s.StatTimerSetOpt);
     
    13091304VMMDECL(int) TMTimerSet(PVMCC pVM, TMTIMERHANDLE hTimer, uint64_t u64Expire)
    13101305{
    1311     PTMTIMER pTimer;
    1312     TMTIMER_HANDLE_TO_PTR_RETURN(pVM, hTimer, pTimer);
     1306    TMTIMER_HANDLE_TO_VARS_RETURN(pVM, hTimer); /* => pTimer, pQueueCC, pQueue, idxTimer, idxQueue */
    13131307    STAM_COUNTER_INC(&pTimer->StatSetAbsolute);
    13141308
    13151309    /* Treat virtual sync timers specially. */
    1316     if (pTimer->enmClock == TMCLOCK_VIRTUAL_SYNC)
     1310    if (idxQueue == TMCLOCK_VIRTUAL_SYNC)
    13171311        return tmTimerVirtualSyncSet(pVM, pTimer, u64Expire);
    13181312
     
    13411335#endif
    13421336
     1337#if 1
    13431338    /*
    13441339     * The most common case is setting the timer again during the callback.
    13451340     * The second most common case is starting a timer at some other time.
    13461341     */
    1347 #if 1
    13481342    TMTIMERSTATE enmState1 = pTimer->enmState;
    13491343    if (    enmState1 == TMTIMERSTATE_EXPIRED_DELIVER
     
    13521346    {
    13531347        /* Try take the TM lock and check the state again. */
    1354         TMCLOCK const       enmClock = pTimer->enmClock;
    1355         AssertReturn((unsigned)enmClock < TMCLOCK_MAX, VERR_TM_IPE_2);
    1356         PTMTIMERQUEUE const pQueue   = &pVM->tm.s.aTimerQueues[enmClock];
    1357 
    13581348        int rc = PDMCritSectTryEnter(&pQueue->TimerLock);
    13591349        if (RT_SUCCESS_NP(rc))
     
    13611351            if (RT_LIKELY(tmTimerTry(pTimer, TMTIMERSTATE_ACTIVE, enmState1)))
    13621352            {
    1363                 tmTimerSetOptimizedStart(pVM, pTimer, u64Expire, pQueue, enmClock);
     1353                tmTimerSetOptimizedStart(pVM, pTimer, u64Expire, pQueue, idxQueue);
    13641354                STAM_PROFILE_STOP(&pVM->tm.s.CTX_SUFF_Z(StatTimerSet), a);
    13651355                PDMCritSectLeave(&pQueue->TimerLock);
     
    15091499 *                          Optional.
    15101500 * @param   pQueue          Pointer to the shared timer queue data.
    1511  * @param   enmClock        The sanitized clock.
     1501 * @param   idxQueue        The queue index.
    15121502 */
    15131503static int tmTimerSetRelativeOptimizedStart(PVMCC pVM, PTMTIMER pTimer, uint64_t cTicksToNext, uint64_t *pu64Now,
    1514                                             PTMTIMERQUEUE pQueue, TMCLOCK enmClock)
     1504                                            PTMTIMERQUEUE pQueue, uint32_t idxQueue)
    15151505{
    15161506    Assert(pTimer->idxPrev == UINT32_MAX);
     
    15211511     * Calculate and set the expiration time.
    15221512     */
    1523     uint64_t const  u64Expire = cTicksToNext + tmTimerSetRelativeNowWorker(pVM, enmClock, pu64Now);
     1513    uint64_t const  u64Expire = cTicksToNext + tmTimerSetRelativeNowWorker(pVM, pQueue->enmClock, pu64Now);
    15241514    pTimer->u64Expire         = u64Expire;
    15251515    Log2(("tmTimerSetRelativeOptimizedStart: %p:{.pszDesc='%s', .u64Expire=%'RU64} cTicksToNext=%'RU64\n", pTimer, pTimer->szName, u64Expire, cTicksToNext));
     
    15291519     */
    15301520    DBGFTRACE_U64_TAG2(pVM, u64Expire, "tmTimerSetRelativeOptimizedStart", pTimer->szName);
    1531     tmTimerQueueLinkActive(pVM, TM_GET_TIMER_QUEUE_CC(pVM, enmClock, pQueue), pQueue, pTimer, u64Expire);
     1521    tmTimerQueueLinkActive(pVM, TM_GET_TIMER_QUEUE_CC(pVM, idxQueue, pQueue), pQueue, pTimer, u64Expire);
    15321522
    15331523    STAM_COUNTER_INC(&pVM->tm.s.StatTimerSetRelativeOpt);
     1524    RT_NOREF(idxQueue);
    15341525    return VINF_SUCCESS;
    15351526}
     
    16241615 *                          Optional.
    16251616 */
    1626 static int tmTimerSetRelative(PVMCC pVM, PTMTIMER pTimer, uint64_t cTicksToNext, uint64_t *pu64Now)
     1617static int tmTimerSetRelative(PVMCC pVM, PTMTIMER pTimer, uint64_t cTicksToNext, uint64_t *pu64Now,
     1618                              PTMTIMERQUEUE pQueue, uint32_t idxQueue)
    16271619{
    16281620    STAM_COUNTER_INC(&pTimer->StatSetRelative);
    16291621
    16301622    /* Treat virtual sync timers specially. */
    1631     TMCLOCK enmClock = pTimer->enmClock;
    1632     if (enmClock == TMCLOCK_VIRTUAL_SYNC)
     1623    if (idxQueue == TMCLOCK_VIRTUAL_SYNC)
    16331624        return tmTimerVirtualSyncSetRelative(pVM, pTimer, cTicksToNext, pu64Now);
    1634     AssertReturn((unsigned)enmClock < (unsigned)TMCLOCK_MAX, VERR_TM_IPE_2);
    16351625
    16361626    STAM_PROFILE_START(&pVM->tm.s.CTX_SUFF_Z(StatTimerSetRelative), a);
     
    16681658     * longer as this isn't supported for any timers, critsect or not.)
    16691659     *
    1670      * Note! Lock ordering doesn't apply when we only tries to
     1660     * Note! Lock ordering doesn't apply when we only _try_ to
    16711661     *       get the innermost locks.
    16721662     */
    1673     PTMTIMERQUEUE pQueue = &pVM->tm.s.aTimerQueues[enmClock];
    16741663    bool fOwnTMLock = RT_SUCCESS_NP(PDMCritSectTryEnter(&pQueue->TimerLock));
    16751664#if 1
     
    16821671                      && tmTimerTry(pTimer, TMTIMERSTATE_ACTIVE, enmState)))
    16831672        {
    1684             tmTimerSetRelativeOptimizedStart(pVM, pTimer, cTicksToNext, pu64Now, pQueue, enmClock);
     1673            tmTimerSetRelativeOptimizedStart(pVM, pTimer, cTicksToNext, pu64Now, pQueue, idxQueue);
    16851674            STAM_PROFILE_STOP(&pVM->tm.s.CTX_SUFF_Z(StatTimerSetRelative), a);
    16861675            PDMCritSectLeave(&pQueue->TimerLock);
     
    17051694        {
    17061695            case TMTIMERSTATE_STOPPED:
    1707                 if (enmClock == TMCLOCK_VIRTUAL_SYNC)
     1696                if (pQueue->enmClock == TMCLOCK_VIRTUAL_SYNC)
    17081697                {
    17091698                    /** @todo To fix assertion in tmR3TimerQueueRunVirtualSync:
     
    17191708                    Assert(pTimer->idxPrev == UINT32_MAX);
    17201709                    Assert(pTimer->idxNext == UINT32_MAX);
    1721                     pTimer->u64Expire = cTicksToNext + tmTimerSetRelativeNowWorker(pVM, enmClock, pu64Now);
     1710                    pTimer->u64Expire = cTicksToNext + tmTimerSetRelativeNowWorker(pVM, pQueue->enmClock, pu64Now);
    17221711                    Log2(("TMTimerSetRelative: %p:{.enmState=%s, .pszDesc='%s', .u64Expire=%'RU64} cRetries=%d [EXP/STOP]\n",
    17231712                          pTimer, tmTimerState(enmState), pTimer->szName, pTimer->u64Expire, cRetries));
     
    17341723                if (tmTimerTry(pTimer, TMTIMERSTATE_PENDING_SCHEDULE_SET_EXPIRE, enmState))
    17351724                {
    1736                     pTimer->u64Expire = cTicksToNext + tmTimerSetRelativeNowWorker(pVM, enmClock, pu64Now);
     1725                    pTimer->u64Expire = cTicksToNext + tmTimerSetRelativeNowWorker(pVM, pQueue->enmClock, pu64Now);
    17371726                    Log2(("TMTimerSetRelative: %p:{.enmState=%s, .pszDesc='%s', .u64Expire=%'RU64} cRetries=%d [PEND_SCHED]\n",
    17381727                          pTimer, tmTimerState(enmState), pTimer->szName, pTimer->u64Expire, cRetries));
     
    17491738                if (tmTimerTryWithLink(pVM, pTimer, TMTIMERSTATE_PENDING_RESCHEDULE_SET_EXPIRE, enmState))
    17501739                {
    1751                     pTimer->u64Expire = cTicksToNext + tmTimerSetRelativeNowWorker(pVM, enmClock, pu64Now);
     1740                    pTimer->u64Expire = cTicksToNext + tmTimerSetRelativeNowWorker(pVM, pQueue->enmClock, pu64Now);
    17521741                    Log2(("TMTimerSetRelative: %p:{.enmState=%s, .pszDesc='%s', .u64Expire=%'RU64} cRetries=%d [ACTIVE]\n",
    17531742                          pTimer, tmTimerState(enmState), pTimer->szName, pTimer->u64Expire, cRetries));
     
    17641753                if (tmTimerTry(pTimer, TMTIMERSTATE_PENDING_RESCHEDULE_SET_EXPIRE, enmState))
    17651754                {
    1766                     pTimer->u64Expire = cTicksToNext + tmTimerSetRelativeNowWorker(pVM, enmClock, pu64Now);
     1755                    pTimer->u64Expire = cTicksToNext + tmTimerSetRelativeNowWorker(pVM, pQueue->enmClock, pu64Now);
    17671756                    Log2(("TMTimerSetRelative: %p:{.enmState=%s, .pszDesc='%s', .u64Expire=%'RU64} cRetries=%d [PEND_RESCH/STOP]\n",
    17681757                          pTimer, tmTimerState(enmState), pTimer->szName, pTimer->u64Expire, cRetries));
     
    18091798        if (rc != VERR_TRY_AGAIN)
    18101799        {
    1811             tmTimerSetRelativeNowWorker(pVM, enmClock, pu64Now);
     1800            tmTimerSetRelativeNowWorker(pVM, pQueue->enmClock, pu64Now);
    18121801            break;
    18131802        }
     
    18161805            AssertMsgFailed(("Failed waiting for stable state. state=%d (%s)\n", pTimer->enmState, pTimer->szName));
    18171806            rc = VERR_TM_TIMER_UNSTABLE_STATE;
    1818             tmTimerSetRelativeNowWorker(pVM, enmClock, pu64Now);
     1807            tmTimerSetRelativeNowWorker(pVM, pQueue->enmClock, pu64Now);
    18191808            break;
    18201809        }
     
    18511840VMMDECL(int) TMTimerSetRelative(PVMCC pVM, TMTIMERHANDLE hTimer, uint64_t cTicksToNext, uint64_t *pu64Now)
    18521841{
    1853     PTMTIMER pTimer;
    1854     TMTIMER_HANDLE_TO_PTR_RETURN(pVM, hTimer, pTimer);
    1855     return tmTimerSetRelative(pVM, pTimer, cTicksToNext, pu64Now);
     1842    TMTIMER_HANDLE_TO_VARS_RETURN(pVM, hTimer); /* => pTimer, pQueueCC, pQueue, idxTimer, idxQueue */
     1843    return tmTimerSetRelative(pVM, pTimer, cTicksToNext, pu64Now, pQueue, idxQueue);
    18561844}
    18571845
     
    20832071VMMDECL(uint64_t) TMTimerGet(PVMCC pVM, TMTIMERHANDLE hTimer)
    20842072{
    2085     PTMTIMER pTimer;
    2086     TMTIMER_HANDLE_TO_PTR_RETURN_EX(pVM, hTimer, UINT64_MAX, pTimer);
     2073    TMTIMER_HANDLE_TO_VARS_RETURN_EX(pVM, hTimer, 0); /* => pTimer, pQueueCC, pQueue, idxTimer, idxQueue */
    20872074    STAM_COUNTER_INC(&pTimer->StatGet);
    20882075
    20892076    uint64_t u64;
    2090     switch (pTimer->enmClock)
     2077    switch (pQueue->enmClock)
    20912078    {
    20922079        case TMCLOCK_VIRTUAL:
     
    21002087            break;
    21012088        default:
    2102             AssertMsgFailed(("Invalid enmClock=%d\n", pTimer->enmClock));
     2089            AssertMsgFailed(("Invalid enmClock=%d\n", pQueue->enmClock));
    21032090            return UINT64_MAX;
    21042091    }
     
    21182105VMMDECL(uint64_t) TMTimerGetFreq(PVMCC pVM, TMTIMERHANDLE hTimer)
    21192106{
    2120     PTMTIMER pTimer;
    2121     TMTIMER_HANDLE_TO_PTR_RETURN_EX(pVM, hTimer, 0, pTimer);
    2122     switch (pTimer->enmClock)
     2107    TMTIMER_HANDLE_TO_VARS_RETURN_EX(pVM, hTimer, 0); /* => pTimer, pQueueCC, pQueue, idxTimer, idxQueue */
     2108    switch (pQueue->enmClock)
    21232109    {
    21242110        case TMCLOCK_VIRTUAL:
     
    21302116
    21312117        default:
    2132             AssertMsgFailed(("Invalid enmClock=%d\n", pTimer->enmClock));
     2118            AssertMsgFailed(("Invalid enmClock=%d\n", pQueue->enmClock));
    21332119            return 0;
    21342120    }
     
    21462132VMMDECL(uint64_t) TMTimerGetExpire(PVMCC pVM, TMTIMERHANDLE hTimer)
    21472133{
    2148     PTMTIMER pTimer;
    2149     TMTIMER_HANDLE_TO_PTR_RETURN_EX(pVM, hTimer, UINT64_MAX, pTimer);
     2134    TMTIMER_HANDLE_TO_VARS_RETURN_EX(pVM, hTimer, UINT64_MAX); /* => pTimer, pQueueCC, pQueue, idxTimer, idxQueue */
    21502135    TMTIMER_ASSERT_CRITSECT(pVM, pTimer);
    21512136    int cRetries = 1000;
    21522137    do
    21532138    {
    2154         TMTIMERSTATE    enmState = pTimer->enmState;
     2139        TMTIMERSTATE enmState = pTimer->enmState;
    21552140        switch (enmState)
    21562141        {
     
    22112196VMMDECL(bool) TMTimerIsActive(PVMCC pVM, TMTIMERHANDLE hTimer)
    22122197{
    2213     PTMTIMER pTimer;
    2214     TMTIMER_HANDLE_TO_PTR_RETURN_EX(pVM, hTimer, false, pTimer);
     2198    TMTIMER_HANDLE_TO_VARS_RETURN_EX(pVM, hTimer, false); /* => pTimer, pQueueCC, pQueue, idxTimer, idxQueue */
    22152199    TMTIMERSTATE enmState = pTimer->enmState;
    22162200    switch (enmState)
     
    22632247VMMDECL(int) TMTimerSetMillies(PVMCC pVM, TMTIMERHANDLE hTimer, uint32_t cMilliesToNext)
    22642248{
    2265     PTMTIMER pTimer;
    2266     TMTIMER_HANDLE_TO_PTR_RETURN(pVM, hTimer, pTimer);
    2267     switch (pTimer->enmClock)
     2249    TMTIMER_HANDLE_TO_VARS_RETURN(pVM, hTimer); /* => pTimer, pQueueCC, pQueue, idxTimer, idxQueue */
     2250    switch (pQueue->enmClock)
    22682251    {
    22692252        case TMCLOCK_VIRTUAL:
    22702253            AssertCompile(TMCLOCK_FREQ_VIRTUAL == 1000000000);
    2271             return tmTimerSetRelative(pVM, pTimer, cMilliesToNext * UINT64_C(1000000), NULL);
     2254            return tmTimerSetRelative(pVM, pTimer, cMilliesToNext * UINT64_C(1000000), NULL, pQueue, idxQueue);
    22722255
    22732256        case TMCLOCK_VIRTUAL_SYNC:
    22742257            AssertCompile(TMCLOCK_FREQ_VIRTUAL == 1000000000);
    2275             return tmTimerSetRelative(pVM, pTimer, cMilliesToNext * UINT64_C(1000000), NULL);
     2258            return tmTimerSetRelative(pVM, pTimer, cMilliesToNext * UINT64_C(1000000), NULL, pQueue, idxQueue);
    22762259
    22772260        case TMCLOCK_REAL:
    22782261            AssertCompile(TMCLOCK_FREQ_REAL == 1000);
    2279             return tmTimerSetRelative(pVM, pTimer, cMilliesToNext, NULL);
     2262            return tmTimerSetRelative(pVM, pTimer, cMilliesToNext, NULL, pQueue, idxQueue);
    22802263
    22812264        default:
    2282             AssertMsgFailed(("Invalid enmClock=%d\n", pTimer->enmClock));
     2265            AssertMsgFailed(("Invalid enmClock=%d\n", pQueue->enmClock));
    22832266            return VERR_TM_TIMER_BAD_CLOCK;
    22842267    }
     
    22962279VMMDECL(int) TMTimerSetMicro(PVMCC pVM, TMTIMERHANDLE hTimer, uint64_t cMicrosToNext)
    22972280{
    2298     PTMTIMER pTimer;
    2299     TMTIMER_HANDLE_TO_PTR_RETURN(pVM, hTimer, pTimer);
    2300     switch (pTimer->enmClock)
     2281    TMTIMER_HANDLE_TO_VARS_RETURN(pVM, hTimer); /* => pTimer, pQueueCC, pQueue, idxTimer, idxQueue */
     2282    switch (pQueue->enmClock)
    23012283    {
    23022284        case TMCLOCK_VIRTUAL:
    23032285            AssertCompile(TMCLOCK_FREQ_VIRTUAL == 1000000000);
    2304             return tmTimerSetRelative(pVM, pTimer, cMicrosToNext * 1000, NULL);
     2286            return tmTimerSetRelative(pVM, pTimer, cMicrosToNext * 1000, NULL, pQueue, idxQueue);
    23052287
    23062288        case TMCLOCK_VIRTUAL_SYNC:
    23072289            AssertCompile(TMCLOCK_FREQ_VIRTUAL == 1000000000);
    2308             return tmTimerSetRelative(pVM, pTimer, cMicrosToNext * 1000, NULL);
     2290            return tmTimerSetRelative(pVM, pTimer, cMicrosToNext * 1000, NULL, pQueue, idxQueue);
    23092291
    23102292        case TMCLOCK_REAL:
    23112293            AssertCompile(TMCLOCK_FREQ_REAL == 1000);
    2312             return tmTimerSetRelative(pVM, pTimer, cMicrosToNext / 1000, NULL);
     2294            return tmTimerSetRelative(pVM, pTimer, cMicrosToNext / 1000, NULL, pQueue, idxQueue);
    23132295
    23142296        default:
    2315             AssertMsgFailed(("Invalid enmClock=%d\n", pTimer->enmClock));
     2297            AssertMsgFailed(("Invalid enmClock=%d\n", pQueue->enmClock));
    23162298            return VERR_TM_TIMER_BAD_CLOCK;
    23172299    }
     
    23292311VMMDECL(int) TMTimerSetNano(PVMCC pVM, TMTIMERHANDLE hTimer, uint64_t cNanosToNext)
    23302312{
    2331     PTMTIMER pTimer;
    2332     TMTIMER_HANDLE_TO_PTR_RETURN(pVM, hTimer, pTimer);
     2313    TMTIMER_HANDLE_TO_VARS_RETURN(pVM, hTimer); /* => pTimer, pQueueCC, pQueue, idxTimer, idxQueue */
    23332314    switch (pTimer->enmClock)
    23342315    {
    23352316        case TMCLOCK_VIRTUAL:
    23362317            AssertCompile(TMCLOCK_FREQ_VIRTUAL == 1000000000);
    2337             return tmTimerSetRelative(pVM, pTimer, cNanosToNext, NULL);
     2318            return tmTimerSetRelative(pVM, pTimer, cNanosToNext, NULL, pQueue, idxQueue);
    23382319
    23392320        case TMCLOCK_VIRTUAL_SYNC:
    23402321            AssertCompile(TMCLOCK_FREQ_VIRTUAL == 1000000000);
    2341             return tmTimerSetRelative(pVM, pTimer, cNanosToNext, NULL);
     2322            return tmTimerSetRelative(pVM, pTimer, cNanosToNext, NULL, pQueue, idxQueue);
    23422323
    23432324        case TMCLOCK_REAL:
    23442325            AssertCompile(TMCLOCK_FREQ_REAL == 1000);
    2345             return tmTimerSetRelative(pVM, pTimer, cNanosToNext / 1000000, NULL);
     2326            return tmTimerSetRelative(pVM, pTimer, cNanosToNext / 1000000, NULL, pQueue, idxQueue);
    23462327
    23472328        default:
     
    24032384VMMDECL(uint64_t) TMTimerToNano(PVMCC pVM, TMTIMERHANDLE hTimer, uint64_t cTicks)
    24042385{
    2405     PTMTIMER pTimer;
    2406     TMTIMER_HANDLE_TO_PTR_RETURN_EX(pVM, hTimer, 0, pTimer);
    2407     switch (pTimer->enmClock)
     2386    TMTIMER_HANDLE_TO_VARS_RETURN_EX(pVM, hTimer, 0); /* => pTimer, pQueueCC, pQueue, idxTimer, idxQueue */
     2387    switch (pQueue->enmClock)
    24082388    {
    24092389        case TMCLOCK_VIRTUAL:
     
    24172397
    24182398        default:
    2419             AssertMsgFailed(("Invalid enmClock=%d\n", pTimer->enmClock));
     2399            AssertMsgFailed(("Invalid enmClock=%d\n", pQueue->enmClock));
    24202400            return 0;
    24212401    }
     
    24352415VMMDECL(uint64_t) TMTimerToMicro(PVMCC pVM, TMTIMERHANDLE hTimer, uint64_t cTicks)
    24362416{
    2437     PTMTIMER pTimer;
    2438     TMTIMER_HANDLE_TO_PTR_RETURN_EX(pVM, hTimer, 0, pTimer);
    2439     switch (pTimer->enmClock)
     2417    TMTIMER_HANDLE_TO_VARS_RETURN_EX(pVM, hTimer, 0); /* => pTimer, pQueueCC, pQueue, idxTimer, idxQueue */
     2418    switch (pQueue->enmClock)
    24402419    {
    24412420        case TMCLOCK_VIRTUAL:
     
    24492428
    24502429        default:
    2451             AssertMsgFailed(("Invalid enmClock=%d\n", pTimer->enmClock));
     2430            AssertMsgFailed(("Invalid enmClock=%d\n", pQueue->enmClock));
    24522431            return 0;
    24532432    }
     
    24672446VMMDECL(uint64_t) TMTimerToMilli(PVMCC pVM, TMTIMERHANDLE hTimer, uint64_t cTicks)
    24682447{
    2469     PTMTIMER pTimer;
    2470     TMTIMER_HANDLE_TO_PTR_RETURN_EX(pVM, hTimer, 0, pTimer);
    2471     switch (pTimer->enmClock)
     2448    TMTIMER_HANDLE_TO_VARS_RETURN_EX(pVM, hTimer, 0); /* => pTimer, pQueueCC, pQueue, idxTimer, idxQueue */
     2449    switch (pQueue->enmClock)
    24722450    {
    24732451        case TMCLOCK_VIRTUAL:
     
    24812459
    24822460        default:
    2483             AssertMsgFailed(("Invalid enmClock=%d\n", pTimer->enmClock));
     2461            AssertMsgFailed(("Invalid enmClock=%d\n", pQueue->enmClock));
    24842462            return 0;
    24852463    }
     
    24982476VMMDECL(uint64_t) TMTimerFromNano(PVMCC pVM, TMTIMERHANDLE hTimer, uint64_t cNanoSecs)
    24992477{
    2500     PTMTIMER pTimer;
    2501     TMTIMER_HANDLE_TO_PTR_RETURN_EX(pVM, hTimer, 0, pTimer);
    2502     switch (pTimer->enmClock)
     2478    TMTIMER_HANDLE_TO_VARS_RETURN_EX(pVM, hTimer, 0); /* => pTimer, pQueueCC, pQueue, idxTimer, idxQueue */
     2479    switch (pQueue->enmClock)
    25032480    {
    25042481        case TMCLOCK_VIRTUAL:
     
    25122489
    25132490        default:
    2514             AssertMsgFailed(("Invalid enmClock=%d\n", pTimer->enmClock));
     2491            AssertMsgFailed(("Invalid enmClock=%d\n", pQueue->enmClock));
    25152492            return 0;
    25162493    }
     
    25292506VMMDECL(uint64_t) TMTimerFromMicro(PVMCC pVM, TMTIMERHANDLE hTimer, uint64_t cMicroSecs)
    25302507{
    2531     PTMTIMER pTimer;
    2532     TMTIMER_HANDLE_TO_PTR_RETURN_EX(pVM, hTimer, 0, pTimer);
    2533     switch (pTimer->enmClock)
     2508    TMTIMER_HANDLE_TO_VARS_RETURN_EX(pVM, hTimer, 0); /* => pTimer, pQueueCC, pQueue, idxTimer, idxQueue */
     2509    switch (pQueue->enmClock)
    25342510    {
    25352511        case TMCLOCK_VIRTUAL:
     
    25432519
    25442520        default:
    2545             AssertMsgFailed(("Invalid enmClock=%d\n", pTimer->enmClock));
     2521            AssertMsgFailed(("Invalid enmClock=%d\n", pQueue->enmClock));
    25462522            return 0;
    25472523    }
     
    25602536VMMDECL(uint64_t) TMTimerFromMilli(PVMCC pVM, TMTIMERHANDLE hTimer, uint64_t cMilliSecs)
    25612537{
    2562     PTMTIMER pTimer;
    2563     TMTIMER_HANDLE_TO_PTR_RETURN_EX(pVM, hTimer, 0, pTimer);
    2564     switch (pTimer->enmClock)
     2538    TMTIMER_HANDLE_TO_VARS_RETURN_EX(pVM, hTimer, 0); /* => pTimer, pQueueCC, pQueue, idxTimer, idxQueue */
     2539    switch (pQueue->enmClock)
    25652540    {
    25662541        case TMCLOCK_VIRTUAL:
     
    25742549
    25752550        default:
    2576             AssertMsgFailed(("Invalid enmClock=%d\n", pTimer->enmClock));
     2551            AssertMsgFailed(("Invalid enmClock=%d\n", pQueue->enmClock));
    25772552            return 0;
    25782553    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette