#define in_syscall(regs) (regs->event & orig_r8_IS_SCALL)
#define in_brkpt_trap(regs) (regs->event & orig_r8_IS_BRKPT)
+#define syscall_wont_restart(regs) (regs->event |= orig_r8_IS_SCALL_RESTARTED)
+#define syscall_restartable(regs) !(regs->event & orig_r8_IS_SCALL_RESTARTED)
+
#define current_pt_regs() \
({ \
/* open-coded current_thread_info() */ \
if (restore_altstack(&sf->uc.uc_stack))
goto badframe;
+ /* Don't restart from sigreturn */
+ syscall_wont_restart(regs);
+
return regs->r0;
badframe:
signr = get_signal_to_deliver(&info, &ka, regs, NULL);
- /* Are we from a system call? */
- restart_scall = in_syscall(regs);
+ restart_scall = in_syscall(regs) && syscall_restartable(regs);
if (signr > 0) {
- if (restart_scall)
+ if (restart_scall) {
arc_restart_syscall(&ka, regs);
-
+ syscall_wont_restart(regs); /* No more restarts */
+ }
handle_signal(signr, &ka, &info, regs);
return;
}
regs->r8 = __NR_restart_syscall;
regs->ret -= 4;
}
+ syscall_wont_restart(regs); /* No more restarts */
}
/* If there's no signal to deliver, restore the saved sigmask back */