svn commit: r216161 - in head/sys: amd64/amd64 i386/i386
mdf at FreeBSD.org
mdf at FreeBSD.org
Fri Dec 3 21:56:30 UTC 2010
On Fri, Dec 3, 2010 at 1:54 PM, Jung-uk Kim <jkim at freebsd.org> wrote:
> Author: jkim
> Date: Fri Dec 3 21:54:10 2010
> New Revision: 216161
> URL: http://svn.freebsd.org/changeset/base/216161
>
> Log:
> Explicitly initialize TSC frequency. To calibrate TSC frequency, we use
> DELAY(9) and it may use TSC in turn if TSC frequency is non-zero.
Doesn't ELF guarantee that the static data is already 0? On AIX the
kernel had to explicitly zero the non-initialized data area, but AIX
uses the a.out format. I thought FreeBSD/ELF meant that global
variables without initializers were 0 by the time the OS started
running.
Thanks,
matthew
>
> MFC after: 3 days
>
> Modified:
> head/sys/amd64/amd64/tsc.c
> head/sys/i386/i386/tsc.c
>
> Modified: head/sys/amd64/amd64/tsc.c
> ==============================================================================
> --- head/sys/amd64/amd64/tsc.c Fri Dec 3 21:52:01 2010 (r216160)
> +++ head/sys/amd64/amd64/tsc.c Fri Dec 3 21:54:10 2010 (r216161)
> @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$");
>
> #include "cpufreq_if.h"
>
> -uint64_t tsc_freq;
> +uint64_t tsc_freq = 0;
> int tsc_is_broken;
> int tsc_is_invariant;
> static eventhandler_tag tsc_levels_tag, tsc_pre_tag, tsc_post_tag;
>
> Modified: head/sys/i386/i386/tsc.c
> ==============================================================================
> --- head/sys/i386/i386/tsc.c Fri Dec 3 21:52:01 2010 (r216160)
> +++ head/sys/i386/i386/tsc.c Fri Dec 3 21:54:10 2010 (r216161)
> @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$");
>
> #include "cpufreq_if.h"
>
> -uint64_t tsc_freq;
> +uint64_t tsc_freq = 0;
> int tsc_is_broken;
> int tsc_is_invariant;
> u_int tsc_present;
>
More information about the svn-src-all
mailing list