Merge tag 'usb-5.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
[linux/fpc-iii.git] / arch / mips / kernel / syscalls / syscalltbl.sh
blob1e2570740c20c86d5ff08dbce368522fc058fcab
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_ni_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" = "64_o32" ] && [ ! -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"