svn commit: r334338 - head/sys/x86/x86

Andriy Gapon avg at FreeBSD.org
Tue May 29 16:03:54 UTC 2018


Author: avg
Date: Tue May 29 16:03:53 2018
New Revision: 334338
URL: https://svnweb.freebsd.org/changeset/base/334338

Log:
  fix x86 UP build broken by r334204, TSC resynchronization
  
  Reported by:	bde
  MFC after:	1 week
  X-MFC with:	r334204

Modified:
  head/sys/x86/x86/tsc.c

Modified: head/sys/x86/x86/tsc.c
==============================================================================
--- head/sys/x86/x86/tsc.c	Tue May 29 15:06:13 2018	(r334337)
+++ head/sys/x86/x86/tsc.c	Tue May 29 16:03:53 2018	(r334338)
@@ -505,19 +505,6 @@ retry:
 
 #undef N
 
-#else
-
-/*
- * The function is not called, it is provided to avoid linking failure
- * on uniprocessor kernel.
- */
-static int
-test_tsc(int adj_max_count __unused)
-{
-
-	return (0);
-}
-
 #endif /* SMP */
 
 static void
@@ -578,9 +565,12 @@ init_TSC_tc(void)
 	 * non-zero value.  The TSC seems unreliable in virtualized SMP
 	 * environments, so it is set to a negative quality in those cases.
 	 */
+#ifdef SMP
 	if (mp_ncpus > 1)
 		tsc_timecounter.tc_quality = test_tsc(smp_tsc_adjust);
-	else if (tsc_is_invariant)
+	else
+#endif /* SMP */
+	if (tsc_is_invariant)
 		tsc_timecounter.tc_quality = 1000;
 	max_freq >>= tsc_shift;
 
@@ -618,6 +608,7 @@ SYSINIT(tsc_tc, SI_SUB_SMP, SI_ORDER_ANY, init_TSC_tc,
 void
 resume_TSC(void)
 {
+#ifdef SMP
 	int quality;
 
 	/* If TSC was not good on boot, it is unlikely to become good now. */
@@ -637,6 +628,7 @@ resume_TSC(void)
 		    tsc_timecounter.tc_quality, quality);
 		tsc_timecounter.tc_quality = quality;
 	}
+#endif /* SMP */
 }
 
 /*


More information about the svn-src-all mailing list