1 #!/bin/sh 2 # SPDX-License-Identifier: GPL-2.0 3 # 4 # Generate system call table for perf. Derived from 5 # s390 script. 6 # 7 # Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com> 8 # Changed by: Tiezhu Yang <yangtiezhu@loongson.cn> 9 10 SYSCALL_TBL=$1 11 12 if ! test -r $SYSCALL_TBL; then 13 echo "Could not read input file" >&2 14 exit 1 15 fi 16 17 create_table() 18 { 19 local max_nr nr abi sc discard 20 21 echo 'static const char *const syscalltbl_mips_n64[] = {' 22 while read nr abi sc discard; do 23 printf '\t[%d] = "%s",\n' $nr $sc 24 max_nr=$nr 25 done 26 echo '};' 27 echo "#define SYSCALLTBL_MIPS_N64_MAX_ID $max_nr" 28 } 29 30 grep -E "^[[:digit:]]+[[:space:]]+(n64)" $SYSCALL_TBL \ 31 |sort -k1 -n \ 32 |create_table
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.