[PATCH v9 09/15] syscalls: Add an option for offsetting the common table
André Almeida
andrealmeid at igalia.com
Thu Nov 12 06:37:33 PST 2026
Em 12/11/2026 11:07, Arnd Bergmann escreveu:
> On Thu, Nov 5, 2026, at 21:05, André Almeida wrote:
>> To better support architectures that doesn't share the same syscall
>> numbers, but have them in the same sequence, add an new option to offset
>> the common syscall table numbers by a value. This make it possible to reuse
>> the common syscall table for alpha.
>>
>> Signed-off-by: André Almeida <andrealmeid at igalia.com>
>> ---
>> Changes from v4:
>> - I was reusing the logic from --offset to apply the --common-offset, but
>> the logic is different: --offset does a string concat, and --common-offset
>> does a addition to the number
>
> I don't understand why this should be different here.
>
> Arnd
This how --offset is used, from arch/mips/kernel/syscalls/Makefile:
cmd_syshdr = $(CONFIG_SHELL) $(syshdr) --offset __NR_Linux $< $@
The effect of this is that the string "__NR_Linux +" will be added to
every syscall number in the unistd header, e.g.:
#define __NR_file_setattr (__NR_Linux + 469)
#define __NR_listns (__NR_Linux + 470)
#define __NR_rseq_slice_yield (__NR_Linux + 471)
...
Now, for --common-offset, from arch/alpha/kernel/syscalls/Makefile:
cmd_systbl = $(CONFIG_SHELL) $(systbl) \
--common-tbl $(systbl_common) --common-offset 110 \
--abis $(abis) $< $@
That means that 110 will be added to the syscall number itself:
#define __NR_file_setattr 579
#define __NR_listns 580
#define __NR_rseq_slice_yield 581
So one option does a string concat, the other option really does a sum
operation. If I had used --offset 110, the result would be
#define __NR_file_setattr (110 + 469)
#define __NR_listns (110 + 470)
#define __NR_rseq_slice_yield (110 + 471)
Thanks!
André
More information about the linux-arm-kernel
mailing list