summaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/signal.c
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2011-10-30 15:16:49 +0100
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2011-10-30 15:16:43 +0100
commitb6ef5bb3d93efb95ba855a628740375c2280a59e (patch)
treefc26947a0111c7e71085a81e26f12c815f3f4c09 /arch/s390/kernel/signal.c
parentccf45cafb0805978e6f13a672caca0e536e87cad (diff)
downloadlinux-b6ef5bb3d93efb95ba855a628740375c2280a59e.tar.gz
linux-b6ef5bb3d93efb95ba855a628740375c2280a59e.tar.bz2
linux-b6ef5bb3d93efb95ba855a628740375c2280a59e.zip
[S390] add TIF_SYSCALL thread flag
Add an explicit TIF_SYSCALL bit that indicates if a task is inside a system call. The svc_code in the pt_regs structure is now only valid if TIF_SYSCALL is set. With this definition TIF_RESTART_SVC can be replaced with TIF_SYSCALL. Overall do_signal is a bit more readable and it saves a few lines of code. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/signal.c')
-rw-r--r--arch/s390/kernel/signal.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c
index 058e372bada1..0e905cb7604a 100644
--- a/arch/s390/kernel/signal.c
+++ b/arch/s390/kernel/signal.c
@@ -157,7 +157,7 @@ static int restore_sigregs(struct pt_regs *regs, _sigregs __user *sregs)
current->thread.fp_regs.fpc &= FPC_VALID_MASK;
restore_fp_regs(&current->thread.fp_regs);
- regs->svc_code = 0; /* disable syscall checks */
+ clear_thread_flag(TIF_SYSCALL); /* No longer in a system call */
return 0;
}
@@ -426,13 +426,14 @@ void do_signal(struct pt_regs *regs)
* the debugger may change all our registers, including the system
* call information.
*/
- current_thread_info()->system_call = regs->svc_code;
+ current_thread_info()->system_call =
+ test_thread_flag(TIF_SYSCALL) ? regs->svc_code : 0;
signr = get_signal_to_deliver(&info, &ka, regs, NULL);
- regs->svc_code = current_thread_info()->system_call;
if (signr > 0) {
/* Whee! Actually deliver the signal. */
- if (regs->svc_code > 0) {
+ if (current_thread_info()->system_call) {
+ regs->svc_code = current_thread_info()->system_call;
/* Check for system call restarting. */
switch (regs->gprs[2]) {
case -ERESTART_RESTARTBLOCK:
@@ -453,7 +454,7 @@ void do_signal(struct pt_regs *regs)
break;
}
/* No longer in a system call */
- regs->svc_code = 0;
+ clear_thread_flag(TIF_SYSCALL);
}
if ((is_compat_task() ?
@@ -478,7 +479,8 @@ void do_signal(struct pt_regs *regs)
}
/* No handlers present - check for system call restart */
- if (regs->svc_code > 0) {
+ if (current_thread_info()->system_call) {
+ regs->svc_code = current_thread_info()->system_call;
switch (regs->gprs[2]) {
case -ERESTART_RESTARTBLOCK:
/* Restart with sys_restart_syscall */
@@ -489,7 +491,10 @@ void do_signal(struct pt_regs *regs)
case -ERESTARTNOINTR:
/* Restart system call with magic TIF bit. */
regs->gprs[2] = regs->orig_gpr2;
- set_thread_flag(TIF_RESTART_SVC);
+ set_thread_flag(TIF_SYSCALL);
+ break;
+ default:
+ clear_thread_flag(TIF_SYSCALL);
break;
}
}