Commit 1bca8fec authored by Anton Blanchard's avatar Anton Blanchard

ppc64: reduce differences to the ppc32 signal code.

parent bf306055
...@@ -206,8 +206,6 @@ long sys_sigaction(int sig, const struct old_sigaction *act, ...@@ -206,8 +206,6 @@ long sys_sigaction(int sig, const struct old_sigaction *act,
* *
* Each of these things must be a multiple of 16 bytes in size. * Each of these things must be a multiple of 16 bytes in size.
* *
* XXX ultimately we will have to stack up a siginfo and ucontext
* for each rt signal.
*/ */
struct sigregs { struct sigregs {
elf_gregset_t gp_regs; elf_gregset_t gp_regs;
...@@ -261,6 +259,8 @@ int sys_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -261,6 +259,8 @@ int sys_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
current->blocked = set; current->blocked = set;
recalc_sigpending(); recalc_sigpending();
spin_unlock_irq(&current->sigmask_lock); spin_unlock_irq(&current->sigmask_lock);
if (regs->msr & MSR_FP)
giveup_fpu(current);
/* restore registers - /* restore registers -
* sigctx is initialized to point to the * sigctx is initialized to point to the
...@@ -268,10 +268,7 @@ int sys_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -268,10 +268,7 @@ int sys_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
* see handle_signal() * see handle_signal()
*/ */
sr = (struct sigregs *) sigctx.regs; sr = (struct sigregs *) sigctx.regs;
if (regs->msr & MSR_FP ) if (copy_from_user(saved_regs, &sr->gp_regs, sizeof(sr->gp_regs)))
giveup_fpu(current);
if (copy_from_user(saved_regs, &sr->gp_regs,
sizeof(sr->gp_regs)))
goto badframe; goto badframe;
saved_regs[PT_MSR] = (regs->msr & ~MSR_USERCHANGE) saved_regs[PT_MSR] = (regs->msr & ~MSR_USERCHANGE)
| (saved_regs[PT_MSR] & MSR_USERCHANGE); | (saved_regs[PT_MSR] & MSR_USERCHANGE);
...@@ -381,13 +378,12 @@ long sys_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -381,13 +378,12 @@ long sys_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
current->blocked = set; current->blocked = set;
recalc_sigpending(); recalc_sigpending();
spin_unlock_irq(&current->sigmask_lock); spin_unlock_irq(&current->sigmask_lock);
if (regs->msr & MSR_FP )
giveup_fpu(current);
/* restore registers */ /* restore registers */
sr = (struct sigregs *) sigctx.regs; sr = (struct sigregs *) sigctx.regs;
if (regs->msr & MSR_FP ) if (copy_from_user(saved_regs, &sr->gp_regs, sizeof(sr->gp_regs)))
giveup_fpu(current);
if (copy_from_user(saved_regs, &sr->gp_regs,
sizeof(sr->gp_regs)))
goto badframe; goto badframe;
saved_regs[PT_MSR] = (regs->msr & ~MSR_USERCHANGE) saved_regs[PT_MSR] = (regs->msr & ~MSR_USERCHANGE)
| (saved_regs[PT_MSR] & MSR_USERCHANGE); | (saved_regs[PT_MSR] & MSR_USERCHANGE);
......
...@@ -512,7 +512,6 @@ long sys32_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -512,7 +512,6 @@ long sys32_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
elf_gregset_t32 saved_regs; /* an array of 32 bit register values */ elf_gregset_t32 saved_regs; /* an array of 32 bit register values */
sigset_t signal_set; sigset_t signal_set;
stack_t stack; stack_t stack;
unsigned int previous_stack;
ret = 0; ret = 0;
/* Adjust the inputted reg1 to point to the first rt signal frame */ /* Adjust the inputted reg1 to point to the first rt signal frame */
......
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