]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/sh/sh4/setjmp.S
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / sysdeps / sh / sh4 / setjmp.S
CommitLineData
3846ef75 1/* setjmp for SH4.
d614a753 2 Copyright (C) 1999-2020 Free Software Foundation, Inc.
3846ef75
UD
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
41bdb6e2
AJ
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
3846ef75
UD
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41bdb6e2 13 Lesser General Public License for more details.
3846ef75 14
41bdb6e2 15 You should have received a copy of the GNU Lesser General Public
59ba27a6 16 License along with the GNU C Library; if not, see
5a82c748 17 <https://www.gnu.org/licenses/>. */
3846ef75
UD
18
19#include <sysdep.h>
a7140723 20#include <jmpbuf-offsets.h>
3846ef75 21
3846ef75
UD
22ENTRY (__sigsetjmp)
23 /* Save registers */
0899b889 24#ifdef __SH_FPU_ANY__
debafa10 25 add #JB_SIZE, r4
3846ef75
UD
26 fmov.s fr15, @-r4
27 fmov.s fr14, @-r4
28 fmov.s fr13, @-r4
29 fmov.s fr12, @-r4
30 sts.l fpscr, @-r4
debafa10
UD
31#else
32 add #(JB_SIZE - 4 * 5), r4
0899b889 33#endif /* __SH_FPU_ANY__ */
3846ef75 34 stc.l gbr, @-r4
d9038ff8
UD
35#ifdef PTR_MANGLE
36 sts pr, r2
a6df7387 37 PTR_MANGLE (r2, r1)
d9038ff8 38 mov.l r2, @-r4
a6df7387
UD
39 mov r15, r2
40 PTR_MANGLE2 (r2, r1)
41 mov.l r2, @-r4
42 mov r14, r2
43 PTR_MANGLE2 (r2, r1)
44 mov.l r2, @-r4
45 mov #0, r1
d9038ff8 46#else
3846ef75
UD
47 sts.l pr, @-r4
48 mov.l r15, @-r4
49 mov.l r14, @-r4
a6df7387 50#endif
3846ef75
UD
51 mov.l r13, @-r4
52 mov.l r12, @-r4
53 mov.l r11, @-r4
54 mov.l r10, @-r4
55 mov.l r9, @-r4
56 mov.l r8, @-r4
57
a3848485 58#if IS_IN (rtld)
d9038ff8
UD
59 /* In ld.so we never save the signal mask. */
60 rts
61 mov #0, r0
62#else
3846ef75 63 /* Make a tail call to __sigjmp_save; it takes the same args. */
d9038ff8 64# ifdef SHARED
3846ef75
UD
65 mov.l 1f, r1
66 mova 1f, r0
67 bra 2f
68 add r1, r0
69 .align 2
701:
71 .long _GLOBAL_OFFSET_TABLE_
722:
73 mov.l .L1, r1
74 mov.l @(r0,r1), r1
75 jmp @r1
76 nop
77 .align 2
78.L1:
79 .long C_SYMBOL_NAME(__sigjmp_save@GOT)
d9038ff8 80# else
3846ef75
UD
81 mov.l .L1, r1
82 jmp @r1
83 nop
84 .align 2
85.L1:
86 .long C_SYMBOL_NAME(__sigjmp_save)
d9038ff8 87# endif
3846ef75 88#endif
57c2def9 89END (__sigsetjmp)
2314a29b 90hidden_def (__sigsetjmp)