]> err.no Git - linux-2.6/commitdiff
[PATCH] uml: signal initialization cleanup
authorJeff Dike <jdike@addtoit.com>
Mon, 10 Jul 2006 11:45:07 +0000 (04:45 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 10 Jul 2006 20:24:23 +0000 (13:24 -0700)
It turns out that init_new_thread_signals is always called with altstack == 1,
so we can eliminate the parameter.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/um/include/os.h
arch/um/kernel/skas/process_kern.c
arch/um/kernel/tt/exec_kern.c
arch/um/kernel/tt/process_kern.c
arch/um/os-Linux/process.c
arch/um/os-Linux/skas/process.c

index f88856c28a66eda6ea6dfe7dba4502401c3ffa5c..700f7a76c822f763a78ae3be8c5387c465f4bda8 100644 (file)
@@ -199,7 +199,7 @@ extern int os_getpid(void);
 extern int os_getpgrp(void);
 
 extern void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int));
-extern void init_new_thread_signals(int altstack);
+extern void init_new_thread_signals(void);
 extern int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr);
 
 extern int os_map_memory(void *virt, int fd, unsigned long long off,
index 2135eaf98a938122e87a269aee5f11f3cf0199de..55caeec8b25725d856db3af7a00d678277a520e5 100644 (file)
@@ -177,7 +177,7 @@ int start_uml_skas(void)
        if(proc_mm)
                userspace_pid[0] = start_userspace(0);
 
-       init_new_thread_signals(1);
+       init_new_thread_signals();
 
        init_task.thread.request.u.thread.proc = start_kernel_proc;
        init_task.thread.request.u.thread.arg = NULL;
index 5c1e4cc1c0493aa85bd86e7e1bc41dff1ea2c086..ad66df17d9d75b8a22bd147b8fac97286ccd16f9 100644 (file)
@@ -21,7 +21,7 @@
 static int exec_tramp(void *sig_stack)
 {
        init_new_thread_stack(sig_stack, NULL);
-       init_new_thread_signals(1);
+       init_new_thread_signals();
        os_stop_process(os_getpid());
        return(0);
 }
index 8368c2dbe635c7727fe4578a8c804d5057541121..1e86f0bfef72b3368eacf491db28166293051bcb 100644 (file)
@@ -142,7 +142,7 @@ static void new_thread_handler(int sig)
                schedule_tail(current->thread.prev_sched);
        current->thread.prev_sched = NULL;
 
-       init_new_thread_signals(1);
+       init_new_thread_signals();
        enable_timer();
        free_page(current->thread.temp_stack);
        set_cmdline("(kernel thread)");
index 233be2f4f8cb96726f270d47e23da0a35a7658c0..b1cda818f5b5755e5ae601c2a39ee3b35f143816 100644 (file)
@@ -250,25 +250,24 @@ void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int))
        if(usr1_handler) set_handler(SIGUSR1, usr1_handler, flags, -1);
 }
 
-void init_new_thread_signals(int altstack)
+void init_new_thread_signals(void)
 {
-       int flags = altstack ? SA_ONSTACK : 0;
-
-       set_handler(SIGSEGV, (__sighandler_t) sig_handler, flags,
+       set_handler(SIGSEGV, (__sighandler_t) sig_handler, SA_ONSTACK,
                    SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
-       set_handler(SIGTRAP, (__sighandler_t) sig_handler, flags,
+       set_handler(SIGTRAP, (__sighandler_t) sig_handler, SA_ONSTACK,
                    SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
-       set_handler(SIGFPE, (__sighandler_t) sig_handler, flags,
+       set_handler(SIGFPE, (__sighandler_t) sig_handler, SA_ONSTACK,
                    SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
-       set_handler(SIGILL, (__sighandler_t) sig_handler, flags,
+       set_handler(SIGILL, (__sighandler_t) sig_handler, SA_ONSTACK,
                    SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
-       set_handler(SIGBUS, (__sighandler_t) sig_handler, flags,
+       set_handler(SIGBUS, (__sighandler_t) sig_handler, SA_ONSTACK,
                    SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
        set_handler(SIGUSR2, (__sighandler_t) sig_handler,
-                   flags, SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
+                   SA_ONSTACK, SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM,
+                   -1);
        signal(SIGHUP, SIG_IGN);
 
-       init_irq_signals(altstack);
+       init_irq_signals(1);
 }
 
 int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr)
index bd89c6b99d5dcf6d58b55eefe68fb280331bea61..bf35572d9cfa6e319976ce6fba4c05fdd2d3b2ce 100644 (file)
@@ -159,7 +159,7 @@ static int userspace_tramp(void *stack)
 
        ptrace(PTRACE_TRACEME, 0, 0, 0);
 
-       init_new_thread_signals(1);
+       init_new_thread_signals();
        enable_timer();
 
        if(!proc_mm){