signal_32.c (5c34202b8bf942da411b6599668a76b07449bbfd) | signal_32.c (22e38f29328296d9d4cc33e46fd32a63e807abaf) |
---|---|
1/* 2 * Signal handling for 32bit PPC and 32bit tasks on 64bit PPC 3 * 4 * PowerPC version 5 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) 6 * Copyright (C) 2001 IBM 7 * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) 8 * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) --- 37 unchanged lines hidden (view full) --- 46#ifdef CONFIG_PPC64 47#include "ppc32.h" 48#include <asm/unistd.h> 49#else 50#include <asm/ucontext.h> 51#include <asm/pgtable.h> 52#endif 53 | 1/* 2 * Signal handling for 32bit PPC and 32bit tasks on 64bit PPC 3 * 4 * PowerPC version 5 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) 6 * Copyright (C) 2001 IBM 7 * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) 8 * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) --- 37 unchanged lines hidden (view full) --- 46#ifdef CONFIG_PPC64 47#include "ppc32.h" 48#include <asm/unistd.h> 49#else 50#include <asm/ucontext.h> 51#include <asm/pgtable.h> 52#endif 53 |
54#include "signal.h" 55 |
|
54#undef DEBUG_SIG 55 56#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 57 58#ifdef CONFIG_PPC64 59#define do_signal do_signal32 60#define sys_sigsuspend compat_sys_sigsuspend 61#define sys_rt_sigsuspend compat_sys_rt_sigsuspend --- 1089 unchanged lines hidden (view full) --- 1151 oldset = ¤t->saved_sigmask; 1152 else if (!oldset) 1153 oldset = ¤t->blocked; 1154 1155 signr = get_signal_to_deliver(&info, &ka, regs, NULL); 1156#ifdef CONFIG_PPC32 1157no_signal: 1158#endif | 56#undef DEBUG_SIG 57 58#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 59 60#ifdef CONFIG_PPC64 61#define do_signal do_signal32 62#define sys_sigsuspend compat_sys_sigsuspend 63#define sys_rt_sigsuspend compat_sys_rt_sigsuspend --- 1089 unchanged lines hidden (view full) --- 1153 oldset = ¤t->saved_sigmask; 1154 else if (!oldset) 1155 oldset = ¤t->blocked; 1156 1157 signr = get_signal_to_deliver(&info, &ka, regs, NULL); 1158#ifdef CONFIG_PPC32 1159no_signal: 1160#endif |
1159 if (TRAP(regs) == 0x0C00 /* System Call! */ 1160 && regs->ccr & 0x10000000 /* error signalled */ 1161 && ((ret = regs->gpr[3]) == ERESTARTSYS 1162 || ret == ERESTARTNOHAND || ret == ERESTARTNOINTR 1163 || ret == ERESTART_RESTARTBLOCK)) { | 1161 /* Is there any syscall restart business here ? */ 1162 check_syscall_restart(regs, &ka, signr > 0); |
1164 | 1163 |
1165 if (signr > 0 1166 && (ret == ERESTARTNOHAND || ret == ERESTART_RESTARTBLOCK 1167 || (ret == ERESTARTSYS 1168 && !(ka.sa.sa_flags & SA_RESTART)))) { 1169 /* make the system call return an EINTR error */ 1170 regs->result = -EINTR; 1171 regs->gpr[3] = EINTR; 1172 /* note that the cr0.SO bit is already set */ 1173 } else { 1174 regs->nip -= 4; /* Back up & retry system call */ 1175 regs->result = 0; 1176 regs->trap = 0; 1177 if (ret == ERESTART_RESTARTBLOCK) 1178 regs->gpr[0] = __NR_restart_syscall; 1179 else 1180 regs->gpr[3] = regs->orig_gpr3; 1181 } 1182 } 1183 | |
1184 if (signr == 0) { 1185 /* No signal to deliver -- put the saved sigmask back */ 1186 if (test_thread_flag(TIF_RESTORE_SIGMASK)) { 1187 clear_thread_flag(TIF_RESTORE_SIGMASK); 1188 sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); 1189 } 1190 return 0; /* no signals delivered */ 1191 } --- 40 unchanged lines hidden --- | 1164 if (signr == 0) { 1165 /* No signal to deliver -- put the saved sigmask back */ 1166 if (test_thread_flag(TIF_RESTORE_SIGMASK)) { 1167 clear_thread_flag(TIF_RESTORE_SIGMASK); 1168 sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); 1169 } 1170 return 0; /* no signals delivered */ 1171 } --- 40 unchanged lines hidden --- |