From bbad6a4d6ab0b6e735acb1d8bcc7ce96d536b545 Mon Sep 17 00:00:00 2001 From: janwas Date: Sun, 27 Jun 2004 01:42:55 +0000 Subject: [PATCH] fix order of detect calls (TSC wasn't getting selected in wtime due to not-yet-set cpu_smp) This was SVN commit r608. --- source/lib/sysdep/ia32.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/source/lib/sysdep/ia32.cpp b/source/lib/sysdep/ia32.cpp index 7ffc6777f3..508bd4552e 100755 --- a/source/lib/sysdep/ia32.cpp +++ b/source/lib/sysdep/ia32.cpp @@ -400,15 +400,6 @@ static void measure_cpu_freq() for(i = lo; i < hi; i++) sum += samples[i]; cpu_freq = sum / (hi-lo); - - // HACK: if _WIN32, the HRT makes its final implementation choice - // in the first calibrate call where cpu_freq is available. - // call wtime_reset_impl here to have that happen now, - // so app code isn't surprised by a timer change, although the HRT - // does try to keep the timer continuous. -#ifdef _WIN32 - wtime_reset_impl(); -#endif } // else: TSC not available, can't measure @@ -513,9 +504,19 @@ void ia32_get_cpu_info() vendor = INTEL; get_cpu_type(); - measure_cpu_freq(); check_speedstep(); on_each_cpu(check_smp); + + measure_cpu_freq(); + + // HACK: if _WIN32, the HRT makes its final implementation choice + // in the first calibrate call where cpu info is available. + // call wtime_reset_impl here to have that happen now, + // so app code isn't surprised by a timer change, although the HRT + // does try to keep the timer continuous. +#ifdef _WIN32 + wtime_reset_impl(); +#endif } #endif // #ifndef _M_IX86