diff --git a/arch/um/include/os.h b/arch/um/include/os.h index 1897785fd5710392ef45285100805bde3be283ec..a6d80721d3c404944af2f5bc06483b5b9a2bbf4d 100644 --- a/arch/um/include/os.h +++ b/arch/um/include/os.h @@ -227,6 +227,7 @@ extern int set_umid(char *name); extern char *get_umid(void); /* signal.c */ +extern void timer_init(void); extern void set_sigstack(void *sig_stack, int size); extern void remove_sigstack(void); extern void set_handler(int sig, void (*handler)(int), int flags, ...); diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c index 2bda07dcd34513022a5892b98b34be8d46cf391b..758d4f9cb22a3e63b5a0a0875bf2812467b16fb0 100644 --- a/arch/um/kernel/time.c +++ b/arch/um/kernel/time.c @@ -97,6 +97,8 @@ static void register_timer(void) { int err; + timer_init(); + err = request_irq(TIMER_IRQ, um_timer, IRQF_DISABLED, "timer", NULL); if (err != 0) printk(KERN_ERR "register_timer : request_irq failed - " diff --git a/arch/um/os-Linux/irq.c b/arch/um/os-Linux/irq.c index a633fa8e0a944a3a3514d6dd64d909b4946945b2..2fe482219b6b2cc9604a2b0fbd30020766864577 100644 --- a/arch/um/os-Linux/irq.c +++ b/arch/um/os-Linux/irq.c @@ -145,10 +145,6 @@ void init_irq_signals(int on_sigstack) flags = on_sigstack ? SA_ONSTACK : 0; - set_handler(SIGVTALRM, (__sighandler_t) alarm_handler, - flags | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, SIGALRM, -1); - set_handler(SIGALRM, (__sighandler_t) alarm_handler, - flags | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, SIGALRM, -1); set_handler(SIGIO, (__sighandler_t) sig_handler, flags | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1); signal(SIGWINCH, SIG_IGN); diff --git a/arch/um/os-Linux/signal.c b/arch/um/os-Linux/signal.c index 1c5267ec13b0943e324f32528b1eb5d77405af2d..53593c8b9c3420761db2b1c0390454a79993bee0 100644 --- a/arch/um/os-Linux/signal.c +++ b/arch/um/os-Linux/signal.c @@ -85,6 +85,16 @@ void alarm_handler(int sig, struct sigcontext *sc) set_signals(enabled); } +void timer_init(void) +{ + set_handler(SIGVTALRM, (__sighandler_t) alarm_handler, + SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, + SIGALRM, -1); + set_handler(SIGALRM, (__sighandler_t) alarm_handler, + SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, + SIGALRM, -1); +} + void set_sigstack(void *sig_stack, int size) { stack_t stack = ((stack_t) { .ss_flags = 0,