Author: jkim
Date: Tue Mar 15 19:47:20 2011
New Revision: 219676
URL: http://svn.freebsd.org/changeset/base/219676

Log:
  Do not let machdep.tsc_freq modify tsc_freq itself.  It is bad for i386 as
  it does not operate atomically.  Actually, it serves no purpose.
  
  Noticed by:   bde

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

Modified: head/sys/x86/x86/tsc.c
==============================================================================
--- head/sys/x86/x86/tsc.c      Tue Mar 15 18:09:29 2011        (r219675)
+++ head/sys/x86/x86/tsc.c      Tue Mar 15 19:47:20 2011        (r219676)
@@ -263,12 +263,10 @@ sysctl_machdep_tsc_freq(SYSCTL_HANDLER_A
 
        if (tsc_timecounter.tc_frequency == 0)
                return (EOPNOTSUPP);
-       freq = tsc_freq;
+       freq = tsc_timecounter.tc_frequency;
        error = sysctl_handle_64(oidp, &freq, 0, req);
-       if (error == 0 && req->newptr != NULL) {
-               tsc_freq = freq;
-               tsc_timecounter.tc_frequency = tsc_freq;
-       }
+       if (error == 0 && req->newptr != NULL)
+               tsc_timecounter.tc_frequency = freq;
        return (error);
 }
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to