summaryrefslogtreecommitdiffstats
path: root/arch/m68knommu
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@uclinux.org>2009-01-13 16:27:03 +1000
committerGreg Ungerer <gerg@uclinux.org>2009-01-27 16:42:03 +1000
commitf3221a39de12377e6eb76460abf95b08f7fb9178 (patch)
treea858e395d82badd7b1f40e0b2c54d50a8ef8a7dc /arch/m68knommu
parentd88ffccbca0428e9b12feec45a2bc7f09efa1ab2 (diff)
downloadkernel-crypto-f3221a39de12377e6eb76460abf95b08f7fb9178.tar.gz
kernel-crypto-f3221a39de12377e6eb76460abf95b08f7fb9178.tar.xz
kernel-crypto-f3221a39de12377e6eb76460abf95b08f7fb9178.zip
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: Greg Ungerer <gerg@uclinux.org>
Diffstat (limited to 'arch/m68knommu')
-rw-r--r--arch/m68knommu/kernel/signal.c15
-rw-r--r--arch/m68knommu/kernel/syscalltable.S2
2 files changed, 16 insertions, 1 deletions
diff --git a/arch/m68knommu/kernel/signal.c b/arch/m68knommu/kernel/signal.c
index bbfcae9e52b..5ab6a04af14 100644
--- a/arch/m68knommu/kernel/signal.c
+++ b/arch/m68knommu/kernel/signal.c
@@ -279,6 +279,9 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext *usc, void *fp,
struct sigcontext context;
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 */
if (copy_from_user(&context, usc, sizeof(context)))
goto badframe;
@@ -316,6 +319,9 @@ rt_restore_ucontext(struct pt_regs *regs, struct switch_stack *sw,
unsigned long usp;
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);
if (temp != MCONTEXT_VERSION)
goto badframe;
@@ -692,6 +698,15 @@ handle_restart(struct pt_regs *regs, struct k_sigaction *ka, int has_handler)
regs->d0 = -EINTR;
break;
+ case -ERESTART_RESTARTBLOCK:
+ if (!has_handler) {
+ regs->d0 = __NR_restart_syscall;
+ regs->pc -= 2;
+ break;
+ }
+ regs->d0 = -EINTR;
+ break;
+
case -ERESTARTSYS:
if (has_handler && !(ka->sa.sa_flags & SA_RESTART)) {
regs->d0 = -EINTR;
diff --git a/arch/m68knommu/kernel/syscalltable.S b/arch/m68knommu/kernel/syscalltable.S
index 5c3e3f62194..1017e76f371 100644
--- a/arch/m68knommu/kernel/syscalltable.S
+++ b/arch/m68knommu/kernel/syscalltable.S
@@ -18,7 +18,7 @@
.text
ALIGN
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_fork
.long sys_read