2 # SPDX-License-Identifier: GPL-2.0
12 # Entry can be either just a function name or "function/qualifier"
13 real_entry
="${entry%%/*}"
14 if [ "$entry" = "$real_entry" ]; then
20 echo "__SYSCALL_${abi}($nr, $real_entry, $qualifier)"
29 if [ "$abi" = "64" -a -n "$compat" ]; then
30 echo "a compat entry for a 64-bit syscall makes no sense" >&2
34 if [ -z "$compat" ]; then
35 if [ -n "$entry" ]; then
36 syscall_macro
"$abi" "$nr" "$entry"
39 echo "#ifdef CONFIG_X86_32"
40 if [ -n "$entry" ]; then
41 syscall_macro
"$abi" "$nr" "$entry"
44 syscall_macro
"$abi" "$nr" "$compat"
49 grep '^[0-9]' "$in" |
sort -n |
(
50 while read nr abi name entry compat
; do
51 abi
=`echo "$abi" | tr '[a-z]' '[A-Z]'`
52 if [ "$abi" = "COMMON" -o "$abi" = "64" ]; then
53 # COMMON is the same as 64, except that we don't expect X32
54 # programs to use it. Our expectation has nothing to do with
55 # any generated code, so treat them the same.
56 emit
64 "$nr" "$entry" "$compat"
57 elif [ "$abi" = "X32" ]; then
58 # X32 is equivalent to 64 on an X32-compatible kernel.
59 echo "#ifdef CONFIG_X86_X32_ABI"
60 emit
64 "$nr" "$entry" "$compat"
62 elif [ "$abi" = "I386" ]; then
63 emit
"$abi" "$nr" "$entry" "$compat"
65 echo "Unknown abi $abi" >&2