Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: 9068/1: syscalls: switch to generic syscalltbl.sh

Many architectures duplicate similar shell scripts.

This commit converts ARM to use scripts/syscalltbl.sh.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>

authored by

Masahiro Yamada and committed by
Russell King
0047eb9f 8252ca87

+8 -31
+4 -4
arch/arm/kernel/entry-common.S
··· 344 344 .size \sym, . - \sym 345 345 .endm 346 346 347 - #define NATIVE(nr, func) syscall nr, func 347 + #define __SYSCALL_WITH_COMPAT(nr, native, compat) __SYSCALL(nr, native) 348 + #define __SYSCALL(nr, func) syscall nr, func 348 349 349 350 /* 350 351 * This is the syscall table declaration for native ABI syscalls. 351 352 * With EABI a couple syscalls are obsolete and defined as sys_ni_syscall. 352 353 */ 353 354 syscall_table_start sys_call_table 354 - #define COMPAT(nr, native, compat) syscall nr, native 355 355 #ifdef CONFIG_AEABI 356 356 #include <calls-eabi.S> 357 357 #else 358 358 #include <calls-oabi.S> 359 359 #endif 360 - #undef COMPAT 361 360 syscall_table_end sys_call_table 362 361 363 362 /*============================================================================ ··· 454 455 * using the compatibility syscall entries. 455 456 */ 456 457 syscall_table_start sys_oabi_call_table 457 - #define COMPAT(nr, native, compat) syscall nr, compat 458 + #undef __SYSCALL_WITH_COMPAT 459 + #define __SYSCALL_WITH_COMPAT(nr, native, compat) __SYSCALL(nr, compat) 458 460 #include <calls-oabi.S> 459 461 syscall_table_end sys_oabi_call_table 460 462
+4 -5
arch/arm/tools/Makefile
··· 10 10 uapi := $(gen)/uapi/asm 11 11 syshdr := $(srctree)/$(src)/syscallhdr.sh 12 12 sysnr := $(srctree)/$(src)/syscallnr.sh 13 - systbl := $(srctree)/$(src)/syscalltbl.sh 13 + systbl := $(srctree)/scripts/syscalltbl.sh 14 14 syscall := $(src)/syscall.tbl 15 15 16 16 gen-y := $(gen)/calls-oabi.S ··· 47 47 '__NR_SYSCALL_BASE' 48 48 49 49 quiet_cmd_systbl = SYSTBL $@ 50 - cmd_systbl = $(CONFIG_SHELL) '$(systbl)' '$<' '$@' \ 51 - '$(systbl_abi_$(basetarget))' 50 + cmd_systbl = $(CONFIG_SHELL) $(systbl) --abis $(abis) $< $@ 52 51 53 52 quiet_cmd_sysnr = SYSNR $@ 54 53 cmd_sysnr = $(CONFIG_SHELL) '$(sysnr)' '$<' '$@' \ ··· 69 70 $(kapi)/unistd-nr.h: $(syscall) $(sysnr) FORCE 70 71 $(call if_changed,sysnr) 71 72 72 - systbl_abi_calls-oabi := common,oabi 73 + $(gen)/calls-oabi.S: abis := common,oabi 73 74 $(gen)/calls-oabi.S: $(syscall) $(systbl) FORCE 74 75 $(call if_changed,systbl) 75 76 76 - systbl_abi_calls-eabi := common,eabi 77 + $(gen)/calls-eabi.S: abis := common,eabi 77 78 $(gen)/calls-eabi.S: $(syscall) $(systbl) FORCE 78 79 $(call if_changed,systbl)
-22
arch/arm/tools/syscalltbl.sh
··· 1 - #!/bin/sh 2 - # SPDX-License-Identifier: GPL-2.0 3 - in="$1" 4 - out="$2" 5 - my_abis=`echo "($3)" | tr ',' '|'` 6 - 7 - grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | ( 8 - while read nr abi name entry compat; do 9 - if [ "$abi" = "eabi" -a -n "$compat" ]; then 10 - echo "$in: error: a compat entry for an EABI syscall ($name) makes no sense" >&2 11 - exit 1 12 - fi 13 - 14 - if [ -n "$entry" ]; then 15 - if [ -z "$compat" ]; then 16 - echo "NATIVE($nr, $entry)" 17 - else 18 - echo "COMPAT($nr, $entry, $compat)" 19 - fi 20 - fi 21 - done 22 - ) > "$out"