]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / s390 / s390-32 / swapcontext.S
index b022f2ca74112886583606838a7fdaa83adcfaa6..d570d4ec7aed68d700ddf597b0605b97bca60582 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2013 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
 
@@ -24,7 +24,7 @@
 /*  __swapcontext (ucontext_t *oucp, const ucontext_t *ucp)
 
   Saves the machine context in oucp such that when it is activated,
-  it appears as if __swapcontextt() returned again, restores the
+  it appears as if __swapcontext() returned again, restores the
   machine context in ucp and thereby resumes execution in that
   context.
 
   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.  */
        lr      %r1,%r2
        lr      %r0,%r3
 
-       /* sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask).  */
-       la      %r2,SIG_BLOCK
-       slr     %r3,%r3
-       la      %r4,SC_MASK(%r1)
-       lhi     %r5,_NSIG8
-       svc     SYS_ify(rt_sigprocmask)
-
        /* Store fpu context.  */
        stfpc   SC_FPC(%r1)
        std     %f0,SC_FPRS(%r1)
@@ -71,11 +67,12 @@ ENTRY(__swapcontext)
        /* Store general purpose registers.  */
        stm     %r0,%r15,SC_GPRS(%r1)
 
-       /* sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL).  */
-       la      %r2,SIG_BLOCK
+       /* rt_sigprocmask (SIG_SETMASK, &ucp->uc_sigmask, &oucp->uc_sigmask,
+          sigsetsize).  */
+       la      %r2,SIG_SETMASK
        lr      %r5,%r0
        la      %r3,SC_MASK(%r5)
-       slr     %r4,%r4
+       la      %r4,SC_MASK(%r1)
        lhi     %r5,_NSIG8
        svc     SYS_ify(rt_sigprocmask)