aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/kernel/trap_user.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/kernel/trap_user.c')
-rw-r--r--arch/um/kernel/trap_user.c65
1 files changed, 13 insertions, 52 deletions
diff --git a/arch/um/kernel/trap_user.c b/arch/um/kernel/trap_user.c
index e55110725124..5590b5739db9 100644
--- a/arch/um/kernel/trap_user.c
+++ b/arch/um/kernel/trap_user.c
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
@@ -25,20 +25,6 @@
25#include "user_util.h" 25#include "user_util.h"
26#include "os.h" 26#include "os.h"
27 27
28void kill_child_dead(int pid)
29{
30 kill(pid, SIGKILL);
31 kill(pid, SIGCONT);
32 do {
33 int n;
34 CATCH_EINTR(n = waitpid(pid, NULL, 0));
35 if (n > 0)
36 kill(pid, SIGCONT);
37 else
38 break;
39 } while(1);
40}
41
42void segv_handler(int sig, union uml_pt_regs *regs) 28void segv_handler(int sig, union uml_pt_regs *regs)
43{ 29{
44 struct faultinfo * fi = UPT_FAULTINFO(regs); 30 struct faultinfo * fi = UPT_FAULTINFO(regs);
@@ -55,43 +41,18 @@ void usr2_handler(int sig, union uml_pt_regs *regs)
55 CHOOSE_MODE(syscall_handler_tt(sig, regs), (void) 0); 41 CHOOSE_MODE(syscall_handler_tt(sig, regs), (void) 0);
56} 42}
57 43
58struct signal_info sig_info[] = { 44void (*sig_info[NSIG])(int, union uml_pt_regs *);
59 [ SIGTRAP ] { .handler = relay_signal,
60 .is_irq = 0 },
61 [ SIGFPE ] { .handler = relay_signal,
62 .is_irq = 0 },
63 [ SIGILL ] { .handler = relay_signal,
64 .is_irq = 0 },
65 [ SIGWINCH ] { .handler = winch,
66 .is_irq = 1 },
67 [ SIGBUS ] { .handler = bus_handler,
68 .is_irq = 0 },
69 [ SIGSEGV] { .handler = segv_handler,
70 .is_irq = 0 },
71 [ SIGIO ] { .handler = sigio_handler,
72 .is_irq = 1 },
73 [ SIGVTALRM ] { .handler = timer_handler,
74 .is_irq = 1 },
75 [ SIGALRM ] { .handler = timer_handler,
76 .is_irq = 1 },
77 [ SIGUSR2 ] { .handler = usr2_handler,
78 .is_irq = 0 },
79};
80 45
81void do_longjmp(void *b, int val) 46void os_fill_handlinfo(struct kern_handlers h)
82{ 47{
83 sigjmp_buf *buf = b; 48 sig_info[SIGTRAP] = h.relay_signal;
84 49 sig_info[SIGFPE] = h.relay_signal;
85 siglongjmp(*buf, val); 50 sig_info[SIGILL] = h.relay_signal;
51 sig_info[SIGWINCH] = h.winch;
52 sig_info[SIGBUS] = h.bus_handler;
53 sig_info[SIGSEGV] = h.page_fault;
54 sig_info[SIGIO] = h.sigio_handler;
55 sig_info[SIGVTALRM] = h.timer_handler;
56 sig_info[SIGALRM] = h.timer_handler;
57 sig_info[SIGUSR2] = usr2_handler;
86} 58}
87
88/*
89 * Overrides for Emacs so that we follow Linus's tabbing style.
90 * Emacs will notice this stuff at the end of the file and automatically
91 * adjust the settings for this buffer only. This must remain at the end
92 * of the file.
93 * ---------------------------------------------------------------------------
94 * Local variables:
95 * c-file-style: "linux"
96 * End:
97 */