diff options
author | Greg Ungerer <gerg@snapgear.com> | 2007-10-23 14:37:54 +1000 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-23 08:32:35 -0700 |
commit | 2f2c2679893c963bd90c5e1c0669b97fd87d1c4a (patch) | |
tree | e999c52741b86aef2ad5bcb4ef4e1aeb44613f1d /arch/m68knommu/kernel | |
parent | 49aa49bfd40d718095669c1c70c9d167b814e29b (diff) | |
download | op-kernel-dev-2f2c2679893c963bd90c5e1c0669b97fd87d1c4a.zip op-kernel-dev-2f2c2679893c963bd90c5e1c0669b97fd87d1c4a.tar.gz |
m68knommu: cleanup m68knommu timer code
Reduce the function pointer mess of the m68knommu timer code by calling
directly to the local hardware's timer setup, and expose the local
common timer interrupt handler to the lower level hardware timer.
Ultimately this will save definitions of all these functions across all
the platform code to setup the function pointers (which for any given
m68knommu CPU family member can be only one set of hardware timer
functions).
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/m68knommu/kernel')
-rw-r--r-- | arch/m68knommu/kernel/setup.c | 9 | ||||
-rw-r--r-- | arch/m68knommu/kernel/time.c | 22 |
2 files changed, 8 insertions, 23 deletions
diff --git a/arch/m68knommu/kernel/setup.c b/arch/m68knommu/kernel/setup.c index de77329..74bf949 100644 --- a/arch/m68knommu/kernel/setup.c +++ b/arch/m68knommu/kernel/setup.c @@ -273,12 +273,3 @@ struct seq_operations cpuinfo_op = { .show = show_cpuinfo, }; -void arch_gettod(int *year, int *mon, int *day, int *hour, - int *min, int *sec) -{ - if (mach_gettod) - mach_gettod(year, mon, day, hour, min, sec); - else - *year = *mon = *day = *hour = *min = *sec = 0; -} - diff --git a/arch/m68knommu/kernel/time.c b/arch/m68knommu/kernel/time.c index 467053d..77e5375 100644 --- a/arch/m68knommu/kernel/time.c +++ b/arch/m68knommu/kernel/time.c @@ -27,7 +27,6 @@ #define TICK_SIZE (tick_nsec / 1000) - static inline int set_rtc_mmss(unsigned long nowtime) { if (mach_set_clock_mmss) @@ -39,15 +38,11 @@ static inline int set_rtc_mmss(unsigned long nowtime) * timer_interrupt() needs to keep up the real-time clock, * as well as call the "do_timer()" routine every clocktick */ -static irqreturn_t timer_interrupt(int irq, void *dummy) +irqreturn_t arch_timer_interrupt(int irq, void *dummy) { /* last time the cmos clock got updated */ static long last_rtc_update=0; - /* may need to kick the hardware timer */ - if (mach_tick) - mach_tick(); - write_seqlock(&xtime_lock); do_timer(1); @@ -103,10 +98,10 @@ void time_init(void) { unsigned int year, mon, day, hour, min, sec; - extern void arch_gettod(int *year, int *mon, int *day, int *hour, - int *min, int *sec); - - arch_gettod(&year, &mon, &day, &hour, &min, &sec); + if (mach_gettod) + mach_gettod(&year, &mon, &day, &hour, &min, &sec); + else + year = mon = day = hour = min = sec = 0; if ((year += 1900) < 1970) year += 100; @@ -114,7 +109,7 @@ void time_init(void) xtime.tv_nsec = 0; wall_to_monotonic.tv_sec = -xtime.tv_sec; - mach_sched_init(timer_interrupt); + hw_timer_init(); } /* @@ -128,7 +123,7 @@ void do_gettimeofday(struct timeval *tv) do { seq = read_seqbegin_irqsave(&xtime_lock, flags); - usec = mach_gettimeoffset ? mach_gettimeoffset() : 0; + usec = hw_timer_offset(); sec = xtime.tv_sec; usec += (xtime.tv_nsec / 1000); } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); @@ -160,8 +155,7 @@ int do_settimeofday(struct timespec *tv) * Discover what correction gettimeofday * would have done, and then undo it! */ - if (mach_gettimeoffset) - nsec -= (mach_gettimeoffset() * 1000); + nsec -= (hw_timer_offset() * 1000); wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec); wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec); |