riscv64: fix linking with binutils 2.40
[uclibc-ng.git] / libc / sysdeps / linux / or1k / setjmp.S
blobccc1141cc590a1b7976398c96242d319ef0c21cc
1 /* setjmp for or1k
3    Based on:
4    setjmp for PowerPC.
5    Copyright (C) 2014 Free Software Foundation, Inc.
6    This file is part of the GNU C Library.
8    The GNU C Library is free software; you can redistribute it and/or
9    modify it under the terms of the GNU Lesser General Public
10    License as published by the Free Software Foundation; either
11    version 2.1 of the License, or (at your option) any later version.
13    The GNU C Library is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16    Lesser General Public License for more details.
18    You should have received a copy of the GNU Lesser General Public
19    License along with the GNU C Library; see the file COPYING.LIB.  If
20    not, see <http://www.gnu.org/licenses/>.  */
22 #include "spr_defs.h"
23 #include <jmpbuf-offsets.h>
25 #ifdef __UCLIBC_HAS_FLOATS__
26 #define FP(x...) x
27 #else
28 #define FP(x...)
29 #endif
31 .globl _setjmp
32 .type _setjmp, @function
33 .align 2
35 _setjmp:
36         l.addi  r4,r0,0                 /* Set second argument to 0.  */
37         l.j     .Local_sigsetjmp
38         l.nop
39 .size     _setjmp,.-_setjmp
41 .globl __setjmp
42 .type __setjmp, @function
43 .align 2
45 __setjmp:
46         l.addi  r4,r0,1                 /* Set second argument to 1.  */
47         l.j     .Local_sigsetjmp
48         l.nop
49 .size __setjmp,.-__setjmp
51 .globl setjmp
52 .set setjmp,__setjmp
54 .globl __sigsetjmp
55 .type __sigsetjmp, @function
56 .align 2
58 __sigsetjmp:
59 .Local_sigsetjmp:
60         l.sw    0(r3),r1
61         l.sw    4(r3),r2
62         l.sw    8(r3),r9
63         l.sw    12(r3),r10
64         l.sw    16(r3),r14
65         l.sw    20(r3),r16
66         l.sw    24(r3),r18
67         l.sw    28(r3),r20
68         l.sw    32(r3),r22
69         l.sw    36(r3),r24
70         l.sw    40(r3),r26
71         l.sw    44(r3),r28
72         l.sw    48(r3),r30
73         l.j     __sigjmp_save
74          l.nop
75 .size __sigsetjmp,.-__sigsetjmp