1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19#include <linux/errno.h>
20#include <linux/module.h>
21#include <linux/sched.h>
22#include <linux/kernel.h>
23#include <linux/param.h>
24#include <linux/string.h>
25#include <linux/mm.h>
26#include <linux/timex.h>
27#include <linux/profile.h>
28
29#include <asm/io.h>
30#include <asm/timer.h>
31
32#define TICK_SIZE (tick_nsec / 1000)
33
34void h8300_timer_tick(void)
35{
36 if (current->pid)
37 profile_tick(CPU_PROFILING);
38 write_seqlock(&xtime_lock);
39 do_timer(1);
40 write_sequnlock(&xtime_lock);
41 update_process_times(user_mode(get_irq_regs()));
42}
43
44void __init time_init(void)
45{
46 unsigned int year, mon, day, hour, min, sec;
47
48
49
50
51 year = 1980;
52 mon = day = 1;
53 hour = min = sec = 0;
54#ifdef CONFIG_H8300_GETTOD
55 h8300_gettod (&year, &mon, &day, &hour, &min, &sec);
56#endif
57 if ((year += 1900) < 1970)
58 year += 100;
59 xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
60 xtime.tv_nsec = 0;
61
62 h8300_timer_setup();
63}
64