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 setup_pit_timer(); 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); if (last_timer->resume) last_timer->resume(); cur_timer = last_timer; last_timer = NULL; touch_softlockup_watchdog(); return 0; }
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(); return 0; }
void update_xtime_from_cmos(void) { if(have_rtc) { xtime.tv_sec = get_cmos_time(); xtime.tv_nsec = 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; write_seqlock_irqsave(&xtime_lock, flags); xtime.tv_sec = sec; xtime.tv_nsec = 0; write_sequnlock_irqrestore(&xtime_lock, flags); jiffies += sleep_length * HZ; return 0; }
/* Duplicate of time_init() below, with hpet_enable part added */ static void __init hpet_time_init(void) { xtime.tv_sec = get_cmos_time(); xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ); set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, -xtime.tv_nsec); if ((hpet_enable() >= 0) && hpet_use_timer) { printk("Using HPET for base-timer\n"); } time_init_hook(); }
/* Duplicate of time_init() below, with hpet_enable part added */ static void __init hpet_time_init(void) { xtime.tv_sec = get_cmos_time(); xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ); set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, -xtime.tv_nsec); if ((hpet_enable() >= 0) && hpet_use_timer) { printk("Using HPET for base-timer\n"); } cur_timer = select_timer(); printk(KERN_INFO "Using %s for high-res timesource\n",cur_timer->name); time_init_hook(); }
void __init time_init(void) { #ifdef CONFIG_HPET_TIMER if (is_hpet_capable()) { /* * HPET initialization needs to do memory-mapped io. So, let * us do a late initialization after mem_init(). */ late_time_init = hpet_time_init; return; } #endif xtime.tv_sec = get_cmos_time(); xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ); set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, -xtime.tv_nsec); time_init_hook(); }
void __init time_init(void) { #ifdef CONFIG_HPET_TIMER if (is_hpet_capable()) { /* * HPET initialization needs to do memory-mapped io. So, let * us do a late initialization after mem_init(). */ late_time_init = hpet_time_init; return; } #endif xtime.tv_sec = get_cmos_time(); xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ); set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, -xtime.tv_nsec); cur_timer = select_timer(); printk(KERN_INFO "Using %s for high-res timesource\n",cur_timer->name); time_init_hook(); }
void mpc1211_rtc_gettimeofday(struct timeval *tv) { tv->tv_sec = get_cmos_time(); tv->tv_usec = 0; }
void sh03_rtc_gettimeofday(struct timespec *tv) { tv->tv_sec = get_cmos_time(); tv->tv_nsec = 0; }
void read_persistent_clock(struct timespec *ts) { ts->tv_sec = get_cmos_time(); ts->tv_nsec = 0; }