aboutsummaryrefslogtreecommitdiffstats
path: root/arch/h8300/kernel
diff options
context:
space:
mode:
authorYoshinori Sato <ysato@users.sourceforge.jp>2008-10-16 01:01:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-16 14:21:29 -0400
commit81d423e280d193d351f41eacdb3f82c3bb9610c1 (patch)
tree37395cbb8104d0a78ae1e2d7d1ca67bff817eeae /arch/h8300/kernel
parente0b0f9e4ead2468f84c26332ec42b118e76af572 (diff)
h8300: update timer handler - misc update
- Update selection - Update common timer handler - Add support functions Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/h8300/kernel')
-rw-r--r--arch/h8300/kernel/Makefile2
-rw-r--r--arch/h8300/kernel/time.c29
2 files changed, 13 insertions, 18 deletions
diff --git a/arch/h8300/kernel/Makefile b/arch/h8300/kernel/Makefile
index 6c248c3c5c3b..8d4d2a54be9e 100644
--- a/arch/h8300/kernel/Makefile
+++ b/arch/h8300/kernel/Makefile
@@ -7,6 +7,6 @@ extra-y := vmlinux.lds
7obj-y := process.o traps.o ptrace.o irq.o \ 7obj-y := process.o traps.o ptrace.o irq.o \
8 sys_h8300.o time.o signal.o \ 8 sys_h8300.o time.o signal.o \
9 setup.o gpio.o init_task.o syscalls.o \ 9 setup.o gpio.o init_task.o syscalls.o \
10 entry.o 10 entry.o timer/
11 11
12obj-$(CONFIG_MODULES) += module.o h8300_ksyms.o 12obj-$(CONFIG_MODULES) += module.o h8300_ksyms.o
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}