VirtualBox

Changeset 49991 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Dec 19, 2013 11:22:06 PM (11 years ago)
Author:
vboxsync
Message:

OHCI,EHCI: Fix save/restore issues keeping saved state compatibility

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/USB/DevOHCI.cpp

    r49959 r49991  
    51055105        }
    51065106    }
     5107
     5108    /*
     5109     * If the bus was started set the timer. This is ugly but avoids changing the
     5110     * saved state version for now so we can backport the changes to other branches.
     5111     */
     5112    /** @todo: Do it properly for 4.4 by changing the saved state. */
     5113    if (pThis->fBusStarted)
     5114    {
     5115        /* Calculate a new timer expiration so this saved state works with older releases. */
     5116        uint64_t u64Expire = PDMDevHlpTMTimeVirtGet(pThis->CTX_SUFF(pDevIns)) + pThis->cTicksPerFrame;
     5117
     5118        LogFlowFunc(("Bus is active, setting timer to %llu\n", u64Expire));
     5119        int rc = TMTimerSet(pThis->pEndOfFrameTimerR3, u64Expire);
     5120        AssertRC(rc);
     5121    }
     5122
    51075123    PDMCritSectLeave(pThis->pDevInsR3->pCritSectRoR3);
    51085124
     
    54505466
    54515467/**
     5468 * Resume notification.
     5469 *
     5470 * @returns VBox status.
     5471 * @param   pDevIns     The device instance data.
     5472 */
     5473static DECLCALLBACK(void) ohciR3Resume(PPDMDEVINS pDevIns)
     5474{
     5475    POHCI pThis = PDMINS_2_DATA(pDevIns, POHCI);
     5476    LogFlowFunc(("\n"));
     5477
     5478    /* Restart the frame thread if the timer is active. */
     5479    if (TMTimerIsActive(pThis->pEndOfFrameTimerR3))
     5480    {
     5481        int rc = TMTimerStop(pThis->pEndOfFrameTimerR3);
     5482        AssertRC(rc);
     5483
     5484        LogFlowFunc(("Bus was active, restart frame thread\n"));
     5485        ASMAtomicXchgBool(&pThis->fBusStarted, true);
     5486        RTSemEventSignal(pThis->hSemEventFrame);
     5487    }
     5488}
     5489
     5490
     5491/**
    54525492 * Info handler, device version. Dumps OHCI control registers.
    54535493 *
     
    57705810    NULL,
    57715811    /* pfnResume */
    5772     NULL,
     5812    ohciR3Resume,
    57735813    /* pfnAttach */
    57745814    NULL,
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