1 #!/bin/sh 2 # SPDX-License-Identifier: GPL-2.0 3 4 in="$1" 5 arch="$2" 6 7 syscall_macro() { 8 nr="$1" 9 name="$2" 10 11 echo " [$nr] = \"$name\"," 12 } 13 14 emit() { 15 nr="$1" 16 entry="$2" 17 18 syscall_macro "$nr" "$entry" 19 } 20 21 echo "static const char *const syscalltbl_${arch}[] = {" 22 23 sorted_table=$(mktemp /tmp/syscalltbl.XXXXXX) 24 grep '^[0-9]' "$in" | sort -n > $sorted_table 25 26 max_nr=0 27 # the params are: nr abi name entry compat 28 # use _ for intentionally unused variables according to SC2034 29 while read nr _ name _ _; do 30 if [ $nr -ge 512 ] ; then # discard compat sycalls 31 break 32 fi 33 34 emit "$nr" "$name" 35 max_nr=$nr 36 done < $sorted_table 37 38 rm -f $sorted_table 39 40 echo "};" 41 42 echo "#define SYSCALLTBL_${arch}_MAX_ID ${max_nr}"
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.