summaryrefslogtreecommitdiff
path: root/src/VBox/Runtime/r3/win/time-win.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2014-03-26 19:21:20 +0000
committer <>2014-05-08 15:03:54 +0000
commitfb123f93f9f5ce42c8e5785d2f8e0edaf951740e (patch)
treec2103d76aec5f1f10892cd1d3a38e24f665ae5db /src/VBox/Runtime/r3/win/time-win.cpp
parent58ed4748338f9466599adfc8a9171280ed99e23f (diff)
downloadVirtualBox-master.tar.gz
Imported from /home/lorry/working-area/delta_VirtualBox/VirtualBox-4.3.10.tar.bz2.HEADVirtualBox-4.3.10master
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;