summaryrefslogtreecommitdiffstats
path: root/usr/klibc/arch/loongarch64/syscall.S
diff options
context:
space:
mode:
Diffstat (limited to 'usr/klibc/arch/loongarch64/syscall.S')
-rw-r--r--usr/klibc/arch/loongarch64/syscall.S13
1 files changed, 13 insertions, 0 deletions
diff --git a/usr/klibc/arch/loongarch64/syscall.S b/usr/klibc/arch/loongarch64/syscall.S
new file mode 100644
index 0000000..9a2ed46
--- /dev/null
+++ b/usr/klibc/arch/loongarch64/syscall.S
@@ -0,0 +1,13 @@
+#include <machine/asm.h>
+#include <asm/unistd.h>
+
+ENTRY(__syscall_common)
+ syscall 0
+ li.w $t0, -4096
+ bleu $a0, $t0, 1f
+ sub.d $a0, $zero, $a0
+ la $t0, errno
+ st.d $a0, $t0, 0
+ li.w $a0, -1
+1: jr $ra
+END(__syscall_common)