]>
Commit | Line | Data |
---|---|---|
a334319f | 1 | /* Copyright (C) 1992, 1994, 1996, 1997, 2002 Free Software Foundation, Inc. |
84384f5b | 2 | This file is part of the GNU C Library. |
28f540f4 | 3 | |
84384f5b | 4 | The GNU C Library is free software; you can redistribute it and/or |
41bdb6e2 AJ |
5 | modify it under the terms of the GNU Lesser General Public |
6 | License as published by the Free Software Foundation; either | |
7 | version 2.1 of the License, or (at your option) any later version. | |
28f540f4 | 8 | |
84384f5b UD |
9 | The GNU C Library is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
41bdb6e2 | 12 | Lesser General Public License for more details. |
28f540f4 | 13 | |
41bdb6e2 AJ |
14 | You should have received a copy of the GNU Lesser General Public |
15 | License along with the GNU C Library; if not, write to the Free | |
16 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | |
17 | 02111-1307 USA. */ | |
28f540f4 | 18 | |
9a0a462c UD |
19 | #define __ASSEMBLY__ |
20 | ||
28f540f4 | 21 | #include <sysdep.h> |
a334319f UD |
22 | #define _ASM |
23 | #define _SETJMP_H | |
24 | #include <bits/setjmp.h> | |
9a0a462c | 25 | |
d9266ea0 UD |
26 | .ent __sigsetjmp |
27 | .global __sigsetjmp | |
9a0a462c | 28 | __sigsetjmp: |
d9266ea0 | 29 | ldgp gp, 0(pv) |
28f540f4 | 30 | |
9a0a462c | 31 | $sigsetjmp_local: |
d9266ea0 UD |
32 | #ifndef PIC |
33 | #define FRAME 16 | |
34 | subq sp, FRAME, sp | |
35 | .frame sp, FRAME, ra, 0 | |
36 | stq ra, 0(sp) | |
37 | .mask 0x04000000, -FRAME | |
38 | #else | |
39 | #define FRAME 0 | |
40 | .frame sp, FRAME, ra, 0 | |
41 | #endif | |
2c6fe0bd | 42 | #ifdef PROF |
84384f5b | 43 | .set noat |
2c6fe0bd UD |
44 | lda AT, _mcount |
45 | jsr AT, (AT), _mcount | |
84384f5b | 46 | .set at |
2c6fe0bd | 47 | #endif |
510ca033 RM |
48 | .prologue 1 |
49 | ||
9a0a462c UD |
50 | stq s0, JB_S0*8(a0) |
51 | stq s1, JB_S1*8(a0) | |
52 | stq s2, JB_S2*8(a0) | |
53 | stq s3, JB_S3*8(a0) | |
54 | stq s4, JB_S4*8(a0) | |
55 | stq s5, JB_S5*8(a0) | |
d9266ea0 UD |
56 | #ifdef PTR_MANGLE |
57 | PTR_MANGLE(t1, ra, t0) | |
58 | stq t1, JB_PC*8(a0) | |
59 | #else | |
9a0a462c | 60 | stq ra, JB_PC*8(a0) |
d9266ea0 UD |
61 | #endif |
62 | #if defined(PTR_MANGLE) && FRAME == 0 | |
63 | PTR_MANGLE2(t1, sp, t0) | |
64 | #else | |
65 | addq sp, FRAME, t1 | |
66 | # ifdef PTR_MANGLE | |
67 | PTR_MANGLE2(t1, t1, t0) | |
68 | # endif | |
69 | #endif | |
70 | stq t1, JB_SP*8(a0) | |
71 | #ifdef PTR_MANGLE | |
72 | PTR_MANGLE2(t1, fp, t0) | |
73 | stq t1, JB_FP*8(a0) | |
74 | #else | |
9a0a462c | 75 | stq fp, JB_FP*8(a0) |
d9266ea0 | 76 | #endif |
9a0a462c UD |
77 | stt $f2, JB_F2*8(a0) |
78 | stt $f3, JB_F3*8(a0) | |
79 | stt $f4, JB_F4*8(a0) | |
80 | stt $f5, JB_F5*8(a0) | |
81 | stt $f6, JB_F6*8(a0) | |
82 | stt $f7, JB_F7*8(a0) | |
83 | stt $f8, JB_F8*8(a0) | |
84 | stt $f9, JB_F9*8(a0) | |
85 | ||
d9266ea0 | 86 | #ifndef PIC |
9a0a462c UD |
87 | /* Call to C to (potentially) save our signal mask. */ |
88 | jsr ra, __sigjmp_save | |
9a0a462c UD |
89 | ldq ra, 0(sp) |
90 | addq sp, 16, sp | |
91 | ret | |
d9266ea0 UD |
92 | #elif defined NOT_IN_libc && defined IS_IN_rtld |
93 | /* In ld.so we never save the signal mask. */ | |
94 | mov 0, v0 | |
95 | ret | |
96 | #else | |
97 | /* Tailcall to save the signal mask. */ | |
98 | br $31, __sigjmp_save !samegp | |
99 | #endif | |
9a0a462c UD |
100 | |
101 | END(__sigsetjmp) | |
102 | ||
103 | /* Put these traditional entry points in the same file so that we can | |
104 | elide much of the nonsense in trying to jmp to the real function. */ | |
105 | ||
57c2def9 | 106 | ENTRY(_setjmp) |
9a0a462c | 107 | ldgp gp, 0(pv) |
160b780a | 108 | .prologue 1 |
9a0a462c UD |
109 | mov 0, a1 |
110 | br $sigsetjmp_local | |
57c2def9 | 111 | END(_setjmp) |
a4baf360 | 112 | libc_hidden_def (_setjmp) |
9a0a462c UD |
113 | |
114 | ENTRY(setjmp) | |
115 | ldgp gp, 0(pv) | |
160b780a | 116 | .prologue 1 |
9a0a462c UD |
117 | mov 1, a1 |
118 | br $sigsetjmp_local | |
119 | END(setjmp) | |
510ca033 | 120 | |
57c2def9 | 121 | weak_extern(_setjmp) |
9a0a462c | 122 | weak_extern(setjmp) |