aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/signal_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/signal_64.c')
-rw-r--r--arch/powerpc/kernel/signal_64.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
index 97c1e4b683fc..2cb0c94cafa5 100644
--- a/arch/powerpc/kernel/signal_64.c
+++ b/arch/powerpc/kernel/signal_64.c
@@ -708,20 +708,19 @@ badframe:
708 return 0; 708 return 0;
709} 709}
710 710
711int handle_rt_signal64(int signr, struct k_sigaction *ka, siginfo_t *info, 711int handle_rt_signal64(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs)
712 sigset_t *set, struct pt_regs *regs)
713{ 712{
714 struct rt_sigframe __user *frame; 713 struct rt_sigframe __user *frame;
715 unsigned long newsp = 0; 714 unsigned long newsp = 0;
716 long err = 0; 715 long err = 0;
717 716
718 frame = get_sigframe(ka, get_tm_stackpointer(regs), sizeof(*frame), 0); 717 frame = get_sigframe(ksig, get_tm_stackpointer(regs), sizeof(*frame), 0);
719 if (unlikely(frame == NULL)) 718 if (unlikely(frame == NULL))
720 goto badframe; 719 goto badframe;
721 720
722 err |= __put_user(&frame->info, &frame->pinfo); 721 err |= __put_user(&frame->info, &frame->pinfo);
723 err |= __put_user(&frame->uc, &frame->puc); 722 err |= __put_user(&frame->uc, &frame->puc);
724 err |= copy_siginfo_to_user(&frame->info, info); 723 err |= copy_siginfo_to_user(&frame->info, &ksig->info);
725 if (err) 724 if (err)
726 goto badframe; 725 goto badframe;
727 726
@@ -736,15 +735,15 @@ int handle_rt_signal64(int signr, struct k_sigaction *ka, siginfo_t *info,
736 err |= __put_user(&frame->uc_transact, &frame->uc.uc_link); 735 err |= __put_user(&frame->uc_transact, &frame->uc.uc_link);
737 err |= setup_tm_sigcontexts(&frame->uc.uc_mcontext, 736 err |= setup_tm_sigcontexts(&frame->uc.uc_mcontext,
738 &frame->uc_transact.uc_mcontext, 737 &frame->uc_transact.uc_mcontext,
739 regs, signr, 738 regs, ksig->sig,
740 NULL, 739 NULL,
741 (unsigned long)ka->sa.sa_handler); 740 (unsigned long)ksig->ka.sa.sa_handler);
742 } else 741 } else
743#endif 742#endif
744 { 743 {
745 err |= __put_user(0, &frame->uc.uc_link); 744 err |= __put_user(0, &frame->uc.uc_link);
746 err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, signr, 745 err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, ksig->sig,
747 NULL, (unsigned long)ka->sa.sa_handler, 746 NULL, (unsigned long)ksig->ka.sa.sa_handler,
748 1); 747 1);
749 } 748 }
750 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); 749 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
@@ -770,7 +769,7 @@ int handle_rt_signal64(int signr, struct k_sigaction *ka, siginfo_t *info,
770 769
771 /* Set up "regs" so we "return" to the signal handler. */ 770 /* Set up "regs" so we "return" to the signal handler. */
772 if (is_elf2_task()) { 771 if (is_elf2_task()) {
773 regs->nip = (unsigned long) ka->sa.sa_handler; 772 regs->nip = (unsigned long) ksig->ka.sa.sa_handler;
774 regs->gpr[12] = regs->nip; 773 regs->gpr[12] = regs->nip;
775 } else { 774 } else {
776 /* Handler is *really* a pointer to the function descriptor for 775 /* Handler is *really* a pointer to the function descriptor for
@@ -779,7 +778,7 @@ int handle_rt_signal64(int signr, struct k_sigaction *ka, siginfo_t *info,
779 * entry is the TOC value we need to use. 778 * entry is the TOC value we need to use.
780 */ 779 */
781 func_descr_t __user *funct_desc_ptr = 780 func_descr_t __user *funct_desc_ptr =
782 (func_descr_t __user *) ka->sa.sa_handler; 781 (func_descr_t __user *) ksig->ka.sa.sa_handler;
783 782
784 err |= get_user(regs->nip, &funct_desc_ptr->entry); 783 err |= get_user(regs->nip, &funct_desc_ptr->entry);
785 err |= get_user(regs->gpr[2], &funct_desc_ptr->toc); 784 err |= get_user(regs->gpr[2], &funct_desc_ptr->toc);
@@ -789,9 +788,9 @@ int handle_rt_signal64(int signr, struct k_sigaction *ka, siginfo_t *info,
789 regs->msr &= ~MSR_LE; 788 regs->msr &= ~MSR_LE;
790 regs->msr |= (MSR_KERNEL & MSR_LE); 789 regs->msr |= (MSR_KERNEL & MSR_LE);
791 regs->gpr[1] = newsp; 790 regs->gpr[1] = newsp;
792 regs->gpr[3] = signr; 791 regs->gpr[3] = ksig->sig;
793 regs->result = 0; 792 regs->result = 0;
794 if (ka->sa.sa_flags & SA_SIGINFO) { 793 if (ksig->ka.sa.sa_flags & SA_SIGINFO) {
795 err |= get_user(regs->gpr[4], (unsigned long __user *)&frame->pinfo); 794 err |= get_user(regs->gpr[4], (unsigned long __user *)&frame->pinfo);
796 err |= get_user(regs->gpr[5], (unsigned long __user *)&frame->puc); 795 err |= get_user(regs->gpr[5], (unsigned long __user *)&frame->puc);
797 regs->gpr[6] = (unsigned long) frame; 796 regs->gpr[6] = (unsigned long) frame;
@@ -801,7 +800,7 @@ int handle_rt_signal64(int signr, struct k_sigaction *ka, siginfo_t *info,
801 if (err) 800 if (err)
802 goto badframe; 801 goto badframe;
803 802
804 return 1; 803 return 0;
805 804
806badframe: 805badframe:
807 if (show_unhandled_signals) 806 if (show_unhandled_signals)
@@ -809,6 +808,5 @@ badframe:
809 current->comm, current->pid, "setup_rt_frame", 808 current->comm, current->pid, "setup_rt_frame",
810 (long)frame, regs->nip, regs->link); 809 (long)frame, regs->nip, regs->link);
811 810
812 force_sigsegv(signr, current); 811 return 1;
813 return 0;
814} 812}