Changeset 46231 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- May 23, 2013 11:23:15 AM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 85960
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/nt/time-r0drv-nt.cpp
r46223 r46231 39 39 * Note! The time source we use here must be exactly the same as in 40 40 * the ring-3 code! 41 * 42 * Using interrupt time is the simplest and requires the least calculation. 43 * It is also accounting for suspended time. Unfortuantely, there is no 44 * ring-3 for reading it... but that won't stop us. 45 * 46 * Using the tick count is problematic in ring-3 on older windows version 47 * as we can only get the 32-bit tick value, i.e. we'll roll over sooner or 48 * later. 41 49 */ 42 #if 0 50 #if 1 51 /* Interrupt time. (NT4 doesn't have an API for it.) */ 43 52 # ifndef IPRT_TARGET_NT4 44 53 ULONGLONG InterruptTime = KeQueryInterruptTime(); … … 55 64 # endif 56 65 #else 66 /* Tick Count (NT4 SP1 has these APIs, haven't got SP0 to check). */ 57 67 LARGE_INTEGER Tick; 58 68 KeQueryTickCount(&Tick); -
trunk/src/VBox/Runtime/r3/win/time-win.cpp
r46223 r46231 43 43 * Note! The selected time source be the exact same one as we use in kernel land! 44 44 */ 45 #define USE_TICK_COUNT45 //#define USE_TICK_COUNT 46 46 //#define USE_PERFORMANCE_COUNTER 47 47 //# define USE_FILE_TIME 48 48 //#if defined(RT_ARCH_X86) || defined(RT_ARCH_AMD64) 49 //# define USE_INTERRUPT_TIME49 # define USE_INTERRUPT_TIME 50 50 //#else 51 51 //# define USE_TICK_COUNT … … 109 109 110 110 #elif defined USE_INTERRUPT_TIME 111 # if 0 /* ASSUME 0x7ffe0000 is set in stone */ 111 112 /* 112 113 * This is exactly what we want, but we have to obtain it by non-official … … 121 122 s_pUserSharedData = (PMY_KUSER_SHARED_DATA)(uintptr_t)0x7ffe0000; 122 123 } 124 # endif 125 PMY_KUSER_SHARED_DATA pUserSharedData = (PMY_KUSER_SHARED_DATA)(uintptr_t)0x7ffe0000; 123 126 124 127 /* use interrupt time */ … … 126 129 do 127 130 { 128 Time.HighPart = s_pUserSharedData->InterruptTime.High1Time;129 Time.LowPart = s_pUserSharedData->InterruptTime.LowPart;130 } while ( s_pUserSharedData->InterruptTime.High2Time != Time.HighPart);131 Time.HighPart = pUserSharedData->InterruptTime.High1Time; 132 Time.LowPart = pUserSharedData->InterruptTime.LowPart; 133 } while (pUserSharedData->InterruptTime.High2Time != Time.HighPart); 131 134 132 135 return (uint64_t)Time.QuadPart * 100;
Note:
See TracChangeset
for help on using the changeset viewer.