Changeset 87626 in vbox for trunk/src/VBox/Runtime/common
- Timestamp:
- Feb 5, 2021 12:58:54 PM (4 years ago)
- Location:
- trunk/src/VBox/Runtime/common/time
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/time/timesup.cpp
r82968 r87626 50 50 #if !defined(IN_GUEST) && !defined(RT_NO_GIP) 51 51 static DECLCALLBACK(void) rtTimeNanoTSInternalBitch(PRTTIMENANOTSDATA pData, uint64_t u64NanoTS, uint64_t u64DeltaPrev, uint64_t u64PrevNanoTS); 52 static DECLCALLBACK(uint64_t) rtTimeNanoTSInternalFallback(PRTTIMENANOTSDATA pData); 53 static DECLCALLBACK(uint64_t) rtTimeNanoTSInternalRediscover(PRTTIMENANOTSDATA pData); 54 static DECLCALLBACK(uint64_t) rtTimeNanoTSInternalBadCpuIndex(PRTTIMENANOTSDATA pData, uint16_t idApic, uint16_t iCpuSet, uint16_t iGipCpu); 52 static DECLCALLBACK(uint64_t) rtTimeNanoTSInternalFallback(PRTTIMENANOTSDATA pData, PRTITMENANOTSEXTRA pExtra); 53 static DECLCALLBACK(uint64_t) rtTimeNanoTSInternalRediscover(PRTTIMENANOTSDATA pData, PRTITMENANOTSEXTRA pExtra); 54 static DECLCALLBACK(uint64_t) rtTimeNanoTSInternalBadCpuIndex(PRTTIMENANOTSDATA pData, PRTITMENANOTSEXTRA pExtra, 55 uint16_t idApic, uint16_t iCpuSet, uint16_t iGipCpu); 55 56 #endif 56 57 … … 129 130 * @interface_method_impl{RTTIMENANOTSDATA,pfnBadCpuIndex} 130 131 */ 131 static DECLCALLBACK(uint64_t) rtTimeNanoTSInternalBadCpuIndex(PRTTIMENANOTSDATA pData, uint16_t idApic,132 uint16_t i CpuSet, uint16_t iGipCpu)132 static DECLCALLBACK(uint64_t) rtTimeNanoTSInternalBadCpuIndex(PRTTIMENANOTSDATA pData, PRTITMENANOTSEXTRA pExtra, 133 uint16_t idApic, uint16_t iCpuSet, uint16_t iGipCpu) 133 134 { 134 135 RT_NOREF_PV(pData); RT_NOREF_PV(idApic); RT_NOREF_PV(iCpuSet); RT_NOREF_PV(iGipCpu); 135 136 # ifndef IN_RC 136 137 AssertMsgFailed(("idApic=%#x iCpuSet=%#x iGipCpu=%#x\n", idApic, iCpuSet, iGipCpu)); 138 if (pExtra) 139 pExtra->uTSCValue = ASMReadTSC(); 137 140 return RTTimeSystemNanoTS(); 138 141 # else … … 146 149 * Fallback function. 147 150 */ 148 static DECLCALLBACK(uint64_t) rtTimeNanoTSInternalFallback(PRTTIMENANOTSDATA pData )151 static DECLCALLBACK(uint64_t) rtTimeNanoTSInternalFallback(PRTTIMENANOTSDATA pData, PRTITMENANOTSEXTRA pExtra) 149 152 { 150 153 PSUPGLOBALINFOPAGE pGip = g_pSUPGlobalInfoPage; … … 154 157 || pGip->u32Mode == SUPGIPMODE_SYNC_TSC 155 158 || pGip->u32Mode == SUPGIPMODE_ASYNC_TSC)) 156 return rtTimeNanoTSInternalRediscover(pData );159 return rtTimeNanoTSInternalRediscover(pData, pExtra); 157 160 NOREF(pData); 158 161 # ifndef IN_RC 162 if (pExtra) 163 pExtra->uTSCValue = ASMReadTSC(); 159 164 return RTTimeSystemNanoTS(); 160 165 # else … … 169 174 * is mapped/unmapped. 170 175 */ 171 static DECLCALLBACK(uint64_t) rtTimeNanoTSInternalRediscover(PRTTIMENANOTSDATA pData )176 static DECLCALLBACK(uint64_t) rtTimeNanoTSInternalRediscover(PRTTIMENANOTSDATA pData, PRTITMENANOTSEXTRA pExtra) 172 177 { 173 178 PSUPGLOBALINFOPAGE pGip = g_pSUPGlobalInfoPage; … … 298 303 # ifdef IN_RC 299 304 ASMAtomicWriteU32((uint32_t volatile *)&g_iWorker, iWorker); 300 return g_apfnWorkers[iWorker](pData );305 return g_apfnWorkers[iWorker](pData, pExtra); 301 306 # else 302 307 ASMAtomicWritePtr((void * volatile *)&g_pfnWorker, (void *)(uintptr_t)pfnWorker); 303 return pfnWorker(pData );308 return pfnWorker(pData, pExtra); 304 309 # endif 305 310 } … … 315 320 #if !defined(IN_GUEST) && !defined(RT_NO_GIP) 316 321 # ifdef IN_RC 317 return g_apfnWorkers[g_iWorker](&g_TimeNanoTSData );318 # else 319 return g_pfnWorker(&g_TimeNanoTSData );322 return g_apfnWorkers[g_iWorker](&g_TimeNanoTSData, NULL /*pExtra*/); 323 # else 324 return g_pfnWorker(&g_TimeNanoTSData, NULL /*pExtra*/); 320 325 # endif 321 326 #else -
trunk/src/VBox/Runtime/common/time/timesupref.h
r82968 r87626 41 41 * @returns Nanosecond timestamp. 42 42 * @param pData Pointer to the data structure. 43 * @param pExtra Where to return extra time info. Optional. 43 44 */ 44 RTDECL(uint64_t) rtTimeNanoTSInternalRef(PRTTIMENANOTSDATA pData )45 RTDECL(uint64_t) rtTimeNanoTSInternalRef(PRTTIMENANOTSDATA pData, PRTITMENANOTSEXTRA pExtra) 45 46 { 46 47 #if TMPL_MODE == TMPL_MODE_SYNC_INVAR_WITH_DELTA && defined(IN_RING3) … … 246 247 #endif 247 248 249 if (pExtra) 250 pExtra->uTSCValue = u64Delta; 251 248 252 /* 249 253 * Calc NanoTS delta. … … 374 378 && TMPL_GET_CPU_METHOD != SUPGIPGETCPU_APIC_ID_EXT_0B /*?*/ \ 375 379 && TMPL_GET_CPU_METHOD != SUPGIPGETCPU_APIC_ID_EXT_8000001E /*?*/) 376 return pData->pfnBadCpuIndex(pData, UINT16_MAX-1, iCpuSet, iGipCpu);380 return pData->pfnBadCpuIndex(pData, pExtra, UINT16_MAX-1, iCpuSet, iGipCpu); 377 381 # else 378 return pData->pfnBadCpuIndex(pData, idApic, UINT16_MAX-1, iGipCpu);382 return pData->pfnBadCpuIndex(pData, pExtra, idApic, UINT16_MAX-1, iGipCpu); 379 383 # endif 380 384 } … … 389 393 ASMSetFlags(uFlags); 390 394 #endif 391 return pData->pfnRediscover(pData );395 return pData->pfnRediscover(pData, pExtra); 392 396 } 393 397 }
Note:
See TracChangeset
for help on using the changeset viewer.