VirtualBox

Changeset 87765 in vbox for trunk


Ignore:
Timestamp:
Feb 16, 2021 12:18:57 AM (4 years ago)
Author:
vboxsync
Message:

VMM/TM,*: Added flag parameter to TMR3TimerCreateInternal and renamed it to TMR3TimerCreate. bugref:9943

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/tm.h

    r87764 r87765  
    278278VMM_INT_DECL(int)       TMR3TimerCreateUsb(PVM pVM, PPDMUSBINS pUsbIns, TMCLOCK enmClock, PFNTMTIMERUSB pfnCallback, void *pvUser, uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer);
    279279VMM_INT_DECL(int)       TMR3TimerCreateDriver(PVM pVM, PPDMDRVINS pDrvIns, TMCLOCK enmClock, PFNTMTIMERDRV pfnCallback, void *pvUser, uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer);
    280 VMMR3DECL(int)          TMR3TimerCreateInternal(PVM pVM, TMCLOCK enmClock, PFNTMTIMERINT pfnCallback, void *pvUser, const char *pszDesc, PPTMTIMERR3 ppTimer);
     280VMMR3DECL(int)          TMR3TimerCreate(PVM pVM, TMCLOCK enmClock, PFNTMTIMERINT pfnCallback, void *pvUser, uint32_t fFlags,
     281                                        const char *pszDesc, PPTMTIMERR3 ppTimer);
    281282VMMR3DECL(int)          TMR3TimerDestroy(PTMTIMER pTimer);
    282283VMM_INT_DECL(int)       TMR3TimerDestroyDevice(PVM pVM, PPDMDEVINS pDevIns);
  • trunk/src/VBox/VMM/VMMR3/CPUM.cpp

    r87523 r87765  
    45034503
    45044504            /* Create VMX-preemption timer for nested guests if required. */
     4505/** @todo r=bird: this should be one in CPUMR3Init, not here.   */
    45054506            if (pVM->cpum.s.GuestFeatures.fVmx)
    45064507            {
     
    45114512                       MMR3HyperInitFinalize has already completed at this point. */
    45124513                    char *pszTimerName = MMR3HeapAPrintf(pVM, MM_TAG_CPUM_CTX, "Nested Guest VMX-preempt. timer %u", idCpu);
    4513                     int rc = TMR3TimerCreateInternal(pVM, TMCLOCK_VIRTUAL_SYNC, cpumR3VmxPreemptTimerCallback, pVCpu,
    4514                                                      pszTimerName, &pVCpu->cpum.s.pNestedVmxPreemptTimerR3);
     4514                    int rc = TMR3TimerCreate(pVM, TMCLOCK_VIRTUAL_SYNC, cpumR3VmxPreemptTimerCallback, pVCpu,
     4515                                             TMTIMER_FLAGS_RING0, pszTimerName, &pVCpu->cpum.s.pNestedVmxPreemptTimerR3);
    45154516                    AssertLogRelRCReturn(rc, rc);
    45164517                    pVCpu->cpum.s.pNestedVmxPreemptTimerR0 = TMTimerR0Ptr(pVCpu->cpum.s.pNestedVmxPreemptTimerR3);
  • trunk/src/VBox/VMM/VMMR3/GIMHv.cpp

    r82968 r87765  
    509509                RTStrPrintf(&pHvStimer->szTimerDesc[0], sizeof(pHvStimer->szTimerDesc), "Hyper-V[%u] Timer%u", pVCpu->idCpu,
    510510                            idxStimer);
    511                 rc = TMR3TimerCreateInternal(pVM, TMCLOCK_VIRTUAL_SYNC, gimR3HvTimerCallback, pHvStimer /* pvUser */,
    512                                              pHvStimer->szTimerDesc, &pHvStimer->pTimerR3);
     511                rc = TMR3TimerCreate(pVM, TMCLOCK_VIRTUAL_SYNC, gimR3HvTimerCallback, pHvStimer /* pvUser */,
     512                                     TMTIMER_FLAGS_RING0, pHvStimer->szTimerDesc, &pHvStimer->pTimerR3);
    513513                AssertLogRelRCReturn(rc, rc);
    514514                pHvStimer->pTimerR0 = TMTimerR0Ptr(pHvStimer->pTimerR3);
  • trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp

    r82968 r87765  
    866866    }
    867867
    868 #ifdef PDM_ASYNC_COMPLETION_FILE_WITH_DELAY
    869     rc = TMR3TimerCreateInternal(pEpClassFile->Core.pVM, TMCLOCK_REAL, pdmacR3TimerCallback, pEpClassFile, "AC Delay", &pEpClassFile->pTimer);
     868# ifdef PDM_ASYNC_COMPLETION_FILE_WITH_DELAY
     869    rc = TMR3TimerCreate(pEpClassFile->Core.pVM, TMCLOCK_REAL, pdmacR3TimerCallback, pEpClassFile,
     870                         TMTIMER_FLAGS_NO_RING0, "AC Delay", &pEpClassFile->pTimer);
    870871    AssertRC(rc);
    871872    pEpClassFile->cMilliesNext = UINT64_MAX;
    872 #endif
     873# endif
    873874#endif
    874875
  • trunk/src/VBox/VMM/VMMR3/PDMBlkCache.cpp

    r86527 r87765  
    11571157        /* Create the commit timer */
    11581158        if (pBlkCacheGlobal->u32CommitTimeoutMs > 0)
    1159             rc = TMR3TimerCreateInternal(pVM, TMCLOCK_REAL,
    1160                                          pdmBlkCacheCommitTimerCallback,
    1161                                          pBlkCacheGlobal,
    1162                                          "BlkCache-Commit",
    1163                                          &pBlkCacheGlobal->pTimerCommit);
     1159            rc = TMR3TimerCreate(pVM, TMCLOCK_REAL, pdmBlkCacheCommitTimerCallback, pBlkCacheGlobal,
     1160                                 TMTIMER_FLAGS_NO_RING0,  "BlkCache-Commit", &pBlkCacheGlobal->pTimerCommit);
    11641161
    11651162        if (RT_SUCCESS(rc))
  • trunk/src/VBox/VMM/VMMR3/PDMQueue.cpp

    r82968 r87765  
    113113    if (cMilliesInterval)
    114114    {
    115         rc = TMR3TimerCreateInternal(pVM, TMCLOCK_REAL, pdmR3QueueTimer, pQueue, "Queue timer", &pQueue->pTimer);
     115        rc = TMR3TimerCreate(pVM, TMCLOCK_REAL, pdmR3QueueTimer, pQueue, TMTIMER_FLAGS_NO_RING0, "Queue timer", &pQueue->pTimer);
    116116        if (RT_SUCCESS(rc))
    117117        {
  • trunk/src/VBox/VMM/VMMR3/TM.cpp

    r87763 r87765  
    11011101     */
    11021102    PTMTIMER pTimer;
    1103     rc = TMR3TimerCreateInternal(pVM, TMCLOCK_REAL, tmR3CpuLoadTimer, NULL, "CPU Load Timer", &pTimer);
     1103    rc = TMR3TimerCreate(pVM, TMCLOCK_REAL, tmR3CpuLoadTimer, NULL, TMTIMER_FLAGS_NO_RING0, "CPU Load Timer", &pTimer);
    11041104    if (RT_SUCCESS(rc))
    11051105        rc = TMTimerSetMillies(pTimer, 1000);
     
    17211721 * @param   pfnCallback     Callback function.
    17221722 * @param   pvUser          User argument to be passed to the callback.
     1723 * @param   fFlags          Timer creation flags, see grp_tm_timer_flags.
    17231724 * @param   pszDesc         Pointer to description string which must stay around
    17241725 *                          until the timer is fully destroyed (i.e. a bit after TMTimerDestroy()).
    17251726 * @param   ppTimer         Where to store the timer on success.
    17261727 */
    1727 VMMR3DECL(int) TMR3TimerCreateInternal(PVM pVM, TMCLOCK enmClock,
    1728                                        PFNTMTIMERINT pfnCallback, void *pvUser, const char *pszDesc, PPTMTIMERR3 ppTimer)
    1729 {
     1728VMMR3DECL(int) TMR3TimerCreate(PVM pVM, TMCLOCK enmClock, PFNTMTIMERINT pfnCallback, void *pvUser,
     1729                               uint32_t fFlags, const char *pszDesc, PPTMTIMERR3 ppTimer)
     1730{
     1731    AssertReturn(fFlags & (TMTIMER_FLAGS_RING0 | TMTIMER_FLAGS_NO_RING0), VERR_INVALID_FLAGS);
     1732    AssertReturn((fFlags & (TMTIMER_FLAGS_RING0 | TMTIMER_FLAGS_NO_RING0)) != (TMTIMER_FLAGS_RING0 | TMTIMER_FLAGS_NO_RING0),
     1733                 VERR_INVALID_FLAGS);
     1734
    17301735    /*
    17311736     * Allocate and init  stuff.
    17321737     */
    17331738    PTMTIMER pTimer;
    1734     int rc = tmr3TimerCreate(pVM, enmClock, 0 /*fFlags*/, pszDesc, &pTimer);
     1739    int rc = tmr3TimerCreate(pVM, enmClock, fFlags, pszDesc, &pTimer);
    17351740    if (RT_SUCCESS(rc))
    17361741    {
  • trunk/src/VBox/VMM/VMMR3/VMM.cpp

    r82968 r87765  
    660660             * Create the EMT yield timer.
    661661             */
    662             rc = TMR3TimerCreateInternal(pVM, TMCLOCK_REAL, vmmR3YieldEMT, NULL, "EMT Yielder", &pVM->vmm.s.pYieldTimer);
     662            rc = TMR3TimerCreate(pVM, TMCLOCK_REAL, vmmR3YieldEMT, NULL, TMTIMER_FLAGS_NO_RING0,
     663                                 "EMT Yielder", &pVM->vmm.s.pYieldTimer);
    663664            AssertRCReturn(rc, rc);
    664665
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