1
0
forked from 0ad/0ad

fix order of detect calls (TSC wasn't getting selected in wtime due to not-yet-set cpu_smp)

This was SVN commit r608.
This commit is contained in:
janwas 2004-06-27 01:42:55 +00:00
parent 70b7f4249f
commit bbad6a4d6a

View File

@ -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