如何在 RISC-V Linux 中添加系统调用?

How to add a system call in RISC-V Linux?

关于如何向 Linux 添加针对 x86 的系统调用的详细文档,例如有一个文件 /arch/x86/entry/syscalls/syscall_64.tbl.

我在/arch/riscv下搜索了目录entry,但没有找到。我试图在 /arch/riscv 下查找是否有以 .tbl 结尾的文件,但仍然没有找到任何内容。

是否有任何有用的资源描述 RISC-V Linux 如何处理系统调用以及我们如何向其添加我们自己的系统调用?或者我们可以忽略 syscall_64.tbl 文件?

感谢@oakad 的评论。我没有尝试这种方法,但发现一个有用的 article 讨论了这个问题:

Some architectures (e.g. x86) have their own architecture-specific syscall tables, but several other architectures share a generic syscall table. Add your new system call to the generic list by adding an entry to the list in include/uapi/asm-generic/unistd.h

添加到 riscv 与 x86 类似,只是 riscv 没有系统调用 table。因此,无需为 riscv 添加 table。对于其余步骤,请遵循此 link.