Changeset 107192 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Nov 29, 2024 2:42:15 PM (7 weeks ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/Makefile.kmk
r107099 r107192 2933 2933 $(if-expr !defined(VBOX_WITH_ALT_HASH_CODE),IPRT_WITHOUT_SHA512T224 IPRT_WITHOUT_SHA512T256,) 2934 2934 ifn1of ($(KBUILD_TARGET_ARCH), amd64 x86) 2935 VBoxRT_DEFS += RT_NO_GIP 2935 ifn1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), win.arm64) 2936 VBoxRT_DEFS += RT_NO_GIP 2937 endif 2936 2938 endif 2937 2939 ifdef VBOX_WITH_LIBCURL -
trunk/src/VBox/Runtime/common/time/timesup.cpp
r106061 r107192 48 48 #if !defined(IN_GUEST) && !defined(RT_NO_GIP) 49 49 # include <iprt/asm.h> 50 # include <iprt/asm-amd64-x86.h> 50 # if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 51 # include <iprt/asm-amd64-x86.h> 52 # elif defined(RT_ARCH_ARM64) || defined(RT_ARCH_ARM32) 53 # include <iprt/asm-arm.h> 54 # else 55 # error "port me" 56 # endif 51 57 # include <iprt/x86.h> 52 58 # include <VBox/sup.h> … … 56 62 57 63 /********************************************************************************************************************************* 64 * Defined Constants And Macros * 65 *********************************************************************************************************************************/ 66 #ifdef IN_RING3 67 # if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 68 # define APPLICABLE_GET_CPU_FLAGS ( SUPGIPGETCPU_APIC_ID \ 69 | SUPGIPGETCPU_RDTSCP_MASK_MAX_SET_CPUS \ 70 | SUPGIPGETCPU_IDTR_LIMIT_MASK_MAX_SET_CPUS \ 71 | SUPGIPGETCPU_RDTSCP_GROUP_IN_CH_NUMBER_IN_CL \ 72 | SUPGIPGETCPU_APIC_ID_EXT_0B \ 73 | SUPGIPGETCPU_APIC_ID_EXT_8000001E) 74 # elif defined(RT_ARCH_ARM64) || defined(RT_ARCH_ARM32) 75 # define APPLICABLE_GET_CPU_FLAGS (SUPGIPGETCPU_TPIDRRO_EL0) 76 # else 77 # error "port me" 78 # endif 79 #endif /* IN_RING3 */ 80 81 82 /********************************************************************************************************************************* 58 83 * Internal Functions * 59 84 *********************************************************************************************************************************/ 60 85 #if !defined(IN_GUEST) && !defined(RT_NO_GIP) 61 static DECLCALLBACK(void) rtTimeNanoTSInternalBitch(PRTTIMENANOTSDATA pData, uint64_t u64NanoTS, uint64_t u64DeltaPrev, uint64_t u64PrevNanoTS); 86 static DECLCALLBACK(void) rtTimeNanoTSInternalComplain(PRTTIMENANOTSDATA pData, uint64_t u64NanoTS, uint64_t u64DeltaPrev, 87 uint64_t u64PrevNanoTS); 62 88 static DECLCALLBACK(uint64_t) rtTimeNanoTSInternalFallback(PRTTIMENANOTSDATA pData, PRTITMENANOTSEXTRA pExtra); 63 89 static DECLCALLBACK(uint64_t) rtTimeNanoTSInternalRediscover(PRTTIMENANOTSDATA pData, PRTITMENANOTSEXTRA pExtra); … … 78 104 { 79 105 /* .pu64Prev = */ &g_TimeNanoTSPrev, 80 /* .pfnBad = */ rtTimeNanoTSInternal Bitch,106 /* .pfnBad = */ rtTimeNanoTSInternalComplain, 81 107 /* .pfnRediscover = */ rtTimeNanoTSInternalRediscover, 82 108 /* .pfnBadCpuIndex = */ rtTimeNanoTSInternalBadCpuIndex, … … 95 121 rtTimeNanoTSInternalRediscover, 96 122 97 # define RTTIMENANO_WORKER_LEGACY_SYNC_INVAR_NO_DELTA 1 123 # if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 124 # define RTTIMENANO_WORKER_LEGACY_SYNC_INVAR_NO_DELTA 1 98 125 RTTimeNanoTSLegacySyncInvarNoDelta, 99 # define RTTIMENANO_WORKER_LEGACY_SYNC_INVAR_WITH_DELTA2126 # define RTTIMENANO_WORKER_LEGACY_SYNC_INVAR_WITH_DELTA 2 100 127 RTTimeNanoTSLegacySyncInvarWithDelta, 101 # define RTTIMENANO_WORKER_LEGACY_ASYNC3128 # define RTTIMENANO_WORKER_LEGACY_ASYNC 3 102 129 RTTimeNanoTSLegacyAsync, 103 130 104 # define RTTIMENANO_WORKER_LFENCE_SYNC_INVAR_NO_DELTA4131 # define RTTIMENANO_WORKER_LFENCE_SYNC_INVAR_NO_DELTA 4 105 132 RTTimeNanoTSLFenceSyncInvarNoDelta, 106 # define RTTIMENANO_WORKER_LFENCE_SYNC_INVAR_WITH_DELTA5133 # define RTTIMENANO_WORKER_LFENCE_SYNC_INVAR_WITH_DELTA 5 107 134 RTTimeNanoTSLFenceSyncInvarWithDelta, 108 # define RTTIMENANO_WORKER_LFENCE_ASYNC6135 # define RTTIMENANO_WORKER_LFENCE_ASYNC 6 109 136 RTTimeNanoTSLFenceAsync, 137 # else 138 # error "port me" 139 # endif 110 140 111 141 # define RTTIMENANO_WORKER_FALLBACK 7 … … 116 146 * code relocation. */ 117 147 static uint32_t g_iWorker = RTTIMENANO_WORKER_DETECT; 118 # else 148 # else /* !IN_RC */ 119 149 /** Pointer to the worker */ 120 150 static PFNTIMENANOTSINTERNAL g_pfnWorker = rtTimeNanoTSInternalRediscover; 121 # endif /* IN_RC */151 # endif /* !IN_RC */ 122 152 123 153 … … 125 155 * @interface_method_impl{RTTIMENANOTSDATA,pfnBad} 126 156 */ 127 static DECLCALLBACK(void) rtTimeNanoTSInternal Bitch(PRTTIMENANOTSDATA pData, uint64_t u64NanoTS, uint64_t u64DeltaPrev,128 uint64_t u64PrevNanoTS)157 static DECLCALLBACK(void) rtTimeNanoTSInternalComplain(PRTTIMENANOTSDATA pData, uint64_t u64NanoTS, uint64_t u64DeltaPrev, 158 uint64_t u64PrevNanoTS) 129 159 { 130 160 pData->cBadPrev++; … … 161 191 static DECLCALLBACK(uint64_t) rtTimeNanoTSInternalFallback(PRTTIMENANOTSDATA pData, PRTITMENANOTSEXTRA pExtra) 162 192 { 193 RT_NOREF(pData); 163 194 PSUPGLOBALINFOPAGE pGip = g_pSUPGlobalInfoPage; 195 uint32_t uMode; 164 196 if ( pGip 165 197 && pGip->u32Magic == SUPGLOBALINFOPAGE_MAGIC 166 && ( pGip->u32Mode == SUPGIPMODE_INVARIANT_TSC 167 || pGip->u32Mode == SUPGIPMODE_SYNC_TSC 168 || pGip->u32Mode == SUPGIPMODE_ASYNC_TSC)) 198 && ( (uMode = pGip->u32Mode) == SUPGIPMODE_INVARIANT_TSC 199 || uMode == SUPGIPMODE_SYNC_TSC 200 || uMode == SUPGIPMODE_ASYNC_TSC) 201 # ifdef IN_RING3 202 && ( (pGip->fGetGipCpu & APPLICABLE_GET_CPU_FLAGS) != 0 203 || ( pGip->enmUseTscDelta <= SUPGIPUSETSCDELTA_PRACTICALLY_ZERO 204 && uMode != SUPGIPMODE_ASYNC_TSC)) 205 # endif 206 ) 169 207 return rtTimeNanoTSInternalRediscover(pData, pExtra); 170 NOREF(pData);171 208 # ifndef IN_RC 172 209 if (pExtra) … … 192 229 PFNTIMENANOTSINTERNAL pfnWorker; 193 230 # endif 231 uint32_t uMode; 194 232 if ( pGip 195 233 && pGip->u32Magic == SUPGLOBALINFOPAGE_MAGIC 196 && ( pGip->u32Mode== SUPGIPMODE_INVARIANT_TSC197 || pGip->u32Mode== SUPGIPMODE_SYNC_TSC198 || pGip->u32Mode== SUPGIPMODE_ASYNC_TSC))234 && ( (uMode = pGip->u32Mode) == SUPGIPMODE_INVARIANT_TSC 235 || uMode == SUPGIPMODE_SYNC_TSC 236 || uMode == SUPGIPMODE_ASYNC_TSC)) 199 237 { 238 # if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 200 239 if (ASMCpuId_EDX(1) & X86_CPUID_FEATURE_EDX_SSE2) 201 240 { 202 # ifdef IN_RC203 iWorker = pGip->u32Mode == SUPGIPMODE_ASYNC_TSC241 # ifdef IN_RC 242 iWorker = uMode == SUPGIPMODE_ASYNC_TSC 204 243 ? RTTIMENANO_WORKER_LFENCE_ASYNC 205 244 : pGip->enmUseTscDelta <= SUPGIPUSETSCDELTA_ROUGHLY_ZERO 206 245 ? RTTIMENANO_WORKER_LFENCE_SYNC_INVAR_NO_DELTA 207 246 : RTTIMENANO_WORKER_LFENCE_SYNC_INVAR_WITH_DELTA; 208 # elif defined(IN_RING0)209 pfnWorker = pGip->u32Mode == SUPGIPMODE_ASYNC_TSC247 # elif defined(IN_RING0) 248 pfnWorker = uMode == SUPGIPMODE_ASYNC_TSC 210 249 ? RTTimeNanoTSLFenceAsync 211 250 : pGip->enmUseTscDelta <= SUPGIPUSETSCDELTA_ROUGHLY_ZERO 212 251 ? RTTimeNanoTSLFenceSyncInvarNoDelta 213 252 : RTTimeNanoTSLFenceSyncInvarWithDelta; 214 # else215 if ( pGip->u32Mode == SUPGIPMODE_ASYNC_TSC)253 # else 254 if (uMode == SUPGIPMODE_ASYNC_TSC) 216 255 { 217 256 if ( pGip->fGetGipCpu & SUPGIPGETCPU_IDTR_LIMIT_MASK_MAX_SET_CPUS) … … 247 286 pfnWorker = rtTimeNanoTSInternalFallback; 248 287 } 249 # endif288 # endif 250 289 } 251 290 else 252 291 { 253 # ifdef IN_RC254 iWorker = pGip->u32Mode == SUPGIPMODE_ASYNC_TSC292 # ifdef IN_RC 293 iWorker = uMode == SUPGIPMODE_ASYNC_TSC 255 294 ? RTTIMENANO_WORKER_LEGACY_ASYNC 256 295 : pGip->enmUseTscDelta <= SUPGIPUSETSCDELTA_ROUGHLY_ZERO 257 296 ? RTTIMENANO_WORKER_LEGACY_SYNC_INVAR_NO_DELTA : RTTIMENANO_WORKER_LEGACY_SYNC_INVAR_WITH_DELTA; 258 # elif defined(IN_RING0)259 pfnWorker = pGip->u32Mode == SUPGIPMODE_ASYNC_TSC297 # elif defined(IN_RING0) 298 pfnWorker = uMode == SUPGIPMODE_ASYNC_TSC 260 299 ? RTTimeNanoTSLegacyAsync 261 300 : pGip->enmUseTscDelta <= SUPGIPUSETSCDELTA_ROUGHLY_ZERO 262 301 ? RTTimeNanoTSLegacySyncInvarNoDelta 263 302 : RTTimeNanoTSLegacySyncInvarWithDelta; 264 # else265 if ( pGip->u32Mode == SUPGIPMODE_ASYNC_TSC)303 # else 304 if (uMode == SUPGIPMODE_ASYNC_TSC) 266 305 pfnWorker = pGip->fGetGipCpu & SUPGIPGETCPU_RDTSCP_MASK_MAX_SET_CPUS 267 306 ? RTTimeNanoTSLegacyAsyncUseRdtscp … … 299 338 : RTTimeNanoTSLegacySyncInvarWithDeltaUseApicId 300 339 : rtTimeNanoTSInternalFallback; 301 # endif340 # endif 302 341 } 342 # else /* !AMD64 && !X86 */ 343 # ifdef IN_RC 344 # error "port me" 345 iWorker = uMode == SUPGIPMODE_ASYNC_TSC 346 ? RTTIMENANO_WORKER_LFENCE_ASYNC 347 : pGip->enmUseTscDelta <= SUPGIPUSETSCDELTA_ROUGHLY_ZERO 348 ? RTTIMENANO_WORKER_LFENCE_SYNC_INVAR_NO_DELTA 349 : RTTIMENANO_WORKER_LFENCE_SYNC_INVAR_WITH_DELTA; 350 # elif defined(IN_RING0) 351 pfnWorker = uMode == SUPGIPMODE_ASYNC_TSC 352 ? RTTimeNanoTSAsync 353 : pGip->enmUseTscDelta <= SUPGIPUSETSCDELTA_ROUGHLY_ZERO 354 ? RTTimeNanoTSSyncInvarNoDelta 355 : RTTimeNanoTSSyncInvarWithDelta; 356 # else 357 if (uMode == SUPGIPMODE_ASYNC_TSC) 358 { 359 if (pGip->fGetGipCpu & SUPGIPGETCPU_TPIDRRO_EL0) 360 pfnWorker = RTTimeNanoTSAsyncUseTpIdRRo; 361 else 362 pfnWorker = rtTimeNanoTSInternalFallback; 363 } 364 else 365 { 366 if (pGip->enmUseTscDelta <= SUPGIPUSETSCDELTA_PRACTICALLY_ZERO) 367 pfnWorker = RTTimeNanoTSSyncInvarNoDelta; 368 else if (pGip->fGetGipCpu & SUPGIPGETCPU_TPIDRRO_EL0) 369 pfnWorker = RTTimeNanoTSSyncInvarWithDeltaUseTpIdRRo; 370 else 371 pfnWorker = rtTimeNanoTSInternalFallback; 372 } 373 # endif 374 375 # endif /* !AMD64 && !X86 */ 303 376 } 304 377 else … … 318 391 } 319 392 393 320 394 # if defined(IN_RING3) || defined(IN_RING0) 321 395 RTDECL(const char *) RTTimeNanoTSWorkerName(void) … … 324 398 { 325 399 # define ENTRY(a_fn) { a_fn, #a_fn } 400 # if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 326 401 ENTRY(RTTimeNanoTSLegacySyncInvarNoDelta), 327 402 ENTRY(RTTimeNanoTSLFenceSyncInvarNoDelta), 328 # ifdef IN_RING3403 # ifdef IN_RING3 329 404 ENTRY(RTTimeNanoTSLegacyAsyncUseApicId), 330 405 ENTRY(RTTimeNanoTSLegacyAsyncUseApicIdExt0B), … … 349 424 ENTRY(RTTimeNanoTSLFenceSyncInvarWithDeltaUseRdtscp), 350 425 ENTRY(RTTimeNanoTSLFenceSyncInvarWithDeltaUseIdtrLim), 351 # else426 # else 352 427 ENTRY(RTTimeNanoTSLegacyAsync), 353 428 ENTRY(RTTimeNanoTSLegacySyncInvarWithDelta), 354 429 ENTRY(RTTimeNanoTSLFenceAsync), 355 430 ENTRY(RTTimeNanoTSLFenceSyncInvarWithDelta), 356 # endif 431 # endif 432 # else /* !AMD64 && !X86 */ 433 ENTRY(RTTimeNanoTSSyncInvarNoDelta), 434 # ifdef IN_RING3 435 # ifdef RT_ARCH_ARM64 436 ENTRY(RTTimeNanoTSSyncInvarWithDeltaUseTpIdRRo), 437 ENTRY(RTTimeNanoTSAsyncUseTpIdRRo), 438 # endif 439 # else 440 ENTRY(RTTimeNanoTSAsync), 441 ENTRY(RTTimeNanoTSSyncInvarWithDelta), 442 # endif 443 # endif /* !AMD64 && !X86 */ 357 444 ENTRY(rtTimeNanoTSInternalFallback), 358 445 # undef ENTRY -
trunk/src/VBox/Runtime/common/time/timesupref.cpp
r106061 r107192 35 35 */ 36 36 37 #if !defined(IN_GUEST) && !defined(RT_NO_GIP) 37 #if !defined(IN_GUEST) && !defined(RT_NO_GIP) /* rest of the file */ 38 38 39 39 … … 46 46 #include <iprt/asm.h> 47 47 #include <iprt/asm-math.h> 48 #include <iprt/asm-amd64-x86.h> 48 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_x86) 49 # include <iprt/asm-amd64-x86.h> 50 #elif defined(RT_ARCH_ARM64) 51 # include <iprt/asm-arm.h> 52 #else 53 # error "port me" 54 #endif 49 55 #include <iprt/param.h> 50 56 #include <iprt/string.h> … … 62 68 63 69 70 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_x86) 71 /* 72 * AMD64 & x86. 73 * AMD64 & x86. 74 * AMD64 & x86. 75 */ 76 64 77 /* 65 78 * Use the XCHG instruction for some kind of serialization. 66 79 */ 67 # define TMPL_READ_FENCE() ASMReadFence()68 69 # undef TMPL_MODE70 # define TMPL_MODE TMPL_MODE_SYNC_INVAR_NO_DELTA71 # undef TMPL_GET_CPU_METHOD72 # define TMPL_GET_CPU_METHOD 073 # undef rtTimeNanoTSInternalRef74 # define rtTimeNanoTSInternalRef RTTimeNanoTSLegacySyncInvarNoDelta75 # include "timesupref.h"80 # define TMPL_READ_FENCE() ASMReadFence() 81 82 # undef TMPL_MODE 83 # define TMPL_MODE TMPL_MODE_SYNC_INVAR_NO_DELTA 84 # undef TMPL_GET_CPU_METHOD 85 # define TMPL_GET_CPU_METHOD 0 86 # undef rtTimeNanoTSInternalRef 87 # define rtTimeNanoTSInternalRef RTTimeNanoTSLegacySyncInvarNoDelta 88 # include "timesupref.h" 76 89 RT_EXPORT_SYMBOL(RTTimeNanoTSLegacySyncInvarNoDelta); 77 90 78 #ifdef IN_RING3 91 # ifdef IN_RING3 92 93 # undef TMPL_MODE 94 # define TMPL_MODE TMPL_MODE_SYNC_INVAR_WITH_DELTA 95 # undef TMPL_GET_CPU_METHOD 96 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_APIC_ID 97 # undef rtTimeNanoTSInternalRef 98 # define rtTimeNanoTSInternalRef RTTimeNanoTSLegacySyncInvarWithDeltaUseApicId 99 # include "timesupref.h" 100 RT_EXPORT_SYMBOL(RTTimeNanoTSLegacySyncInvarWithDeltaUseApicId); 101 102 # undef TMPL_MODE 103 # define TMPL_MODE TMPL_MODE_SYNC_INVAR_WITH_DELTA 104 # undef TMPL_GET_CPU_METHOD 105 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_APIC_ID_EXT_0B 106 # undef rtTimeNanoTSInternalRef 107 # define rtTimeNanoTSInternalRef RTTimeNanoTSLegacySyncInvarWithDeltaUseApicIdExt0B 108 # include "timesupref.h" 109 RT_EXPORT_SYMBOL(RTTimeNanoTSLegacySyncInvarWithDeltaUseApicIdExt0B); 110 111 # undef TMPL_MODE 112 # define TMPL_MODE TMPL_MODE_SYNC_INVAR_WITH_DELTA 113 # undef TMPL_GET_CPU_METHOD 114 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_APIC_ID_EXT_8000001E 115 # undef rtTimeNanoTSInternalRef 116 # define rtTimeNanoTSInternalRef RTTimeNanoTSLegacySyncInvarWithDeltaUseApicIdExt8000001E 117 # include "timesupref.h" 118 RT_EXPORT_SYMBOL(RTTimeNanoTSLegacySyncInvarWithDeltaUseApicIdExt8000001E); 119 120 # undef TMPL_GET_CPU_METHOD 121 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_RDTSCP_MASK_MAX_SET_CPUS 122 # undef rtTimeNanoTSInternalRef 123 # define rtTimeNanoTSInternalRef RTTimeNanoTSLegacySyncInvarWithDeltaUseRdtscp 124 # include "timesupref.h" 125 RT_EXPORT_SYMBOL(RTTimeNanoTSLegacySyncInvarWithDeltaUseRdtscp); 126 127 # undef TMPL_GET_CPU_METHOD 128 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_IDTR_LIMIT_MASK_MAX_SET_CPUS 129 # undef rtTimeNanoTSInternalRef 130 # define rtTimeNanoTSInternalRef RTTimeNanoTSLegacySyncInvarWithDeltaUseIdtrLim 131 # include "timesupref.h" 132 RT_EXPORT_SYMBOL(RTTimeNanoTSLegacySyncInvarWithDeltaUseIdtrLim); 133 134 # undef TMPL_MODE 135 # define TMPL_MODE TMPL_MODE_ASYNC 136 # undef TMPL_GET_CPU_METHOD 137 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_APIC_ID 138 # undef rtTimeNanoTSInternalRef 139 # define rtTimeNanoTSInternalRef RTTimeNanoTSLegacyAsyncUseApicId 140 # include "timesupref.h" 141 RT_EXPORT_SYMBOL(RTTimeNanoTSLegacyAsyncUseApicId); 142 143 # undef TMPL_MODE 144 # define TMPL_MODE TMPL_MODE_ASYNC 145 # undef TMPL_GET_CPU_METHOD 146 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_APIC_ID_EXT_0B 147 # undef rtTimeNanoTSInternalRef 148 # define rtTimeNanoTSInternalRef RTTimeNanoTSLegacyAsyncUseApicIdExt0B 149 # include "timesupref.h" 150 RT_EXPORT_SYMBOL(RTTimeNanoTSLegacyAsyncUseApicIdExt0B); 151 152 # undef TMPL_MODE 153 # define TMPL_MODE TMPL_MODE_ASYNC 154 # undef TMPL_GET_CPU_METHOD 155 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_APIC_ID_EXT_8000001E 156 # undef rtTimeNanoTSInternalRef 157 # define rtTimeNanoTSInternalRef RTTimeNanoTSLegacyAsyncUseApicIdExt8000001E 158 # include "timesupref.h" 159 RT_EXPORT_SYMBOL(RTTimeNanoTSLegacyAsyncUseApicIdExt8000001E); 160 161 # undef TMPL_GET_CPU_METHOD 162 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_RDTSCP_MASK_MAX_SET_CPUS 163 # undef rtTimeNanoTSInternalRef 164 # define rtTimeNanoTSInternalRef RTTimeNanoTSLegacyAsyncUseRdtscp 165 # include "timesupref.h" 166 RT_EXPORT_SYMBOL(RTTimeNanoTSLegacyAsyncUseRdtscp); 167 168 # undef TMPL_GET_CPU_METHOD 169 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_IDTR_LIMIT_MASK_MAX_SET_CPUS 170 # undef rtTimeNanoTSInternalRef 171 # define rtTimeNanoTSInternalRef RTTimeNanoTSLegacyAsyncUseIdtrLim 172 # include "timesupref.h" 173 RT_EXPORT_SYMBOL(RTTimeNanoTSLegacyAsyncUseIdtrLim); 174 175 # undef TMPL_GET_CPU_METHOD 176 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_RDTSCP_GROUP_IN_CH_NUMBER_IN_CL 177 # undef rtTimeNanoTSInternalRef 178 # define rtTimeNanoTSInternalRef RTTimeNanoTSLegacyAsyncUseRdtscpGroupChNumCl 179 # include "timesupref.h" 180 RT_EXPORT_SYMBOL(RTTimeNanoTSLegacyAsyncUseRdtscpGroupChNumCl); 181 182 # else /* IN_RC || IN_RING0: Disable interrupts and call getter function. */ 183 184 # undef TMPL_MODE 185 # define TMPL_MODE TMPL_MODE_SYNC_INVAR_WITH_DELTA 186 # undef TMPL_GET_CPU_METHOD 187 # define TMPL_GET_CPU_METHOD UINT32_MAX 188 # undef rtTimeNanoTSInternalRef 189 # define rtTimeNanoTSInternalRef RTTimeNanoTSLegacySyncInvarWithDelta 190 # include "timesupref.h" 191 RT_EXPORT_SYMBOL(RTTimeNanoTSLegacySyncInvarWithDelta); 192 193 # undef TMPL_MODE 194 # define TMPL_MODE TMPL_MODE_ASYNC 195 # undef rtTimeNanoTSInternalRef 196 # define rtTimeNanoTSInternalRef RTTimeNanoTSLegacyAsync 197 # include "timesupref.h" 198 RT_EXPORT_SYMBOL(RTTimeNanoTSLegacyAsync); 199 200 # endif 201 202 203 /* 204 * Use LFENCE for load serialization. 205 */ 206 # undef TMPL_READ_FENCE 207 # define TMPL_READ_FENCE() ASMReadFenceSSE2() 79 208 80 209 # undef TMPL_MODE 81 # define TMPL_MODE TMPL_MODE_SYNC_INVAR_WITH_DELTA210 # define TMPL_MODE TMPL_MODE_SYNC_INVAR_NO_DELTA 82 211 # undef TMPL_GET_CPU_METHOD 83 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_APIC_ID212 # define TMPL_GET_CPU_METHOD 0 84 213 # undef rtTimeNanoTSInternalRef 85 # define rtTimeNanoTSInternalRef RTTimeNanoTSLegacySyncInvarWithDeltaUseApicId214 # define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceSyncInvarNoDelta 86 215 # include "timesupref.h" 87 RT_EXPORT_SYMBOL(RTTimeNanoTSLegacySyncInvarWithDeltaUseApicId); 216 RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceSyncInvarNoDelta); 217 218 # ifdef IN_RING3 219 220 # undef TMPL_MODE 221 # define TMPL_MODE TMPL_MODE_SYNC_INVAR_WITH_DELTA 222 # undef TMPL_GET_CPU_METHOD 223 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_APIC_ID 224 # undef rtTimeNanoTSInternalRef 225 # define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceSyncInvarWithDeltaUseApicId 226 # include "timesupref.h" 227 RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceSyncInvarWithDeltaUseApicId); 228 229 # undef TMPL_MODE 230 # define TMPL_MODE TMPL_MODE_SYNC_INVAR_WITH_DELTA 231 # undef TMPL_GET_CPU_METHOD 232 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_APIC_ID_EXT_0B 233 # undef rtTimeNanoTSInternalRef 234 # define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceSyncInvarWithDeltaUseApicIdExt0B 235 # include "timesupref.h" 236 RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceSyncInvarWithDeltaUseApicIdExt0B); 237 238 # undef TMPL_MODE 239 # define TMPL_MODE TMPL_MODE_SYNC_INVAR_WITH_DELTA 240 # undef TMPL_GET_CPU_METHOD 241 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_APIC_ID_EXT_8000001E 242 # undef rtTimeNanoTSInternalRef 243 # define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceSyncInvarWithDeltaUseApicIdExt8000001E 244 # include "timesupref.h" 245 RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceSyncInvarWithDeltaUseApicIdExt8000001E); 246 247 # undef TMPL_GET_CPU_METHOD 248 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_RDTSCP_MASK_MAX_SET_CPUS 249 # undef rtTimeNanoTSInternalRef 250 # define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceSyncInvarWithDeltaUseRdtscp 251 # include "timesupref.h" 252 RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceSyncInvarWithDeltaUseRdtscp); 253 254 # undef TMPL_GET_CPU_METHOD 255 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_IDTR_LIMIT_MASK_MAX_SET_CPUS 256 # undef rtTimeNanoTSInternalRef 257 # define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceSyncInvarWithDeltaUseIdtrLim 258 # include "timesupref.h" 259 RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceSyncInvarWithDeltaUseIdtrLim); 260 261 # undef TMPL_MODE 262 # define TMPL_MODE TMPL_MODE_ASYNC 263 # undef TMPL_GET_CPU_METHOD 264 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_APIC_ID 265 # undef rtTimeNanoTSInternalRef 266 # define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceAsyncUseApicId 267 # include "timesupref.h" 268 RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceAsyncUseApicId); 269 270 # undef TMPL_MODE 271 # define TMPL_MODE TMPL_MODE_ASYNC 272 # undef TMPL_GET_CPU_METHOD 273 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_APIC_ID_EXT_0B 274 # undef rtTimeNanoTSInternalRef 275 # define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceAsyncUseApicIdExt0B 276 # include "timesupref.h" 277 RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceAsyncUseApicIdExt0B); 278 279 # undef TMPL_MODE 280 # define TMPL_MODE TMPL_MODE_ASYNC 281 # undef TMPL_GET_CPU_METHOD 282 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_APIC_ID_EXT_8000001E 283 # undef rtTimeNanoTSInternalRef 284 # define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceAsyncUseApicIdExt8000001E 285 # include "timesupref.h" 286 RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceAsyncUseApicIdExt8000001E); 287 288 # undef TMPL_GET_CPU_METHOD 289 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_RDTSCP_MASK_MAX_SET_CPUS 290 # undef rtTimeNanoTSInternalRef 291 # define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceAsyncUseRdtscp 292 # include "timesupref.h" 293 RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceAsyncUseRdtscp); 294 295 # undef TMPL_GET_CPU_METHOD 296 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_IDTR_LIMIT_MASK_MAX_SET_CPUS 297 # undef rtTimeNanoTSInternalRef 298 # define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceAsyncUseIdtrLim 299 # include "timesupref.h" 300 RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceAsyncUseIdtrLim); 301 302 # undef TMPL_GET_CPU_METHOD 303 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_RDTSCP_GROUP_IN_CH_NUMBER_IN_CL 304 # undef rtTimeNanoTSInternalRef 305 # define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceAsyncUseRdtscpGroupChNumCl 306 # include "timesupref.h" 307 RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceAsyncUseRdtscpGroupChNumCl); 308 309 # else /* IN_RC || IN_RING0: Disable interrupts and call getter function. */ 310 311 # undef TMPL_MODE 312 # define TMPL_MODE TMPL_MODE_SYNC_INVAR_WITH_DELTA 313 # undef TMPL_GET_CPU_METHOD 314 # define TMPL_GET_CPU_METHOD UINT32_MAX 315 # undef rtTimeNanoTSInternalRef 316 # define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceSyncInvarWithDelta 317 # include "timesupref.h" 318 RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceSyncInvarWithDelta); 319 320 # undef TMPL_MODE 321 # define TMPL_MODE TMPL_MODE_ASYNC 322 # undef rtTimeNanoTSInternalRef 323 # define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceAsync 324 # include "timesupref.h" 325 RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceAsync); 326 327 # endif 328 329 #else /* !AMD64 && !X86 */ 330 /* 331 * Generic. 332 */ 333 # define TMPL_READ_FENCE() ASMReadFence() 88 334 89 335 # undef TMPL_MODE 90 # define TMPL_MODE TMPL_MODE_SYNC_INVAR_WITH_DELTA336 # define TMPL_MODE TMPL_MODE_SYNC_INVAR_NO_DELTA 91 337 # undef TMPL_GET_CPU_METHOD 92 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_APIC_ID_EXT_0B338 # define TMPL_GET_CPU_METHOD 0 93 339 # undef rtTimeNanoTSInternalRef 94 # define rtTimeNanoTSInternalRef RTTimeNanoTSLegacySyncInvarWithDeltaUseApicIdExt0B340 # define rtTimeNanoTSInternalRef RTTimeNanoTSSyncInvarNoDelta 95 341 # include "timesupref.h" 96 RT_EXPORT_SYMBOL(RTTimeNanoTSLegacySyncInvarWithDeltaUseApicIdExt0B); 97 98 # undef TMPL_MODE 99 # define TMPL_MODE TMPL_MODE_SYNC_INVAR_WITH_DELTA 100 # undef TMPL_GET_CPU_METHOD 101 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_APIC_ID_EXT_8000001E 102 # undef rtTimeNanoTSInternalRef 103 # define rtTimeNanoTSInternalRef RTTimeNanoTSLegacySyncInvarWithDeltaUseApicIdExt8000001E 104 # include "timesupref.h" 105 RT_EXPORT_SYMBOL(RTTimeNanoTSLegacySyncInvarWithDeltaUseApicIdExt8000001E); 106 107 # undef TMPL_GET_CPU_METHOD 108 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_RDTSCP_MASK_MAX_SET_CPUS 109 # undef rtTimeNanoTSInternalRef 110 # define rtTimeNanoTSInternalRef RTTimeNanoTSLegacySyncInvarWithDeltaUseRdtscp 111 # include "timesupref.h" 112 RT_EXPORT_SYMBOL(RTTimeNanoTSLegacySyncInvarWithDeltaUseRdtscp); 113 114 # undef TMPL_GET_CPU_METHOD 115 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_IDTR_LIMIT_MASK_MAX_SET_CPUS 116 # undef rtTimeNanoTSInternalRef 117 # define rtTimeNanoTSInternalRef RTTimeNanoTSLegacySyncInvarWithDeltaUseIdtrLim 118 # include "timesupref.h" 119 RT_EXPORT_SYMBOL(RTTimeNanoTSLegacySyncInvarWithDeltaUseIdtrLim); 120 121 # undef TMPL_MODE 122 # define TMPL_MODE TMPL_MODE_ASYNC 123 # undef TMPL_GET_CPU_METHOD 124 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_APIC_ID 125 # undef rtTimeNanoTSInternalRef 126 # define rtTimeNanoTSInternalRef RTTimeNanoTSLegacyAsyncUseApicId 127 # include "timesupref.h" 128 RT_EXPORT_SYMBOL(RTTimeNanoTSLegacyAsyncUseApicId); 129 130 # undef TMPL_MODE 131 # define TMPL_MODE TMPL_MODE_ASYNC 132 # undef TMPL_GET_CPU_METHOD 133 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_APIC_ID_EXT_0B 134 # undef rtTimeNanoTSInternalRef 135 # define rtTimeNanoTSInternalRef RTTimeNanoTSLegacyAsyncUseApicIdExt0B 136 # include "timesupref.h" 137 RT_EXPORT_SYMBOL(RTTimeNanoTSLegacyAsyncUseApicIdExt0B); 138 139 # undef TMPL_MODE 140 # define TMPL_MODE TMPL_MODE_ASYNC 141 # undef TMPL_GET_CPU_METHOD 142 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_APIC_ID_EXT_8000001E 143 # undef rtTimeNanoTSInternalRef 144 # define rtTimeNanoTSInternalRef RTTimeNanoTSLegacyAsyncUseApicIdExt8000001E 145 # include "timesupref.h" 146 RT_EXPORT_SYMBOL(RTTimeNanoTSLegacyAsyncUseApicIdExt8000001E); 147 148 # undef TMPL_GET_CPU_METHOD 149 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_RDTSCP_MASK_MAX_SET_CPUS 150 # undef rtTimeNanoTSInternalRef 151 # define rtTimeNanoTSInternalRef RTTimeNanoTSLegacyAsyncUseRdtscp 152 # include "timesupref.h" 153 RT_EXPORT_SYMBOL(RTTimeNanoTSLegacyAsyncUseRdtscp); 154 155 # undef TMPL_GET_CPU_METHOD 156 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_IDTR_LIMIT_MASK_MAX_SET_CPUS 157 # undef rtTimeNanoTSInternalRef 158 # define rtTimeNanoTSInternalRef RTTimeNanoTSLegacyAsyncUseIdtrLim 159 # include "timesupref.h" 160 RT_EXPORT_SYMBOL(RTTimeNanoTSLegacyAsyncUseIdtrLim); 161 162 # undef TMPL_GET_CPU_METHOD 163 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_RDTSCP_GROUP_IN_CH_NUMBER_IN_CL 164 # undef rtTimeNanoTSInternalRef 165 # define rtTimeNanoTSInternalRef RTTimeNanoTSLegacyAsyncUseRdtscpGroupChNumCl 166 # include "timesupref.h" 167 RT_EXPORT_SYMBOL(RTTimeNanoTSLegacyAsyncUseRdtscpGroupChNumCl); 168 169 #else /* IN_RC || IN_RING0: Disable interrupts and call getter function. */ 170 171 # undef TMPL_MODE 172 # define TMPL_MODE TMPL_MODE_SYNC_INVAR_WITH_DELTA 173 # undef TMPL_GET_CPU_METHOD 174 # define TMPL_GET_CPU_METHOD UINT32_MAX 175 # undef rtTimeNanoTSInternalRef 176 # define rtTimeNanoTSInternalRef RTTimeNanoTSLegacySyncInvarWithDelta 177 # include "timesupref.h" 178 RT_EXPORT_SYMBOL(RTTimeNanoTSLegacySyncInvarWithDelta); 179 180 # undef TMPL_MODE 181 # define TMPL_MODE TMPL_MODE_ASYNC 182 # undef rtTimeNanoTSInternalRef 183 # define rtTimeNanoTSInternalRef RTTimeNanoTSLegacyAsync 184 # include "timesupref.h" 185 RT_EXPORT_SYMBOL(RTTimeNanoTSLegacyAsync); 186 187 #endif 188 189 190 /* 191 * Use LFENCE for load serialization. 192 */ 193 #undef TMPL_READ_FENCE 194 #define TMPL_READ_FENCE() ASMReadFenceSSE2() 195 196 #undef TMPL_MODE 197 #define TMPL_MODE TMPL_MODE_SYNC_INVAR_NO_DELTA 198 #undef TMPL_GET_CPU_METHOD 199 #define TMPL_GET_CPU_METHOD 0 200 #undef rtTimeNanoTSInternalRef 201 #define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceSyncInvarNoDelta 202 #include "timesupref.h" 203 RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceSyncInvarNoDelta); 204 205 #ifdef IN_RING3 206 207 # undef TMPL_MODE 208 # define TMPL_MODE TMPL_MODE_SYNC_INVAR_WITH_DELTA 209 # undef TMPL_GET_CPU_METHOD 210 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_APIC_ID 211 # undef rtTimeNanoTSInternalRef 212 # define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceSyncInvarWithDeltaUseApicId 213 # include "timesupref.h" 214 RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceSyncInvarWithDeltaUseApicId); 215 216 # undef TMPL_MODE 217 # define TMPL_MODE TMPL_MODE_SYNC_INVAR_WITH_DELTA 218 # undef TMPL_GET_CPU_METHOD 219 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_APIC_ID_EXT_0B 220 # undef rtTimeNanoTSInternalRef 221 # define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceSyncInvarWithDeltaUseApicIdExt0B 222 # include "timesupref.h" 223 RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceSyncInvarWithDeltaUseApicIdExt0B); 224 225 # undef TMPL_MODE 226 # define TMPL_MODE TMPL_MODE_SYNC_INVAR_WITH_DELTA 227 # undef TMPL_GET_CPU_METHOD 228 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_APIC_ID_EXT_8000001E 229 # undef rtTimeNanoTSInternalRef 230 # define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceSyncInvarWithDeltaUseApicIdExt8000001E 231 # include "timesupref.h" 232 RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceSyncInvarWithDeltaUseApicIdExt8000001E); 233 234 # undef TMPL_GET_CPU_METHOD 235 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_RDTSCP_MASK_MAX_SET_CPUS 236 # undef rtTimeNanoTSInternalRef 237 # define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceSyncInvarWithDeltaUseRdtscp 238 # include "timesupref.h" 239 RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceSyncInvarWithDeltaUseRdtscp); 240 241 # undef TMPL_GET_CPU_METHOD 242 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_IDTR_LIMIT_MASK_MAX_SET_CPUS 243 # undef rtTimeNanoTSInternalRef 244 # define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceSyncInvarWithDeltaUseIdtrLim 245 # include "timesupref.h" 246 RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceSyncInvarWithDeltaUseIdtrLim); 247 248 # undef TMPL_MODE 249 # define TMPL_MODE TMPL_MODE_ASYNC 250 # undef TMPL_GET_CPU_METHOD 251 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_APIC_ID 252 # undef rtTimeNanoTSInternalRef 253 # define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceAsyncUseApicId 254 # include "timesupref.h" 255 RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceAsyncUseApicId); 256 257 # undef TMPL_MODE 258 # define TMPL_MODE TMPL_MODE_ASYNC 259 # undef TMPL_GET_CPU_METHOD 260 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_APIC_ID_EXT_0B 261 # undef rtTimeNanoTSInternalRef 262 # define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceAsyncUseApicIdExt0B 263 # include "timesupref.h" 264 RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceAsyncUseApicIdExt0B); 265 266 # undef TMPL_MODE 267 # define TMPL_MODE TMPL_MODE_ASYNC 268 # undef TMPL_GET_CPU_METHOD 269 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_APIC_ID_EXT_8000001E 270 # undef rtTimeNanoTSInternalRef 271 # define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceAsyncUseApicIdExt8000001E 272 # include "timesupref.h" 273 RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceAsyncUseApicIdExt8000001E); 274 275 # undef TMPL_GET_CPU_METHOD 276 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_RDTSCP_MASK_MAX_SET_CPUS 277 # undef rtTimeNanoTSInternalRef 278 # define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceAsyncUseRdtscp 279 # include "timesupref.h" 280 RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceAsyncUseRdtscp); 281 282 # undef TMPL_GET_CPU_METHOD 283 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_IDTR_LIMIT_MASK_MAX_SET_CPUS 284 # undef rtTimeNanoTSInternalRef 285 # define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceAsyncUseIdtrLim 286 # include "timesupref.h" 287 RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceAsyncUseIdtrLim); 288 289 # undef TMPL_GET_CPU_METHOD 290 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_RDTSCP_GROUP_IN_CH_NUMBER_IN_CL 291 # undef rtTimeNanoTSInternalRef 292 # define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceAsyncUseRdtscpGroupChNumCl 293 # include "timesupref.h" 294 RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceAsyncUseRdtscpGroupChNumCl); 295 296 #else /* IN_RC || IN_RING0: Disable interrupts and call getter function. */ 297 298 # undef TMPL_MODE 299 # define TMPL_MODE TMPL_MODE_SYNC_INVAR_WITH_DELTA 300 # undef TMPL_GET_CPU_METHOD 301 # define TMPL_GET_CPU_METHOD UINT32_MAX 302 # undef rtTimeNanoTSInternalRef 303 # define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceSyncInvarWithDelta 304 # include "timesupref.h" 305 RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceSyncInvarWithDelta); 306 307 # undef TMPL_MODE 308 # define TMPL_MODE TMPL_MODE_ASYNC 309 # undef rtTimeNanoTSInternalRef 310 # define rtTimeNanoTSInternalRef RTTimeNanoTSLFenceAsync 311 # include "timesupref.h" 312 RT_EXPORT_SYMBOL(RTTimeNanoTSLFenceAsync); 313 314 #endif 315 342 RT_EXPORT_SYMBOL(RTTimeNanoTSSyncInvarNoDelta); 343 344 # ifdef IN_RING0 345 346 # undef TMPL_MODE 347 # define TMPL_MODE TMPL_MODE_SYNC_INVAR_WITH_DELTA 348 # undef TMPL_GET_CPU_METHOD 349 # define TMPL_GET_CPU_METHOD UINT32_MAX 350 # undef rtTimeNanoTSInternalRef 351 # define rtTimeNanoTSInternalRef RTTimeNanoTSSyncInvarWithDelta 352 # include "timesupref.h" 353 RT_EXPORT_SYMBOL(RTTimeNanoTSSyncInvarWithDelta); 354 355 # undef TMPL_MODE 356 # define TMPL_MODE TMPL_MODE_ASYNC 357 # undef rtTimeNanoTSInternalRef 358 # define rtTimeNanoTSInternalRef RTTimeNanoTSAsync 359 # include "timesupref.h" 360 RT_EXPORT_SYMBOL(RTTimeNanoTSAsync); 361 362 # elif defined(IN_RING3) && defined(RT_ARCH_ARM64) 363 364 # undef TMPL_MODE 365 # define TMPL_MODE TMPL_MODE_SYNC_INVAR_WITH_DELTA 366 # undef TMPL_GET_CPU_METHOD 367 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_TPIDRRO_EL0 368 # undef rtTimeNanoTSInternalRef 369 # define rtTimeNanoTSInternalRef RTTimeNanoTSSyncInvarWithDeltaUseTpIdRRo 370 # include "timesupref.h" 371 RT_EXPORT_SYMBOL(RTTimeNanoTSSyncInvarWithDeltaUseTpIdRRo); 372 373 # undef TMPL_MODE 374 # define TMPL_MODE TMPL_MODE_ASYNC 375 # undef TMPL_GET_CPU_METHOD 376 # define TMPL_GET_CPU_METHOD SUPGIPGETCPU_TPIDRRO_EL0 377 # undef rtTimeNanoTSInternalRef 378 # define rtTimeNanoTSInternalRef RTTimeNanoTSAsyncUseTpIdRRo 379 # include "timesupref.h" 380 RT_EXPORT_SYMBOL(RTTimeNanoTSAsyncUseTpIdRRo); 381 382 # endif 383 384 #endif /* !AMD64 && !X86 */ 316 385 317 386 #endif /* !IN_GUEST && !RT_NO_GIP */ -
trunk/src/VBox/Runtime/common/time/timesupref.h
r106061 r107192 139 139 uint16_t const iCpuSet = (cbLim - 256 * (ARCH_BITS == 64 ? 16 : 8)) & (RTCPUSET_MAX_CPUS - 1); 140 140 uint16_t const iGipCpu = pGip->aiCpuFromCpuSetIdx[iCpuSet]; 141 # elif TMPL_GET_CPU_METHOD == SUPGIPGETCPU_TPIDRRO_EL0 142 uint32_t const iCpuSet = ASMGetThreadIdRoEL0() & (RTCPUSET_MAX_CPUS - 1); 143 uint16_t const iGipCpu = pGip->aiCpuFromCpuSetIdx[iCpuSet]; 141 144 # else 142 145 # error "What?" -
trunk/src/VBox/Runtime/r3/nt/time-nt.cpp
r106061 r107192 55 55 *********************************************************************************************************************************/ 56 56 /** Whether we've tried to resolve g_pfnRtlGetSystemTimePrecise or not. */ 57 static bool g_fInitialized = false;57 static bool g_fInitialized = false; 58 58 /** Pointer to RtlGetSystemTimePrecise, added in 6.2 (windows 8). */ 59 static PFNRTLGETSYSTEMTIMEPRECISE g_pfnRtlGetSystemTimePrecise = NULL;59 static PFNRTLGETSYSTEMTIMEPRECISE g_pfnRtlGetSystemTimePrecise = NULL; 60 60 61 61 … … 70 70 if (ASMAtomicCmpXchgBool(&g_fInitialized, true, false)) 71 71 { 72 /** @todo there is a RtlGetInterruptTimePrecise export since W10 */ 72 73 void *pvFunc = RTLdrGetSystemSymbol("ntdll.dll", "RtlGetSystemTimePrecise"); 73 74 if (pvFunc) … … 90 91 * interrupt time from it. (Microsoft doesn't expose interrupt time to user 91 92 * application, which is very unfortunate as there are a lot place where 92 * monotonic time is applicable but developer is "forced" to use wall clock.) 93 * monotonic time is applicable but developers are "forced" to use the wall 94 * clock.) 93 95 */ 94 96 if (g_pfnRtlGetSystemTimePrecise)
Note:
See TracChangeset
for help on using the changeset viewer.