summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/sparc/setjmp.S
blob: 579df757cef8587ea5485f0c7a5bd8cc43633f3a (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
#include <setjmp.h>

#define JB_SP  0
#define JB_FP  1
#define JB_PC  2

#define ST_FLUSH_WINDOWS        0x03

.text
.globl __setjmp
.type __setjmp,function
__setjmp:
	b	1f
	set	0, %o1
.size __setjmp,.-__setjmp

.globl setjmp
.type setjmp,function
setjmp:
	set	1, %o1
.size setjmp,.-setjmp

.globl __sigsetjmp
.type __sigsetjmp,function
__sigsetjmp:
1:
	/* Save our PC, SP and FP.  Save the signal mask if requested with
	   a tail-call for simplicity; it always returns zero.  */
	ta	ST_FLUSH_WINDOWS

	st	%o7, [%o0 + (JB_PC * 4)]
	st	%sp, [%o0 + (JB_SP * 4)]
	st	%fp, [%o0 + (JB_FP * 4)]

	mov	%o7, %g1
	call	__sigjmp_save
	mov	%g1, %o7
.size __sigsetjmp,.-__sigsetjmp