Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/arch/x86/x86/cpu.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/arch/x86/x86/cpu.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.171.2.3 retrieving revision 1.172 diff -u -p -r1.171.2.3 -r1.172 --- src/sys/arch/x86/x86/cpu.c 2020/08/02 07:33:38 1.171.2.3 +++ src/sys/arch/x86/x86/cpu.c 2019/08/30 07:53:47 1.172 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.171.2.3 2020/08/02 07:33:38 martin Exp $ */ +/* $NetBSD: cpu.c,v 1.172 2019/08/30 07:53:47 mrg Exp $ */ /* * Copyright (c) 2000-2012 NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.171.2.3 2020/08/02 07:33:38 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.172 2019/08/30 07:53:47 mrg Exp $"); #include "opt_ddb.h" #include "opt_mpbios.h" /* for MPDEBUG */ @@ -521,16 +521,6 @@ cpu_rescan(device_t self, const char *if struct cpufeature_attach_args cfaa; struct cpu_info *ci = sc->sc_info; - /* - * If we booted with RB_MD1 to disable multiprocessor, the - * auto-configuration data still contains the additional - * CPUs. But their initialization was mostly bypassed - * during attach, so we have to make sure we don't look at - * their featurebus info, since it wasn't retrieved. - */ - if (ci == NULL) - return 0; - memset(&cfaa, 0, sizeof(cfaa)); cfaa.ci = ci; @@ -989,8 +979,14 @@ cpu_debug_dump(void) { struct cpu_info *ci; CPU_INFO_ITERATOR cii; + const char sixtyfour64space[] = +#ifdef _LP64 + " " +#endif + ""; - db_printf("addr dev id flags ipis curlwp fpcurlwp\n"); + db_printf("addr %sdev id flags ipis curlwp " + "fpcurlwp\n", sixtyfour64space); for (CPU_INFO_FOREACH(cii, ci)) { db_printf("%p %s %ld %x %x %10p %10p\n", ci, @@ -1261,25 +1257,16 @@ cpu_shutdown(device_t dv, int how) return cpu_stop(dv); } -/* Get the TSC frequency and set it to ci->ci_data.cpu_cc_freq. */ void cpu_get_tsc_freq(struct cpu_info *ci) { - uint64_t freq = 0, last_tsc; + uint64_t last_tsc; if (cpu_hascounter()) { - freq = cpu_tsc_freq_cpuid(ci); - - if (freq != 0) { - /* Use TSC frequency taken from CPUID. */ - ci->ci_data.cpu_cc_freq = freq; - } else { - /* Calibrate TSC frequency. */ - last_tsc = cpu_counter_serializing(); - x86_delay(100000); - ci->ci_data.cpu_cc_freq = - (cpu_counter_serializing() - last_tsc) * 10; - } + last_tsc = cpu_counter_serializing(); + x86_delay(100000); + ci->ci_data.cpu_cc_freq = + (cpu_counter_serializing() - last_tsc) * 10; } }