summaryrefslogtreecommitdiff
path: root/libc/sysdeps/unix/sysv/linux/s390/s390-64
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/unix/sysv/linux/s390/s390-64')
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S43
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S43
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S6
3 files changed, 49 insertions, 43 deletions
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S b/libc/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S
index 68e89102a..7c406cb23 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S
@@ -31,41 +31,42 @@
other than the PRESERVED state. */
ENTRY(__getcontext)
- lgr %r5,%r2
+ lgr %r1,%r2
/* sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask). */
la %r2,SIG_BLOCK
slgr %r3,%r3
- la %r4,SC_MASK(%r5)
+ la %r4,SC_MASK(%r1)
+ lghi %r5,_NSIG8
svc SYS_ify(rt_sigprocmask)
/* Store fpu context. */
- stfpc SC_FPC(%r5)
- std %f0,SC_FPRS(%r5)
- std %f1,SC_FPRS+8(%r5)
- std %f2,SC_FPRS+16(%r5)
- std %f3,SC_FPRS+24(%r5)
- std %f4,SC_FPRS+32(%r5)
- std %f5,SC_FPRS+40(%r5)
- std %f6,SC_FPRS+48(%r5)
- std %f7,SC_FPRS+56(%r5)
- std %f8,SC_FPRS+64(%r5)
- std %f9,SC_FPRS+72(%r5)
- std %f10,SC_FPRS+80(%r5)
- std %f11,SC_FPRS+88(%r5)
- std %f12,SC_FPRS+96(%r5)
- std %f13,SC_FPRS+104(%r5)
- std %f14,SC_FPRS+112(%r5)
- std %f15,SC_FPRS+120(%r5)
+ stfpc SC_FPC(%r1)
+ std %f0,SC_FPRS(%r1)
+ std %f1,SC_FPRS+8(%r1)
+ std %f2,SC_FPRS+16(%r1)
+ std %f3,SC_FPRS+24(%r1)
+ std %f4,SC_FPRS+32(%r1)
+ std %f5,SC_FPRS+40(%r1)
+ std %f6,SC_FPRS+48(%r1)
+ std %f7,SC_FPRS+56(%r1)
+ std %f8,SC_FPRS+64(%r1)
+ std %f9,SC_FPRS+72(%r1)
+ std %f10,SC_FPRS+80(%r1)
+ std %f11,SC_FPRS+88(%r1)
+ std %f12,SC_FPRS+96(%r1)
+ std %f13,SC_FPRS+104(%r1)
+ std %f14,SC_FPRS+112(%r1)
+ std %f15,SC_FPRS+120(%r1)
/* Set __getcontext return value to 0. */
slgr %r2,%r2
/* Store access registers. */
- stam %a0,%a15,SC_ACRS(%r5)
+ stam %a0,%a15,SC_ACRS(%r1)
/* Store general purpose registers. */
- stmg %r0,%r15,SC_GPRS(%r5)
+ stmg %r0,%r15,SC_GPRS(%r1)
/* Return. */
br %r14
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S b/libc/sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S
index 7415bd938..8157327bf 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S
@@ -31,38 +31,39 @@
other than the PRESERVED state. */
ENTRY(__setcontext)
- lgr %r5,%r2
+ lgr %r1,%r2
/* sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL). */
la %r2,SIG_BLOCK
- la %r3,SC_MASK(%r5)
+ la %r3,SC_MASK(%r1)
slgr %r4,%r4
+ lghi %r5,_NSIG8
svc SYS_ify(rt_sigprocmask)
/* Load fpu context. */
- lfpc SC_FPC(%r5)
- ld %f0,SC_FPRS(%r5)
- ld %f1,SC_FPRS+8(%r5)
- ld %f2,SC_FPRS+16(%r5)
- ld %f3,SC_FPRS+24(%r5)
- ld %f4,SC_FPRS+32(%r5)
- ld %f5,SC_FPRS+40(%r5)
- ld %f6,SC_FPRS+48(%r5)
- ld %f7,SC_FPRS+56(%r5)
- ld %f8,SC_FPRS+64(%r5)
- ld %f9,SC_FPRS+72(%r5)
- ld %f10,SC_FPRS+80(%r5)
- ld %f11,SC_FPRS+88(%r5)
- ld %f12,SC_FPRS+96(%r5)
- ld %f13,SC_FPRS+104(%r5)
- ld %f14,SC_FPRS+112(%r5)
- ld %f15,SC_FPRS+120(%r5)
+ lfpc SC_FPC(%r1)
+ ld %f0,SC_FPRS(%r1)
+ ld %f1,SC_FPRS+8(%r1)
+ ld %f2,SC_FPRS+16(%r1)
+ ld %f3,SC_FPRS+24(%r1)
+ ld %f4,SC_FPRS+32(%r1)
+ ld %f5,SC_FPRS+40(%r1)
+ ld %f6,SC_FPRS+48(%r1)
+ ld %f7,SC_FPRS+56(%r1)
+ ld %f8,SC_FPRS+64(%r1)
+ ld %f9,SC_FPRS+72(%r1)
+ ld %f10,SC_FPRS+80(%r1)
+ ld %f11,SC_FPRS+88(%r1)
+ ld %f12,SC_FPRS+96(%r1)
+ ld %f13,SC_FPRS+104(%r1)
+ ld %f14,SC_FPRS+112(%r1)
+ ld %f15,SC_FPRS+120(%r1)
/* Don't touch %a0 and %a1, used for thread purposes. */
- lam %a2,%a15,SC_ACRS+8(%r5)
+ lam %a2,%a15,SC_ACRS+8(%r1)
/* Load general purpose registers. */
- lmg %r0,%r15,SC_GPRS(%r5)
+ lmg %r0,%r15,SC_GPRS(%r1)
/* Return. */
br %r14
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S b/libc/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S
index 2d8f0d50e..a08e68cdd 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S
@@ -34,12 +34,13 @@
ENTRY(__swapcontext)
lgr %r1,%r2
- lgr %r5,%r3
+ lgr %r0,%r3
/* sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask). */
la %r2,SIG_BLOCK
slgr %r3,%r3
la %r4,SC_MASK(%r1)
+ lghi %r5,_NSIG8
svc SYS_ify(rt_sigprocmask)
/* Store fpu context. */
@@ -72,11 +73,14 @@ ENTRY(__swapcontext)
/* sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL). */
la %r2,SIG_BLOCK
+ lgr %r5,%r0
la %r3,SC_MASK(%r5)
+ lghi %r5,_NSIG8
slgr %r4,%r4
svc SYS_ify(rt_sigprocmask)
/* Load fpu context. */
+ lgr %r5,%r0
lfpc SC_FPC(%r5)
ld %f0,SC_FPRS(%r5)
ld %f1,SC_FPRS+8(%r5)