i386/machdep.c: revert revisions 1.659 and 1.660
authorcheloha <cheloha@openbsd.org>
Wed, 11 Jan 2023 02:49:34 +0000 (02:49 +0000)
committercheloha <cheloha@openbsd.org>
Wed, 11 Jan 2023 02:49:34 +0000 (02:49 +0000)
"put it back" kettenis@

sys/arch/i386/i386/machdep.c

index 43ab182..b911a97 100644 (file)
@@ -1,4 +1,4 @@
-/*     $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 $    */
 
 /*-
@@ -1862,8 +1862,19 @@ identifycpu(struct cpu_info *ci)
                        }
                        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)