if (clone_flags & CLONE_SETTLS)
t->kregs->u_regs[UREG_G7] = regs->u_regs[UREG_I3];
- /* We do not want to accidently trigger system call restart
- * handling in the new thread. Therefore, clear out the trap
- * type, which will make pt_regs_regs_is_syscall() return false.
- */
- pt_regs_clear_trap_type(t->kregs);
-
return 0;
}
regs->tpc = tpc;
regs->tnpc = tnpc;
+ /* Prevent syscall restart. */
+ pt_regs_clear_trap_type(regs);
+
sigdelsetmask(&set, ~_BLOCKABLE);
spin_lock_irq(¤t->sighand->siglock);
current->blocked = set;
siginfo_t info;
int signr;
- if (pt_regs_is_syscall(regs)) {
+ if (pt_regs_is_syscall(regs) &&
+ (regs->tstate & (TSTATE_XCARRY | TSTATE_ICARRY))) {
pt_regs_clear_trap_type(regs);
cookie.restart_syscall = 1;
} else
regs->tstate &= ~(TSTATE_ICC|TSTATE_XCC);
regs->tstate |= psr_to_tstate_icc(psr);
+ /* Prevent syscall restart. */
+ pt_regs_clear_trap_type(regs);
+
err |= __get_user(fpu_save, &sf->fpu_save);
if (fpu_save)
err |= restore_fpu_state32(regs, &sf->fpu_state);
regs->tstate &= ~(TSTATE_ICC|TSTATE_XCC);
regs->tstate |= psr_to_tstate_icc(psr);
+ /* Prevent syscall restart. */
+ pt_regs_clear_trap_type(regs);
+
err |= __get_user(fpu_save, &sf->fpu_save);
if (fpu_save)
err |= restore_fpu_state32(regs, &sf->fpu_state);