From d231baccef1da8267505e4ac0742f219f6178b42 Mon Sep 17 00:00:00 2001 From: janwas Date: Mon, 21 Jun 2004 14:19:43 +0000 Subject: [PATCH] use ia32_cap() instead of direct access to cap var This was SVN commit r580. --- source/lib/sysdep/win/wtime.cpp | 9 +++++---- source/lib/sysdep/win/wtime.h | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/source/lib/sysdep/win/wtime.cpp b/source/lib/sysdep/win/wtime.cpp index 422794fb3b..6f924bc199 100755 --- a/source/lib/sysdep/win/wtime.cpp +++ b/source/lib/sysdep/win/wtime.cpp @@ -29,10 +29,12 @@ #include #include +#include "wdbg.h" + // define to disable time sources (useful for simulating other systems) -// #define NO_QPC -// #define NO_TSC +//#define NO_QPC +//#define NO_TSC #pragma data_seg(".LIB$WIA") @@ -142,7 +144,7 @@ static int choose_impl() // frequency changes are too often and drastic to correct, // and we don't want to mess with the system power settings. // => unsafe. - if(cpu_caps & TSC && cpu_freq > 0.0) + if(ia32_cap(TSC) && cpu_freq > 0.0) { safe = (cpus == 1 && !cpu_speedstep); SAFETY_OVERRIDE(HRT_TSC); @@ -225,7 +227,6 @@ static int choose_impl() return 0; } - // no warning here - doesn't inspire confidence in VC dead code removal. debug_warn("hrt_choose_impl: no safe timer found!"); hrt_impl = HRT_NONE; hrt_nominal_freq = -1; diff --git a/source/lib/sysdep/win/wtime.h b/source/lib/sysdep/win/wtime.h index bde1d4499a..b73b436a9b 100755 --- a/source/lib/sysdep/win/wtime.h +++ b/source/lib/sysdep/win/wtime.h @@ -71,8 +71,8 @@ extern int clock_getres(clockid_t clock, struct timespec* res); // HACK: if _WIN32, the HRT makes its final implementation choice -// in the first calibrate call where cpu_freq and cpu_caps are -// available. provide a routine that makes the choice when called, +// in the first calibrate call where cpu_freq is available. +// provide a routine that makes the choice when called, // so app code isn't surprised by a timer change, although the HRT // does try to keep the timer continuous. extern void wtime_reset_impl();