hugetlb: introduce generic version of hugetlb_free_pgd_range
[linux/fpc-iii.git] / arch / x86 / entry / syscalls / syscallhdr.sh
blob12fbbcfe7ef353109f42b6e8b827be19f1e3b910
1 #!/bin/sh
2 # SPDX-License-Identifier: GPL-2.0
4 in="$1"
5 out="$2"
6 my_abis=`echo "($3)" | tr ',' '|'`
7 prefix="$4"
8 offset="$5"
10 fileguard=_ASM_X86_`basename "$out" | sed \
11 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
12 -e 's/[^A-Z0-9_]/_/g' -e 's/__/_/g'`
13 grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
14 echo "#ifndef ${fileguard}"
15 echo "#define ${fileguard} 1"
16 echo ""
18 while read nr abi name entry ; do
19 if [ -z "$offset" ]; then
20 echo "#define __NR_${prefix}${name} $nr"
21 else
22 echo "#define __NR_${prefix}${name} ($offset + $nr)"
24 done
26 echo ""
27 echo "#endif /* ${fileguard} */"
28 ) > "$out"