Issue
It is well-documented on how to add a system call to Linux targeting x86, e.g. there is a file /arch/x86/entry/syscalls/syscall_64.tbl
.
I searched for the directory entry
under /arch/riscv
but did not find it. I tried to find if there is a file ends with .tbl
under /arch/riscv
but still did not find anything.
Is there any useful resource that describes how RISC-V Linux handles the system call and how we could add our own system calls to it? Or we could just ignore the syscall_64.tbl
file?
Solution
Thanks @oakad's comment. I did not try that approach, but found one useful article that discusses about this:
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
Adding to riscv is similar to x86, except that riscv does not have a syscall table. Hence, no need to add to the table for riscv. For the rest of the steps, follow this link.
Answered By - Ethan L. Answer Checked By - Willingham (WPSolving Volunteer)