blob: d7ca72ad5bfa510833cc24cf095a5e8d2f94813b [file] [log] [blame]
yuezonghe824eb0c2024-06-27 02:32:26 -07001/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. ARM version.
2 Copyright (C) 1997, 1998 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#include <bits/arm_asm.h>
21
22/* This just does a tail-call to `__sigsetjmp (ARG, 1)'.
23 We cannot do it in C because it must be a tail-call, so frame-unwinding
24 in setjmp doesn't clobber the state restored by longjmp. */
25
26.global setjmp
27.type setjmp,%function
28.align 2
29#if defined(THUMB1_ONLY)
30.thumb_func
31setjmp:
32 mov r1, #1
33#ifdef __PIC__
34 ldr r3, .L_GOT
35 adr r2, .L_GOT
36 add r3, r2, r3
37
38 ldr r2, .L_GOT+4 /* __sigsetjmp */
39 ldr r2, [r2, r3]
40 bx r2
41
42 .align 2
43.L_GOT:
44 .word _GLOBAL_OFFSET_TABLE_-.L_GOT
45 .word __sigsetjmp(GOT)
46#else
47 ldr r2, =__sigsetjmp
48 bx r2
49.pool
50#endif
51#else
52setjmp:
53 mov r1, #1
54#ifdef __PIC__
55 b __sigsetjmp(PLT)
56#else
57 b __sigsetjmp
58#endif
59#endif
60
61.size setjmp,.-setjmp