diff options
author | Kevin Ryde <user42@zip.com.au> | 2002-03-19 01:27:44 +0100 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2002-03-19 01:27:44 +0100 |
commit | 441a925de63c8755d1befa65be4c891eacd136da (patch) | |
tree | cc9974db33736822a52531cfff901acdd300fc2a /tune/freq.c | |
parent | fa0f9f1372881e12ea8cb279bd2c18a503fc68a6 (diff) | |
download | gmp-441a925de63c8755d1befa65be4c891eacd136da.tar.gz |
* tune/freq.c (freq_proc_cpuinfo): Recognise powerpc "clock", where
previously got the wrong result from "bogomips".
Diffstat (limited to 'tune/freq.c')
-rw-r--r-- | tune/freq.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tune/freq.c b/tune/freq.c index 12d8c8cbb..9d132c7d9 100644 --- a/tune/freq.c +++ b/tune/freq.c @@ -247,6 +247,8 @@ freq_sysctl_hw_model (int help) alpha 2.2.18pre21 - "cycle frequency [Hz]" is 0 on at least one system, "BogoMIPS" seems near enough. + + powerpc 2.2.19 - "clock" is the frequency, bogomips is something weird */ static int @@ -272,7 +274,7 @@ freq_proc_cpuinfo (int help) ret = 1; break; } - if (sscanf (buf, "cpu MHz : %lf\n", &val) == 1) + if (sscanf (buf, "cpu MHz : %lf\n", &val) == 1) { speed_cycletime = 1e-6 / val; if (speed_option_verbose) @@ -280,6 +282,14 @@ freq_proc_cpuinfo (int help) ret = 1; break; } + if (sscanf (buf, "clock : %lfMHz\n", &val) == 1) + { + speed_cycletime = 1e-6 / val; + if (speed_option_verbose) + printf ("Using /proc/cpuinfo \"clock\" %.2f for cycle time %.3g\n", val, speed_cycletime); + ret = 1; + break; + } if (sscanf (buf, "bogomips : %lf\n", &val) == 1 || sscanf (buf, "BogoMIPS : %lf\n", &val) == 1) { |