OSDN Git Service

Replace FSF snail mail address with URLs
[uclinux-h8/uClibc.git] / libc / sysdeps / linux / arm / bsd-setjmp.S
1 /* 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, see
17    <http://www.gnu.org/licenses/>.  */
18
19 #include <bits/arm_asm.h>
20
21 /* This just does a tail-call to `__sigsetjmp (ARG, 1)'.
22    We cannot do it in C because it must be a tail-call, so frame-unwinding
23    in setjmp doesn't clobber the state restored by longjmp.  */
24
25 .global setjmp
26 .type setjmp,%function
27 .align 2
28 #if defined(THUMB1_ONLY)
29 .thumb_func
30 setjmp:
31         mov     r1, #1
32 #ifdef __PIC__
33         ldr     r3, .L_GOT
34         adr     r2, .L_GOT
35         add     r3, r2, r3
36
37         ldr     r2, .L_GOT+4    /* __sigsetjmp */
38         ldr     r2, [r2, r3]
39         bx      r2
40
41         .align 2
42 .L_GOT:
43         .word   _GLOBAL_OFFSET_TABLE_-.L_GOT
44         .word   __sigsetjmp(GOT)
45 #else
46         ldr     r2, =__sigsetjmp
47         bx      r2
48 .pool
49 #endif
50 #else
51 setjmp:
52         mov     r1, #1
53 #ifdef __PIC__
54         b       __sigsetjmp(PLT)
55 #else
56         b       __sigsetjmp
57 #endif
58 #endif
59
60 .size setjmp,.-setjmp