diff options
author | Sebastian Siewior <bigeasy@linutronix.de> | 2008-04-28 11:43:00 +0200 |
---|---|---|
committer | Greg Ungerer <gerg@uclinux.org> | 2008-07-23 15:11:28 +1000 |
commit | 0df185f5a1430ab8b437be402d286ee0728ef9f8 (patch) | |
tree | c149e6e0152a69323b09d1f1ae88ced6160a61fe /arch/m68knommu/kernel | |
parent | 1fda83d83c664ad74bfec8ce093a86d4d962f093 (diff) | |
download | linux-0df185f5a1430ab8b437be402d286ee0728ef9f8.tar.bz2 |
m68knommu: move code within time.c
This patch creates two functions do_set_rtc() and read_rtc_mmss()
based on allready available code.
Signed-off-by: Sebastian Siewior <bigeasy@linutronix.de>
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Diffstat (limited to 'arch/m68knommu/kernel')
-rw-r--r-- | arch/m68knommu/kernel/time.c | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/arch/m68knommu/kernel/time.c b/arch/m68knommu/kernel/time.c index 0ccfb2ad6380..d33ed9a84cc7 100644 --- a/arch/m68knommu/kernel/time.c +++ b/arch/m68knommu/kernel/time.c @@ -33,22 +33,11 @@ static inline int set_rtc_mmss(unsigned long nowtime) return -1; } -/* - * timer_interrupt() needs to keep up the real-time clock, - * as well as call the "do_timer()" routine every clocktick - */ -irqreturn_t arch_timer_interrupt(int irq, void *dummy) +static inline void do_set_rtc(void) { /* last time the cmos clock got updated */ static long last_rtc_update=0; - if (current->pid) - profile_tick(CPU_PROFILING); - - write_seqlock(&xtime_lock); - - do_timer(1); - /* * If we have an externally synchronized Linux clock, then update * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be @@ -63,6 +52,23 @@ irqreturn_t arch_timer_interrupt(int irq, void *dummy) else last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */ } +} + +/* + * timer_interrupt() needs to keep up the real-time clock, + * as well as call the "do_timer()" routine every clocktick + */ +irqreturn_t arch_timer_interrupt(int irq, void *dummy) +{ + + if (current->pid) + profile_tick(CPU_PROFILING); + + write_seqlock(&xtime_lock); + + do_timer(1); + + do_set_rtc(); write_sequnlock(&xtime_lock); @@ -72,7 +78,7 @@ irqreturn_t arch_timer_interrupt(int irq, void *dummy) return(IRQ_HANDLED); } -void time_init(void) +static unsigned long read_rtc_mmss(void) { unsigned int year, mon, day, hour, min, sec; @@ -83,7 +89,13 @@ void time_init(void) if ((year += 1900) < 1970) year += 100; - xtime.tv_sec = mktime(year, mon, day, hour, min, sec); + + return mktime(year, mon, day, hour, min, sec);; +} + +void time_init(void) +{ + xtime.tv_sec = read_rtc_mmss(); xtime.tv_nsec = 0; wall_to_monotonic.tv_sec = -xtime.tv_sec; |