summaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel/signal_32.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2007-06-04 05:15:49 (GMT)
committerPaul Mackerras <paulus@samba.org>2007-06-14 12:29:57 (GMT)
commit22e38f29328296d9d4cc33e46fd32a63e807abaf (patch)
tree4cfea90671815ce87d5d0e896bb9f818565132c8 /arch/powerpc/kernel/signal_32.c
parent791cc501d422be96d6e3098faf6471ba29f4dd33 (diff)
downloadlinux-22e38f29328296d9d4cc33e46fd32a63e807abaf.tar.xz
[POWERPC] Make syscall restart code more common
This patch moves the code in signal_32.c and signal_64.c for handling syscall restart into a common signal.c file and converge around a single implementation that is based on the 32 bits one, using trap, ccr and r3 rather than the special "result" field for deciding what to do. The "result" field is now pretty much deprecated. We still set it for the sake of whatever might rely on it in userland but we no longer use it's content. This, along with a previous patch that enables ptracers to write to "trap" and "orig_r3" should allow gdb to properly handle syscall restarting. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/signal_32.c')
-rw-r--r--arch/powerpc/kernel/signal_32.c28
1 files changed, 4 insertions, 24 deletions
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index dd1dca5..e5cc803 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -51,6 +51,8 @@
#include <asm/pgtable.h>
#endif
+#include "signal.h"
+
#undef DEBUG_SIG
#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
@@ -1156,30 +1158,8 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
#ifdef CONFIG_PPC32
no_signal:
#endif
- if (TRAP(regs) == 0x0C00 /* System Call! */
- && regs->ccr & 0x10000000 /* error signalled */
- && ((ret = regs->gpr[3]) == ERESTARTSYS
- || ret == ERESTARTNOHAND || ret == ERESTARTNOINTR
- || ret == ERESTART_RESTARTBLOCK)) {
-
- if (signr > 0
- && (ret == ERESTARTNOHAND || ret == ERESTART_RESTARTBLOCK
- || (ret == ERESTARTSYS
- && !(ka.sa.sa_flags & SA_RESTART)))) {
- /* make the system call return an EINTR error */
- regs->result = -EINTR;
- regs->gpr[3] = EINTR;
- /* note that the cr0.SO bit is already set */
- } else {
- regs->nip -= 4; /* Back up & retry system call */
- regs->result = 0;
- regs->trap = 0;
- if (ret == ERESTART_RESTARTBLOCK)
- regs->gpr[0] = __NR_restart_syscall;
- else
- regs->gpr[3] = regs->orig_gpr3;
- }
- }
+ /* Is there any syscall restart business here ? */
+ check_syscall_restart(regs, &ka, signr > 0);
if (signr == 0) {
/* No signal to deliver -- put the saved sigmask back */