From f5e48e94a2f4d4bbd6e5628c7f2afafc6dbcc459 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Thu, 7 Mar 2024 17:28:52 -0500 Subject: build: Build mlibc + add distclean target Signed-off-by: Ian Moffett --- lib/mlibc/sysdeps/linux/riscv64/arch-syscall.cpp | 117 ----------------------- 1 file changed, 117 deletions(-) delete mode 100644 lib/mlibc/sysdeps/linux/riscv64/arch-syscall.cpp (limited to 'lib/mlibc/sysdeps/linux/riscv64/arch-syscall.cpp') diff --git a/lib/mlibc/sysdeps/linux/riscv64/arch-syscall.cpp b/lib/mlibc/sysdeps/linux/riscv64/arch-syscall.cpp deleted file mode 100644 index 18ac6b0..0000000 --- a/lib/mlibc/sysdeps/linux/riscv64/arch-syscall.cpp +++ /dev/null @@ -1,117 +0,0 @@ -#include -#include - -using sc_word_t = __sc_word_t; - -sc_word_t __do_syscall0(long sc) { - register int sc_reg asm("a7") = sc; - register sc_word_t ret asm("a0"); - asm volatile ("ecall" : "=r"(ret) : "r"(sc_reg) : "memory", "a1"); - return ret; -} - -sc_word_t __do_syscall1(long sc, - sc_word_t arg1) { - register int sc_reg asm("a7") = sc; - register sc_word_t arg1_reg asm("a0") = arg1; - register sc_word_t ret asm("a0"); - asm volatile ("ecall" : "=r"(ret) : - "r"(sc_reg), - "r"(arg1_reg) - : "memory", "a1"); - return ret; -} - -sc_word_t __do_syscall2(long sc, - sc_word_t arg1, sc_word_t arg2) { - register int sc_reg asm("a7") = sc; - register sc_word_t arg1_reg asm("a0") = arg1; - register sc_word_t arg2_reg asm("a1") = arg2; - register sc_word_t ret asm("a0"); - asm volatile ("ecall" : "=r"(ret) : - "r"(sc_reg), - "r"(arg1_reg), - "r"(arg2_reg) - : "memory"); - return ret; -} - -sc_word_t __do_syscall3(long sc, - sc_word_t arg1, sc_word_t arg2, sc_word_t arg3) { - register int sc_reg asm("a7") = sc; - register sc_word_t arg1_reg asm("a0") = arg1; - register sc_word_t arg2_reg asm("a1") = arg2; - register sc_word_t arg3_reg asm("a2") = arg3; - register sc_word_t ret asm("a0"); - asm volatile ("ecall" : "=r"(ret) : - "r"(sc_reg), - "r"(arg1_reg), - "r"(arg2_reg), - "r"(arg3_reg) - : "memory"); - return ret; -} - -sc_word_t __do_syscall4(long sc, - sc_word_t arg1, sc_word_t arg2, sc_word_t arg3, - sc_word_t arg4) { - register int sc_reg asm("a7") = sc; - register sc_word_t arg1_reg asm("a0") = arg1; - register sc_word_t arg2_reg asm("a1") = arg2; - register sc_word_t arg3_reg asm("a2") = arg3; - register sc_word_t arg4_reg asm("a3") = arg4; - register sc_word_t ret asm("a0"); - asm volatile ("ecall" : "=r"(ret) : - "r"(sc_reg), - "r"(arg1_reg), - "r"(arg2_reg), - "r"(arg3_reg), - "r"(arg4_reg) - : "memory"); - return ret; -} - -sc_word_t __do_syscall5(long sc, - sc_word_t arg1, sc_word_t arg2, sc_word_t arg3, - sc_word_t arg4, sc_word_t arg5) { - register int sc_reg asm("a7") = sc; - register sc_word_t arg1_reg asm("a0") = arg1; - register sc_word_t arg2_reg asm("a1") = arg2; - register sc_word_t arg3_reg asm("a2") = arg3; - register sc_word_t arg4_reg asm("a3") = arg4; - register sc_word_t arg5_reg asm("a4") = arg5; - register sc_word_t ret asm("a0"); - asm volatile ("ecall" : "=r"(ret) : - "r"(sc_reg), - "r"(arg1_reg), - "r"(arg2_reg), - "r"(arg3_reg), - "r"(arg4_reg), - "r"(arg5_reg) - : "memory"); - return ret; -} - -sc_word_t __do_syscall6(long sc, - sc_word_t arg1, sc_word_t arg2, sc_word_t arg3, - sc_word_t arg4, sc_word_t arg5, sc_word_t arg6) { - register int sc_reg asm("a7") = sc; - register sc_word_t arg1_reg asm("a0") = arg1; - register sc_word_t arg2_reg asm("a1") = arg2; - register sc_word_t arg3_reg asm("a2") = arg3; - register sc_word_t arg4_reg asm("a3") = arg4; - register sc_word_t arg5_reg asm("a4") = arg5; - register sc_word_t arg6_reg asm("a5") = arg6; - register sc_word_t ret asm("a0"); - asm volatile ("ecall" : "=r"(ret) : - "r"(sc_reg), - "r"(arg1_reg), - "r"(arg2_reg), - "r"(arg3_reg), - "r"(arg4_reg), - "r"(arg5_reg), - "r"(arg6_reg) - : "memory" - ); - return ret; -} -- cgit v1.2.3