aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/kernel/time.c
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2005-06-25 17:55:24 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-25 19:24:35 -0400
commitfc47a0d18a1994b4a18d2235fcde1b75dfa72552 (patch)
treefd551126b4ae4a4a6e9be99773cf04a7eacc4b72 /arch/um/kernel/time.c
parent026549d28469f7d4ca7e5a4707f0d2dc4f2c164c (diff)
[PATCH] uml: time initialization tidying
user_time_init_skas and user_time_init_tt were essentially the same. So, this merges them, deleting the mode-specific functions and declarations. Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/kernel/time.c')
-rw-r--r--arch/um/kernel/time.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c
index c40c86a3f918..f829b309b63c 100644
--- a/arch/um/kernel/time.c
+++ b/arch/um/kernel/time.c
@@ -33,7 +33,7 @@ void timer(void)
33 timeradd(&xtime, &local_offset, &xtime); 33 timeradd(&xtime, &local_offset, &xtime);
34} 34}
35 35
36void set_interval(int timer_type) 36static void set_interval(int timer_type)
37{ 37{
38 int usec = 1000000/hz(); 38 int usec = 1000000/hz();
39 struct itimerval interval = ((struct itimerval) { { 0, usec }, 39 struct itimerval interval = ((struct itimerval) { { 0, usec },
@@ -45,12 +45,7 @@ void set_interval(int timer_type)
45 45
46void enable_timer(void) 46void enable_timer(void)
47{ 47{
48 int usec = 1000000/hz(); 48 set_interval(ITIMER_VIRTUAL);
49 struct itimerval enable = ((struct itimerval) { { 0, usec },
50 { 0, usec }});
51 if(setitimer(ITIMER_VIRTUAL, &enable, NULL))
52 printk("enable_timer - setitimer failed, errno = %d\n",
53 errno);
54} 49}
55 50
56void disable_timer(void) 51void disable_timer(void)
@@ -155,13 +150,15 @@ void idle_sleep(int secs)
155 nanosleep(&ts, NULL); 150 nanosleep(&ts, NULL);
156} 151}
157 152
158/* 153/* XXX This partly duplicates init_irq_signals */
159 * Overrides for Emacs so that we follow Linus's tabbing style. 154
160 * Emacs will notice this stuff at the end of the file and automatically 155void user_time_init(void)
161 * adjust the settings for this buffer only. This must remain at the end 156{
162 * of the file. 157 set_handler(SIGVTALRM, (__sighandler_t) alarm_handler,
163 * --------------------------------------------------------------------------- 158 SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH,
164 * Local variables: 159 SIGALRM, SIGUSR2, -1);
165 * c-file-style: "linux" 160 set_handler(SIGALRM, (__sighandler_t) alarm_handler,
166 * End: 161 SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH,
167 */ 162 SIGVTALRM, SIGUSR2, -1);
163 set_interval(ITIMER_VIRTUAL);
164}