summaryrefslogtreecommitdiff
path: root/arch/um/kernel/time.c
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2005-06-26 01:55:24 +0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-26 03:24:35 +0400
commitfc47a0d18a1994b4a18d2235fcde1b75dfa72552 (patch)
treefd551126b4ae4a4a6e9be99773cf04a7eacc4b72 /arch/um/kernel/time.c
parent026549d28469f7d4ca7e5a4707f0d2dc4f2c164c (diff)
downloadlinux-fc47a0d18a1994b4a18d2235fcde1b75dfa72552.tar.xz
[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)
timeradd(&xtime, &local_offset, &xtime);
}
-void set_interval(int timer_type)
+static void set_interval(int timer_type)
{
int usec = 1000000/hz();
struct itimerval interval = ((struct itimerval) { { 0, usec },
@@ -45,12 +45,7 @@ void set_interval(int timer_type)
void enable_timer(void)
{
- int usec = 1000000/hz();
- struct itimerval enable = ((struct itimerval) { { 0, usec },
- { 0, usec }});
- if(setitimer(ITIMER_VIRTUAL, &enable, NULL))
- printk("enable_timer - setitimer failed, errno = %d\n",
- errno);
+ set_interval(ITIMER_VIRTUAL);
}
void disable_timer(void)
@@ -155,13 +150,15 @@ void idle_sleep(int secs)
nanosleep(&ts, NULL);
}
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-file-style: "linux"
- * End:
- */
+/* XXX This partly duplicates init_irq_signals */
+
+void user_time_init(void)
+{
+ set_handler(SIGVTALRM, (__sighandler_t) alarm_handler,
+ SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH,
+ SIGALRM, SIGUSR2, -1);
+ set_handler(SIGALRM, (__sighandler_t) alarm_handler,
+ SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH,
+ SIGVTALRM, SIGUSR2, -1);
+ set_interval(ITIMER_VIRTUAL);
+}