diff options
author | Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com> | 2008-09-05 19:28:06 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-09-06 08:54:03 -0400 |
commit | 1d13024e624d0e2e47f117b383917249a41ef5ce (patch) | |
tree | 2996ec62b051815d861b9c426afccb9928c71f2c /arch/x86/kernel/signal_32.c | |
parent | 8fcd8e20f388d787f6abf701b11037b122029d5b (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_32.c')
-rw-r--r-- | arch/x86/kernel/signal_32.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/arch/x86/kernel/signal_32.c b/arch/x86/kernel/signal_32.c index bd9b65031a9a..48982f7ce886 100644 --- a/arch/x86/kernel/signal_32.c +++ b/arch/x86/kernel/signal_32.c | |||
@@ -338,8 +338,8 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size, | |||
338 | } | 338 | } |
339 | 339 | ||
340 | static int | 340 | static int |
341 | setup_frame(int sig, struct k_sigaction *ka, sigset_t *set, | 341 | __setup_frame(int sig, struct k_sigaction *ka, sigset_t *set, |
342 | struct pt_regs *regs) | 342 | struct pt_regs *regs) |
343 | { | 343 | { |
344 | struct sigframe __user *frame; | 344 | struct sigframe __user *frame; |
345 | void __user *restorer; | 345 | void __user *restorer; |
@@ -416,8 +416,8 @@ give_sigsegv: | |||
416 | return -EFAULT; | 416 | return -EFAULT; |
417 | } | 417 | } |
418 | 418 | ||
419 | static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | 419 | static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, |
420 | sigset_t *set, struct pt_regs *regs) | 420 | sigset_t *set, struct pt_regs *regs) |
421 | { | 421 | { |
422 | struct rt_sigframe __user *frame; | 422 | struct rt_sigframe __user *frame; |
423 | void __user *restorer; | 423 | void __user *restorer; |
@@ -502,6 +502,21 @@ give_sigsegv: | |||
502 | * OK, we're invoking a handler: | 502 | * OK, we're invoking a handler: |
503 | */ | 503 | */ |
504 | static int | 504 | static int |
505 | setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | ||
506 | sigset_t *set, struct pt_regs *regs) | ||
507 | { | ||
508 | int ret; | ||
509 | |||
510 | /* Set up the stack frame */ | ||
511 | if (ka->sa.sa_flags & SA_SIGINFO) | ||
512 | ret = __setup_rt_frame(sig, ka, info, set, regs); | ||
513 | else | ||
514 | ret = __setup_frame(sig, ka, set, regs); | ||
515 | |||
516 | return ret; | ||
517 | } | ||
518 | |||
519 | static int | ||
505 | handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, | 520 | handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, |
506 | sigset_t *oldset, struct pt_regs *regs) | 521 | sigset_t *oldset, struct pt_regs *regs) |
507 | { | 522 | { |
@@ -537,11 +552,7 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, | |||
537 | likely(test_and_clear_thread_flag(TIF_FORCED_TF))) | 552 | likely(test_and_clear_thread_flag(TIF_FORCED_TF))) |
538 | regs->flags &= ~X86_EFLAGS_TF; | 553 | regs->flags &= ~X86_EFLAGS_TF; |
539 | 554 | ||
540 | /* Set up the stack frame */ | 555 | ret = setup_rt_frame(sig, ka, info, oldset, regs); |
541 | if (ka->sa.sa_flags & SA_SIGINFO) | ||
542 | ret = setup_rt_frame(sig, ka, info, oldset, regs); | ||
543 | else | ||
544 | ret = setup_frame(sig, ka, oldset, regs); | ||
545 | 556 | ||
546 | if (ret) | 557 | if (ret) |
547 | return ret; | 558 | return ret; |