-
Notifications
You must be signed in to change notification settings - Fork 21
Description
Problem
When generating the RISC-V syscall tables with syscalls-gen (currently pinned to Linux v6.16), the entries for riscv_hwprobe (258) and riscv_flush_icache (259) disappear from src/arch/riscv64.rs / src/arch/riscv32.rs.
On crates.io syscalls-0.7.0 the table jumps directly from recvmmsg = 243 to wait4 = 260, so matching on Sysno::riscv_flush_icache fails to compile.
Reproduction
cargo new demo && cd democargo add syscalls@0.7 --no-default-features- On a RISC-V target, reference
syscalls::Sysno::riscv_flush_icache– the variant does not exist.
Root cause
Since Linux v6.11 the file arch/riscv/include/uapi/asm/unistd.h was reduced to:
#if __BITS_PER_LONG == 64
#include <asm/unistd_64.h>
#else
#include <asm/unistd_32.h>
#endif
All __NR_riscv_* macros now live in the generated headers include/generated/uapi/asm/unistd_{32,64}.h, but syscalls-gen only fetches the non-generated headers listed above, so the RISC-V arch-specific slots (258/259) are never parsed.
Suggested fix
- Short term: after fetching the RISC-V table, ensure entries 258/259 exist (inject them if missing) so published crates remain usable.
- Long term: teach
syscalls-gento follow the include chain or to replicate whatscripts/syscallhdr.shdoes, so it can materializearch/riscv/include/generated/uapi/asm/unistd_{32,64}.hbefore parsing.
Happy to provide a PR for either approach; please advise which direction you prefer.