aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/um/os-Linux/signal.c12
-rw-r--r--arch/um/os-Linux/sys-i386/Makefile2
-rw-r--r--arch/um/os-Linux/sys-i386/signal.c13
-rw-r--r--arch/um/os-Linux/sys-x86_64/Makefile2
-rw-r--r--arch/um/os-Linux/sys-x86_64/signal.c16
5 files changed, 10 insertions, 35 deletions
diff --git a/arch/um/os-Linux/signal.c b/arch/um/os-Linux/signal.c
index 4fc3cd19ec69..2dde9f6d6c0f 100644
--- a/arch/um/os-Linux/signal.c
+++ b/arch/um/os-Linux/signal.c
@@ -127,7 +127,7 @@ void set_sigstack(void *sig_stack, int size)
127 127
128static void (*handlers[_NSIG])(int sig, struct sigcontext *sc); 128static void (*handlers[_NSIG])(int sig, struct sigcontext *sc);
129 129
130void handle_signal(int sig, struct sigcontext *sc) 130static void handle_signal(int sig, struct sigcontext *sc)
131{ 131{
132 unsigned long pending = 1UL << sig; 132 unsigned long pending = 1UL << sig;
133 133
@@ -168,7 +168,11 @@ void handle_signal(int sig, struct sigcontext *sc)
168 } while (pending); 168 } while (pending);
169} 169}
170 170
171extern void hard_handler(int sig); 171static void hard_handler(int sig, siginfo_t *info, void *p)
172{
173 struct ucontext *uc = p;
174 handle_signal(sig, (struct sigcontext *) &uc->uc_mcontext);
175}
172 176
173void set_handler(int sig, void (*handler)(int), int flags, ...) 177void set_handler(int sig, void (*handler)(int), int flags, ...)
174{ 178{
@@ -178,7 +182,7 @@ void set_handler(int sig, void (*handler)(int), int flags, ...)
178 int mask; 182 int mask;
179 183
180 handlers[sig] = (void (*)(int, struct sigcontext *)) handler; 184 handlers[sig] = (void (*)(int, struct sigcontext *)) handler;
181 action.sa_handler = hard_handler; 185 action.sa_sigaction = hard_handler;
182 186
183 sigemptyset(&action.sa_mask); 187 sigemptyset(&action.sa_mask);
184 188
@@ -190,7 +194,7 @@ void set_handler(int sig, void (*handler)(int), int flags, ...)
190 if (sig == SIGSEGV) 194 if (sig == SIGSEGV)
191 flags |= SA_NODEFER; 195 flags |= SA_NODEFER;
192 196
193 action.sa_flags = flags; 197 action.sa_flags = flags | SA_SIGINFO;
194 action.sa_restorer = NULL; 198 action.sa_restorer = NULL;
195 if (sigaction(sig, &action, NULL) < 0) 199 if (sigaction(sig, &action, NULL) < 0)
196 panic("sigaction failed - errno = %d\n", errno); 200 panic("sigaction failed - errno = %d\n", errno);
diff --git a/arch/um/os-Linux/sys-i386/Makefile b/arch/um/os-Linux/sys-i386/Makefile
index b4bc6ac4f30b..d491754bf701 100644
--- a/arch/um/os-Linux/sys-i386/Makefile
+++ b/arch/um/os-Linux/sys-i386/Makefile
@@ -3,7 +3,7 @@
3# Licensed under the GPL 3# Licensed under the GPL
4# 4#
5 5
6obj-y = registers.o signal.o task_size.o tls.o 6obj-y = registers.o task_size.o tls.o
7 7
8USER_OBJS := $(obj-y) 8USER_OBJS := $(obj-y)
9 9
diff --git a/arch/um/os-Linux/sys-i386/signal.c b/arch/um/os-Linux/sys-i386/signal.c
deleted file mode 100644
index f311609f93da..000000000000
--- a/arch/um/os-Linux/sys-i386/signal.c
+++ /dev/null
@@ -1,13 +0,0 @@
1/*
2 * Copyright (C) 2006 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL
4 */
5
6#include <signal.h>
7
8extern void handle_signal(int sig, struct sigcontext *sc);
9
10void hard_handler(int sig)
11{
12 handle_signal(sig, (struct sigcontext *) (&sig + 1));
13}
diff --git a/arch/um/os-Linux/sys-x86_64/Makefile b/arch/um/os-Linux/sys-x86_64/Makefile
index a44a47f8f57b..58f6e0a38598 100644
--- a/arch/um/os-Linux/sys-x86_64/Makefile
+++ b/arch/um/os-Linux/sys-x86_64/Makefile
@@ -3,7 +3,7 @@
3# Licensed under the GPL 3# Licensed under the GPL
4# 4#
5 5
6obj-y = registers.o prctl.o signal.o task_size.o 6obj-y = registers.o prctl.o task_size.o
7 7
8USER_OBJS := $(obj-y) 8USER_OBJS := $(obj-y)
9 9
diff --git a/arch/um/os-Linux/sys-x86_64/signal.c b/arch/um/os-Linux/sys-x86_64/signal.c
deleted file mode 100644
index 82a388822cd3..000000000000
--- a/arch/um/os-Linux/sys-x86_64/signal.c
+++ /dev/null
@@ -1,16 +0,0 @@
1/*
2 * Copyright (C) 2006 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL
4 */
5
6#include <signal.h>
7
8extern void handle_signal(int sig, struct sigcontext *sc);
9
10void hard_handler(int sig)
11{
12 struct ucontext *uc;
13 asm("movq %%rdx, %0" : "=r" (uc));
14
15 handle_signal(sig, (struct sigcontext *) &uc->uc_mcontext);
16}