hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/x86/entry/syscalls/syscalltbl.sh
....@@ -1,51 +1,31 @@
1
-#!/bin/sh
1
+#!/bin/bash
22 # SPDX-License-Identifier: GPL-2.0
33
44 in="$1"
55 out="$2"
66
77 syscall_macro() {
8
- abi="$1"
9
- nr="$2"
10
- entry="$3"
8
+ local abi="$1"
9
+ local nr="$2"
10
+ local entry="$3"
1111
12
- # Entry can be either just a function name or "function/qualifier"
13
- real_entry="${entry%%/*}"
14
- if [ "$entry" = "$real_entry" ]; then
15
- qualifier=
16
- else
17
- qualifier=${entry#*/}
18
- fi
19
-
20
- echo "__SYSCALL_${abi}($nr, $real_entry, $qualifier)"
12
+ echo "__SYSCALL_${abi}($nr, $entry)"
2113 }
2214
2315 emit() {
24
- abi="$1"
25
- nr="$2"
26
- entry="$3"
27
- compat="$4"
28
- umlentry=""
16
+ local abi="$1"
17
+ local nr="$2"
18
+ local entry="$3"
19
+ local compat="$4"
2920
30
- if [ "$abi" = "64" -a -n "$compat" ]; then
31
- echo "a compat entry for a 64-bit syscall makes no sense" >&2
21
+ if [ "$abi" != "I386" -a -n "$compat" ]; then
22
+ echo "a compat entry ($abi: $compat) for a 64-bit syscall makes no sense" >&2
3223 exit 1
3324 fi
3425
35
- # For CONFIG_UML, we need to strip the __x64_sys prefix
36
- if [ "$abi" = "64" -a "${entry}" != "${entry#__x64_sys}" ]; then
37
- umlentry="sys${entry#__x64_sys}"
38
- fi
39
-
4026 if [ -z "$compat" ]; then
41
- if [ -n "$entry" -a -z "$umlentry" ]; then
27
+ if [ -n "$entry" ]; then
4228 syscall_macro "$abi" "$nr" "$entry"
43
- elif [ -n "$umlentry" ]; then # implies -n "$entry"
44
- echo "#ifdef CONFIG_X86"
45
- syscall_macro "$abi" "$nr" "$entry"
46
- echo "#else /* CONFIG_UML */"
47
- syscall_macro "$abi" "$nr" "$umlentry"
48
- echo "#endif"
4929 fi
5030 else
5131 echo "#ifdef CONFIG_X86_32"
....@@ -61,21 +41,6 @@
6141 grep '^[0-9]' "$in" | sort -n | (
6242 while read nr abi name entry compat; do
6343 abi=`echo "$abi" | tr '[a-z]' '[A-Z]'`
64
- if [ "$abi" = "COMMON" -o "$abi" = "64" ]; then
65
- # COMMON is the same as 64, except that we don't expect X32
66
- # programs to use it. Our expectation has nothing to do with
67
- # any generated code, so treat them the same.
68
- emit 64 "$nr" "$entry" "$compat"
69
- elif [ "$abi" = "X32" ]; then
70
- # X32 is equivalent to 64 on an X32-compatible kernel.
71
- echo "#ifdef CONFIG_X86_X32_ABI"
72
- emit 64 "$nr" "$entry" "$compat"
73
- echo "#endif"
74
- elif [ "$abi" = "I386" ]; then
75
- emit "$abi" "$nr" "$entry" "$compat"
76
- else
77
- echo "Unknown abi $abi" >&2
78
- exit 1
79
- fi
44
+ emit "$abi" "$nr" "$entry" "$compat"
8045 done
8146 ) > "$out"