aboutsummaryrefslogtreecommitdiff
path: root/lib/mlibc/options/internal/riscv64/setjmp.S
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-03-07 17:28:00 -0500
committerIan Moffett <ian@osmora.org>2024-03-07 17:28:32 -0500
commitbd5969fc876a10b18613302db7087ef3c40f18e1 (patch)
tree7c2b8619afe902abf99570df2873fbdf40a4d1a1 /lib/mlibc/options/internal/riscv64/setjmp.S
parenta95b38b1b92b172e6cc4e8e56a88a30cc65907b0 (diff)
lib: Add mlibc
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'lib/mlibc/options/internal/riscv64/setjmp.S')
-rw-r--r--lib/mlibc/options/internal/riscv64/setjmp.S71
1 files changed, 71 insertions, 0 deletions
diff --git a/lib/mlibc/options/internal/riscv64/setjmp.S b/lib/mlibc/options/internal/riscv64/setjmp.S
new file mode 100644
index 0000000..51568f7
--- /dev/null
+++ b/lib/mlibc/options/internal/riscv64/setjmp.S
@@ -0,0 +1,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
+