diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2001-01-25 05:15:25 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2001-01-25 05:15:25 +0000 |
commit | 81b5ee24ca117091ba8501c90ce48a0710556553 (patch) | |
tree | a8c981d30656550f23f6c43b6586b263ec304021 | |
parent | a3e788151b41e35445ff70186cb5970319d52156 (diff) |
print cpu speed in GHz rounded to 2 digits after point
-rw-r--r-- | sys/arch/i386/i386/machdep.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index 4e8627ade3f..eac14da82f3 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.144 2001/01/25 04:39:46 deraadt Exp $ */ +/* $OpenBSD: machdep.c,v 1.145 2001/01/25 05:15:24 mickey Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -1286,7 +1286,17 @@ identifycpu() #if defined(I586_CPU) || defined(I686_CPU) if (cpu_feature && (cpu_feature & CPUID_TSC)) { /* Has TSC */ calibrate_cyclecounter(); - printf(" %d MHz", pentium_mhz); + if (pentium_mhz > 994) { + int ghz, fr; + + ghz = (pentium_mhz + 9) / 1000; + fr = ((pentium_mhz + 9) / 10 ) % 100; + if (fr) + printf(" %d.%02d GHz", ghz, fr); + else + printf(" %d GHz", ghz); + } else + printf(" %d MHz", pentium_mhz); } #endif printf("\n"); |