blob: 05d0e25672bacfc1cd95f786b28fcf64d32e06b0 [file] [log] [blame]
Raghu Gandham405b8022012-07-25 18:16:42 -07001/*
2 * Copyright (c) 2001-2002 Opsycon AB (www.opsycon.se / www.opsycon.com)
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * 3. Neither the name of Opsycon AB nor the names of its contributors
13 * may be used to endorse or promote products derived from this software
14 * without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
17 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 */
Elliott Hughesd27ae2f2014-12-08 17:01:11 -080029/*-
30 * Copyright (c) 1991, 1993, 1995,
31 * The Regents of the University of California. All rights reserved.
32 *
33 * This code is derived from software contributed to Berkeley by
34 * Havard Eidnes.
35 *
36 * Redistribution and use in source and binary forms, with or without
37 * modification, are permitted provided that the following conditions
38 * are met:
39 * 1. Redistributions of source code must retain the above copyright
40 * notice, this list of conditions and the following disclaimer.
41 * 2. Redistributions in binary form must reproduce the above copyright
42 * notice, this list of conditions and the following disclaimer in the
43 * documentation and/or other materials provided with the distribution.
44 * 3. Neither the name of the University nor the names of its contributors
45 * may be used to endorse or promote products derived from this software
46 * without specific prior written permission.
47 *
48 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
49 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
50 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
51 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
52 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
53 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
54 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
55 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
58 * SUCH DAMAGE.
59 */
60/*
61 * Copyright (c) 1992, 1993
62 * The Regents of the University of California. All rights reserved.
63 *
64 * This code is derived from software contributed to Berkeley by
65 * Ralph Campbell.
66 *
67 * Redistribution and use in source and binary forms, with or without
68 * modification, are permitted provided that the following conditions
69 * are met:
70 * 1. Redistributions of source code must retain the above copyright
71 * notice, this list of conditions and the following disclaimer.
72 * 2. Redistributions in binary form must reproduce the above copyright
73 * notice, this list of conditions and the following disclaimer in the
74 * documentation and/or other materials provided with the distribution.
75 * 3. Neither the name of the University nor the names of its contributors
76 * may be used to endorse or promote products derived from this software
77 * without specific prior written permission.
78 *
79 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
80 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
81 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
82 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
83 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
84 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
85 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
86 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
87 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
88 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
89 * SUCH DAMAGE.
90 *
91 * @(#)signal.h 8.1 (Berkeley) 6/10/93
92 */
Raghu Gandham405b8022012-07-25 18:16:42 -070093
Elliott Hughes851e68a2014-02-19 16:53:20 -080094#include <private/bionic_asm.h>
Elliott Hughesd27ae2f2014-12-08 17:01:11 -080095#include <machine/setjmp.h>
96
97/* On Mips32, jmpbuf begins with optional 4-byte filler so that
98 * all saved FP regs are aligned on 8-byte boundary, despite this whole
99 * struct being mis-declared to users as an array of (4-byte) longs.
100 * All the following offsets are then from the rounded-up base addr
101 */
102
103/* Fields of same size on all MIPS abis: */
104#define SC_MAGIC (0*4) /* 4 bytes, identify jmpbuf */
105#define SC_MASK (1*4) /* 4 bytes, saved signal mask */
106#define SC_FPSR (2*4) /* 4 bytes, floating point control/status reg */
107/* filler2 (3*4) 4 bytes, pad to 8-byte boundary */
108
109/* Registers that are 4-byte on mips32 o32, and 8-byte on mips64 n64 abi */
110#define SC_REGS_SAVED 12 /* ra,gp,sp,s0-s8 */
111#define SC_REGS (4*4) /* SC_REGS_SAVED*REGSZ bytes */
112
113/* Floating pt registers are 8-bytes on all abis,
114 * but the number of saved fp regs varies for o32/n32 versus n64 abis:
115 */
116
117#ifdef __LP64__
118#define SC_FPREGS_SAVED 8 /* all fp regs f24,f25,f26,f27,f28,f29,f30,f31 */
119#else
120#define SC_FPREGS_SAVED 6 /* even fp regs f20,f22,f24,f26,f28,f30 */
121#endif
122
123#define SC_FPREGS (SC_REGS + SC_REGS_SAVED*REGSZ) /* SC_FPREGS_SAVED*REGSZ_FP bytes */
124
125#define SC_BYTES (SC_FPREGS + SC_FPREGS_SAVED*REGSZ_FP)
126#define SC_LONGS (SC_BYTES/REGSZ)
127
128#ifdef __LP64__
129/* SC_LONGS is 22, so _JBLEN should be 22 or larger */
130#else
131/* SC_LONGS is 28, but must also allocate dynamic-roundup filler.
132 so _JBLEN should be 29 or larger */
133#endif
Raghu Gandham405b8022012-07-25 18:16:42 -0700134
135/*
Duane Sand3a478632014-11-25 17:33:10 -0800136 * _setjmp, _longjmp (restoring signal state)
137 *
138 * GPOFF and FRAMESIZE must be the same for both _setjmp and _longjmp!
Raghu Gandham405b8022012-07-25 18:16:42 -0700139 *
140 */
141
142FRAMESZ= MKFSIZ(2,6)
143A1OFF= FRAMESZ-4*REGSZ
144A0OFF= FRAMESZ-3*REGSZ
145GPOFF= FRAMESZ-2*REGSZ
146RAOFF= FRAMESZ-1*REGSZ
147
Raghu Gandham405b8022012-07-25 18:16:42 -0700148NON_LEAF(setjmp, FRAMESZ, ra)
149 .mask 0x80000000, RAOFF
150 PTR_SUBU sp, FRAMESZ # allocate stack frame
151 SETUP_GP64(GPOFF, setjmp)
152 SAVE_GP(GPOFF)
153 .set reorder
Duane Sand3a478632014-11-25 17:33:10 -0800154
155#ifndef __LP64__
156 addiu a0, 7 # roundup jmpbuf addr to 8-byte boundary
157 li t0, ~7
158 and a0, t0
159#endif
160
Raghu Gandham405b8022012-07-25 18:16:42 -0700161 REG_S ra, RAOFF(sp) # save state
162 REG_S a0, A0OFF(sp)
Raghu Gandham405b8022012-07-25 18:16:42 -0700163 move a0, zero # get current signal mask
164 jal sigblock
Duane Sand3a478632014-11-25 17:33:10 -0800165 REG_L a0, A0OFF(sp)
Raghu Gandham405b8022012-07-25 18:16:42 -0700166 REG_L ra, RAOFF(sp)
Raghu Gandham405b8022012-07-25 18:16:42 -0700167
Duane Sand3a478632014-11-25 17:33:10 -0800168 REG_S v0, SC_MASK(a0) # save sc_mask = sigblock(0)
169
170 li v0, 0xACEDBADE # sigcontext magic number
171 sw v0, SC_MAGIC(a0)
172 # callee-saved long-sized regs:
173 REG_S ra, SC_REGS+0*REGSZ(a0)
174 REG_S s0, SC_REGS+1*REGSZ(a0)
175 REG_S s1, SC_REGS+2*REGSZ(a0)
176 REG_S s2, SC_REGS+3*REGSZ(a0)
177 REG_S s3, SC_REGS+4*REGSZ(a0)
178 REG_S s4, SC_REGS+5*REGSZ(a0)
179 REG_S s5, SC_REGS+6*REGSZ(a0)
180 REG_S s6, SC_REGS+7*REGSZ(a0)
181 REG_S s7, SC_REGS+8*REGSZ(a0)
182 REG_S s8, SC_REGS+9*REGSZ(a0)
183 REG_L v0, GPOFF(sp)
184 REG_S v0, SC_REGS+10*REGSZ(a0)
185 PTR_ADDU v0, sp, FRAMESZ
186 REG_S v0, SC_REGS+11*REGSZ(a0)
187
Raghu Gandham405b8022012-07-25 18:16:42 -0700188 cfc1 v0, $31
Duane Sand3a478632014-11-25 17:33:10 -0800189
190#ifdef __LP64__
191 # callee-saved fp regs on mips n64 ABI are $f24..$f31
192 s.d $f24, SC_FPREGS+0*REGSZ_FP(a0)
193 s.d $f25, SC_FPREGS+1*REGSZ_FP(a0)
194 s.d $f26, SC_FPREGS+2*REGSZ_FP(a0)
195 s.d $f27, SC_FPREGS+3*REGSZ_FP(a0)
196 s.d $f28, SC_FPREGS+4*REGSZ_FP(a0)
197 s.d $f29, SC_FPREGS+5*REGSZ_FP(a0)
198 s.d $f30, SC_FPREGS+6*REGSZ_FP(a0)
199 s.d $f31, SC_FPREGS+7*REGSZ_FP(a0)
200#else
201 # callee-saved fp regs on mips o32 ABI are
202 # the even-numbered fp regs $f20,$f22,...$f30
203 s.d $f20, SC_FPREGS+0*REGSZ_FP(a0)
204 s.d $f22, SC_FPREGS+1*REGSZ_FP(a0)
205 s.d $f24, SC_FPREGS+2*REGSZ_FP(a0)
206 s.d $f26, SC_FPREGS+3*REGSZ_FP(a0)
207 s.d $f28, SC_FPREGS+4*REGSZ_FP(a0)
208 s.d $f30, SC_FPREGS+5*REGSZ_FP(a0)
Raghu Gandham405b8022012-07-25 18:16:42 -0700209#endif
Duane Sand3a478632014-11-25 17:33:10 -0800210 sw v0, SC_FPSR(a0)
Raghu Gandham405b8022012-07-25 18:16:42 -0700211 move v0, zero
212 RESTORE_GP64
213 PTR_ADDU sp, FRAMESZ
214 j ra
Duane Sand3a478632014-11-25 17:33:10 -0800215END(setjmp)
216
Duane Sand3a478632014-11-25 17:33:10 -0800217NON_LEAF(longjmp, FRAMESZ, ra)
218 .mask 0x80000000, RAOFF
219 PTR_SUBU sp, FRAMESZ
220 SETUP_GP64(GPOFF, longjmp)
221 SAVE_GP(GPOFF)
222 .set reorder
223
224#ifndef __LP64__
225 addiu a0, 7 # roundup jmpbuf addr to 8-byte boundary
226 li t0, ~7
227 and a0, t0
228#endif
229
230 REG_S a1, A1OFF(sp)
231 REG_S a0, A0OFF(sp)
232 lw a0, SC_MASK(a0)
233 jal sigsetmask
234 REG_L a0, A0OFF(sp)
235 REG_L a1, A1OFF(sp)
236
237 lw v0, SC_MAGIC(a0)
238 li t0, 0xACEDBADE
Elliott Hughesd27ae2f2014-12-08 17:01:11 -0800239 bne v0, t0, longjmp_botch # jump if error
Duane Sand3a478632014-11-25 17:33:10 -0800240
241 # callee-saved long-sized regs:
242 REG_L ra, SC_REGS+0*REGSZ(a0)
243 REG_L s0, SC_REGS+1*REGSZ(a0)
244 REG_L s1, SC_REGS+2*REGSZ(a0)
245 REG_L s2, SC_REGS+3*REGSZ(a0)
246 REG_L s3, SC_REGS+4*REGSZ(a0)
247 REG_L s4, SC_REGS+5*REGSZ(a0)
248 REG_L s5, SC_REGS+6*REGSZ(a0)
249 REG_L s6, SC_REGS+7*REGSZ(a0)
250 REG_L s7, SC_REGS+8*REGSZ(a0)
251 REG_L s8, SC_REGS+9*REGSZ(a0)
252 REG_L gp, SC_REGS+10*REGSZ(a0)
253 REG_L sp, SC_REGS+11*REGSZ(a0)
254
255 lw v0, SC_FPSR(a0)
256 ctc1 v0, $31
257#ifdef __LP64__
258 # callee-saved fp regs on mips n64 ABI are $f24..$f31
259 l.d $f24, SC_FPREGS+0*REGSZ_FP(a0)
260 l.d $f25, SC_FPREGS+1*REGSZ_FP(a0)
261 l.d $f26, SC_FPREGS+2*REGSZ_FP(a0)
262 l.d $f27, SC_FPREGS+3*REGSZ_FP(a0)
263 l.d $f28, SC_FPREGS+4*REGSZ_FP(a0)
264 l.d $f29, SC_FPREGS+5*REGSZ_FP(a0)
265 l.d $f30, SC_FPREGS+6*REGSZ_FP(a0)
266 l.d $f31, SC_FPREGS+7*REGSZ_FP(a0)
267#else
268 # callee-saved fp regs on mips o32 ABI are
269 # the even-numbered fp regs $f20,$f22,...$f30
270 l.d $f20, SC_FPREGS+0*REGSZ_FP(a0)
271 l.d $f22, SC_FPREGS+1*REGSZ_FP(a0)
272 l.d $f24, SC_FPREGS+2*REGSZ_FP(a0)
273 l.d $f26, SC_FPREGS+3*REGSZ_FP(a0)
274 l.d $f28, SC_FPREGS+4*REGSZ_FP(a0)
275 l.d $f30, SC_FPREGS+5*REGSZ_FP(a0)
276#endif
277 bne a1, zero, 1f
278 li a1, 1 # never return 0!
2791:
280 move v0, a1
281 j ra
Raghu Gandham405b8022012-07-25 18:16:42 -0700282
Elliott Hughesd27ae2f2014-12-08 17:01:11 -0800283longjmp_botch:
Raghu Gandham405b8022012-07-25 18:16:42 -0700284 jal longjmperror
285 jal abort
286 RESTORE_GP64
287 PTR_ADDU sp, FRAMESZ
Raghu Gandham405b8022012-07-25 18:16:42 -0700288END(longjmp)
Elliott Hughesd27ae2f2014-12-08 17:01:11 -0800289
290
291/*
292 * _setjmp, _longjmp (not restoring signal state)
293 *
294 * GPOFF and FRAMESIZE must be the same for both _setjmp and _longjmp!
295 *
296 */
297
298FRAMESZ= MKFSIZ(0,4)
299GPOFF= FRAMESZ-2*REGSZ
300
301LEAF(_setjmp, FRAMESZ)
302 PTR_SUBU sp, FRAMESZ
303 SETUP_GP64(GPOFF, _setjmp)
304 SAVE_GP(GPOFF)
305 .set reorder
306
307#ifndef __LP64__
308 addiu a0, 7 # roundup jmpbuf addr to 8-byte boundary
309 li t0, ~7
310 and a0, t0
311#endif
312
313 # SC_MASK is unused here
314
315 li v0, 0xACEDBADE # sigcontext magic number
316 sw v0, SC_MAGIC(a0)
317 # callee-saved long-sized regs:
318 REG_S ra, SC_REGS+0*REGSZ(a0)
319 REG_S s0, SC_REGS+1*REGSZ(a0)
320 REG_S s1, SC_REGS+2*REGSZ(a0)
321 REG_S s2, SC_REGS+3*REGSZ(a0)
322 REG_S s3, SC_REGS+4*REGSZ(a0)
323 REG_S s4, SC_REGS+5*REGSZ(a0)
324 REG_S s5, SC_REGS+6*REGSZ(a0)
325 REG_S s6, SC_REGS+7*REGSZ(a0)
326 REG_S s7, SC_REGS+8*REGSZ(a0)
327 REG_S s8, SC_REGS+9*REGSZ(a0)
328 REG_L v0, GPOFF(sp)
329 REG_S v0, SC_REGS+10*REGSZ(a0)
330 PTR_ADDU v0, sp, FRAMESZ
331 REG_S v0, SC_REGS+11*REGSZ(a0)
332
333 cfc1 v0, $31
334
335#ifdef __LP64__
336 # callee-saved fp regs on mips n64 ABI are $f24..$f31
337 s.d $f24, SC_FPREGS+0*REGSZ_FP(a0)
338 s.d $f25, SC_FPREGS+1*REGSZ_FP(a0)
339 s.d $f26, SC_FPREGS+2*REGSZ_FP(a0)
340 s.d $f27, SC_FPREGS+3*REGSZ_FP(a0)
341 s.d $f28, SC_FPREGS+4*REGSZ_FP(a0)
342 s.d $f29, SC_FPREGS+5*REGSZ_FP(a0)
343 s.d $f30, SC_FPREGS+6*REGSZ_FP(a0)
344 s.d $f31, SC_FPREGS+7*REGSZ_FP(a0)
345#else
346 # callee-saved fp regs on mips o32 ABI are
347 # the even-numbered fp regs $f20,$f22,...$f30
348 s.d $f20, SC_FPREGS+0*REGSZ_FP(a0)
349 s.d $f22, SC_FPREGS+1*REGSZ_FP(a0)
350 s.d $f24, SC_FPREGS+2*REGSZ_FP(a0)
351 s.d $f26, SC_FPREGS+3*REGSZ_FP(a0)
352 s.d $f28, SC_FPREGS+4*REGSZ_FP(a0)
353 s.d $f30, SC_FPREGS+5*REGSZ_FP(a0)
354#endif
355 sw v0, SC_FPSR(a0)
356 move v0, zero
357 RESTORE_GP64
358 PTR_ADDU sp, FRAMESZ
359 j ra
360END(_setjmp)
361
362
363LEAF(_longjmp, FRAMESZ)
364 PTR_SUBU sp, FRAMESZ
365 SETUP_GP64(GPOFF, _longjmp)
366 SAVE_GP(GPOFF)
367 .set reorder
368
369#ifndef __LP64__
370 addiu a0, 7 # roundup jmpbuf addr to 8-byte boundary
371 li t0, ~7
372 and a0, t0
373#endif
374
375 # SC_MASK is unused here
376
377 lw v0, SC_MAGIC(a0)
378 li t0, 0xACEDBADE
379 bne v0, t0, _longjmp_botch # jump if error
380
381 # callee-saved long-sized regs:
382 REG_L ra, SC_REGS+0*REGSZ(a0)
383 REG_L s0, SC_REGS+1*REGSZ(a0)
384 REG_L s1, SC_REGS+2*REGSZ(a0)
385 REG_L s2, SC_REGS+3*REGSZ(a0)
386 REG_L s3, SC_REGS+4*REGSZ(a0)
387 REG_L s4, SC_REGS+5*REGSZ(a0)
388 REG_L s5, SC_REGS+6*REGSZ(a0)
389 REG_L s6, SC_REGS+7*REGSZ(a0)
390 REG_L s7, SC_REGS+8*REGSZ(a0)
391 REG_L s8, SC_REGS+9*REGSZ(a0)
392 REG_L gp, SC_REGS+10*REGSZ(a0)
393 REG_L sp, SC_REGS+11*REGSZ(a0)
394
395 lw v0, SC_FPSR(a0)
396 ctc1 v0, $31
397#ifdef __LP64__
398 # callee-saved fp regs on mips n64 ABI are $f24..$f31
399 l.d $f24, SC_FPREGS+0*REGSZ_FP(a0)
400 l.d $f25, SC_FPREGS+1*REGSZ_FP(a0)
401 l.d $f26, SC_FPREGS+2*REGSZ_FP(a0)
402 l.d $f27, SC_FPREGS+3*REGSZ_FP(a0)
403 l.d $f28, SC_FPREGS+4*REGSZ_FP(a0)
404 l.d $f29, SC_FPREGS+5*REGSZ_FP(a0)
405 l.d $f30, SC_FPREGS+6*REGSZ_FP(a0)
406 l.d $f31, SC_FPREGS+7*REGSZ_FP(a0)
407#else
408 # callee-saved fp regs on mips o32 ABI are
409 # the even-numbered fp regs $f20,$f22,...$f30
410 l.d $f20, SC_FPREGS+0*REGSZ_FP(a0)
411 l.d $f22, SC_FPREGS+1*REGSZ_FP(a0)
412 l.d $f24, SC_FPREGS+2*REGSZ_FP(a0)
413 l.d $f26, SC_FPREGS+3*REGSZ_FP(a0)
414 l.d $f28, SC_FPREGS+4*REGSZ_FP(a0)
415 l.d $f30, SC_FPREGS+5*REGSZ_FP(a0)
416#endif
417 bne a1, zero, 1f
418 li a1, 1 # never return 0!
4191:
420 move v0, a1
421 j ra
422
423_longjmp_botch:
424 jal longjmperror
425 jal abort
426 RESTORE_GP64
427 PTR_ADDU sp, FRAMESZ
428END(_longjmp)
429
430/*
431 * trampolines for sigsetjmp and siglongjmp save and restore mask.
432 *
433 */
434FRAMESZ= MKFSIZ(1,1)
435GPOFF= FRAMESZ-2*REGSZ
436
437LEAF(sigsetjmp, FRAMESZ)
438 PTR_SUBU sp, FRAMESZ
439 SETUP_GP64(GPOFF, sigsetjmp)
440 .set reorder
441 sw a1, _JBLEN*REGSZ(a0) # save "savemask"
442 bne a1, 0x0, 1f # do saving of signal mask?
443 LA t9, _setjmp
444 RESTORE_GP64
445 PTR_ADDU sp, FRAMESZ
446 jr t9
447
4481: LA t9, setjmp
449 RESTORE_GP64
450 PTR_ADDU sp, FRAMESZ
451 jr t9
452END(sigsetjmp)
453
454LEAF(siglongjmp, FRAMESZ)
455 PTR_SUBU sp, FRAMESZ
456 SETUP_GP64(GPOFF, siglongjmp)
457 .set reorder
458 lw t0, _JBLEN*REGSZ(a0) # get "savemask"
459 bne t0, 0x0, 1f # restore signal mask?
460 LA t9, _longjmp
461 RESTORE_GP64
462 PTR_ADDU sp, FRAMESZ
463 jr t9
4641:
465 LA t9, longjmp
466 RESTORE_GP64
467 PTR_ADDU sp, FRAMESZ
468 jr t9
469END(siglongjmp)