diff options
author | Greg Ungerer <gerg@uclinux.org> | 2009-01-13 01:27:03 -0500 |
---|---|---|
committer | Greg Ungerer <gerg@uclinux.org> | 2009-01-27 01:42:03 -0500 |
commit | f3221a39de12377e6eb76460abf95b08f7fb9178 (patch) | |
tree | a858e395d82badd7b1f40e0b2c54d50a8ef8a7dc /arch | |
parent | d88ffccbca0428e9b12feec45a2bc7f09efa1ab2 (diff) |
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')
-rw-r--r-- | arch/m68knommu/kernel/signal.c | 15 | ||||
-rw-r--r-- | arch/m68knommu/kernel/syscalltable.S | 2 |
2 files changed, 16 insertions, 1 deletions
diff --git a/arch/m68knommu/kernel/signal.c b/arch/m68knommu/kernel/signal.c index bbfcae9e52b4..5ab6a04af14e 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, | |||
279 | struct sigcontext context; | 279 | struct sigcontext context; |
280 | int err = 0; | 280 | int err = 0; |
281 | 281 | ||
282 | /* Always make any pending restarted system calls return -EINTR */ | ||
283 | current_thread_info()->restart_block.fn = do_no_restart_syscall; | ||
284 | |||
282 | /* get previous context */ | 285 | /* get previous context */ |
283 | if (copy_from_user(&context, usc, sizeof(context))) | 286 | if (copy_from_user(&context, usc, sizeof(context))) |
284 | goto badframe; | 287 | goto badframe; |
@@ -316,6 +319,9 @@ rt_restore_ucontext(struct pt_regs *regs, struct switch_stack *sw, | |||
316 | unsigned long usp; | 319 | unsigned long usp; |
317 | int err; | 320 | int err; |
318 | 321 | ||
322 | /* Always make any pending restarted system calls return -EINTR */ | ||
323 | current_thread_info()->restart_block.fn = do_no_restart_syscall; | ||
324 | |||
319 | err = __get_user(temp, &uc->uc_mcontext.version); | 325 | err = __get_user(temp, &uc->uc_mcontext.version); |
320 | if (temp != MCONTEXT_VERSION) | 326 | if (temp != MCONTEXT_VERSION) |
321 | goto badframe; | 327 | goto badframe; |
@@ -692,6 +698,15 @@ handle_restart(struct pt_regs *regs, struct k_sigaction *ka, int has_handler) | |||
692 | regs->d0 = -EINTR; | 698 | regs->d0 = -EINTR; |
693 | break; | 699 | break; |
694 | 700 | ||
701 | case -ERESTART_RESTARTBLOCK: | ||
702 | if (!has_handler) { | ||
703 | regs->d0 = __NR_restart_syscall; | ||
704 | regs->pc -= 2; | ||
705 | break; | ||
706 | } | ||
707 | regs->d0 = -EINTR; | ||
708 | break; | ||
709 | |||
695 | case -ERESTARTSYS: | 710 | case -ERESTARTSYS: |
696 | if (has_handler && !(ka->sa.sa_flags & SA_RESTART)) { | 711 | if (has_handler && !(ka->sa.sa_flags & SA_RESTART)) { |
697 | regs->d0 = -EINTR; | 712 | regs->d0 = -EINTR; |
diff --git a/arch/m68knommu/kernel/syscalltable.S b/arch/m68knommu/kernel/syscalltable.S index 5c3e3f62194a..1017e76f3711 100644 --- a/arch/m68knommu/kernel/syscalltable.S +++ b/arch/m68knommu/kernel/syscalltable.S | |||
@@ -18,7 +18,7 @@ | |||
18 | .text | 18 | .text |
19 | ALIGN | 19 | ALIGN |
20 | ENTRY(sys_call_table) | 20 | ENTRY(sys_call_table) |
21 | .long sys_ni_syscall /* 0 - old "setup()" system call*/ | 21 | .long sys_restart_syscall /* 0 - old "setup()" system call */ |
22 | .long sys_exit | 22 | .long sys_exit |
23 | .long sys_fork | 23 | .long sys_fork |
24 | .long sys_read | 24 | .long sys_read |