summaryrefslogtreecommitdiff
path: root/src/VBox/Runtime/r3/win/time-win.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/VBox/Runtime/r3/win/time-win.cpp')
-rw-r--r--src/VBox/Runtime/r3/win/time-win.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/VBox/Runtime/r3/win/time-win.cpp b/src/VBox/Runtime/r3/win/time-win.cpp
index bd4e768a..44dea140 100644
--- a/src/VBox/Runtime/r3/win/time-win.cpp
+++ b/src/VBox/Runtime/r3/win/time-win.cpp
@@ -39,13 +39,17 @@
#include <iprt/err.h>
#include "internal/time.h"
-#define USE_TICK_COUNT
+/*
+ * Note! The selected time source be the exact same one as we use in kernel land!
+ */
+//#define USE_TICK_COUNT
//#define USE_PERFORMANCE_COUNTER
-#if 0//defined(RT_ARCH_X86) || defined(RT_ARCH_AMD64)
-# define USE_INTERRUPT_TIME
-#else
//# define USE_FILE_TIME
-#endif
+//#if defined(RT_ARCH_X86) || defined(RT_ARCH_AMD64)
+# define USE_INTERRUPT_TIME
+//#else
+//# define USE_TICK_COUNT
+//#endif
#ifdef USE_INTERRUPT_TIME
@@ -104,6 +108,7 @@ DECLINLINE(uint64_t) rtTimeGetSystemNanoTS(void)
return u64 * 100;
#elif defined USE_INTERRUPT_TIME
+# if 0 /* ASSUME 0x7ffe0000 is set in stone */
/*
* This is exactly what we want, but we have to obtain it by non-official
* means.
@@ -114,16 +119,18 @@ DECLINLINE(uint64_t) rtTimeGetSystemNanoTS(void)
/** @todo find official way of getting this or some more clever
* detection algorithm if necessary. The com debugger class
* exports this too, windbg knows it too... */
- s_pUserSharedData = (MY_ KUSER_SHARED_DATA *)(uintptr_t)0x7ffe0000;
+ s_pUserSharedData = (PMY_KUSER_SHARED_DATA)(uintptr_t)0x7ffe0000;
}
+# endif
+ PMY_KUSER_SHARED_DATA pUserSharedData = (PMY_KUSER_SHARED_DATA)(uintptr_t)0x7ffe0000;
/* use interrupt time */
LARGE_INTEGER Time;
do
{
- Time.HighPart = s_pUserSharedData->InterruptTime.High1Time;
- Time.LowPart = s_pUserSharedData->InterruptTime.LowPart;
- } while (s_pUserSharedData->InterruptTime.High2Time != Time.HighPart);
+ Time.HighPart = pUserSharedData->InterruptTime.High1Time;
+ Time.LowPart = pUserSharedData->InterruptTime.LowPart;
+ } while (pUserSharedData->InterruptTime.High2Time != Time.HighPart);
return (uint64_t)Time.QuadPart * 100;