From 2f438e20ab591641760e97458d5d1569942eced5 Mon Sep 17 00:00:00 2001 From: Stefan Liebler Date: Thu, 31 Jul 2014 20:04:54 +0200 Subject: S/390: Revert the jmp_buf/ucontext_t ABI change. --- .../unix/sysv/linux/s390/s390-64/____longjmp_chk.c | 25 +------ .../sysv/linux/s390/s390-64/getcontext-common.S | 79 -------------------- sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S | 86 ++++++++++++++++++++++ sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist | 1 - sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S | 14 ++-- .../unix/sysv/linux/s390/s390-64/ucontext_i.sym | 25 ------- 6 files changed, 94 insertions(+), 136 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/getcontext-common.S create mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/ucontext_i.sym (limited to 'sysdeps/unix/sysv/linux/s390/s390-64') diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c b/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c index bc27b08728..a3b1375a0d 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c +++ b/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c @@ -26,8 +26,8 @@ #include #include #include -#include -#include + +#define __longjmp ____longjmp_chk #define CHECK_SP(env, guard) \ do \ @@ -51,23 +51,4 @@ } \ } while (0) - -#if defined NOT_IN_libc -/* Build a non-versioned object for rtld-*. */ -# define __longjmp ____longjmp_chk -# include "__longjmp-common.c" - -#else /* !NOT_IN_libc */ -# define __longjmp ____v2__longjmp_chk -# include "__longjmp-common.c" -# undef __longjmp - -# if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_11, GLIBC_2_19) -# undef __longjmp -# define __V1_JMPBUF -# define __longjmp ____v1__longjmp_chk -# include "__longjmp-common.c" -# undef __longjmp - -# endif -#endif /* !NOT_IN_libc */ +#include "__longjmp.c" diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/getcontext-common.S b/sysdeps/unix/sysv/linux/s390/s390-64/getcontext-common.S deleted file mode 100644 index 3e61e30702..0000000000 --- a/sysdeps/unix/sysv/linux/s390/s390-64/getcontext-common.S +++ /dev/null @@ -1,79 +0,0 @@ -/* Copyright (C) 2001-2014 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include - -#include "ucontext_i.h" - -/* __getcontext (const ucontext_t *ucp) - - Saves the machine context in UCP such that when it is activated, - it appears as if __getcontext() returned again. - - This implementation is intended to be used for *synchronous* context - switches only. Therefore, it does not have to save anything - other than the PRESERVED state. */ - -ENTRY(__getcontext) - lgr %r1,%r2 - - /* rt_sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask, sigsetsize). */ - la %r2,SIG_BLOCK - slgr %r3,%r3 - la %r4,SC_MASK(%r1) - lghi %r5,_NSIG8 - svc SYS_ify(rt_sigprocmask) - - /* Store fpu context. */ - 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 the version number into the uc_flags field. So far - we do not make use of the reserved bytes so we store a zero. */ - stg %r2,SC_FLGS(%r1) - - /* Store access registers. */ - stam %a0,%a15,SC_ACRS(%r1) - - /* Store general purpose registers. */ - stmg %r0,%r15,SC_GPRS(%r1) - - /* Return. */ - br %r14 -END(__getcontext) - -weak_alias (__getcontext, getcontext) diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S b/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S new file mode 100644 index 0000000000..26a1c514c4 --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S @@ -0,0 +1,86 @@ +/* Copyright (C) 2001-2014 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + +#include "ucontext_i.h" + +#include + +/* __getcontext (const ucontext_t *ucp) + + Saves the machine context in UCP such that when it is activated, + it appears as if __getcontext() returned again. + + This implementation is intended to be used for *synchronous* context + switches only. Therefore, it does not have to save anything + other than the PRESERVED state. */ + +ENTRY(__getcontext) + lgr %r1,%r2 + + /* rt_sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask, sigsetsize). */ + la %r2,SIG_BLOCK + slgr %r3,%r3 + la %r4,SC_MASK(%r1) + lghi %r5,_NSIG8 + svc SYS_ify(rt_sigprocmask) + + /* Store fpu context. */ + 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(%r1) + + /* Store general purpose registers. */ + stmg %r0,%r15,SC_GPRS(%r1) + + /* Return. */ + br %r14 +END(__getcontext) + +weak_alias (__getcontext, getcontext) + +#if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) +/* In glibc release 2.19 a new version of getcontext was introduced, + but was reverted before 2.20. Thus both versions are the same function. */ +weak_alias (__getcontext, __v1__getcontext) +weak_alias (__getcontext, __v2__getcontext) +versioned_symbol (libc, __v1__getcontext, getcontext, GLIBC_2_1) +compat_symbol (libc, __v2__getcontext, getcontext, GLIBC_2_19) +#endif diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist index 4576fc8d14..807f702981 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist @@ -98,7 +98,6 @@ GLIBC_2.18 GLIBC_2.19 GLIBC_2.19 A __longjmp_chk F - __setjmp F __sigsetjmp F _longjmp F _setjmp F diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S b/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S index ac74b6bc08..e3e624c91b 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S +++ b/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S @@ -65,25 +65,21 @@ 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) - /* 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 + lgr %r5,%r0 la %r3,SC_MASK(%r5) - slgr %r4,%r4 lghi %r5,_NSIG8 + slgr %r4,%r4 svc SYS_ify(rt_sigprocmask) /* Load fpu context. */ diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/ucontext_i.sym b/sysdeps/unix/sysv/linux/s390/s390-64/ucontext_i.sym deleted file mode 100644 index 6cc9f19624..0000000000 --- a/sysdeps/unix/sysv/linux/s390/s390-64/ucontext_i.sym +++ /dev/null @@ -1,25 +0,0 @@ -#include -#include -#include - --- - -SIG_BLOCK -SIG_UNBLOCK -SIG_SETMASK - -_NSIG8 (_NSIG / 8) - -#define ucontext(member) offsetof (ucontext_t, member) -#define mcontext(member) ucontext (uc_mcontext.member) - -SC_FLGS ucontext (uc_flags) -SC_LINK ucontext (uc_link) -SC_STCK ucontext (uc_stack.ss_sp) -SC_STSZ ucontext (uc_stack.ss_size) -SC_PSW mcontext (psw) -SC_GPRS mcontext (gregs) -SC_ACRS mcontext (aregs) -SC_FPC mcontext (fpregs.fpc) -SC_FPRS mcontext (fpregs.fprs) -SC_MASK ucontext (uc_sigmask) -- cgit 1.4.1