mips: syscalls: define syscall offsets directly in <asm/unistd.h>
authorMasahiro Yamada <masahiroy@kernel.org>
Fri, 28 May 2021 03:46:14 +0000 (12:46 +0900)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Tue, 1 Jun 2021 09:17:24 +0000 (11:17 +0200)
There is no good reason to generate the syscall offset macros by
scripting since they are not derived from the syscall tables.

Define __NR_*_Linux macros directly in arch/mips/include/asm/unistd.h,
and clean up the Makefile and the shell script.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/include/asm/unistd.h
arch/mips/kernel/syscalls/Makefile
arch/mips/kernel/syscalls/syscallnr.sh

index 5d70bab..c2196b1 100644 (file)
 #include <asm/unistd_nr_n64.h>
 #include <asm/unistd_nr_o32.h>
 
+#define __NR_N32_Linux 6000
+#define __NR_64_Linux  5000
+#define __NR_O32_Linux 4000
+
 #ifdef CONFIG_MIPS32_N32
 #define NR_syscalls  (__NR_N32_Linux + __NR_N32_Linux_syscalls)
 #elif defined(CONFIG_64BIT)
index 9044529..6eee6a3 100644 (file)
@@ -18,8 +18,7 @@ quiet_cmd_syshdr = SYSHDR  $@
 quiet_cmd_sysnr = SYSNR   $@
       cmd_sysnr = $(CONFIG_SHELL) '$(sysnr)' '$<' '$@'         \
                  '$(sysnr_abis_$(basetarget))'                 \
-                 '$(sysnr_pfx_$(basetarget))'                  \
-                 '$(sysnr_offset_$(basetarget))'
+                 '$(sysnr_pfx_$(basetarget))'
 
 quiet_cmd_systbl = SYSTBL  $@
       cmd_systbl = $(CONFIG_SHELL) $(systbl) $< $@
@@ -34,17 +33,14 @@ $(uapi)/unistd_o32.h: $(syscallo32) $(syshdr) FORCE
        $(call if_changed,syshdr)
 
 sysnr_pfx_unistd_nr_n32 := N32
-sysnr_offset_unistd_nr_n32 := 6000
 $(kapi)/unistd_nr_n32.h: $(syscalln32) $(sysnr) FORCE
        $(call if_changed,sysnr)
 
 sysnr_pfx_unistd_nr_n64 := 64
-sysnr_offset_unistd_nr_n64 := 5000
 $(kapi)/unistd_nr_n64.h: $(syscalln64) $(sysnr) FORCE
        $(call if_changed,sysnr)
 
 sysnr_pfx_unistd_nr_o32 := O32
-sysnr_offset_unistd_nr_o32 := 4000
 $(kapi)/unistd_nr_o32.h: $(syscallo32) $(sysnr) FORCE
        $(call if_changed,sysnr)
 
index 60bbdb3..c190bbe 100644 (file)
@@ -5,7 +5,6 @@ in="$1"
 out="$2"
 my_abis=`echo "($3)" | tr ',' '|'`
 prefix="$4"
-offset="$5"
 
 fileguard=_UAPI_ASM_MIPS_`basename "$out" | sed \
        -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
@@ -20,7 +19,6 @@ grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
                nxt=$((nr+1))
        done
 
-       printf "#define __NR_%s_Linux\t%s\n" "${prefix}" "${offset}"
        printf "#define __NR_%s_Linux_syscalls\t%s\n" "${prefix}" "${nxt}"
        printf "\n"
        printf "#endif /* %s */" "${fileguard}"