]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/s390/s390-64/setjmp.S
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / sysdeps / s390 / s390-64 / setjmp.S
CommitLineData
492e01c8 1/* setjmp for 64 bit S/390, ELF version.
04277e02 2 Copyright (C) 2001-2019 Free Software Foundation, Inc.
847b055c 3 Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
ffeac417 4 This file is part of the GNU C Library.
847b055c
AJ
5
6 The GNU C Library is free software; you can redistribute it and/or
41bdb6e2
AJ
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
847b055c
AJ
10
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41bdb6e2 14 Lesser General Public License for more details.
847b055c 15
41bdb6e2 16 You should have received a copy of the GNU Lesser General Public
59ba27a6
PE
17 License along with the GNU C Library; if not, see
18 <http://www.gnu.org/licenses/>. */
847b055c 19
ffeac417 20#include <sysdep.h>
492e01c8
AJ
21#define _ASM
22#define _SETJMP_H
ffeac417 23#include <bits/setjmp.h>
2f438e20 24#include <shlib-compat.h>
53244a4e 25#include <stap-probe.h>
2f438e20 26
001f81ad
FW
27#if !IS_IN (rtld) && defined SHARED \
28 && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)
29# define NEED_COMPAT_SYMBOLS 1
30/* We need a unique name in case of symbol versioning. */
31# define setjmp __v1setjmp
32# define _setjmp __v1_setjmp
33# define __sigsetjmp __v1__sigsetjmp
34#else
35# define NEED_COMPAT_SYMBOLS 0
36#endif
ffeac417 37
37d13b17 38 /* We include the BSD entry points here as well. */
492e01c8 39ENTRY (setjmp)
37d13b17
SL
40 lghi %r3,1 /* Second argument of one. */
41 j .Linternal_sigsetjmp /* Branch relativ to __sigsetjmp. */
492e01c8
AJ
42END (setjmp)
43
44 /* Binary compatibility entry point. */
45ENTRY(_setjmp)
37d13b17
SL
46 slgr %r3,%r3 /* Second argument of zero. */
47 j .Linternal_sigsetjmp /* Branch relativ to __sigsetjmp. */
93a45ff1 48END (_setjmp)
001f81ad
FW
49#if NEED_COMPAT_SYMBOLS
50strong_alias (_setjmp, __GI__setjmp)
51#else
492e01c8 52libc_hidden_def (_setjmp)
001f81ad 53#endif
492e01c8
AJ
54
55ENTRY(__setjmp)
37d13b17
SL
56 slgr %r3,%r3 /* Second argument of zero. */
57 j .Linternal_sigsetjmp /* Branch relativ to __sigsetjmp. */
93a45ff1 58END (__setjmp)
ffeac417
UD
59
60ENTRY(__sigsetjmp)
2f438e20 61.Linternal_sigsetjmp:
53244a4e
SL
62 /* setjmp probe expects sig/setjmp first argument (8@%r2), second
63 argument (-8@%r3) and target address (8@%r14). */
64 LIBC_PROBE (setjmp, 3, 8@%r2, -4@%r3, 8@%r14)
00c2b3b9
UD
65#ifdef PTR_MANGLE
66 stmg %r6,%r13,0(%r2) /* Store registers in jmp_buf. */
67 lgr %r4,%r14
305bb37e
UD
68 lgr %r5,%r15
69 PTR_MANGLE (%r4, %r1)
70 PTR_MANGLE2 (%r5, %r1)
71 stmg %r4,%r5,64(%r2)
00c2b3b9 72#else
37d13b17 73 stmg %r6,%r15,0(%r2) /* Store registers in jmp_buf. */
00c2b3b9 74#endif
bc101e26
AK
75 std %f8,80(%r2)
76 std %f9,88(%r2)
77 std %f10,96(%r2)
78 std %f11,104(%r2)
79 std %f12,112(%r2)
80 std %f13,120(%r2)
81 std %f14,128(%r2)
82 std %f15,136(%r2)
a3848485 83#if IS_IN (rtld)
00c2b3b9
UD
84 /* In ld.so we never save the signal mask. */
85 lghi %r2,0
86 br %r14
87#elif defined PIC
37d13b17 88 jg __sigjmp_save@PLT /* Branch to PLT of __sigsetjmp. */
ffeac417 89#else
492e01c8 90 jg __sigjmp_save
847b055c 91#endif
ffeac417 92END (__sigsetjmp)
001f81ad
FW
93#if NEED_COMPAT_SYMBOLS
94strong_alias (__sigsetjmp, __GI___sigsetjmp)
95#else
96libc_hidden_def (__sigsetjmp)
97#endif
2f438e20 98
001f81ad 99#if NEED_COMPAT_SYMBOLS
2f438e20
SL
100/* In glibc release 2.19 new versions of setjmp-functions were introduced,
101 but were reverted before 2.20. Thus both versions are the same function. */
102
001f81ad
FW
103# undef setjmp
104# undef _setjmp
105# undef __sigsetjmp
2f438e20 106
37d13b17 107strong_alias (__v1setjmp, __v2setjmp);
2f438e20
SL
108versioned_symbol (libc, __v1setjmp, setjmp, GLIBC_2_0);
109compat_symbol (libc, __v2setjmp, setjmp, GLIBC_2_19);
110
37d13b17 111strong_alias (__v1_setjmp, __v2_setjmp);
2f438e20
SL
112versioned_symbol (libc, __v1_setjmp, _setjmp, GLIBC_2_0);
113compat_symbol (libc, __v2_setjmp, _setjmp, GLIBC_2_19);
114
115strong_alias (__v1__sigsetjmp, __v2__sigsetjmp);
116versioned_symbol (libc, __v1__sigsetjmp, __sigsetjmp, GLIBC_2_0);
117compat_symbol (libc, __v2__sigsetjmp, __sigsetjmp, GLIBC_2_19);
001f81ad 118#endif /* NEED_COMPAT_SYMBOLS */