summaryrefslogtreecommitdiffstats
path: root/libc-top-half/musl/src/signal/sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 13:54:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 13:54:38 +0000
commit8c1ab65c0f548d20b7f177bdb736daaf603340e1 (patch)
treedf55b7e75bf43f2bf500845b105afe3ac3a5157e /libc-top-half/musl/src/signal/sh
parentInitial commit. (diff)
downloadwasi-libc-8c1ab65c0f548d20b7f177bdb736daaf603340e1.tar.xz
wasi-libc-8c1ab65c0f548d20b7f177bdb736daaf603340e1.zip
Adding upstream version 0.0~git20221206.8b7148f.upstream/0.0_git20221206.8b7148f
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libc-top-half/musl/src/signal/sh')
-rw-r--r--libc-top-half/musl/src/signal/sh/restore.s24
-rw-r--r--libc-top-half/musl/src/signal/sh/sigsetjmp.s41
2 files changed, 65 insertions, 0 deletions
diff --git a/libc-top-half/musl/src/signal/sh/restore.s b/libc-top-half/musl/src/signal/sh/restore.s
new file mode 100644
index 0000000..3a92199
--- /dev/null
+++ b/libc-top-half/musl/src/signal/sh/restore.s
@@ -0,0 +1,24 @@
+.global __restore
+.hidden __restore
+__restore:
+ mov #119, r3 !__NR_sigreturn
+ trapa #31
+
+ or r0, r0
+ or r0, r0
+ or r0, r0
+ or r0, r0
+ or r0, r0
+
+.global __restore_rt
+.hidden __restore_rt
+__restore_rt:
+ mov #100, r3 !__NR_rt_sigreturn
+ add #73, r3
+ trapa #31
+
+ or r0, r0
+ or r0, r0
+ or r0, r0
+ or r0, r0
+ or r0, r0
diff --git a/libc-top-half/musl/src/signal/sh/sigsetjmp.s b/libc-top-half/musl/src/signal/sh/sigsetjmp.s
new file mode 100644
index 0000000..1e2270b
--- /dev/null
+++ b/libc-top-half/musl/src/signal/sh/sigsetjmp.s
@@ -0,0 +1,41 @@
+.global sigsetjmp
+.global __sigsetjmp
+.type sigsetjmp,@function
+.type __sigsetjmp,@function
+sigsetjmp:
+__sigsetjmp:
+ tst r5, r5
+ bt 9f
+
+ mov r4, r6
+ add #60, r6
+ sts pr, r0
+ mov.l r0, @r6
+ mov.l r8, @(4+8,r6)
+
+ mov.l 1f, r0
+2: bsrf r0
+ mov r4, r8
+
+ mov r0, r5
+ mov r8, r4
+ mov r4, r6
+ add #60, r6
+
+ mov.l @r6, r0
+ lds r0, pr
+
+ mov.l 3f, r0
+4: braf r0
+ mov.l @(4+8,r4), r8
+
+9: mov.l 5f, r0
+6: braf r0
+ nop
+
+.align 2
+.hidden ___setjmp
+1: .long ___setjmp@PLT-(2b+4-.)
+.hidden __sigsetjmp_tail
+3: .long __sigsetjmp_tail@PLT-(4b+4-.)
+5: .long ___setjmp@PLT-(6b+4-.)