From: Al Viro <viro@ftp.linux.org.uk>
To: richard@nod.at
Cc: user-mode-linux-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org
Subject: Subject: [PATCH 28/91] um: merge hard_handler() instances, switch to use of SA_SIGINFO
Date: Thu, 18 Aug 2011 20:03:39 +0100 [thread overview]
Message-ID: <E1Qu7sR-0007cn-D8@ZenIV.linux.org.uk> (raw)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
arch/um/os-Linux/signal.c | 12 ++++++++----
arch/um/os-Linux/sys-i386/Makefile | 2 +-
arch/um/os-Linux/sys-i386/signal.c | 13 -------------
arch/um/os-Linux/sys-x86_64/Makefile | 2 +-
arch/um/os-Linux/sys-x86_64/signal.c | 16 ----------------
5 files changed, 10 insertions(+), 35 deletions(-)
delete mode 100644 arch/um/os-Linux/sys-i386/signal.c
delete mode 100644 arch/um/os-Linux/sys-x86_64/signal.c
diff --git a/arch/um/os-Linux/signal.c b/arch/um/os-Linux/signal.c
index 4fc3cd1..2dde9f6 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)
static void (*handlers[_NSIG])(int sig, struct sigcontext *sc);
-void handle_signal(int sig, struct sigcontext *sc)
+static void handle_signal(int sig, struct sigcontext *sc)
{
unsigned long pending = 1UL << sig;
@@ -168,7 +168,11 @@ void handle_signal(int sig, struct sigcontext *sc)
} while (pending);
}
-extern void hard_handler(int sig);
+static void hard_handler(int sig, siginfo_t *info, void *p)
+{
+ struct ucontext *uc = p;
+ handle_signal(sig, (struct sigcontext *) &uc->uc_mcontext);
+}
void set_handler(int sig, void (*handler)(int), int flags, ...)
{
@@ -178,7 +182,7 @@ void set_handler(int sig, void (*handler)(int), int flags, ...)
int mask;
handlers[sig] = (void (*)(int, struct sigcontext *)) handler;
- action.sa_handler = hard_handler;
+ action.sa_sigaction = hard_handler;
sigemptyset(&action.sa_mask);
@@ -190,7 +194,7 @@ void set_handler(int sig, void (*handler)(int), int flags, ...)
if (sig == SIGSEGV)
flags |= SA_NODEFER;
- action.sa_flags = flags;
+ action.sa_flags = flags | SA_SIGINFO;
action.sa_restorer = NULL;
if (sigaction(sig, &action, NULL) < 0)
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 b4bc6ac..d491754 100644
--- a/arch/um/os-Linux/sys-i386/Makefile
+++ b/arch/um/os-Linux/sys-i386/Makefile
@@ -3,7 +3,7 @@
# Licensed under the GPL
#
-obj-y = registers.o signal.o task_size.o tls.o
+obj-y = registers.o task_size.o tls.o
USER_OBJS := $(obj-y)
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 f311609..0000000
--- a/arch/um/os-Linux/sys-i386/signal.c
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * Copyright (C) 2006 Jeff Dike (jdike@{addtoit,linux.intel}.com)
- * Licensed under the GPL
- */
-
-#include <signal.h>
-
-extern void handle_signal(int sig, struct sigcontext *sc);
-
-void hard_handler(int sig)
-{
- handle_signal(sig, (struct sigcontext *) (&sig + 1));
-}
diff --git a/arch/um/os-Linux/sys-x86_64/Makefile b/arch/um/os-Linux/sys-x86_64/Makefile
index a44a47f..58f6e0a 100644
--- a/arch/um/os-Linux/sys-x86_64/Makefile
+++ b/arch/um/os-Linux/sys-x86_64/Makefile
@@ -3,7 +3,7 @@
# Licensed under the GPL
#
-obj-y = registers.o prctl.o signal.o task_size.o
+obj-y = registers.o prctl.o task_size.o
USER_OBJS := $(obj-y)
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 82a3888..0000000
--- a/arch/um/os-Linux/sys-x86_64/signal.c
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright (C) 2006 Jeff Dike (jdike@{addtoit,linux.intel}.com)
- * Licensed under the GPL
- */
-
-#include <signal.h>
-
-extern void handle_signal(int sig, struct sigcontext *sc);
-
-void hard_handler(int sig)
-{
- struct ucontext *uc;
- asm("movq %%rdx, %0" : "=r" (uc));
-
- handle_signal(sig, (struct sigcontext *) &uc->uc_mcontext);
-}
--
1.7.2.5
reply other threads:[~2011-08-18 19:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1Qu7sR-0007cn-D8@ZenIV.linux.org.uk \
--to=viro@ftp.linux.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=richard@nod.at \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome