xref: /kernel/linux/linux-6.6/tools/perf/arch/mips/entry/syscalls/mksyscalltbl
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /kernel/linux/linux-6.6/tools/perf/arch/mips/entry/syscalls/
162306a36Sopenharmony_ci#!/bin/sh
262306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
362306a36Sopenharmony_ci#
462306a36Sopenharmony_ci# Generate system call table for perf. Derived from
562306a36Sopenharmony_ci# s390 script.
662306a36Sopenharmony_ci#
762306a36Sopenharmony_ci# Author(s):  Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
862306a36Sopenharmony_ci# Changed by: Tiezhu Yang <yangtiezhu@loongson.cn>
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ciSYSCALL_TBL=$1
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ciif ! test -r $SYSCALL_TBL; then
1362306a36Sopenharmony_ci	echo "Could not read input file" >&2
1462306a36Sopenharmony_ci	exit 1
1562306a36Sopenharmony_cifi
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_cicreate_table()
1862306a36Sopenharmony_ci{
1962306a36Sopenharmony_ci	local max_nr nr abi sc discard
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ci	echo 'static const char *const syscalltbl_mips_n64[] = {'
2262306a36Sopenharmony_ci	while read nr abi sc discard; do
2362306a36Sopenharmony_ci		printf '\t[%d] = "%s",\n' $nr $sc
2462306a36Sopenharmony_ci		max_nr=$nr
2562306a36Sopenharmony_ci	done
2662306a36Sopenharmony_ci	echo '};'
2762306a36Sopenharmony_ci	echo "#define SYSCALLTBL_MIPS_N64_MAX_ID $max_nr"
2862306a36Sopenharmony_ci}
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_cigrep -E "^[[:digit:]]+[[:space:]]+(n64)" $SYSCALL_TBL	\
3162306a36Sopenharmony_ci	|sort -k1 -n					\
3262306a36Sopenharmony_ci	|create_table
33

Indexes created Thu Nov 07 10:32:03 CST 2024