summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S')
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S21
1 files changed, 14 insertions, 7 deletions
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S b/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S
index a626660744..ac74b6bc08 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2013 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
@@ -33,6 +33,9 @@
other than the PRESERVED state. */
ENTRY(__swapcontext)
+ /* While not part of the ABI a system call never clobbers r0
+ or r1. So keeping the values here while calling
+ rt_sigprocmask is ok. */
lgr %r1,%r2
lgr %r0,%r3
@@ -62,21 +65,25 @@ ENTRY(__swapcontext)
std %f14,SC_FPRS+112(%r1)
std %f15,SC_FPRS+120(%r1)
- /* Set __swapcontext return value to 0. */
- slgr %r2,%r2
-
/* Store access registers. */
stam %a0,%a15,SC_ACRS(%r1)
+ /* Set __swapcontext return value to 0. */
+ slgr %r2,%r2
+
/* Store general purpose registers. */
stmg %r0,%r15,SC_GPRS(%r1)
- /* sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL). */
- la %r2,SIG_BLOCK
+ /* Copy uc_flags into the new ucontext_t. */
lgr %r5,%r0
+ lg %r2,SC_FLGS(%r5)
+ stg %r2,SC_FLGS(%r1)
+
+ /* rt_sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL, sigsetsize). */
+ la %r2,SIG_BLOCK
la %r3,SC_MASK(%r5)
- lghi %r5,_NSIG8
slgr %r4,%r4
+ lghi %r5,_NSIG8
svc SYS_ify(rt_sigprocmask)
/* Load fpu context. */