aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/signal_64.c
diff options
context:
space:
mode:
authorHiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>2008-09-05 19:28:06 -0400
committerIngo Molnar <mingo@elte.hu>2008-09-06 08:54:03 -0400
commit1d13024e624d0e2e47f117b383917249a41ef5ce (patch)
tree2996ec62b051815d861b9c426afccb9928c71f2c /arch/x86/kernel/signal_64.c
parent8fcd8e20f388d787f6abf701b11037b122029d5b (diff)
x86: signal: split out frame setups
Make setup_rt_frame() and split out frame setups from handle_signal(). This is for cosmetic unification of handle_signal(). Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/signal_64.c')
-rw-r--r--arch/x86/kernel/signal_64.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/arch/x86/kernel/signal_64.c b/arch/x86/kernel/signal_64.c
index 19e2b9143205..8fbdd23d5cc6 100644
--- a/arch/x86/kernel/signal_64.c
+++ b/arch/x86/kernel/signal_64.c
@@ -195,8 +195,8 @@ get_stack(struct k_sigaction *ka, struct pt_regs *regs, unsigned long size)
195 return (void __user *)round_down(sp - size, 64); 195 return (void __user *)round_down(sp - size, 64);
196} 196}
197 197
198static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, 198static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
199 sigset_t *set, struct pt_regs *regs) 199 sigset_t *set, struct pt_regs *regs)
200{ 200{
201 struct rt_sigframe __user *frame; 201 struct rt_sigframe __user *frame;
202 void __user *fp = NULL; 202 void __user *fp = NULL;
@@ -280,6 +280,24 @@ give_sigsegv:
280/* 280/*
281 * OK, we're invoking a handler 281 * OK, we're invoking a handler
282 */ 282 */
283static int
284setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
285 sigset_t *set, struct pt_regs *regs)
286{
287 int ret;
288
289#ifdef CONFIG_IA32_EMULATION
290 if (test_thread_flag(TIF_IA32)) {
291 if (ka->sa.sa_flags & SA_SIGINFO)
292 ret = ia32_setup_rt_frame(sig, ka, info, set, regs);
293 else
294 ret = ia32_setup_frame(sig, ka, set, regs);
295 } else
296#endif
297 ret = __setup_rt_frame(sig, ka, info, set, regs);
298
299 return ret;
300}
283 301
284static int 302static int
285handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, 303handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
@@ -317,14 +335,6 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
317 likely(test_and_clear_thread_flag(TIF_FORCED_TF))) 335 likely(test_and_clear_thread_flag(TIF_FORCED_TF)))
318 regs->flags &= ~X86_EFLAGS_TF; 336 regs->flags &= ~X86_EFLAGS_TF;
319 337
320#ifdef CONFIG_IA32_EMULATION
321 if (test_thread_flag(TIF_IA32)) {
322 if (ka->sa.sa_flags & SA_SIGINFO)
323 ret = ia32_setup_rt_frame(sig, ka, info, oldset, regs);
324 else
325 ret = ia32_setup_frame(sig, ka, oldset, regs);
326 } else
327#endif
328 ret = setup_rt_frame(sig, ka, info, oldset, regs); 338 ret = setup_rt_frame(sig, ka, info, oldset, regs);
329 339
330 if (ret == 0) { 340 if (ret == 0) {