1 #!/bin/sh 1 #!/bin/sh 2 # SPDX-License-Identifier: GPL-2.0 2 # SPDX-License-Identifier: GPL-2.0 3 3 4 in="$1" 4 in="$1" 5 out="$2" 5 out="$2" 6 my_abis=`echo "($3)" | tr ',' '|'` 6 my_abis=`echo "($3)" | tr ',' '|'` 7 prefix="$4" 7 prefix="$4" 8 8 9 fileguard=_UAPI_ASM_MIPS_`basename "$out" | se 9 fileguard=_UAPI_ASM_MIPS_`basename "$out" | sed \ 10 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDE 10 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ 11 -e 's/[^A-Z0-9_]/_/g' -e 's/__/_/g'` 11 -e 's/[^A-Z0-9_]/_/g' -e 's/__/_/g'` 12 grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis} 12 grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | ( 13 printf "#ifndef %s\n" "${fileguard}" 13 printf "#ifndef %s\n" "${fileguard}" 14 printf "#define %s\n" "${fileguard}" 14 printf "#define %s\n" "${fileguard}" 15 printf "\n" 15 printf "\n" 16 16 17 nxt=0 17 nxt=0 18 while read nr abi name entry compat ; 18 while read nr abi name entry compat ; do 19 nxt=$((nr+1)) 19 nxt=$((nr+1)) 20 done 20 done 21 21 22 printf "#define __NR_%s_Linux_syscalls 22 printf "#define __NR_%s_Linux_syscalls\t%s\n" "${prefix}" "${nxt}" 23 printf "\n" 23 printf "\n" 24 printf "#endif /* %s */" "${fileguard} 24 printf "#endif /* %s */" "${fileguard}" 25 printf "\n" 25 printf "\n" 26 ) > "$out" 26 ) > "$out"
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.