public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] x86: signal_32.c: introduce signr_convert()
@ 2008-09-25  2:10 Hiroshi Shimamoto
  2008-09-25  2:12 ` [PATCH 2/4] x86: signal_64.c: introduce helper function signr_convert() Hiroshi Shimamoto
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Hiroshi Shimamoto @ 2008-09-25  2:10 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin; +Cc: linux-kernel

From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>

Introduce signr_convert().
This function will help unification of setup_rt_frame().

Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
---
 arch/x86/kernel/signal_32.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/arch/x86/kernel/signal_32.c b/arch/x86/kernel/signal_32.c
index bb05917..b1bc90f 100644
--- a/arch/x86/kernel/signal_32.c
+++ b/arch/x86/kernel/signal_32.c
@@ -482,18 +482,21 @@ static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
 /*
  * OK, we're invoking a handler:
  */
+static int signr_convert(int sig)
+{
+	struct thread_info *info = current_thread_info();
+
+	if (info->exec_domain && info->exec_domain->signal_invmap && sig < 32)
+		return info->exec_domain->signal_invmap[sig];
+	return sig;
+}
+
 static int
 setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
 	       sigset_t *set, struct pt_regs *regs)
 {
+	int usig = signr_convert(sig);
 	int ret;
-	int usig;
-
-	usig = current_thread_info()->exec_domain
-		&& current_thread_info()->exec_domain->signal_invmap
-		&& sig < 32
-		? current_thread_info()->exec_domain->signal_invmap[sig]
-		: sig;
 
 	/* Set up the stack frame */
 	if (ka->sa.sa_flags & SA_SIGINFO)
-- 
1.5.6


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-09-25 16:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-25  2:10 [PATCH 1/4] x86: signal_32.c: introduce signr_convert() Hiroshi Shimamoto
2008-09-25  2:12 ` [PATCH 2/4] x86: signal_64.c: introduce helper function signr_convert() Hiroshi Shimamoto
2008-09-25  2:13 ` [PATCH 3/4] x86: signal: introduce helper macro is_ia32 Hiroshi Shimamoto
2008-09-25  2:13 ` [PATCH 4/4] x86: signal_32.c: introduce macro ia32_setup_frame and ia32_setup_rt_frame Hiroshi Shimamoto
2008-09-25  8:14 ` [PATCH 1/4] x86: signal_32.c: introduce signr_convert() Ingo Molnar
2008-09-25 16:59   ` Hiroshi Shimamoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox