Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Dec 2010 13:56:32 -0800
From:      Garrett Cooper <gcooper@FreeBSD.org>
To:        Jung-uk Kim <jkim@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r216161 - in head/sys: amd64/amd64 i386/i386
Message-ID:  <AANLkTi=fLON_qWcfY2fy3HP0aqm%2B_EU9jVupEut6Bcrv@mail.gmail.com>
In-Reply-To: <201012032154.oB3LsADC035461@svn.freebsd.org>
References:  <201012032154.oB3LsADC035461@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On Fri, Dec 3, 2010 at 1:54 PM, Jung-uk Kim <jkim@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.
>
>  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;

    This is unnecessary. Global values (like this) are initialized to
0 by default:

$ cat ~/test_global.c
#include <stdio.h>
int aglobal;
int
main(void)
{
	printf("%d\n", aglobal);
	return 0;
}
$ ~/test_global
0

Thanks,
-Garrett



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTi=fLON_qWcfY2fy3HP0aqm%2B_EU9jVupEut6Bcrv>