]> Pileus Git - ~andy/linux/blobdiff - arch/um/os-Linux/time.c
[PATCH] uml: Move signal handlers to arch code
[~andy/linux] / arch / um / os-Linux / time.c
index 6f7626775acb983e7f2e663d2312533d80c1a792..7f5ebbadca63b61df8e2eccc7f40e6237dd37046 100644 (file)
 #include "kern_constants.h"
 #include "os.h"
 
-/* XXX This really needs to be declared and initialized in a kernel file since
- * it's in <linux/time.h>
- */
-extern struct timespec wall_to_monotonic;
-
 static void set_interval(int timer_type)
 {
        int usec = 1000000/hz();
@@ -45,8 +40,8 @@ void disable_timer(void)
                printk("disnable_timer - setitimer failed, errno = %d\n",
                       errno);
        /* If there are signals already queued, after unblocking ignore them */
-       set_handler(SIGALRM, SIG_IGN, 0, -1);
-       set_handler(SIGVTALRM, SIG_IGN, 0, -1);
+       signal(SIGALRM, SIG_IGN);
+       signal(SIGVTALRM, SIG_IGN);
 }
 
 void switch_timers(int to_real)
@@ -71,6 +66,7 @@ void switch_timers(int to_real)
                       errno);
 }
 
+#ifdef UML_CONFIG_MODE_TT
 void uml_idle_timer(void)
 {
        if(signal(SIGVTALRM, SIG_IGN) == SIG_ERR)
@@ -80,22 +76,7 @@ void uml_idle_timer(void)
                    SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, SIGVTALRM, -1);
        set_interval(ITIMER_REAL);
 }
-
-extern void ktime_get_ts(struct timespec *ts);
-#define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts)
-
-void time_init(void)
-{
-       struct timespec now;
-
-       if(signal(SIGVTALRM, boot_timer_handler) == SIG_ERR)
-               panic("Couldn't set SIGVTALRM handler");
-       set_interval(ITIMER_VIRTUAL);
-
-       do_posix_clock_monotonic_gettime(&now);
-       wall_to_monotonic.tv_sec = -now.tv_sec;
-       wall_to_monotonic.tv_nsec = -now.tv_nsec;
-}
+#endif
 
 unsigned long long os_nsecs(void)
 {
@@ -114,15 +95,7 @@ void idle_sleep(int secs)
        nanosleep(&ts, NULL);
 }
 
-/* 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);
 }