Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / arch / parisc / kernel / time.c
index 949998f..594930b 100644 (file)
 
 #include <linux/timex.h>
 
-u64 jiffies_64 = INITIAL_JIFFIES;
-
-EXPORT_SYMBOL(jiffies_64);
-
 /* xtime and wall_jiffies keep wall-clock time */
 extern unsigned long wall_jiffies;
 
-static long clocktick; /* timer cycles per tick */
-static long halftick;
+static long clocktick __read_mostly;   /* timer cycles per tick */
+static long halftick __read_mostly;
 
 #ifdef CONFIG_SMP
 extern void smp_do_timer(struct pt_regs *regs);
 #endif
 
-static inline void
-parisc_do_profile(struct pt_regs *regs)
-{
-       unsigned long pc = regs->iaoq[0];
-#if 0
-       extern unsigned long prof_cpu_mask;
-#endif
-       extern char _stext;
-
-       profile_hook(regs);
-
-       if (user_mode(regs))
-               return;
-
-       if (!prof_buffer)
-               return;
-
-#if 0
-       /* FIXME: when we have irq affinity to cpu, we need to
-        * only look at the cpus specified in this mask 
-        */
-
-       if (!((1 << smp_processor_id()) & prof_cpu_mask))
-               return;
-#endif
-
-       pc -= (unsigned long) &_stext;
-       pc >>= prof_shift;
-       /*
-        * Don't ignore out-of-bounds PC values silently,
-        * put them into the last histogram slot, so if
-        * present, they will show up as a sharp peak.
-        */
-       if (pc > prof_len - 1)
-               pc = prof_len - 1;
-       atomic_inc((atomic_t *)&prof_buffer[pc]);
-}
-
 irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
        long now;
@@ -92,7 +50,7 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
        int nticks;
        int cpu = smp_processor_id();
 
-       parisc_do_profile(regs);
+       profile_tick(CPU_PROFILING, regs);
 
        now = mfctl(16);
        /* initialize next_tick to time at last clocktick */
@@ -117,6 +75,8 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
        while (nticks--) {
 #ifdef CONFIG_SMP
                smp_do_timer(regs);
+#else
+               update_process_times(user_mode(regs));
 #endif
                if (cpu == 0) {
                        write_seqlock(&xtime_lock);
@@ -125,14 +85,6 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
                }
        }
     
-#ifdef CONFIG_CHASSIS_LCD_LED
-       /* Only schedule the led tasklet on cpu 0, and only if it
-        * is enabled.
-        */
-       if (cpu == 0 && !atomic_read(&led_tasklet.count))
-               tasklet_schedule(&led_tasklet);
-#endif
-
        /* check soft power switch status */
        if (cpu == 0 && !atomic_read(&power_tasklet.count))
                tasklet_schedule(&power_tasklet);
@@ -140,6 +92,24 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
        return IRQ_HANDLED;
 }
 
+
+unsigned long profile_pc(struct pt_regs *regs)
+{
+       unsigned long pc = instruction_pointer(regs);
+
+       if (regs->gr[0] & PSW_N)
+               pc -= 4;
+
+#ifdef CONFIG_SMP
+       if (in_lock_functions(pc))
+               pc = regs->gr[2];
+#endif
+
+       return pc;
+}
+EXPORT_SYMBOL(profile_pc);
+
+
 /*** converted from ia64 ***/
 /*
  * Return the number of micro-seconds that elapsed since the last
@@ -224,10 +194,7 @@ do_settimeofday (struct timespec *tv)
                set_normalized_timespec(&xtime, sec, nsec);
                set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec);
 
-               time_adjust = 0;                /* stop active adjtime() */
-               time_status |= STA_UNSYNC;
-               time_maxerror = NTP_PHASE_LIMIT;
-               time_esterror = NTP_PHASE_LIMIT;
+               ntp_clear();
        }
        write_sequnlock_irq(&xtime_lock);
        clock_was_set();