summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1996-08-10 06:35:35 +0000
committerpeter <peter@FreeBSD.org>1996-08-10 06:35:35 +0000
commitd6987f0ce13738a30ff52bb78cd8ff1fe6a63b23 (patch)
treef4ebcb34cac6d837c9e87badb64e901f3e9e1919 /sys
parented5b9abd63e0dfcfc82294c571272aaaba400020 (diff)
downloadFreeBSD-src-d6987f0ce13738a30ff52bb78cd8ff1fe6a63b23.zip
FreeBSD-src-d6987f0ce13738a30ff52bb78cd8ff1fe6a63b23.tar.gz
Trivial cosmetic tweak to make the i[56]86 CPU MHz reprting round to the
nearest .01 Mhz rather than simply truncating it downwards. This hack makes this 89.999928 Mhz clock correctly round to the closer 90.00-MHz rather than 89.99-MHz: > i586 clock: 89999928 Hz, i8254 clock: 1193152 Hz > CPU: Pentium (90.00-MHz 586-class CPU)
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/identcpu.c8
-rw-r--r--sys/i386/i386/identcpu.c8
2 files changed, 10 insertions, 6 deletions
diff --git a/sys/amd64/amd64/identcpu.c b/sys/amd64/amd64/identcpu.c
index d5acc8d..5ae7c1f 100644
--- a/sys/amd64/amd64/identcpu.c
+++ b/sys/amd64/amd64/identcpu.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: Id: machdep.c,v 1.193 1996/06/18 01:22:04 bde Exp
- * $Id: identcpu.c,v 1.1 1996/07/08 19:44:38 wollman Exp $
+ * $Id: identcpu.c,v 1.2 1996/08/02 21:15:47 bde Exp $
*/
#include <sys/param.h>
@@ -169,14 +169,16 @@ identifycpu(void)
#if defined(I586_CPU)
case CPUCLASS_586:
printf("%d.%02d-MHz ",
- i586_ctr_freq / 1000000, (i586_ctr_freq / 10000) % 100);
+ (i586_ctr_freq + 4999) / 1000000,
+ ((i586_ctr_freq + 4999) / 10000) % 100);
printf("586");
break;
#endif
#if defined(I686_CPU)
case CPUCLASS_686:
printf("%d.%02d-MHz ",
- i586_ctr_freq / 1000000, (i586_ctr_freq / 10000) % 100);
+ (i586_ctr_freq + 4999) / 1000000,
+ ((i586_ctr_freq + 4999) / 10000) % 100);
printf("686");
break;
#endif
diff --git a/sys/i386/i386/identcpu.c b/sys/i386/i386/identcpu.c
index d5acc8d..5ae7c1f 100644
--- a/sys/i386/i386/identcpu.c
+++ b/sys/i386/i386/identcpu.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: Id: machdep.c,v 1.193 1996/06/18 01:22:04 bde Exp
- * $Id: identcpu.c,v 1.1 1996/07/08 19:44:38 wollman Exp $
+ * $Id: identcpu.c,v 1.2 1996/08/02 21:15:47 bde Exp $
*/
#include <sys/param.h>
@@ -169,14 +169,16 @@ identifycpu(void)
#if defined(I586_CPU)
case CPUCLASS_586:
printf("%d.%02d-MHz ",
- i586_ctr_freq / 1000000, (i586_ctr_freq / 10000) % 100);
+ (i586_ctr_freq + 4999) / 1000000,
+ ((i586_ctr_freq + 4999) / 10000) % 100);
printf("586");
break;
#endif
#if defined(I686_CPU)
case CPUCLASS_686:
printf("%d.%02d-MHz ",
- i586_ctr_freq / 1000000, (i586_ctr_freq / 10000) % 100);
+ (i586_ctr_freq + 4999) / 1000000,
+ ((i586_ctr_freq + 4999) / 10000) % 100);
printf("686");
break;
#endif
OpenPOWER on IntegriCloud