blob: 1f57a97e7f81dfddef05de2fb22a7b56bfc3910a [file] [log] [blame]
yuezonghe824eb0c2024-06-27 02:32:26 -07001/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. MIPS version.
2 Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
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.
9
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.
14
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. */
19
20/* This just does a tail-call to `__sigsetjmp (ARG, 1)'.
21 We cannot do it in C because it must be a tail-call, so frame-unwinding
22 in setjmp doesn't clobber the state restored by longjmp. */
23
24#include <sys/regdef.h>
25#include <sys/asm.h>
26
27#ifdef __PIC__
28 .option pic2
29#endif
30
31.text
32.global setjmp
33.align 2;
34.ent setjmp,0;
35.type setjmp,@function
36
37setjmp:
38 .set noreorder
39#ifdef __PIC__
40#if _MIPS_SIM == _MIPS_SIM_ABI32
41 .cpload t9
42 .set reorder
43 la t9, __sigsetjmp
44#else /* N32 */
45 .cpsetup t9, v0, setjmp
46 PTR_LA t9, __sigsetjmp
47 .cprestore
48#endif /* N32 */
49#endif
50 li a1, 1 /* Pass a second argument of one. */
51#ifdef __PIC__
52 jr t9
53#else
54 j __sigsetjmp
55#endif
56 .end setjmp