blob: 3ef0f1129fc3e3b6dffc5f7a5073c54b1c87314f [file] [log] [blame]
Raghu Gandham405b8022012-07-25 18:16:42 -07001/*
Elliott Hughesdd570292015-05-12 10:10:01 -07002 * Copyright (C) 2014 The Android Open Source Project
Duane Sandb6d301f2015-01-26 14:48:48 -08003 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in
12 * the documentation and/or other materials provided with the
13 * distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
18 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
19 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
22 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 */
28/*
Raghu Gandham405b8022012-07-25 18:16:42 -070029 * Copyright (c) 2001-2002 Opsycon AB (www.opsycon.se / www.opsycon.com)
30 *
31 * Redistribution and use in source and binary forms, with or without
32 * modification, are permitted provided that the following conditions
33 * are met:
34 * 1. Redistributions of source code must retain the above copyright
35 * notice, this list of conditions and the following disclaimer.
36 * 2. Redistributions in binary form must reproduce the above copyright
37 * notice, this list of conditions and the following disclaimer in the
38 * documentation and/or other materials provided with the distribution.
39 * 3. Neither the name of Opsycon AB nor the names of its contributors
40 * may be used to endorse or promote products derived from this software
41 * without specific prior written permission.
42 *
43 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
44 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
45 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
46 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
47 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
48 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
49 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
50 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
51 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
52 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
53 * SUCH DAMAGE.
54 *
55 */
Elliott Hughesd27ae2f2014-12-08 17:01:11 -080056/*-
57 * Copyright (c) 1991, 1993, 1995,
58 * The Regents of the University of California. All rights reserved.
59 *
60 * This code is derived from software contributed to Berkeley by
61 * Havard Eidnes.
62 *
63 * Redistribution and use in source and binary forms, with or without
64 * modification, are permitted provided that the following conditions
65 * are met:
66 * 1. Redistributions of source code must retain the above copyright
67 * notice, this list of conditions and the following disclaimer.
68 * 2. Redistributions in binary form must reproduce the above copyright
69 * notice, this list of conditions and the following disclaimer in the
70 * documentation and/or other materials provided with the distribution.
71 * 3. Neither the name of the University nor the names of its contributors
72 * may be used to endorse or promote products derived from this software
73 * without specific prior written permission.
74 *
75 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
76 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
77 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
78 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
79 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
80 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
81 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
82 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
83 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
84 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
85 * SUCH DAMAGE.
86 */
87/*
88 * Copyright (c) 1992, 1993
89 * The Regents of the University of California. All rights reserved.
90 *
91 * This code is derived from software contributed to Berkeley by
92 * Ralph Campbell.
93 *
94 * Redistribution and use in source and binary forms, with or without
95 * modification, are permitted provided that the following conditions
96 * are met:
97 * 1. Redistributions of source code must retain the above copyright
98 * notice, this list of conditions and the following disclaimer.
99 * 2. Redistributions in binary form must reproduce the above copyright
100 * notice, this list of conditions and the following disclaimer in the
101 * documentation and/or other materials provided with the distribution.
102 * 3. Neither the name of the University nor the names of its contributors
103 * may be used to endorse or promote products derived from this software
104 * without specific prior written permission.
105 *
106 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
107 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
108 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
109 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
110 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
111 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
112 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
113 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
114 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
115 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
116 * SUCH DAMAGE.
117 *
118 * @(#)signal.h 8.1 (Berkeley) 6/10/93
119 */
Raghu Gandham405b8022012-07-25 18:16:42 -0700120
Elliott Hughes851e68a2014-02-19 16:53:20 -0800121#include <private/bionic_asm.h>
Elliott Hughesd27ae2f2014-12-08 17:01:11 -0800122#include <machine/setjmp.h>
123
Duane Sandb6d301f2015-01-26 14:48:48 -0800124/* jmpbuf is declared to users as an array of longs, which is only
125 * 4-byte aligned in 32-bit builds. The Mips jmpbuf begins with a
126 * dynamically-sized 0- or 4-byte unused filler so that double-prec FP regs
127 * are saved to 8-byte-aligned mem cells.
128 * All the following jmpbuf offsets are from the rounded-DOWN base addr.
Elliott Hughesd27ae2f2014-12-08 17:01:11 -0800129 */
130
131/* Fields of same size on all MIPS abis: */
Duane Sandb6d301f2015-01-26 14:48:48 -0800132/* field: byte offset: size: */
133/* dynam filler (0*4) 0-4 bytes of rounddown filler, DON'T TOUCH!!
134 often overlays user storage!! */
135#define SC_MAGIC_OFFSET (1*4) /* 4 bytes, identify jmpbuf, first actual field */
136#define SC_FLAG_OFFSET (2*4) /* 4 bytes, savesigs flag */
137#define SC_FPSR_OFFSET (3*4) /* 4 bytes, floating point control/status reg */
138/* following fields are 8-byte aligned */
139#define SC_MASK_OFFSET (4*4) /* 16 bytes, mips32/mips64 version of sigset_t */
140#define SC_SPARE_OFFSET (8*4) /* 8 bytes, reserved for future uses */
Elliott Hughesd27ae2f2014-12-08 17:01:11 -0800141
142/* Registers that are 4-byte on mips32 o32, and 8-byte on mips64 n64 abi */
Duane Sandb6d301f2015-01-26 14:48:48 -0800143#define SC_REGS_OFFSET (10*4) /* SC_REGS_BYTES */
144#define SC_REGS_SAVED 12 /*regs*/ /* ra,s0-s8,gp,sp */
145#define SC_REGS_BYTES (SC_REGS_SAVED*REGSZ)
146#define SC_REGS SC_REGS_OFFSET
Elliott Hughesd27ae2f2014-12-08 17:01:11 -0800147
Duane Sandb6d301f2015-01-26 14:48:48 -0800148/* Double floating pt registers are 8-bytes on all abis,
Elliott Hughesd27ae2f2014-12-08 17:01:11 -0800149 * but the number of saved fp regs varies for o32/n32 versus n64 abis:
150 */
151
152#ifdef __LP64__
153#define SC_FPREGS_SAVED 8 /* all fp regs f24,f25,f26,f27,f28,f29,f30,f31 */
154#else
155#define SC_FPREGS_SAVED 6 /* even fp regs f20,f22,f24,f26,f28,f30 */
156#endif
157
Duane Sandb6d301f2015-01-26 14:48:48 -0800158#define SC_FPREGS_OFFSET (SC_REGS_OFFSET + SC_REGS_BYTES) /* SC_FPREGS_BYTES */
159#define SC_FPREGS_BYTES (SC_FPREGS_SAVED*REGSZ_FP)
160#define SC_FPREGS SC_FPREGS_OFFSET
Elliott Hughesd27ae2f2014-12-08 17:01:11 -0800161
Duane Sandb6d301f2015-01-26 14:48:48 -0800162#define SC_TOTAL_BYTES (SC_FPREGS_OFFSET + SC_FPREGS_BYTES)
163#define SC_TOTAL_LONGS (SC_TOTAL_BYTES/REGSZ)
Elliott Hughesd27ae2f2014-12-08 17:01:11 -0800164
Duane Sandb6d301f2015-01-26 14:48:48 -0800165#if SC_TOTAL_LONGS > _JBLEN
166#error _JBLEN is too small
Elliott Hughesd27ae2f2014-12-08 17:01:11 -0800167#endif
Raghu Gandham405b8022012-07-25 18:16:42 -0700168
169/*
Duane Sand3a478632014-11-25 17:33:10 -0800170 *
Duane Sandb6d301f2015-01-26 14:48:48 -0800171 * GPOFF and FRAMESIZE must be the same for all setjmp/longjmp routines
Raghu Gandham405b8022012-07-25 18:16:42 -0700172 *
173 */
174
175FRAMESZ= MKFSIZ(2,6)
176A1OFF= FRAMESZ-4*REGSZ
177A0OFF= FRAMESZ-3*REGSZ
178GPOFF= FRAMESZ-2*REGSZ
179RAOFF= FRAMESZ-1*REGSZ
180
Duane Sandb6d301f2015-01-26 14:48:48 -0800181NON_LEAF(sigsetjmp, FRAMESZ, ra)
Raghu Gandham405b8022012-07-25 18:16:42 -0700182 .mask 0x80000000, RAOFF
183 PTR_SUBU sp, FRAMESZ # allocate stack frame
Duane Sandb6d301f2015-01-26 14:48:48 -0800184 SETUP_GP64(GPOFF, sigsetjmp)
Raghu Gandham405b8022012-07-25 18:16:42 -0700185 SAVE_GP(GPOFF)
186 .set reorder
Duane Sand3a478632014-11-25 17:33:10 -0800187
Duane Sandb6d301f2015-01-26 14:48:48 -0800188setjmp_common:
Duane Sand3a478632014-11-25 17:33:10 -0800189#ifndef __LP64__
Duane Sandb6d301f2015-01-26 14:48:48 -0800190 li t0, ~7
191 and a0, t0 # round jmpbuf addr DOWN to 8-byte boundary
Duane Sand3a478632014-11-25 17:33:10 -0800192#endif
Duane Sandb6d301f2015-01-26 14:48:48 -0800193 sw a1, SC_FLAG_OFFSET(a0) # save savesigs flag
194 beqz a1, 1f # do saving of signal mask?
Duane Sand3a478632014-11-25 17:33:10 -0800195
Duane Sandb6d301f2015-01-26 14:48:48 -0800196 REG_S ra, RAOFF(sp) # spill state
Raghu Gandham405b8022012-07-25 18:16:42 -0700197 REG_S a0, A0OFF(sp)
Duane Sandb6d301f2015-01-26 14:48:48 -0800198 # call sigprocmask(int how ignored, sigset_t* null, sigset_t* SC_MASK(a0)):
199 LA a2, SC_MASK_OFFSET(a0) # gets current signal mask
200 li a0, 0 # how; ignored when new mask is null
201 li a1, 0 # null new mask
202 jal sigprocmask # get current signal mask
Duane Sand3a478632014-11-25 17:33:10 -0800203 REG_L a0, A0OFF(sp)
Raghu Gandham405b8022012-07-25 18:16:42 -0700204 REG_L ra, RAOFF(sp)
Duane Sandb6d301f2015-01-26 14:48:48 -08002051:
Duane Sand3a478632014-11-25 17:33:10 -0800206 li v0, 0xACEDBADE # sigcontext magic number
Duane Sandb6d301f2015-01-26 14:48:48 -0800207 sw v0, SC_MAGIC_OFFSET(a0)
Duane Sand3a478632014-11-25 17:33:10 -0800208 # callee-saved long-sized regs:
209 REG_S ra, SC_REGS+0*REGSZ(a0)
210 REG_S s0, SC_REGS+1*REGSZ(a0)
211 REG_S s1, SC_REGS+2*REGSZ(a0)
212 REG_S s2, SC_REGS+3*REGSZ(a0)
213 REG_S s3, SC_REGS+4*REGSZ(a0)
214 REG_S s4, SC_REGS+5*REGSZ(a0)
215 REG_S s5, SC_REGS+6*REGSZ(a0)
216 REG_S s6, SC_REGS+7*REGSZ(a0)
217 REG_S s7, SC_REGS+8*REGSZ(a0)
218 REG_S s8, SC_REGS+9*REGSZ(a0)
219 REG_L v0, GPOFF(sp)
Duane Sandb6d301f2015-01-26 14:48:48 -0800220 REG_S v0, SC_REGS+10*REGSZ(a0) # save gp
Duane Sand3a478632014-11-25 17:33:10 -0800221 PTR_ADDU v0, sp, FRAMESZ
Duane Sandb6d301f2015-01-26 14:48:48 -0800222 REG_S v0, SC_REGS+11*REGSZ(a0) # save orig sp
Duane Sand3a478632014-11-25 17:33:10 -0800223
Raghu Gandham405b8022012-07-25 18:16:42 -0700224 cfc1 v0, $31
Duane Sand3a478632014-11-25 17:33:10 -0800225
226#ifdef __LP64__
227 # callee-saved fp regs on mips n64 ABI are $f24..$f31
228 s.d $f24, SC_FPREGS+0*REGSZ_FP(a0)
229 s.d $f25, SC_FPREGS+1*REGSZ_FP(a0)
230 s.d $f26, SC_FPREGS+2*REGSZ_FP(a0)
231 s.d $f27, SC_FPREGS+3*REGSZ_FP(a0)
232 s.d $f28, SC_FPREGS+4*REGSZ_FP(a0)
233 s.d $f29, SC_FPREGS+5*REGSZ_FP(a0)
234 s.d $f30, SC_FPREGS+6*REGSZ_FP(a0)
235 s.d $f31, SC_FPREGS+7*REGSZ_FP(a0)
236#else
237 # callee-saved fp regs on mips o32 ABI are
Duane Sandb6d301f2015-01-26 14:48:48 -0800238 # the even-numbered double fp regs $f20,$f22,...$f30
Duane Sand3a478632014-11-25 17:33:10 -0800239 s.d $f20, SC_FPREGS+0*REGSZ_FP(a0)
240 s.d $f22, SC_FPREGS+1*REGSZ_FP(a0)
241 s.d $f24, SC_FPREGS+2*REGSZ_FP(a0)
242 s.d $f26, SC_FPREGS+3*REGSZ_FP(a0)
243 s.d $f28, SC_FPREGS+4*REGSZ_FP(a0)
244 s.d $f30, SC_FPREGS+5*REGSZ_FP(a0)
Raghu Gandham405b8022012-07-25 18:16:42 -0700245#endif
Duane Sandb6d301f2015-01-26 14:48:48 -0800246 sw v0, SC_FPSR_OFFSET(a0)
Raghu Gandham405b8022012-07-25 18:16:42 -0700247 move v0, zero
248 RESTORE_GP64
249 PTR_ADDU sp, FRAMESZ
250 j ra
Duane Sandb6d301f2015-01-26 14:48:48 -0800251END(sigsetjmp)
Duane Sand3a478632014-11-25 17:33:10 -0800252
Duane Sandb6d301f2015-01-26 14:48:48 -0800253
254# Alternate entry points:
255
256NON_LEAF(setjmp, FRAMESZ, ra)
Duane Sand3a478632014-11-25 17:33:10 -0800257 .mask 0x80000000, RAOFF
258 PTR_SUBU sp, FRAMESZ
Duane Sandb6d301f2015-01-26 14:48:48 -0800259 SETUP_GP64(GPOFF, setjmp) # can't share sigsetjmp's gp code
260 SAVE_GP(GPOFF)
261 .set reorder
262
263 li a1, 1 # save/restore signals state
264 b setjmp_common # tail call
265END(setjmp)
266
267
268NON_LEAF(_setjmp, FRAMESZ, ra)
269 .mask 0x80000000, RAOFF
270 PTR_SUBU sp, FRAMESZ
271 SETUP_GP64(GPOFF, _setjmp) # can't share sigsetjmp's gp code
272 SAVE_GP(GPOFF)
273 .set reorder
274
275 li a1, 0 # don't save/restore signals
276 b setjmp_common # tail call
277END(_setjmp)
278
279
280NON_LEAF(siglongjmp, FRAMESZ, ra)
281 .mask 0x80000000, RAOFF
282 PTR_SUBU sp, FRAMESZ
283 SETUP_GP64(GPOFF, siglongjmp)
Duane Sand3a478632014-11-25 17:33:10 -0800284 SAVE_GP(GPOFF)
285 .set reorder
286
287#ifndef __LP64__
Duane Sandb6d301f2015-01-26 14:48:48 -0800288 li t0, ~7
289 and a0, t0 # round jmpbuf addr DOWN to 8-byte boundary
Duane Sand3a478632014-11-25 17:33:10 -0800290#endif
Duane Sandb6d301f2015-01-26 14:48:48 -0800291 lw v0, SC_MAGIC_OFFSET(a0)
292 li t0, 0xACEDBADE
293 bne v0, t0, longjmp_botch # jump if error
Duane Sand3a478632014-11-25 17:33:10 -0800294
Duane Sandb6d301f2015-01-26 14:48:48 -0800295 lw t0, SC_FLAG_OFFSET(a0) # get savesigs flag
296 beqz t0, 1f # restore signal mask?
297
298 REG_S a1, A1OFF(sp) # temp spill
Duane Sand3a478632014-11-25 17:33:10 -0800299 REG_S a0, A0OFF(sp)
Duane Sandb6d301f2015-01-26 14:48:48 -0800300 # call sigprocmask(int how SIG_SETMASK, sigset_t* SC_MASK(a0), sigset_t* null):
301 LA a1, SC_MASK_OFFSET(a0) # signals being restored
302 li a0, 3 # mips SIG_SETMASK
303 li a2, 0 # null
304 jal sigprocmask # restore signal mask
Duane Sand3a478632014-11-25 17:33:10 -0800305 REG_L a0, A0OFF(sp)
306 REG_L a1, A1OFF(sp)
Duane Sandb6d301f2015-01-26 14:48:48 -08003071:
Duane Sand3a478632014-11-25 17:33:10 -0800308 # callee-saved long-sized regs:
309 REG_L ra, SC_REGS+0*REGSZ(a0)
310 REG_L s0, SC_REGS+1*REGSZ(a0)
311 REG_L s1, SC_REGS+2*REGSZ(a0)
312 REG_L s2, SC_REGS+3*REGSZ(a0)
313 REG_L s3, SC_REGS+4*REGSZ(a0)
314 REG_L s4, SC_REGS+5*REGSZ(a0)
315 REG_L s5, SC_REGS+6*REGSZ(a0)
316 REG_L s6, SC_REGS+7*REGSZ(a0)
317 REG_L s7, SC_REGS+8*REGSZ(a0)
318 REG_L s8, SC_REGS+9*REGSZ(a0)
319 REG_L gp, SC_REGS+10*REGSZ(a0)
320 REG_L sp, SC_REGS+11*REGSZ(a0)
321
Duane Sandb6d301f2015-01-26 14:48:48 -0800322 lw v0, SC_FPSR_OFFSET(a0)
323 ctc1 v0, $31 # restore old fr mode before fp values
Duane Sand3a478632014-11-25 17:33:10 -0800324#ifdef __LP64__
325 # callee-saved fp regs on mips n64 ABI are $f24..$f31
326 l.d $f24, SC_FPREGS+0*REGSZ_FP(a0)
327 l.d $f25, SC_FPREGS+1*REGSZ_FP(a0)
328 l.d $f26, SC_FPREGS+2*REGSZ_FP(a0)
329 l.d $f27, SC_FPREGS+3*REGSZ_FP(a0)
330 l.d $f28, SC_FPREGS+4*REGSZ_FP(a0)
331 l.d $f29, SC_FPREGS+5*REGSZ_FP(a0)
332 l.d $f30, SC_FPREGS+6*REGSZ_FP(a0)
333 l.d $f31, SC_FPREGS+7*REGSZ_FP(a0)
334#else
335 # callee-saved fp regs on mips o32 ABI are
Duane Sandb6d301f2015-01-26 14:48:48 -0800336 # the even-numbered double fp regs $f20,$f22,...$f30
Duane Sand3a478632014-11-25 17:33:10 -0800337 l.d $f20, SC_FPREGS+0*REGSZ_FP(a0)
338 l.d $f22, SC_FPREGS+1*REGSZ_FP(a0)
339 l.d $f24, SC_FPREGS+2*REGSZ_FP(a0)
340 l.d $f26, SC_FPREGS+3*REGSZ_FP(a0)
341 l.d $f28, SC_FPREGS+4*REGSZ_FP(a0)
342 l.d $f30, SC_FPREGS+5*REGSZ_FP(a0)
343#endif
344 bne a1, zero, 1f
345 li a1, 1 # never return 0!
3461:
347 move v0, a1
Duane Sandb6d301f2015-01-26 14:48:48 -0800348 j ra # return to setjmp call site
Raghu Gandham405b8022012-07-25 18:16:42 -0700349
Elliott Hughesd27ae2f2014-12-08 17:01:11 -0800350longjmp_botch:
Raghu Gandham405b8022012-07-25 18:16:42 -0700351 jal longjmperror
352 jal abort
Elliott Hughesd27ae2f2014-12-08 17:01:11 -0800353END(siglongjmp)
Duane Sandb6d301f2015-01-26 14:48:48 -0800354
Christopher Ferris24958512015-03-25 09:12:00 -0700355ALIAS_SYMBOL(longjmp, siglongjmp)
356ALIAS_SYMBOL(_longjmp, siglongjmp)