OSDN Git Service

Replace FSF snail mail address with URLs
[uclinux-h8/uClibc.git] / libc / sysdeps / linux / microblaze / setjmp.S
1 /*
2  * libc/sysdeps/linux/microblaze/setjmp.S -- `setjmp' for microblaze
3  *
4  *  Copyright (C) 2003       John Williams <jwilliams@itee.uq.edu.au>
5  *  Copyright (C) 2001,2002  NEC Corporation
6  *  Copyright (C) 2001,2002  Miles Bader <miles@gnu.org>
7  *
8  * This file is subject to the terms and conditions of the GNU Lesser
9  * General Public License.  See the file COPYING.LIB in the main
10  * directory of this archive for more details.
11  *
12  * Written by Miles Bader <miles@gnu.org>
13  *
14  * PIC code based on glibc 2.3.6 */
15
16 /*
17    The GNU C Library is free software; you can redistribute it and/or
18    modify it under the terms of the GNU Lesser General Public
19    License as published by the Free Software Foundation; either
20    version 2.1 of the License, or (at your option) any later version.
21
22    The GNU C Library is distributed in the hope that it will be useful,
23    but WITHOUT ANY WARRANTY; without even the implied warranty of
24    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
25    Lesser General Public License for more details.
26
27    You should have received a copy of the GNU Lesser General Public
28    License along with the GNU C Library; if not, see
29    <http://www.gnu.org/licenses/>.  */
30
31 #include <libc-symbols.h>
32
33         .text
34         .globl C_SYMBOL_NAME(setjmp)
35         .align 4
36 C_SYMBOL_NAME(setjmp):
37 #ifdef __PIC__
38         brid    1f
39 #else
40         braid   C_SYMBOL_NAME(__sigsetjmp)
41 #endif
42         addi    r6, r0, 1                       /* Save the signal mask.  */
43
44         .globl C_SYMBOL_NAME(_setjmp)
45 C_SYMBOL_NAME(_setjmp):
46         and     r6, r0, r0                      /* Don't save the signal mask.  */
47
48         .globl C_SYMBOL_NAME(__sigsetjmp)
49 C_SYMBOL_NAME(__sigsetjmp):
50 1:
51         /* Save registers relative to r5 (arg0)*/
52         swi     r1, r5, 0                       /* stack pointer */
53         swi     r15, r5, 4                      /* link register */
54         swi     r2,  r5, 8                      /* SDA and SDA2 ptrs */
55         swi     r13, r5, 12
56         swi     r18, r5, 16                     /* assembler temp */
57         swi     r19, r5, 20                     /* now call-preserved regs */
58         swi     r20, r5, 24
59         swi     r21, r5, 28
60         swi     r22, r5, 32
61         swi     r23, r5, 36
62         swi     r24, r5, 40
63         swi     r25, r5, 44
64         swi     r26, r5, 48
65         swi     r27, r5, 52
66         swi     r28, r5, 56
67         swi     r29, r5, 60
68         swi     r30, r5, 64
69         swi     r31, r5, 68
70
71         /* Make a tail call to __sigjmp_save; it takes the same args.  */
72 #ifdef __PIC__
73         mfs   r12,rpc
74         addik r12,r12,_GLOBAL_OFFSET_TABLE_+8
75         lwi   r12,r12,__sigjmp_save@GOT
76         brad  r12
77         nop
78 #else
79         braid   C_SYMBOL_NAME(__sigjmp_save)
80         nop
81 #endif