Commit 455edbc4 authored by Hiroshi Shimamoto's avatar Hiroshi Shimamoto Committed by Ingo Molnar

x86: signal: introduce helper macro is_ia32

Introduce new macro is_ia32 for unification of setup_rt_frame().
No effect in binary, compiler will optimize.
Signed-off-by: default avatarHiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent b94fd698
...@@ -491,6 +491,8 @@ static int signr_convert(int sig) ...@@ -491,6 +491,8 @@ static int signr_convert(int sig)
return sig; return sig;
} }
#define is_ia32 1
static int static int
setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
sigset_t *set, struct pt_regs *regs) sigset_t *set, struct pt_regs *regs)
...@@ -499,10 +501,13 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, ...@@ -499,10 +501,13 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
int ret; int ret;
/* Set up the stack frame */ /* Set up the stack frame */
if (ka->sa.sa_flags & SA_SIGINFO) if (is_ia32) {
ret = __setup_rt_frame(usig, ka, info, set, regs); if (ka->sa.sa_flags & SA_SIGINFO)
else ret = __setup_rt_frame(usig, ka, info, set, regs);
ret = __setup_frame(usig, ka, set, regs); else
ret = __setup_frame(usig, ka, set, regs);
} else
ret = __setup_rt_frame(sig, ka, info, set, regs);
if (ret) { if (ret) {
force_sigsegv(sig, current); force_sigsegv(sig, current);
......
...@@ -286,6 +286,12 @@ static int signr_convert(int sig) ...@@ -286,6 +286,12 @@ static int signr_convert(int sig)
return sig; return sig;
} }
#ifdef CONFIG_IA32_EMULATION
#define is_ia32 test_thread_flag(TIF_IA32)
#else
#define is_ia32 0
#endif
static int static int
setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
sigset_t *set, struct pt_regs *regs) sigset_t *set, struct pt_regs *regs)
...@@ -293,15 +299,14 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, ...@@ -293,15 +299,14 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
int usig = signr_convert(sig); int usig = signr_convert(sig);
int ret; int ret;
#ifdef CONFIG_IA32_EMULATION /* Set up the stack frame */
if (test_thread_flag(TIF_IA32)) { if (is_ia32) {
if (ka->sa.sa_flags & SA_SIGINFO) if (ka->sa.sa_flags & SA_SIGINFO)
ret = ia32_setup_rt_frame(usig, ka, info, set, regs); ret = ia32_setup_rt_frame(usig, ka, info, set, regs);
else else
ret = ia32_setup_frame(usig, ka, set, regs); ret = ia32_setup_frame(usig, ka, set, regs);
} else } else
#endif ret = __setup_rt_frame(sig, ka, info, set, regs);
ret = __setup_rt_frame(sig, ka, info, set, regs);
if (ret) { if (ret) {
force_sigsegv(sig, current); force_sigsegv(sig, current);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment