-/* $OpenBSD: machdep.c,v 1.661 2023/01/10 01:09:14 dv Exp $ */
+/* $OpenBSD: machdep.c,v 1.662 2023/01/11 02:49:34 cheloha Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
}
break;
}
- if (CPU_IS_PRIMARY(ci))
- calibrate_cyclecounter(); /* set cpuspeed */
+ calibrate_cyclecounter();
+ if (cpuspeed > 994) {
+ int ghz, fr;
+
+ ghz = (cpuspeed + 9) / 1000;
+ fr = ((cpuspeed + 9) / 10 ) % 100;
+ if (fr)
+ printf(" %d.%02d GHz", ghz, fr);
+ else
+ printf(" %d GHz", ghz);
+ } else {
+ printf(" %d MHz", cpuspeed);
+ }
}
if (cpuid_level != -1)