aboutsummaryrefslogtreecommitdiff
path: root/lib/mlibc/options/internal/riscv64/setjmp.S
blob: 51568f7c688af8b91cd48c87e25d6effd11724aa (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
.global setjmp
.type setjmp, "function"
setjmp:
	sd ra, 0(a0)
	sd s0, 8(a0)
	sd s1, 16(a0)
	sd s2, 24(a0)
	sd s3, 32(a0)
	sd s4, 40(a0)
	sd s5, 48(a0)
	sd s6, 56(a0)
	sd s7, 64(a0)
	sd s8, 72(a0)
	sd s9, 80(a0)
	sd s10, 88(a0)
	sd s11, 96(a0)
	sd sp, 104(a0)
	fsd fs0, 112(a0)
	fsd fs1, 120(a0)
	fsd fs2, 128(a0)
	fsd fs3, 136(a0)
	fsd fs4, 144(a0)
	fsd fs5, 152(a0)
	fsd fs6, 160(a0)
	fsd fs7, 168(a0)
	fsd fs8, 176(a0)
	fsd fs9, 184(a0)
	fsd fs10, 192(a0)
	fsd fs11, 200(a0)
	li a0, 0
	ret

.global sigsetjmp
.type sigsetjmp, "function"
sigsetjmp:
	unimp // TODO

.global longjmp
.type longjmp, "function"
longjmp:
	ld ra,0(a0)
	ld s0,8(a0)
	ld s1,16(a0)
	ld s2,24(a0)
	ld s3,32(a0)
	ld s4,40(a0)
	ld s5,48(a0)
	ld s6,56(a0)
	ld s7,64(a0)
	ld s8,72(a0)
	ld s9,80(a0)
	ld s10,88(a0)
	ld s11,96(a0)
	ld sp,104(a0)
	fld fs0,112(a0)
	fld fs1,120(a0)
	fld fs2,128(a0)
	fld fs3,136(a0)
	fld fs4,144(a0)
	fld fs5,152(a0)
	fld fs6,160(a0)
	fld fs7,168(a0)
	fld fs8,176(a0)
	fld fs9,184(a0)
	fld fs10,192(a0)
	fld fs11,200(a0)
	seqz a0,a1
	add a0,a0,a1
	ret
.section .note.GNU-stack,"",%progbits