Changeset 54224 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Feb 16, 2015 10:41:32 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/time/timesup.cpp
r54215 r54224 153 153 154 154 /** 155 * Checks if we really need to apply the delta values.156 *157 * Getting the delta for a CPU is _very_ expensive, it more than doubles the158 * execution time for RTTimeNanoTS.159 *160 * @returns true if deltas needs to be applied, false if not.161 * @param pGip The GIP.162 *163 * @remarks If you change this, make sure to also change tmR3ReallyNeedDeltas().164 */165 static bool rtTimeNanoTsInternalReallyNeedDeltas(PSUPGLOBALINFOPAGE pGip)166 {167 return !pGip->fOsTscDeltasInSync && !pGip->fTscDeltasRoughlyInSync;168 #if 0169 if (!pGip->fOsTscDeltasInSync)170 {171 uint32_t i = pGip->cCpus;172 while (i-- > 0)173 if ( pGip->aCPUs[i].enmState == SUPGIPCPUSTATE_ONLINE174 && ( pGip->aCPUs[i].i64TSCDelta > 384175 || pGip->aCPUs[i].i64TSCDelta < -384) )176 return true;177 }178 return false;179 #endif180 }181 182 183 /**184 155 * Called the first time somebody asks for the time or when the GIP 185 156 * is mapped/unmapped. … … 197 168 if (ASMCpuId_EDX(1) & X86_CPUID_FEATURE_EDX_SSE2) 198 169 iWorker = pGip->u32Mode == SUPGIPMODE_INVARIANT_TSC 199 ? rtTimeNanoTsInternalReallyNeedDeltas(pGip)170 ? !pGip->fOsTscDeltasInSync && !pGip->fTscDeltasRoughlyInSync 200 171 ? RTTIMENANO_WORKER_LFENCE_INVAR_WITH_DELTA : RTTIMENANO_WORKER_LFENCE_INVAR_NO_DELTA 201 172 : pGip->u32Mode == SUPGIPMODE_SYNC_TSC 202 ? false /** @todo ! rtTimeNanoTsInternalReallyNeedDeltas(pGip)*/173 ? false /** @todo !pGip->fOsTscDeltasInSync && !pGip->fTscDeltasRoughlyInSync */ 203 174 ? RTTIMENANO_WORKER_LFENCE_SYNC_WITH_DELTA : RTTIMENANO_WORKER_LFENCE_SYNC_NO_DELTA 204 175 : RTTIMENANO_WORKER_LFENCE_ASYNC; 205 176 else 206 177 iWorker = pGip->u32Mode == SUPGIPMODE_INVARIANT_TSC 207 ? rtTimeNanoTsInternalReallyNeedDeltas(pGip)178 ? !pGip->fOsTscDeltasInSync && !pGip->fTscDeltasRoughlyInSync 208 179 ? RTTIMENANO_WORKER_LEGACY_INVAR_WITH_DELTA : RTTIMENANO_WORKER_LEGACY_INVAR_NO_DELTA 209 180 : pGip->u32Mode == SUPGIPMODE_SYNC_TSC 210 ? false /** @todo rtTimeNanoTsInternalReallyNeedDeltas(pGip)*/181 ? false /** @todo !pGip->fOsTscDeltasInSync && !pGip->fTscDeltasRoughlyInSync */ 211 182 ? RTTIMENANO_WORKER_LEGACY_SYNC_WITH_DELTA : RTTIMENANO_WORKER_LEGACY_SYNC_NO_DELTA 212 183 : RTTIMENANO_WORKER_LEGACY_ASYNC;
Note:
See TracChangeset
for help on using the changeset viewer.