about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S')
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S6
1 files changed, 6 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S b/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S
index b3f2a8b344..ccf4d7a935 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S
@@ -66,6 +66,12 @@ ENTRY(__swapcontext)
 	/* Store general purpose registers.  */
 	stm     %r0,%r15,SC_GPRS(%r1)
 
+	/* Store psw mask to 0x0 and addr to return address.  Then the address
+	   can be retrieved from the ucontext structure in the same way as if it
+	   is created by kernel and passed to a signal-handler.  */
+	st	%r2,SC_PSW+0(%r1)
+	st	%r14,SC_PSW+4(%r1)
+
 	/* rt_sigprocmask (SIG_SETMASK, &ucp->uc_sigmask, &oucp->uc_sigmask,
 	   sigsetsize).  */
 	la      %r2,SIG_SETMASK