WIP FPC-III support
[linux/fpc-iii.git] / arch / sparc / kernel / syscalls / syscalltbl.sh
blob77cf0143ba1969c47779cab8d3d23b4b782fa73c
1 #!/bin/sh
2 # SPDX-License-Identifier: GPL-2.0
4 in="$1"
5 out="$2"
6 my_abis=`echo "($3)" | tr ',' '|'`
7 my_abi="$4"
8 offset="$5"
10 emit() {
11 t_nxt="$1"
12 t_nr="$2"
13 t_entry="$3"
15 while [ $t_nxt -lt $t_nr ]; do
16 printf "__SYSCALL(%s, sys_nis_syscall, )\n" "${t_nxt}"
17 t_nxt=$((t_nxt+1))
18 done
19 printf "__SYSCALL(%s, %s, )\n" "${t_nxt}" "${t_entry}"
22 grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
23 nxt=0
24 if [ -z "$offset" ]; then
25 offset=0
28 while read nr abi name entry compat ; do
29 if [ "$my_abi" = "c32" ] && [ ! -z "$compat" ]; then
30 emit $((nxt+offset)) $((nr+offset)) $compat
31 else
32 emit $((nxt+offset)) $((nr+offset)) $entry
34 nxt=$((nr+1))
35 done
36 ) > "$out"