···6767int (*rtc_mips_set_time)(unsigned long) = null_rtc_set_time;6868int (*rtc_mips_set_mmss)(unsigned long);69697070+int update_persistent_clock(struct timespec now)7171+{7272+ return rtc_mips_set_mmss(now.tv_sec);7373+}70747175/* how many counter cycles in a jiffy */7276static unsigned long cycles_per_jiffy __read_mostly;···129125int (*mips_timer_state)(void);130126void (*mips_timer_ack)(void);131127132132-/* last time when xtime and rtc are sync'ed up */133133-static long last_rtc_update;134134-135128/*136129 * local_timer_interrupt() does profiling and process accounting137130 * on a per-CPU basis.···159158 * call the generic timer interrupt handling160159 */161160 do_timer(1);162162-163163- /*164164- * If we have an externally synchronized Linux clock, then update165165- * CMOS clock accordingly every ~11 minutes. rtc_mips_set_time() has to be166166- * called as close as possible to 500 ms before the new second starts.167167- */168168- if (ntp_synced() &&169169- xtime.tv_sec > last_rtc_update + 660 &&170170- (xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 &&171171- (xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2) {172172- if (rtc_mips_set_mmss(xtime.tv_sec) == 0) {173173- last_rtc_update = xtime.tv_sec;174174- } else {175175- /* do it again in 60 s */176176- last_rtc_update = xtime.tv_sec - 600;177177- }178178- }179161180162 write_sequnlock(&xtime_lock);181163
-18
arch/mips/sgi-ip27/ip27-timer.c
···4040#define TICK_SIZE (tick_nsec / 1000)41414242static unsigned long ct_cur[NR_CPUS]; /* What counter should be at next timer irq */4343-static long last_rtc_update; /* Last time the rtc clock got updated */44434544#if 04645static int set_rtc_mmss(unsigned long nowtime)···111112 do_timer(1);112113113114 update_process_times(user_mode(get_irq_regs()));114114-115115- /*116116- * If we have an externally synchronized Linux clock, then update117117- * RTC clock accordingly every ~11 minutes. Set_rtc_mmss() has to be118118- * called as close as possible to when a second starts.119119- */120120- if (ntp_synced() &&121121- xtime.tv_sec > last_rtc_update + 660 &&122122- (xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 &&123123- (xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2) {124124- if (rtc_mips_set_time(xtime.tv_sec) == 0) {125125- last_rtc_update = xtime.tv_sec;126126- } else {127127- last_rtc_update = xtime.tv_sec - 600;128128- /* do it again in 60 s */129129- }130130- }131115132116 write_sequnlock(&xtime_lock);133117 irq_exit();