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

Jung-uk Kim jkim at FreeBSD.org
Wed Jun 8 23:45:00 UTC 2011


Author: jkim
Date: Wed Jun  8 23:44:59 2011
New Revision: 222884
URL: http://svn.freebsd.org/changeset/base/222884

Log:
  Tidy up r222866.
  
  - Re-add accidentally removed atomic op. for sysctl(9) handler.
  - Remove a period(`.') at the end of a debugging message.
  - Consistently spell "low" for "TSC-low" timecounter throughout.
  
  Pointed out by:	bde

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

Modified: head/sys/x86/x86/tsc.c
==============================================================================
--- head/sys/x86/x86/tsc.c	Wed Jun  8 21:59:07 2011	(r222883)
+++ head/sys/x86/x86/tsc.c	Wed Jun  8 23:44:59 2011	(r222884)
@@ -80,7 +80,7 @@ static void tsc_freq_changed(void *arg, 
 static void tsc_freq_changing(void *arg, const struct cf_level *level,
     int *status);
 static unsigned tsc_get_timecount(struct timecounter *tc);
-static unsigned tsc_get_timecount_lowres(struct timecounter *tc);
+static unsigned tsc_get_timecount_low(struct timecounter *tc);
 static void tsc_levels_changed(void *arg, int unit);
 
 static struct timecounter tsc_timecounter = {
@@ -464,10 +464,10 @@ init:
 	for (shift = 0; shift < 32 && (tsc_freq >> shift) > max_freq; shift++)
 		;
 	if (shift > 0) {
-		tsc_timecounter.tc_get_timecount = tsc_get_timecount_lowres;
+		tsc_timecounter.tc_get_timecount = tsc_get_timecount_low;
 		tsc_timecounter.tc_name = "TSC-low";
 		if (bootverbose)
-			printf("TSC timecounter discards lower %d bit(s).\n",
+			printf("TSC timecounter discards lower %d bit(s)\n",
 			    shift);
 	}
 	if (tsc_freq != 0) {
@@ -560,8 +560,8 @@ sysctl_machdep_tsc_freq(SYSCTL_HANDLER_A
 	error = sysctl_handle_64(oidp, &freq, 0, req);
 	if (error == 0 && req->newptr != NULL) {
 		atomic_store_rel_64(&tsc_freq, freq);
-		tsc_timecounter.tc_frequency =
-		    freq >> (int)(intptr_t)tsc_timecounter.tc_priv;
+		atomic_store_rel_64(&tsc_timecounter.tc_frequency,
+		    freq >> (int)(intptr_t)tsc_timecounter.tc_priv);
 	}
 	return (error);
 }
@@ -577,7 +577,7 @@ tsc_get_timecount(struct timecounter *tc
 }
 
 static u_int
-tsc_get_timecount_lowres(struct timecounter *tc)
+tsc_get_timecount_low(struct timecounter *tc)
 {
 
 	return (rdtsc() >> (int)(intptr_t)tc->tc_priv);


More information about the svn-src-head mailing list