From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 06:57:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B942106566C; Wed, 10 Feb 2010 06:57:06 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 118BB8FC12; Wed, 10 Feb 2010 06:57:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1A6v5p6013710; Wed, 10 Feb 2010 06:57:05 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1A6v5Wn013708; Wed, 10 Feb 2010 06:57:05 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201002100657.o1A6v5Wn013708@svn.freebsd.org> From: Neel Natu Date: Wed, 10 Feb 2010 06:57:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203746 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 06:57:06 -0000 Author: neel Date: Wed Feb 10 06:57:05 2010 New Revision: 203746 URL: http://svn.freebsd.org/changeset/base/203746 Log: Code cleanup: - make some variables static - remove unused variables. Modified: head/sys/mips/mips/tick.c Modified: head/sys/mips/mips/tick.c ============================================================================== --- head/sys/mips/mips/tick.c Wed Feb 10 06:29:43 2010 (r203745) +++ head/sys/mips/mips/tick.c Wed Feb 10 06:57:05 2010 (r203746) @@ -47,21 +47,19 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include uint64_t counter_freq; -uint64_t cycles_per_tick; -uint64_t cycles_per_usec; -uint64_t cycles_per_sec; -uint64_t cycles_per_hz, cycles_per_stathz, cycles_per_profhz; - -u_int32_t counter_upper = 0; -u_int32_t counter_lower_last = 0; -int tick_started = 0; -void platform_initclocks(void); +static uint64_t cycles_per_tick; +static uint64_t cycles_per_usec; +static uint64_t cycles_per_hz, cycles_per_stathz, cycles_per_profhz; + +static u_int32_t counter_upper = 0; +static u_int32_t counter_lower_last = 0; struct clk_ticks { @@ -103,10 +101,8 @@ mips_timer_early_init(uint64_t clock_hz) void platform_initclocks(void) { - if (!tick_started) { - tc_init(&counter_timecounter); - tick_started++; - } + + tc_init(&counter_timecounter); } static uint64_t @@ -157,20 +153,17 @@ mips_timer_init_params(uint64_t platform cycles_per_stathz = counter_freq / stathz; cycles_per_profhz = counter_freq / profhz; cycles_per_usec = counter_freq / (1 * 1000 * 1000); - cycles_per_sec = counter_freq ; counter_timecounter.tc_frequency = counter_freq; printf("hz=%d cyl_per_tick:%jd cyl_per_usec:%jd freq:%jd " - "cyl_per_hz:%jd cyl_per_stathz:%jd cyl_per_profhz:%jd " - "cyl_per_sec:%jd\n", + "cyl_per_hz:%jd cyl_per_stathz:%jd cyl_per_profhz:%jd\n", hz, cycles_per_tick, cycles_per_usec, counter_freq, cycles_per_hz, cycles_per_stathz, - cycles_per_profhz, - cycles_per_sec); + cycles_per_profhz); set_cputicker(tick_ticker, counter_freq, 1); } @@ -307,7 +300,7 @@ clock_intr(void *arg) #if 0 /* TARGET_OCTEON */ /* Run the FreeBSD display once every hz ticks */ wheel_run += cycles_per_tick; - if (wheel_run >= cycles_per_sec) { + if (wheel_run >= cycles_per_usec * 1000000ULL) { wheel_run = 0; octeon_led_run_wheel(); }