aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/os-Linux
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2007-10-16 04:27:27 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 12:43:08 -0400
commit61b63c556c0877ee6d3832ee641bc427ff4d94d6 (patch)
treee35a047a7b11f349d3d68ac18639bc33801ec001 /arch/um/os-Linux
parent5f734614fc6218db352d26571ab4d1604620199c (diff)
uml: eliminate SIGALRM
Now that ITIMER_REAL is no longer used, there is no need for any use of SIGALRM whatsoever. This patch removes all mention of it. In addition, real_alarm_handler took a signal argument which is now always SIGVTALRM. So, that is gone. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/os-Linux')
-rw-r--r--arch/um/os-Linux/irq.c2
-rw-r--r--arch/um/os-Linux/main.c2
-rw-r--r--arch/um/os-Linux/process.c10
-rw-r--r--arch/um/os-Linux/signal.c28
-rw-r--r--arch/um/os-Linux/skas/process.c4
-rw-r--r--arch/um/os-Linux/skas/trap.c5
-rw-r--r--arch/um/os-Linux/trap.c1
7 files changed, 17 insertions, 35 deletions
diff --git a/arch/um/os-Linux/irq.c b/arch/um/os-Linux/irq.c
index 2fe482219b6b..6aa6f95d6524 100644
--- a/arch/um/os-Linux/irq.c
+++ b/arch/um/os-Linux/irq.c
@@ -146,6 +146,6 @@ void init_irq_signals(int on_sigstack)
146 flags = on_sigstack ? SA_ONSTACK : 0; 146 flags = on_sigstack ? SA_ONSTACK : 0;
147 147
148 set_handler(SIGIO, (__sighandler_t) sig_handler, flags | SA_RESTART, 148 set_handler(SIGIO, (__sighandler_t) sig_handler, flags | SA_RESTART,
149 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1); 149 SIGUSR1, SIGIO, SIGWINCH, SIGVTALRM, -1);
150 signal(SIGWINCH, SIG_IGN); 150 signal(SIGWINCH, SIG_IGN);
151} 151}
diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c
index 1518f7a45a24..82c3778627b8 100644
--- a/arch/um/os-Linux/main.c
+++ b/arch/um/os-Linux/main.c
@@ -161,7 +161,7 @@ int __init main(int argc, char **argv, char **envp)
161 * some time) and cause a segfault. 161 * some time) and cause a segfault.
162 */ 162 */
163 163
164 /* stop timers and set SIG*ALRM to be ignored */ 164 /* stop timers and set SIGVTALRM to be ignored */
165 disable_timer(); 165 disable_timer();
166 166
167 /* disable SIGIO for the fds and set SIGIO to be ignored */ 167 /* disable SIGIO for the fds and set SIGIO to be ignored */
diff --git a/arch/um/os-Linux/process.c b/arch/um/os-Linux/process.c
index 90b480cf78f4..37781db4ceca 100644
--- a/arch/um/os-Linux/process.c
+++ b/arch/um/os-Linux/process.c
@@ -238,15 +238,15 @@ out:
238void init_new_thread_signals(void) 238void init_new_thread_signals(void)
239{ 239{
240 set_handler(SIGSEGV, (__sighandler_t) sig_handler, SA_ONSTACK, 240 set_handler(SIGSEGV, (__sighandler_t) sig_handler, SA_ONSTACK,
241 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1); 241 SIGUSR1, SIGIO, SIGWINCH, SIGVTALRM, -1);
242 set_handler(SIGTRAP, (__sighandler_t) sig_handler, SA_ONSTACK, 242 set_handler(SIGTRAP, (__sighandler_t) sig_handler, SA_ONSTACK,
243 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1); 243 SIGUSR1, SIGIO, SIGWINCH, SIGVTALRM, -1);
244 set_handler(SIGFPE, (__sighandler_t) sig_handler, SA_ONSTACK, 244 set_handler(SIGFPE, (__sighandler_t) sig_handler, SA_ONSTACK,
245 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1); 245 SIGUSR1, SIGIO, SIGWINCH, SIGVTALRM, -1);
246 set_handler(SIGILL, (__sighandler_t) sig_handler, SA_ONSTACK, 246 set_handler(SIGILL, (__sighandler_t) sig_handler, SA_ONSTACK,
247 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1); 247 SIGUSR1, SIGIO, SIGWINCH, SIGVTALRM, -1);
248 set_handler(SIGBUS, (__sighandler_t) sig_handler, SA_ONSTACK, 248 set_handler(SIGBUS, (__sighandler_t) sig_handler, SA_ONSTACK,
249 SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1); 249 SIGUSR1, SIGIO, SIGWINCH, SIGVTALRM, -1);
250 signal(SIGHUP, SIG_IGN); 250 signal(SIGHUP, SIG_IGN);
251 251
252 init_irq_signals(1); 252 init_irq_signals(1);
diff --git a/arch/um/os-Linux/signal.c b/arch/um/os-Linux/signal.c
index fbad174775ee..e9800b0b5689 100644
--- a/arch/um/os-Linux/signal.c
+++ b/arch/um/os-Linux/signal.c
@@ -15,8 +15,7 @@
15#include "user.h" 15#include "user.h"
16 16
17/* 17/*
18 * These are the asynchronous signals. SIGVTALRM and SIGARLM are handled 18 * These are the asynchronous signals. SIGPROF is excluded because we want to
19 * together under SIGVTALRM_BIT. SIGPROF is excluded because we want to
20 * be able to profile all of UML, not just the non-critical sections. If 19 * be able to profile all of UML, not just the non-critical sections. If
21 * profiling is not thread-safe, then that is not my problem. We can disable 20 * profiling is not thread-safe, then that is not my problem. We can disable
22 * profiling when SMP is enabled in that case. 21 * profiling when SMP is enabled in that case.
@@ -27,9 +26,6 @@
27#define SIGVTALRM_BIT 1 26#define SIGVTALRM_BIT 1
28#define SIGVTALRM_MASK (1 << SIGVTALRM_BIT) 27#define SIGVTALRM_MASK (1 << SIGVTALRM_BIT)
29 28
30#define SIGALRM_BIT 2
31#define SIGALRM_MASK (1 << SIGALRM_BIT)
32
33/* 29/*
34 * These are used by both the signal handlers and 30 * These are used by both the signal handlers and
35 * block/unblock_signals. I don't want modifications cached in a 31 * block/unblock_signals. I don't want modifications cached in a
@@ -55,7 +51,7 @@ void sig_handler(int sig, struct sigcontext *sc)
55 set_signals(enabled); 51 set_signals(enabled);
56} 52}
57 53
58static void real_alarm_handler(int sig, struct sigcontext *sc) 54static void real_alarm_handler(struct sigcontext *sc)
59{ 55{
60 struct uml_pt_regs regs; 56 struct uml_pt_regs regs;
61 57
@@ -63,7 +59,7 @@ static void real_alarm_handler(int sig, struct sigcontext *sc)
63 copy_sc(&regs, sc); 59 copy_sc(&regs, sc);
64 regs.is_user = 0; 60 regs.is_user = 0;
65 unblock_signals(); 61 unblock_signals();
66 timer_handler(sig, &regs); 62 timer_handler(SIGVTALRM, &regs);
67} 63}
68 64
69void alarm_handler(int sig, struct sigcontext *sc) 65void alarm_handler(int sig, struct sigcontext *sc)
@@ -72,27 +68,20 @@ void alarm_handler(int sig, struct sigcontext *sc)
72 68
73 enabled = signals_enabled; 69 enabled = signals_enabled;
74 if (!signals_enabled) { 70 if (!signals_enabled) {
75 if (sig == SIGVTALRM) 71 pending |= SIGVTALRM_MASK;
76 pending |= SIGVTALRM_MASK;
77 else pending |= SIGALRM_MASK;
78
79 return; 72 return;
80 } 73 }
81 74
82 block_signals(); 75 block_signals();
83 76
84 real_alarm_handler(sig, sc); 77 real_alarm_handler(sc);
85 set_signals(enabled); 78 set_signals(enabled);
86} 79}
87 80
88void timer_init(void) 81void timer_init(void)
89{ 82{
90 set_handler(SIGVTALRM, (__sighandler_t) alarm_handler, 83 set_handler(SIGVTALRM, (__sighandler_t) alarm_handler,
91 SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, 84 SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, -1);
92 SIGALRM, -1);
93 set_handler(SIGALRM, (__sighandler_t) alarm_handler,
94 SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH,
95 SIGALRM, -1);
96} 85}
97 86
98void set_sigstack(void *sig_stack, int size) 87void set_sigstack(void *sig_stack, int size)
@@ -267,11 +256,8 @@ void unblock_signals(void)
267 if (save_pending & SIGIO_MASK) 256 if (save_pending & SIGIO_MASK)
268 sig_handler_common_skas(SIGIO, NULL); 257 sig_handler_common_skas(SIGIO, NULL);
269 258
270 if (save_pending & SIGALRM_MASK)
271 real_alarm_handler(SIGALRM, NULL);
272
273 if (save_pending & SIGVTALRM_MASK) 259 if (save_pending & SIGVTALRM_MASK)
274 real_alarm_handler(SIGVTALRM, NULL); 260 real_alarm_handler(NULL);
275 } 261 }
276} 262}
277 263
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c
index 3e64814e888e..9936531a2620 100644
--- a/arch/um/os-Linux/skas/process.c
+++ b/arch/um/os-Linux/skas/process.c
@@ -222,7 +222,6 @@ static int userspace_tramp(void *stack)
222 sigemptyset(&sa.sa_mask); 222 sigemptyset(&sa.sa_mask);
223 sigaddset(&sa.sa_mask, SIGIO); 223 sigaddset(&sa.sa_mask, SIGIO);
224 sigaddset(&sa.sa_mask, SIGWINCH); 224 sigaddset(&sa.sa_mask, SIGWINCH);
225 sigaddset(&sa.sa_mask, SIGALRM);
226 sigaddset(&sa.sa_mask, SIGVTALRM); 225 sigaddset(&sa.sa_mask, SIGVTALRM);
227 sigaddset(&sa.sa_mask, SIGUSR1); 226 sigaddset(&sa.sa_mask, SIGUSR1);
228 sa.sa_flags = SA_ONSTACK; 227 sa.sa_flags = SA_ONSTACK;
@@ -539,8 +538,7 @@ int start_idle_thread(void *stack, jmp_buf *switch_buf)
539 int n; 538 int n;
540 539
541 set_handler(SIGWINCH, (__sighandler_t) sig_handler, 540 set_handler(SIGWINCH, (__sighandler_t) sig_handler,
542 SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGALRM, 541 SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGVTALRM, -1);
543 SIGVTALRM, -1);
544 542
545 /* 543 /*
546 * Can't use UML_SETJMP or UML_LONGJMP here because they save 544 * Can't use UML_SETJMP or UML_LONGJMP here because they save
diff --git a/arch/um/os-Linux/skas/trap.c b/arch/um/os-Linux/skas/trap.c
index e53face44200..3b1b9244f468 100644
--- a/arch/um/os-Linux/skas/trap.c
+++ b/arch/um/os-Linux/skas/trap.c
@@ -58,9 +58,8 @@ void sig_handler_common_skas(int sig, void *sc_ptr)
58 58
59 handler = sig_info[sig]; 59 handler = sig_info[sig];
60 60
61 /* unblock SIGALRM, SIGVTALRM, SIGIO if sig isn't IRQ signal */ 61 /* unblock SIGVTALRM, SIGIO if sig isn't IRQ signal */
62 if (sig != SIGIO && sig != SIGWINCH && 62 if ((sig != SIGIO) && (sig != SIGWINCH) && (sig != SIGVTALRM))
63 sig != SIGVTALRM && sig != SIGALRM)
64 unblock_signals(); 63 unblock_signals();
65 64
66 handler(sig, r); 65 handler(sig, r);
diff --git a/arch/um/os-Linux/trap.c b/arch/um/os-Linux/trap.c
index d3a34ca8a891..2a1c9843e32e 100644
--- a/arch/um/os-Linux/trap.c
+++ b/arch/um/os-Linux/trap.c
@@ -20,5 +20,4 @@ void os_fill_handlinfo(struct kern_handlers h)
20 sig_info[SIGSEGV] = h.page_fault; 20 sig_info[SIGSEGV] = h.page_fault;
21 sig_info[SIGIO] = h.sigio_handler; 21 sig_info[SIGIO] = h.sigio_handler;
22 sig_info[SIGVTALRM] = h.timer_handler; 22 sig_info[SIGVTALRM] = h.timer_handler;
23 sig_info[SIGALRM] = h.timer_handler;
24} 23}