提交 78a26e25 编写于 作者: J Jeff Dike 提交者: Linus Torvalds

uml: separate timer initialization

Move timer signal initialization from init_irq_signals to a new function,
timer_init.
Signed-off-by: NJeff Dike <jdike@linux.intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 a2f018bf
...@@ -227,6 +227,7 @@ extern int set_umid(char *name); ...@@ -227,6 +227,7 @@ extern int set_umid(char *name);
extern char *get_umid(void); extern char *get_umid(void);
/* signal.c */ /* signal.c */
extern void timer_init(void);
extern void set_sigstack(void *sig_stack, int size); extern void set_sigstack(void *sig_stack, int size);
extern void remove_sigstack(void); extern void remove_sigstack(void);
extern void set_handler(int sig, void (*handler)(int), int flags, ...); extern void set_handler(int sig, void (*handler)(int), int flags, ...);
......
...@@ -97,6 +97,8 @@ static void register_timer(void) ...@@ -97,6 +97,8 @@ static void register_timer(void)
{ {
int err; int err;
timer_init();
err = request_irq(TIMER_IRQ, um_timer, IRQF_DISABLED, "timer", NULL); err = request_irq(TIMER_IRQ, um_timer, IRQF_DISABLED, "timer", NULL);
if (err != 0) if (err != 0)
printk(KERN_ERR "register_timer : request_irq failed - " printk(KERN_ERR "register_timer : request_irq failed - "
......
...@@ -145,10 +145,6 @@ void init_irq_signals(int on_sigstack) ...@@ -145,10 +145,6 @@ void init_irq_signals(int on_sigstack)
flags = on_sigstack ? SA_ONSTACK : 0; 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, set_handler(SIGIO, (__sighandler_t) sig_handler, flags | SA_RESTART,
SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1); SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
signal(SIGWINCH, SIG_IGN); signal(SIGWINCH, SIG_IGN);
......
...@@ -85,6 +85,16 @@ void alarm_handler(int sig, struct sigcontext *sc) ...@@ -85,6 +85,16 @@ void alarm_handler(int sig, struct sigcontext *sc)
set_signals(enabled); 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) void set_sigstack(void *sig_stack, int size)
{ {
stack_t stack = ((stack_t) { .ss_flags = 0, stack_t stack = ((stack_t) { .ss_flags = 0,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册