[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] linux/x86: fix up time-xen.c



# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1193324380 -3600
# Node ID 2b8d5e48dddadcbd590b98aa8945348d36e91191
# Parent  11fb85f45a87786cd2e31cc1bcb1d3235b58a5ac
linux/x86: fix up time-xen.c

Changeset 143 removed the uses of timer_suspend/timer_resume, but not
the implementations. It also introduced an incompatible pointer
assignment.

Also replace an #if checking a CONFIG_ variable by #ifdef.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 arch/i386/kernel/time-xen.c |   41 ++++++-----------------------------------
 1 files changed, 6 insertions(+), 35 deletions(-)

diff -r 11fb85f45a87 -r 2b8d5e48ddda arch/i386/kernel/time-xen.c
--- a/arch/i386/kernel/time-xen.c       Thu Oct 25 15:56:17 2007 +0100
+++ b/arch/i386/kernel/time-xen.c       Thu Oct 25 15:59:40 2007 +0100
@@ -833,44 +833,15 @@ void notify_arch_cmos_timer(void)
        mod_timer(&sync_xen_wallclock_timer, jiffies + 1);
 }
 
-static long clock_cmos_diff, sleep_start;
-
-static int timer_suspend(struct sys_device *dev, pm_message_t state)
-{
-       /*
-        * Estimate time zone so that set_time can update the clock
-        */
-       clock_cmos_diff = -get_cmos_time();
-       clock_cmos_diff += get_seconds();
-       sleep_start = get_cmos_time();
+static int timer_resume(struct sys_device *dev)
+{
+       extern void time_resume(void);
+       time_resume();
        return 0;
 }
 
-static int timer_resume(struct sys_device *dev)
-{
-       unsigned long flags;
-       unsigned long sec;
-       unsigned long sleep_length;
-
-#ifdef CONFIG_HPET_TIMER
-       if (is_hpet_enabled())
-               hpet_reenable();
-#endif
-       sec = get_cmos_time() + clock_cmos_diff;
-       sleep_length = (get_cmos_time() - sleep_start) * HZ;
-       write_seqlock_irqsave(&xtime_lock, flags);
-       xtime.tv_sec = sec;
-       xtime.tv_nsec = 0;
-       jiffies_64 += sleep_length;
-       wall_jiffies += sleep_length;
-       write_sequnlock_irqrestore(&xtime_lock, flags);
-       touch_softlockup_watchdog();
-       return 0;
-}
-
-void time_resume(void);
 static struct sysdev_class timer_sysclass = {
-       .resume = time_resume,
+       .resume = timer_resume,
        set_kset_name("timer"),
 };
 
@@ -1121,7 +1092,7 @@ void local_teardown_timer(unsigned int c
 }
 #endif
 
-#if CONFIG_CPU_FREQ
+#ifdef CONFIG_CPU_FREQ
 static int time_cpufreq_notifier(struct notifier_block *nb, unsigned long val, 
                                void *data)
 {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.