VirtualBox

忽略:
時間撮記:
2007-10-25 下午11:47:19 (17 年 以前)
作者:
vboxsync
訊息:

Hooked up the new IPRT time code.

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/VMM/VMMAll/TMAllVirtual.cpp

    r5400 r5505  
    4242static DECLCALLBACK(int) tmVirtualSetWarpDrive(PVM pVM, uint32_t u32Percent);
    4343
     44
     45/**
     46 * Helper function that's used by the assembly routines when something goes bust.
     47 *
     48 * @param   pData           Pointer to the data structure.
     49 * @param   u64NanoTS       The calculated nano ts.
     50 * @param   u64DeltaPrev    The delta relative to the previously returned timestamp.
     51 * @param   u64PrevNanoTS   The previously returned timestamp (as it was read it).
     52 */
     53DECLEXPORT(void) tmVirtualNanoTSBad(PRTTIMENANOTSDATA pData, uint64_t u64NanoTS, uint64_t u64DeltaPrev, uint64_t u64PrevNanoTS)
     54{
     55    //PVM pVM = (PVM)((uint8_t *)pData - RT_OFFSETOF(VM, CTXALLSUFF(s.tm.VirtualGetRawData)));
     56    pData->cBadPrev++;
     57    if ((int64_t)u64DeltaPrev < 0)
     58        LogRel(("TM: u64DeltaPrev=%RI64 u64PrevNanoTS=0x%016RX64 u64NanoTS=0x%016RX64\n",
     59                u64DeltaPrev, u64PrevNanoTS, u64NanoTS));
     60    else
     61        Log(("TM: u64DeltaPrev=%RI64 u64PrevNanoTS=0x%016RX64 u64NanoTS=0x%016RX64 (debugging?)\n",
     62             u64DeltaPrev, u64PrevNanoTS, u64NanoTS));
     63}
     64
     65
     66/**
     67 * Called the first time somebody asks for the time or when the GIP
     68 * is mapped/unmapped.
     69 *
     70 * This should never ever happen.
     71 */
     72DECLEXPORT(uint64_t) tmVirtualNanoTSRediscover(PRTTIMENANOTSDATA pData)
     73{
     74    //PVM pVM = (PVM)((uint8_t *)pData - RT_OFFSETOF(VM, CTXALLSUFF(s.tm.VirtualGetRawData)));
     75    PSUPGLOBALINFOPAGE pGip = g_pSUPGlobalInfoPage;
     76    AssertFatalMsgFailed(("pGip=%p u32Magic=%#x\n", pGip, VALID_PTR(pGip) ? pGip->u32Magic : 0));
     77}
     78
     79
     80#if 1
     81
     82/**
     83 * Wrapper around the IPRT GIP time methods.
     84 */
     85DECLINLINE(uint64_t) tmVirtualGetRawNanoTS(PVM pVM)
     86{
     87    return CTXALLSUFF(pVM->tm.s.pfnVirtualGetRaw)(&CTXALLSUFF(pVM->tm.s.VirtualGetRawData));
     88}
     89
     90#else
    4491
    4592/**
     
    167214    {
    168215        /* occasional - u64NanoTS is in the 'past' relative to previous returns. */
    169         ASMAtomicIncU32(&pVM->tm.s.c1nsVirtualRawSteps);
     216        ASMAtomicIncU32(&pVM->tm.s.CTXALLSUFF(VirtualGetRawData).c1nsSteps);
    170217        u64NanoTS = u64PrevNanoTS + 1;
    171218    }
     
    173220    {
    174221        /* Something has gone bust, if negative offset it's real bad. */
    175         ASMAtomicIncU32(&pVM->tm.s.cVirtualRawBadRawPrev);
     222        ASMAtomicIncU32(&pVM->tm.s.CTXALLSUFF(VirtualGetRawData).cBadPrev);
    176223        if ((int64_t)u64DeltaPrev < 0)
    177224            LogRel(("TM: u64DeltaPrev=%RI64 u64PrevNanoTS=0x%016RX64 u64NanoTS=0x%016RX64 u64Delta=%#RX64\n",
     
    212259    return u64NanoTS;
    213260}
     261
     262#endif
    214263
    215264
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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