summaryrefslogtreecommitdiffstats
path: root/libc-top-half/musl/src/signal/x32
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/x32
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/x32')
-rw-r--r--libc-top-half/musl/src/signal/x32/getitimer.c7
-rw-r--r--libc-top-half/musl/src/signal/x32/restore.s8
-rw-r--r--libc-top-half/musl/src/signal/x32/setitimer.c7
-rw-r--r--libc-top-half/musl/src/signal/x32/sigsetjmp.s25
4 files changed, 47 insertions, 0 deletions
diff --git a/libc-top-half/musl/src/signal/x32/getitimer.c b/libc-top-half/musl/src/signal/x32/getitimer.c
new file mode 100644
index 0000000..8a8046a
--- /dev/null
+++ b/libc-top-half/musl/src/signal/x32/getitimer.c
@@ -0,0 +1,7 @@
+#include <sys/time.h>
+#include "syscall.h"
+
+int getitimer(int which, struct itimerval *old)
+{
+ return syscall(SYS_getitimer, which, old);
+}
diff --git a/libc-top-half/musl/src/signal/x32/restore.s b/libc-top-half/musl/src/signal/x32/restore.s
new file mode 100644
index 0000000..1117446
--- /dev/null
+++ b/libc-top-half/musl/src/signal/x32/restore.s
@@ -0,0 +1,8 @@
+ nop
+.global __restore_rt
+.hidden __restore_rt
+.type __restore_rt,@function
+__restore_rt:
+ mov $0x40000201, %rax /* SYS_rt_sigreturn */
+ syscall
+.size __restore_rt,.-__restore_rt
diff --git a/libc-top-half/musl/src/signal/x32/setitimer.c b/libc-top-half/musl/src/signal/x32/setitimer.c
new file mode 100644
index 0000000..21b1f45
--- /dev/null
+++ b/libc-top-half/musl/src/signal/x32/setitimer.c
@@ -0,0 +1,7 @@
+#include <sys/time.h>
+#include "syscall.h"
+
+int setitimer(int which, const struct itimerval *restrict new, struct itimerval *restrict old)
+{
+ return syscall(SYS_setitimer, which, new, old);
+}
diff --git a/libc-top-half/musl/src/signal/x32/sigsetjmp.s b/libc-top-half/musl/src/signal/x32/sigsetjmp.s
new file mode 100644
index 0000000..1f02b0e
--- /dev/null
+++ b/libc-top-half/musl/src/signal/x32/sigsetjmp.s
@@ -0,0 +1,25 @@
+.global sigsetjmp
+.global __sigsetjmp
+.type sigsetjmp,@function
+.type __sigsetjmp,@function
+sigsetjmp:
+__sigsetjmp:
+ test %esi,%esi
+ jz 1f
+
+ popq 64(%rdi)
+ mov %rbx,72+8(%rdi)
+ mov %rdi,%rbx
+
+ call setjmp@PLT
+
+ pushq 64(%rbx)
+ movl $0, 4(%rsp)
+ mov %rbx,%rdi
+ mov %eax,%esi
+ mov 72+8(%rbx),%rbx
+
+.hidden __sigsetjmp_tail
+ jmp __sigsetjmp_tail
+
+1: jmp setjmp@PLT