summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/v850/setjmp.S
blob: 8bb3649a33667902833cee1fbf1071226c0f16fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
 * libc/sysdeps/linux/v850/setjmp.S -- `setjmp' for v850
 *
 *  Copyright (C) 2001,2002  NEC Corporation
 *  Copyright (C) 2001,2002  Miles Bader <miles@gnu.org>
 *
 * This file is subject to the terms and conditions of the GNU Lesser
 * General Public License.  See the file COPYING.LIB in the main
 * directory of this archive for more details.
 * 
 * Written by Miles Bader <miles@gnu.org>
 */

#include <clinkage.h>

	.text
C_ENTRY(setjmp):
	mov	1, r7			/* Save the signal mask.  */
	br	C_SYMBOL_NAME(__sigsetjmp)

	.globl C_SYMBOL_NAME(_setjmp)
C_SYMBOL_NAME(_setjmp):
	mov	0, r7			/* Don't save the signal mask.  */

	.globl C_SYMBOL_NAME(__sigsetjmp)
C_SYMBOL_NAME(__sigsetjmp):
	/* Save registers */
	mov	r6, ep
	sst.w	sp, 0[ep]
	sst.w	lp, 4[ep]
	sst.w	r2, 8[ep]
	sst.w	r20, 12[ep]
	sst.w	r21, 16[ep]
	sst.w	r22, 20[ep]
	sst.w	r23, 24[ep]
	sst.w	r24, 28[ep]
	sst.w	r25, 32[ep]
	sst.w	r26, 36[ep]
	sst.w	r27, 40[ep]
	sst.w	r28, 44[ep]
	sst.w	r29, 48[ep]
	/* Make a tail call to __sigjmp_save; it takes the same args.  */
	jr	C_SYMBOL_NAME(__sigjmp_save)
C_END(setjmp)