aboutsummaryrefslogtreecommitdiffstats
path: root/arch/h8300/kernel/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/h8300/kernel/time.c')
-rw-r--r--arch/h8300/kernel/time.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/arch/h8300/kernel/time.c b/arch/h8300/kernel/time.c
index e37c835e67cf..7f2d6cfbb4b6 100644
--- a/arch/h8300/kernel/time.c
+++ b/arch/h8300/kernel/time.c
@@ -27,27 +27,21 @@
27#include <linux/profile.h> 27#include <linux/profile.h>
28 28
29#include <asm/io.h> 29#include <asm/io.h>
30#include <asm/target_time.h> 30#include <asm/timer.h>
31 31
32#define TICK_SIZE (tick_nsec / 1000) 32#define TICK_SIZE (tick_nsec / 1000)
33 33
34/* 34void h8300_timer_tick(void)
35 * timer_interrupt() needs to keep up the real-time clock,
36 * as well as call the "do_timer()" routine every clocktick
37 */
38static void timer_interrupt(int irq, void *dummy, struct pt_regs * regs)
39{ 35{
40 /* may need to kick the hardware timer */ 36 if (current->pid)
41 platform_timer_eoi(); 37 profile_tick(CPU_PROFILING);
42 38 write_seqlock(&xtime_lock);
43 do_timer(1); 39 do_timer(1);
44#ifndef CONFIG_SMP 40 write_sequnlock(&xtime_lock);
45 update_process_times(user_mode(regs)); 41 update_process_times(user_mode(get_irq_regs()));
46#endif
47 profile_tick(CPU_PROFILING);
48} 42}
49 43
50void time_init(void) 44void __init time_init(void)
51{ 45{
52 unsigned int year, mon, day, hour, min, sec; 46 unsigned int year, mon, day, hour, min, sec;
53 47
@@ -57,12 +51,13 @@ void time_init(void)
57 year = 1980; 51 year = 1980;
58 mon = day = 1; 52 mon = day = 1;
59 hour = min = sec = 0; 53 hour = min = sec = 0;
60 platform_gettod (&year, &mon, &day, &hour, &min, &sec); 54#ifdef CONFIG_H8300_GETTOD
61 55 h8300_gettod (&year, &mon, &day, &hour, &min, &sec);
56#endif
62 if ((year += 1900) < 1970) 57 if ((year += 1900) < 1970)
63 year += 100; 58 year += 100;
64 xtime.tv_sec = mktime(year, mon, day, hour, min, sec); 59 xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
65 xtime.tv_nsec = 0; 60 xtime.tv_nsec = 0;
66 61
67 platform_timer_setup(timer_interrupt); 62 h8300_timer_setup();
68} 63}