VirtualBox

Changeset 2551 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 9, 2007 12:05:52 PM (18 years ago)
Author:
vboxsync
Message:

Added TMVirtualSyncGetEx. Do not check timers in TMCpuTickGetOffset.

Location:
trunk/src/VBox/VMM/VMMAll
Files:
2 edited

Legend:

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

    r2469 r2551  
    4242DECLINLINE(uint64_t) tmCpuTickGetRawVirtual(PVM pVM, bool fCheckTimers)
    4343{
    44     uint64_t u64 = TMVirtualSyncGet(pVM/** @todo fCheckTimers */);
     44    uint64_t u64 = TMVirtualSyncGetEx(pVM, fCheckTimers);
    4545    if (u64 != TMCLOCK_FREQ_VIRTUAL)
    4646        u64 = ASMMultU64ByU32DivByU32(u64, pVM->tm.s.cTSCTicksPerSecond, TMCLOCK_FREQ_VIRTUAL);
  • trunk/src/VBox/VMM/VMMAll/TMAllVirtual.cpp

    r2283 r2551  
    167167 * @returns The timestamp.
    168168 * @param   pVM     VM handle.
     169 * @param   fCheckTimers    Check timers or not
    169170 * @thread  EMT.
    170171 */
    171 TMDECL(uint64_t) TMVirtualSyncGet(PVM pVM)
     172TMDECL(uint64_t) TMVirtualSyncGetEx(PVM pVM, bool fCheckTimers)
    172173{
    173174    VM_ASSERT_EMT(pVM);
     
    183184        Assert(pVM->tm.s.fVirtualTicking);
    184185        u64 = tmVirtualGetRaw(pVM);
    185         if (    !VM_FF_ISSET(pVM, VM_FF_TIMER)
     186        if (    fCheckTimers
     187            &&  !VM_FF_ISSET(pVM, VM_FF_TIMER)
    186188            &&  pVM->tm.s.CTXALLSUFF(paTimerQueues)[TMCLOCK_VIRTUAL].u64Expire <= u64)
    187189        {
     
    262264            ASMAtomicXchgU64(&pVM->tm.s.u64VirtualSync, u64);
    263265            ASMAtomicXchgBool(&pVM->tm.s.fVirtualSyncTicking, false);
    264             if (!VM_FF_ISSET(pVM, VM_FF_TIMER))
     266            if (    fCheckTimers
     267                &&  !VM_FF_ISSET(pVM, VM_FF_TIMER))
    265268            {
    266269                VM_FF_SET(pVM, VM_FF_TIMER);
     
    283286
    284287/**
     288 * Gets the current TMCLOCK_VIRTUAL_SYNC time.
     289 *
     290 * @returns The timestamp.
     291 * @param   pVM             VM handle.
     292 * @thread  EMT.
     293 */
     294TMDECL(uint64_t) TMVirtualSyncGet(PVM pVM)
     295{
     296    return TMVirtualSyncGetEx(pVM, true /* check timers */);
     297}
     298
     299
     300/**
    285301 * Gets the current lag of the synchronous virtual clock (relative to the virtual clock).
    286302 *
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