Re: [PATCH v7 09/13] mips: Use the common syscall table
From: Arnd Bergmann
Date: Fri Sep 18 2026 - 02:57:53 EST
On Fri, Sep 18, 2026, at 01:46, André Almeida wrote:
> +
> +src_n32 := $(src)/syscall_n.tbl
> +src_n64 := $(src)/syscall_n.tbl
> +src_o32 := $(src)/syscall_o32.tbl
> +
> +.SECONDEXPANSION:
> +
> +$(uapi)/unistd_%.h: $(systbl_common) $$(src_$$*) $(syshdr) FORCE
> + $(call if_changed,syshdr)
> +
> +$(kapi)/unistd_nr_%.h: $(systbl_common) $$(src_$$*) $(sysnr) FORCE
> $(call if_changed,sysnr)
>
> -$(kapi)/syscall_table_%.h: $(src)/syscall_%.tbl $(systbl) FORCE
> +$(kapi)/syscall_table_%.h: $(systbl) $(systbl_common) $$(src_$$*) FORCE
> $(call if_changed,systbl)
I can see how this will work, but I'm not sure we want to keep
maintaining it like this, if anybody wanting to use the syscall
table input files now has to use and understand .SECONDEXPANSION.
For instance, we will already have to duplicate this for the
./tools/perf/arch/powerpc/entry/syscalls/syscall.tbl
directory in the kernel, but I assume that others already have
something like this in userspace.
I really liked the idea of combining the n32/n64 tables into one
file, but the added complexity of using two input files for three
ABIs here makes this much less appealing. The easiest way would
be to give up here and revert back to three input files.
A possible alternative may be to go all the way and only have
one syscall.tbl file per architecture to simplify the scripts,
and then combine mips o32/n32/n64 into one file and do the
same thing for arm oabi/eabi/aarch64 and x86 i386/x86-64/x32.
Arnd