]>
Commit | Line | Data |
---|---|---|
9a0a462c | 1 | /* Copyright (C) 1992, 1994, 1996, 1997 Free Software Foundation, Inc. |
84384f5b | 2 | This file is part of the GNU C Library. |
28f540f4 | 3 | |
84384f5b UD |
4 | The GNU C Library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Library General Public License as | |
6 | published by the Free Software Foundation; either version 2 of the | |
7 | 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 | |
12 | Library General Public License for more details. | |
28f540f4 | 13 | |
84384f5b UD |
14 | You should have received a copy of the GNU Library General Public |
15 | License along with the GNU C Library; see the file COPYING.LIB. If not, | |
16 | write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
17 | Boston, MA 02111-1307, USA. */ | |
28f540f4 | 18 | |
9a0a462c UD |
19 | #define __ASSEMBLY__ |
20 | ||
28f540f4 | 21 | #include <sysdep.h> |
04be94a8 UD |
22 | #define _ASM |
23 | #define _SETJMP_H | |
9a0a462c UD |
24 | #include <bits/setjmp.h> |
25 | ||
26 | .ent __sigsetjmp | |
27 | .global __sigsetjmp | |
28 | __sigsetjmp: | |
29 | ldgp gp, 0(pv) | |
28f540f4 | 30 | |
9a0a462c UD |
31 | $sigsetjmp_local: |
32 | subq sp, 16, sp | |
33 | .frame sp, 16, ra, 0 | |
34 | stq ra, 0(sp) | |
35 | .mask 0x04000000, -16 | |
2c6fe0bd | 36 | #ifdef PROF |
84384f5b | 37 | .set noat |
2c6fe0bd UD |
38 | lda AT, _mcount |
39 | jsr AT, (AT), _mcount | |
84384f5b | 40 | .set at |
2c6fe0bd | 41 | #endif |
510ca033 RM |
42 | .prologue 1 |
43 | ||
9a0a462c UD |
44 | stq s0, JB_S0*8(a0) |
45 | stq s1, JB_S1*8(a0) | |
46 | stq s2, JB_S2*8(a0) | |
47 | stq s3, JB_S3*8(a0) | |
48 | stq s4, JB_S4*8(a0) | |
49 | stq s5, JB_S5*8(a0) | |
50 | stq ra, JB_PC*8(a0) | |
51 | addq sp, 16, t0 | |
52 | stq fp, JB_FP*8(a0) | |
53 | stq t0, JB_SP*8(a0) | |
54 | stt $f2, JB_F2*8(a0) | |
55 | stt $f3, JB_F3*8(a0) | |
56 | stt $f4, JB_F4*8(a0) | |
57 | stt $f5, JB_F5*8(a0) | |
58 | stt $f6, JB_F6*8(a0) | |
59 | stt $f7, JB_F7*8(a0) | |
60 | stt $f8, JB_F8*8(a0) | |
61 | stt $f9, JB_F9*8(a0) | |
62 | ||
63 | /* Call to C to (potentially) save our signal mask. */ | |
64 | jsr ra, __sigjmp_save | |
65 | ||
66 | ldq ra, 0(sp) | |
67 | addq sp, 16, sp | |
68 | ret | |
69 | ||
70 | END(__sigsetjmp) | |
71 | ||
72 | /* Put these traditional entry points in the same file so that we can | |
73 | elide much of the nonsense in trying to jmp to the real function. */ | |
74 | ||
dfd2257a | 75 | ENTRY(__setjmp) |
9a0a462c UD |
76 | ldgp gp, 0(pv) |
77 | mov 0, a1 | |
78 | br $sigsetjmp_local | |
dfd2257a | 79 | END(__setjmp) |
9a0a462c UD |
80 | |
81 | ENTRY(setjmp) | |
82 | ldgp gp, 0(pv) | |
83 | mov 1, a1 | |
84 | br $sigsetjmp_local | |
85 | END(setjmp) | |
510ca033 | 86 | |
dfd2257a | 87 | weak_alias(__setjmp, _setjmp) |
9a0a462c | 88 | weak_extern(setjmp) |