From: BitKeeper B. <ri...@su...> - 2004-10-30 12:00:38
|
ChangeSet 1.1471, 2004/10/30 12:42:28+01:00, ka...@fr... Some very small time cleanups. Also call cur_timer->init during resume. time.c | 27 ++++++++++++++++----------- timers/timer_tsc.c | 5 +---- 2 files changed, 17 insertions(+), 15 deletions(-) diff -Nru a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/time.c b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/time.c --- a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/time.c 2004-10-30 08:00:35 -04:00 +++ b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/time.c 2004-10-30 08:00:35 -04:00 @@ -675,21 +675,26 @@ void time_suspend(void) { + /* nothing */ } +/* No locking required. We are only CPU running, and interrupts are off. */ void time_resume(void) { - unsigned long flags; - write_seqlock_irqsave(&xtime_lock, flags); - /* Get timebases for new environment. */ - __get_time_values_from_xen(); - /* Reset our own concept of passage of system time. */ - processed_system_time = shadow_system_time; - /* Accept a warp in UTC (wall-clock) time. */ - last_seen_tv.tv_sec = 0; - /* Make sure we resync UTC time with Xen on next timer interrupt. */ - last_update_from_xen = 0; - write_sequnlock_irqrestore(&xtime_lock, flags); + if (cur_timer->init(NULL) != 0) + BUG(); + + /* Get timebases for new environment. */ + __get_time_values_from_xen(); + + /* Reset our own concept of passage of system time. */ + processed_system_time = shadow_system_time; + + /* Accept a warp in UTC (wall-clock) time. */ + last_seen_tv.tv_sec = 0; + + /* Make sure we resync UTC time with Xen on next timer interrupt. */ + last_update_from_xen = 0; } /* diff -Nru a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/timers/timer_tsc.c b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/timers/timer_tsc.c --- a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/timers/timer_tsc.c 2004-10-30 08:00:35 -04:00 +++ b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/timers/timer_tsc.c 2004-10-30 08:00:35 -04:00 @@ -332,7 +332,6 @@ static int __init init_tsc(char* override) { - unsigned long long alarm; u64 __cpu_khz; __cpu_khz = HYPERVISOR_shared_info->cpu_freq; @@ -353,9 +352,7 @@ set_cyc2ns_scale(cpu_khz/1000); - rdtscll(alarm); - - use_tsc=1; + use_tsc = 1; return 0; } |