summaryrefslogtreecommitdiff
path: root/tune/freq.c
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2001-01-30 23:00:01 +0100
committerKevin Ryde <user42@zip.com.au>2001-01-30 23:00:01 +0100
commitca856459948ec6c2007bd6c960f5ac67c394b2ed (patch)
tree5e92d4efbc10c2df46a816305c900442f1f57a4c /tune/freq.c
parentf6b161c341cb20d276caf5212ec584da5bcd0641 (diff)
downloadgmp-ca856459948ec6c2007bd6c960f5ac67c394b2ed.tar.gz
* tune/freq.c (speed_cpu_frequency_proc_cpuinfo): Ignore "cycle
frequency" of 0, allow "BogoMIPS" as well as "bogomips".
Diffstat (limited to 'tune/freq.c')
-rw-r--r--tune/freq.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/tune/freq.c b/tune/freq.c
index 53e156122..8cc5d5462 100644
--- a/tune/freq.c
+++ b/tune/freq.c
@@ -233,7 +233,11 @@ speed_cpu_frequency_sysctl (void)
is the frequency.
alpha 2.2.5 - "cycle frequency [Hz]" seems to be right, "BogoMIPS" is
- very slightly different. */
+ very slightly different.
+
+ alpha 2.2.18pre21 - "cycle frequency [Hz]" is 0 on at least one system,
+ "BogoMIPS" seems near enough.
+ */
int
speed_cpu_frequency_proc_cpuinfo (void)
@@ -247,7 +251,8 @@ speed_cpu_frequency_proc_cpuinfo (void)
{
while (fgets (buf, sizeof (buf), fp) != NULL)
{
- if (sscanf (buf, "cycle frequency [Hz] : %lf est.\n", &val) == 1)
+ if (sscanf (buf, "cycle frequency [Hz] : %lf", &val) == 1
+ && val != 0.0)
{
speed_cycletime = 1.0 / val;
if (speed_option_verbose)
@@ -263,7 +268,8 @@ speed_cpu_frequency_proc_cpuinfo (void)
ret = 1;
break;
}
- if (sscanf (buf, "bogomips : %lf\n", &val) == 1)
+ if (sscanf (buf, "bogomips : %lf\n", &val) == 1
+ || sscanf (buf, "BogoMIPS : %lf\n", &val) == 1)
{
speed_cycletime = 1e-6 / val;
if (speed_option_verbose)