diff options
author | john stultz <johnstul@us.ibm.com> | 2006-09-26 02:32:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-26 11:48:57 -0400 |
commit | c7f40ff15aba95bc09a759024d62b2c344ef0856 (patch) | |
tree | cccf693193af5253127726172461f5910f349e74 /arch/i386/kernel/time.c | |
parent | 0f0f1b400ce3c4780b9d974bc69e8b558d99aba4 (diff) |
[PATCH] i386: Kill references to xtime
Remove all references to xtime in i386 and replace them w/
get/set_timeofday(). Requires some ugly and uncertain changes to APM, but
has been lightly tested to work.
Signed-off-by: John Stultz <johnstul@us.ibm.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/kernel/time.c')
-rw-r--r-- | arch/i386/kernel/time.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c index edd00f6cee37..6f333e7fb23c 100644 --- a/arch/i386/kernel/time.c +++ b/arch/i386/kernel/time.c | |||
@@ -288,7 +288,7 @@ static int timer_resume(struct sys_device *dev) | |||
288 | unsigned long flags; | 288 | unsigned long flags; |
289 | unsigned long sec; | 289 | unsigned long sec; |
290 | unsigned long sleep_length; | 290 | unsigned long sleep_length; |
291 | 291 | struct timespec ts; | |
292 | #ifdef CONFIG_HPET_TIMER | 292 | #ifdef CONFIG_HPET_TIMER |
293 | if (is_hpet_enabled()) | 293 | if (is_hpet_enabled()) |
294 | hpet_reenable(); | 294 | hpet_reenable(); |
@@ -296,9 +296,11 @@ static int timer_resume(struct sys_device *dev) | |||
296 | setup_pit_timer(); | 296 | setup_pit_timer(); |
297 | sec = get_cmos_time() + clock_cmos_diff; | 297 | sec = get_cmos_time() + clock_cmos_diff; |
298 | sleep_length = (get_cmos_time() - sleep_start) * HZ; | 298 | sleep_length = (get_cmos_time() - sleep_start) * HZ; |
299 | |||
300 | ts.tv_sec = sec; | ||
301 | ts.tv_nsec = 0; | ||
302 | do_settimeofday(&ts); | ||
299 | write_seqlock_irqsave(&xtime_lock, flags); | 303 | write_seqlock_irqsave(&xtime_lock, flags); |
300 | xtime.tv_sec = sec; | ||
301 | xtime.tv_nsec = 0; | ||
302 | jiffies_64 += sleep_length; | 304 | jiffies_64 += sleep_length; |
303 | wall_jiffies += sleep_length; | 305 | wall_jiffies += sleep_length; |
304 | write_sequnlock_irqrestore(&xtime_lock, flags); | 306 | write_sequnlock_irqrestore(&xtime_lock, flags); |
@@ -334,10 +336,11 @@ extern void (*late_time_init)(void); | |||
334 | /* Duplicate of time_init() below, with hpet_enable part added */ | 336 | /* Duplicate of time_init() below, with hpet_enable part added */ |
335 | static void __init hpet_time_init(void) | 337 | static void __init hpet_time_init(void) |
336 | { | 338 | { |
337 | xtime.tv_sec = get_cmos_time(); | 339 | struct timespec ts; |
338 | xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ); | 340 | ts.tv_sec = get_cmos_time(); |
339 | set_normalized_timespec(&wall_to_monotonic, | 341 | ts.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ); |
340 | -xtime.tv_sec, -xtime.tv_nsec); | 342 | |
343 | do_settimeofday(&ts); | ||
341 | 344 | ||
342 | if ((hpet_enable() >= 0) && hpet_use_timer) { | 345 | if ((hpet_enable() >= 0) && hpet_use_timer) { |
343 | printk("Using HPET for base-timer\n"); | 346 | printk("Using HPET for base-timer\n"); |
@@ -349,6 +352,7 @@ static void __init hpet_time_init(void) | |||
349 | 352 | ||
350 | void __init time_init(void) | 353 | void __init time_init(void) |
351 | { | 354 | { |
355 | struct timespec ts; | ||
352 | #ifdef CONFIG_HPET_TIMER | 356 | #ifdef CONFIG_HPET_TIMER |
353 | if (is_hpet_capable()) { | 357 | if (is_hpet_capable()) { |
354 | /* | 358 | /* |
@@ -359,10 +363,10 @@ void __init time_init(void) | |||
359 | return; | 363 | return; |
360 | } | 364 | } |
361 | #endif | 365 | #endif |
362 | xtime.tv_sec = get_cmos_time(); | 366 | ts.tv_sec = get_cmos_time(); |
363 | xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ); | 367 | ts.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ); |
364 | set_normalized_timespec(&wall_to_monotonic, | 368 | |
365 | -xtime.tv_sec, -xtime.tv_nsec); | 369 | do_settimeofday(&ts); |
366 | 370 | ||
367 | time_init_hook(); | 371 | time_init_hook(); |
368 | } | 372 | } |