Updated to fedora-glibc-20051220T1751
[glibc.git] / sysdeps / sh / sh3 / setjmp.S
blobf60ca874cf2a778be1eec17f73a085c930490e2f
1 /* setjmp for SH3.
2    Copyright (C) 1999, 2000, 2005 Free Software Foundation, Inc.
3    This file is part of the GNU C Library.
5    The GNU C Library is free software; you can redistribute it and/or
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.
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
13    Lesser General Public License for more details.
15    You should have received a copy of the GNU Lesser General Public
16    License along with the GNU C Library; if not, write to the Free
17    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18    02111-1307 USA.  */
20 #include <sysdep.h>
21 #define _SETJMP_H
22 #define _ASM
23 #include <bits/setjmp.h>
25 ENTRY (__sigsetjmp)
26         /* Save registers */
27         add     #(JB_SIZE - 4 * 5), r4
28         stc.l   gbr, @-r4
29 #ifdef PTR_MANGLE
30         sts     pr, r2
31         PTR_MANGLE (r2)
32         mov.l   r2, @-r4
33 #else
34         sts.l   pr, @-r4
35 #endif
36         mov.l   r15, @-r4
37         mov.l   r14, @-r4
38         mov.l   r13, @-r4
39         mov.l   r12, @-r4
40         mov.l   r11, @-r4
41         mov.l   r10, @-r4
42         mov.l   r9, @-r4
43         mov.l   r8, @-r4
45 #if defined NOT_IN_libc && defined IS_IN_rtld
46         /* In ld.so we never save the signal mask.  */
47         rts
48          mov    #0, r0
49 #else
50         /* Make a tail call to __sigjmp_save; it takes the same args.  */
51 # ifdef SHARED
52         mov.l   1f, r1
53         mova    1f, r0
54         bra     2f
55          add    r1, r0
56         .align  2
58         .long   _GLOBAL_OFFSET_TABLE_
60         mov.l   .L1, r1
61         mov.l   @(r0,r1), r1
62         jmp     @r1
63          nop
64         .align  2
65 .L1:
66         .long   C_SYMBOL_NAME(__sigjmp_save@GOT)
67 # else
68         mov.l   .L1, r1
69         jmp     @r1
70          nop
71         .align  2
72 .L1:
73         .long   C_SYMBOL_NAME(__sigjmp_save)
74 # endif
75 #endif
76 END (__sigsetjmp)