]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - arch/powerpc/kernel/time.c
Merge branch 'cpus4096-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel...
[net-next-2.6.git] / arch / powerpc / kernel / time.c
index f1a38a6c1e2d41c749fb656401e49c97d38204fb..99f1ddd68582e9628456f8d8e7f8fe3fb0c5b25f 100644 (file)
@@ -129,7 +129,7 @@ static unsigned long __initdata iSeries_recal_titan;
 static signed long __initdata iSeries_recal_tb;
 
 /* Forward declaration is only needed for iSereis compiles */
-void __init clocksource_init(void);
+static void __init clocksource_init(void);
 #endif
 
 #define XSEC_PER_SEC (1024*1024)
@@ -150,8 +150,8 @@ u64 tb_to_xs;
 unsigned tb_to_us;
 
 #define TICKLEN_SCALE  NTP_SCALE_SHIFT
-u64 last_tick_len;     /* units are ns / 2^TICKLEN_SCALE */
-u64 ticklen_to_xs;     /* 0.64 fraction */
+static u64 last_tick_len;      /* units are ns / 2^TICKLEN_SCALE */
+static u64 ticklen_to_xs;      /* 0.64 fraction */
 
 /* If last_tick_len corresponds to about 1/HZ seconds, then
    last_tick_len << TICKLEN_SHIFT will be about 2^63. */
@@ -164,8 +164,6 @@ static u64 tb_to_ns_scale __read_mostly;
 static unsigned tb_to_ns_shift __read_mostly;
 static unsigned long boot_tb __read_mostly;
 
-struct gettimeofday_struct do_gtod;
-
 extern struct timezone sys_tz;
 static long timezone_offset;
 
@@ -415,31 +413,9 @@ void udelay(unsigned long usecs)
 }
 EXPORT_SYMBOL(udelay);
 
-
-/*
- * There are two copies of tb_to_xs and stamp_xsec so that no
- * lock is needed to access and use these values in
- * do_gettimeofday.  We alternate the copies and as long as a
- * reasonable time elapses between changes, there will never
- * be inconsistent values.  ntpd has a minimum of one minute
- * between updates.
- */
 static inline void update_gtod(u64 new_tb_stamp, u64 new_stamp_xsec,
                               u64 new_tb_to_xs)
 {
-       unsigned temp_idx;
-       struct gettimeofday_vars *temp_varp;
-
-       temp_idx = (do_gtod.var_idx == 0);
-       temp_varp = &do_gtod.vars[temp_idx];
-
-       temp_varp->tb_to_xs = new_tb_to_xs;
-       temp_varp->tb_orig_stamp = new_tb_stamp;
-       temp_varp->stamp_xsec = new_stamp_xsec;
-       smp_mb();
-       do_gtod.varp = temp_varp;
-       do_gtod.var_idx = temp_idx;
-
        /*
         * tb_update_count is used to allow the userspace gettimeofday code
         * to assure itself that it sees a consistent view of the tb_to_xs and
@@ -456,6 +432,7 @@ static inline void update_gtod(u64 new_tb_stamp, u64 new_stamp_xsec,
        vdso_data->tb_to_xs = new_tb_to_xs;
        vdso_data->wtom_clock_sec = wall_to_monotonic.tv_sec;
        vdso_data->wtom_clock_nsec = wall_to_monotonic.tv_nsec;
+       vdso_data->stamp_xtime = xtime;
        smp_wmb();
        ++(vdso_data->tb_update_count);
 }
@@ -514,9 +491,7 @@ static int __init iSeries_tb_recal(void)
                                tb_ticks_per_sec   = new_tb_ticks_per_sec;
                                calc_cputime_factors();
                                div128_by_32( XSEC_PER_SEC, 0, tb_ticks_per_sec, &divres );
-                               do_gtod.tb_ticks_per_sec = tb_ticks_per_sec;
                                tb_to_xs = divres.result_low;
-                               do_gtod.varp->tb_to_xs = tb_to_xs;
                                vdso_data->tb_ticks_per_sec = tb_ticks_per_sec;
                                vdso_data->tb_to_xs = tb_to_xs;
                        }
@@ -742,10 +717,6 @@ void __init generic_calibrate_decr(void)
        }
 
 #if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
-       /* Set the time base to zero */
-       mtspr(SPRN_TBWL, 0);
-       mtspr(SPRN_TBWU, 0);
-
        /* Clear any pending timer interrupts */
        mtspr(SPRN_TSR, TSR_ENW | TSR_WIS | TSR_DIS | TSR_FIS);
 
@@ -832,7 +803,7 @@ void update_vsyscall_tz(void)
        ++vdso_data->tb_update_count;
 }
 
-void __init clocksource_init(void)
+static void __init clocksource_init(void)
 {
        struct clocksource *clock;
 
@@ -873,7 +844,7 @@ static void register_decrementer_clockevent(int cpu)
        struct clock_event_device *dec = &per_cpu(decrementers, cpu).event;
 
        *dec = decrementer_clockevent;
-       dec->cpumask = cpumask_of_cpu(cpu);
+       dec->cpumask = cpumask_of(cpu);
 
        printk(KERN_DEBUG "clockevent: %s mult[%lx] shift[%d] cpu[%d]\n",
               dec->name, dec->mult, dec->shift, cpu);
@@ -992,15 +963,6 @@ void __init time_init(void)
                sys_tz.tz_dsttime = 0;
         }
 
-       do_gtod.varp = &do_gtod.vars[0];
-       do_gtod.var_idx = 0;
-       do_gtod.varp->tb_orig_stamp = tb_last_jiffy;
-       __get_cpu_var(last_jiffy) = tb_last_jiffy;
-       do_gtod.varp->stamp_xsec = (u64) xtime.tv_sec * XSEC_PER_SEC;
-       do_gtod.tb_ticks_per_sec = tb_ticks_per_sec;
-       do_gtod.varp->tb_to_xs = tb_to_xs;
-       do_gtod.tb_to_us = tb_to_us;
-
        vdso_data->tb_orig_stamp = tb_last_jiffy;
        vdso_data->tb_update_count = 0;
        vdso_data->tb_ticks_per_sec = tb_ticks_per_sec;