Date: Tue, 15 Mar 2011 19:47:20 +0000 (UTC) From: Jung-uk Kim <jkim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r219676 - head/sys/x86/x86 Message-ID: <201103151947.p2FJlK3L057573@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201103151947.p2FJlK3L057573>