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

Configure Feed

Select the types of activity you want to include in your feed.

sparc: syscalls: switch to generic syscallshdr.sh

Many architectures duplicate similar shell scripts.

This commit converts sparc to use scripts/syscallhdr.sh.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

+4 -43
+4 -7
arch/sparc/kernel/syscalls/Makefile
··· 6 6 $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') 7 7 8 8 syscall := $(src)/syscall.tbl 9 - syshdr := $(srctree)/$(src)/syscallhdr.sh 9 + syshdr := $(srctree)/scripts/syscallhdr.sh 10 10 systbl := $(srctree)/scripts/syscalltbl.sh 11 11 12 12 quiet_cmd_syshdr = SYSHDR $@ 13 - cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' '$<' '$@' \ 14 - '$(syshdr_abis_$(basetarget))' \ 15 - '$(syshdr_pfx_$(basetarget))' \ 16 - '$(syshdr_offset_$(basetarget))' 13 + cmd_syshdr = $(CONFIG_SHELL) $(syshdr) --emit-nr --abis $(abis) $< $@ 17 14 18 15 quiet_cmd_systbl = SYSTBL $@ 19 16 cmd_systbl = $(CONFIG_SHELL) $(systbl) --abis $(abis) $< $@ 20 17 21 - syshdr_abis_unistd_32 := common,32 18 + $(uapi)/unistd_32.h: abis := common,32 22 19 $(uapi)/unistd_32.h: $(syscall) $(syshdr) FORCE 23 20 $(call if_changed,syshdr) 24 21 25 - syshdr_abis_unistd_64 := common,64 22 + $(uapi)/unistd_64.h: abis := common,64 26 23 $(uapi)/unistd_64.h: $(syscall) $(syshdr) FORCE 27 24 $(call if_changed,syshdr) 28 25
-36
arch/sparc/kernel/syscalls/syscallhdr.sh
··· 1 - #!/bin/sh 2 - # SPDX-License-Identifier: GPL-2.0 3 - 4 - in="$1" 5 - out="$2" 6 - my_abis=`echo "($3)" | tr ',' '|'` 7 - prefix="$4" 8 - offset="$5" 9 - 10 - fileguard=_UAPI_ASM_SPARC_`basename "$out" | sed \ 11 - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ 12 - -e 's/[^A-Z0-9_]/_/g' -e 's/__/_/g'` 13 - grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | ( 14 - printf "#ifndef %s\n" "${fileguard}" 15 - printf "#define %s\n" "${fileguard}" 16 - printf "\n" 17 - 18 - nxt=0 19 - while read nr abi name entry compat ; do 20 - if [ -z "$offset" ]; then 21 - printf "#define __NR_%s%s\t%s\n" \ 22 - "${prefix}" "${name}" "${nr}" 23 - else 24 - printf "#define __NR_%s%s\t(%s + %s)\n" \ 25 - "${prefix}" "${name}" "${offset}" "${nr}" 26 - fi 27 - nxt=$((nr+1)) 28 - done 29 - 30 - printf "\n" 31 - printf "#ifdef __KERNEL__\n" 32 - printf "#define __NR_syscalls\t%s\n" "${nxt}" 33 - printf "#endif\n" 34 - printf "\n" 35 - printf "#endif /* %s */\n" "${fileguard}" 36 - ) > "$out"