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/irq_regs.h>
31#include <asm/timer.h>
32
33#define TICK_SIZE (tick_nsec / 1000)
34
35void h8300_timer_tick(void)
36{
37 if (current->pid)
38 profile_tick(CPU_PROFILING);
39 xtime_update(1);
40 update_process_times(user_mode(get_irq_regs()));
41}
42
43void read_persistent_clock(struct timespec *ts)
44{
45 unsigned int year, mon, day, hour, min, sec;
46
47
48
49
50 year = 1980;
51 mon = day = 1;
52 hour = min = sec = 0;
53#ifdef CONFIG_H8300_GETTOD
54 h8300_gettod (&year, &mon, &day, &hour, &min, &sec);
55#endif
56 if ((year += 1900) < 1970)
57 year += 100;
58 ts->tv_sec = mktime(year, mon, day, hour, min, sec);
59 ts->tv_nsec = 0;
60}
61
62void __init time_init(void)
63{
64
65 h8300_timer_setup();
66}
67