]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - arch/ia64/kernel/time.c
Pull pvops into release branch
[net-next-2.6.git] / arch / ia64 / kernel / time.c
index 48e15a51782f617fae2c1fbc6f8964d70ccb870c..65c10a42c88f37fbb998012a8f293bd4003f1485 100644 (file)
@@ -24,6 +24,7 @@
 #include <asm/machvec.h>
 #include <asm/delay.h>
 #include <asm/hw_irq.h>
+#include <asm/paravirt.h>
 #include <asm/ptrace.h>
 #include <asm/sal.h>
 #include <asm/sections.h>
@@ -48,6 +49,15 @@ EXPORT_SYMBOL(last_cli_ip);
 
 #endif
 
+#ifdef CONFIG_PARAVIRT
+static void
+paravirt_clocksource_resume(void)
+{
+       if (pv_time_ops.clocksource_resume)
+               pv_time_ops.clocksource_resume();
+}
+#endif
+
 static struct clocksource clocksource_itc = {
        .name           = "itc",
        .rating         = 350,
@@ -56,6 +66,9 @@ static struct clocksource clocksource_itc = {
        .mult           = 0, /*to be calculated*/
        .shift          = 16,
        .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
+#ifdef CONFIG_PARAVIRT
+       .resume         = paravirt_clocksource_resume,
+#endif
 };
 static struct clocksource *itc_clocksource;
 
@@ -117,6 +130,7 @@ void account_system_vtime(struct task_struct *tsk)
 
        local_irq_restore(flags);
 }
+EXPORT_SYMBOL_GPL(account_system_vtime);
 
 /*
  * Called from the timer interrupt handler to charge accumulated user time
@@ -156,6 +170,9 @@ timer_interrupt (int irq, void *dev_id)
 
        profile_tick(CPU_PROFILING);
 
+       if (paravirt_do_steal_accounting(&new_itm))
+               goto skip_process_time_accounting;
+
        while (1) {
                update_process_times(user_mode(get_irq_regs()));
 
@@ -185,6 +202,8 @@ timer_interrupt (int irq, void *dev_id)
                local_irq_disable();
        }
 
+skip_process_time_accounting:
+
        do {
                /*
                 * If we're too close to the next clock tick for
@@ -334,6 +353,11 @@ ia64_init_itm (void)
                 */
                clocksource_itc.rating = 50;
 
+       paravirt_init_missing_ticks_accounting(smp_processor_id());
+
+       /* avoid softlock up message when cpu is unplug and plugged again. */
+       touch_softlockup_watchdog();
+
        /* Setup the CPU local timer tick */
        ia64_cpu_local_tick();
 
@@ -379,11 +403,6 @@ static struct irqaction timer_irqaction = {
        .name =         "timer"
 };
 
-void __devinit ia64_disable_timer(void)
-{
-       ia64_set_itv(1 << 16);
-}
-
 void __init
 time_init (void)
 {