aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/timers/timer_tsc.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/i386/kernel/timers/timer_tsc.c')
-rw-r--r--arch/i386/kernel/timers/timer_tsc.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c
index 8f4e4d5bc560..6dd470cc9f72 100644
--- a/arch/i386/kernel/timers/timer_tsc.c
+++ b/arch/i386/kernel/timers/timer_tsc.c
@@ -543,6 +543,19 @@ static int __init init_tsc(char* override)
543 return -ENODEV; 543 return -ENODEV;
544} 544}
545 545
546static int tsc_resume(void)
547{
548 write_seqlock(&monotonic_lock);
549 /* Assume this is the last mark offset time */
550 rdtsc(last_tsc_low, last_tsc_high);
551#ifdef CONFIG_HPET_TIMER
552 if (is_hpet_enabled() && hpet_use_timer)
553 hpet_last = hpet_readl(HPET_COUNTER);
554#endif
555 write_sequnlock(&monotonic_lock);
556 return 0;
557}
558
546#ifndef CONFIG_X86_TSC 559#ifndef CONFIG_X86_TSC
547/* disable flag for tsc. Takes effect by clearing the TSC cpu flag 560/* disable flag for tsc. Takes effect by clearing the TSC cpu flag
548 * in cpu/common.c */ 561 * in cpu/common.c */
@@ -573,6 +586,7 @@ static struct timer_opts timer_tsc = {
573 .monotonic_clock = monotonic_clock_tsc, 586 .monotonic_clock = monotonic_clock_tsc,
574 .delay = delay_tsc, 587 .delay = delay_tsc,
575 .read_timer = read_timer_tsc, 588 .read_timer = read_timer_tsc,
589 .resume = tsc_resume,
576}; 590};
577 591
578struct init_timer_opts __initdata timer_tsc_init = { 592struct init_timer_opts __initdata timer_tsc_init = {