Commit f3221a39 authored by Greg Ungerer's avatar Greg Ungerer

m68knommu: fix syscall restarting

Make restart blocks working, required for proper syscall restarting.
Derived from same changes for m68k arch by Andreas Schwab <schwab@suse.de>
Signed-off-by: default avatarGreg Ungerer <gerg@uclinux.org>
parent d88ffccb
...@@ -279,6 +279,9 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext *usc, void *fp, ...@@ -279,6 +279,9 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext *usc, void *fp,
struct sigcontext context; struct sigcontext context;
int err = 0; int err = 0;
/* Always make any pending restarted system calls return -EINTR */
current_thread_info()->restart_block.fn = do_no_restart_syscall;
/* get previous context */ /* get previous context */
if (copy_from_user(&context, usc, sizeof(context))) if (copy_from_user(&context, usc, sizeof(context)))
goto badframe; goto badframe;
...@@ -316,6 +319,9 @@ rt_restore_ucontext(struct pt_regs *regs, struct switch_stack *sw, ...@@ -316,6 +319,9 @@ rt_restore_ucontext(struct pt_regs *regs, struct switch_stack *sw,
unsigned long usp; unsigned long usp;
int err; int err;
/* Always make any pending restarted system calls return -EINTR */
current_thread_info()->restart_block.fn = do_no_restart_syscall;
err = __get_user(temp, &uc->uc_mcontext.version); err = __get_user(temp, &uc->uc_mcontext.version);
if (temp != MCONTEXT_VERSION) if (temp != MCONTEXT_VERSION)
goto badframe; goto badframe;
...@@ -692,6 +698,15 @@ handle_restart(struct pt_regs *regs, struct k_sigaction *ka, int has_handler) ...@@ -692,6 +698,15 @@ handle_restart(struct pt_regs *regs, struct k_sigaction *ka, int has_handler)
regs->d0 = -EINTR; regs->d0 = -EINTR;
break; break;
case -ERESTART_RESTARTBLOCK:
if (!has_handler) {
regs->d0 = __NR_restart_syscall;
regs->pc -= 2;
break;
}
regs->d0 = -EINTR;
break;
case -ERESTARTSYS: case -ERESTARTSYS:
if (has_handler && !(ka->sa.sa_flags & SA_RESTART)) { if (has_handler && !(ka->sa.sa_flags & SA_RESTART)) {
regs->d0 = -EINTR; regs->d0 = -EINTR;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
.text .text
ALIGN ALIGN
ENTRY(sys_call_table) ENTRY(sys_call_table)
.long sys_ni_syscall /* 0 - old "setup()" system call*/ .long sys_restart_syscall /* 0 - old "setup()" system call */
.long sys_exit .long sys_exit
.long sys_fork .long sys_fork
.long sys_read .long sys_read
......
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