xref: /openbmc/qemu/scripts/update-syscalltbl.sh (revision 05caa062)
1TBL_LIST="\
2arch/alpha/kernel/syscalls/syscall.tbl,linux-user/alpha/syscall.tbl \
3arch/arm/tools/syscall.tbl,linux-user/arm/syscall.tbl \
4arch/m68k/kernel/syscalls/syscall.tbl,linux-user/m68k/syscall.tbl \
5arch/microblaze/kernel/syscalls/syscall.tbl,linux-user/microblaze/syscall.tbl \
6arch/mips/kernel/syscalls/syscall_n32.tbl,linux-user/mips64/syscall_n32.tbl \
7arch/mips/kernel/syscalls/syscall_n64.tbl,linux-user/mips64/syscall_n64.tbl \
8arch/mips/kernel/syscalls/syscall_o32.tbl,linux-user/mips/syscall_o32.tbl \
9arch/parisc/kernel/syscalls/syscall.tbl,linux-user/hppa/syscall.tbl \
10arch/powerpc/kernel/syscalls/syscall.tbl,linux-user/ppc/syscall.tbl \
11arch/s390/kernel/syscalls/syscall.tbl,linux-user/s390x/syscall.tbl \
12arch/sh/kernel/syscalls/syscall.tbl,linux-user/sh4/syscall.tbl \
13arch/sparc/kernel/syscalls/syscall.tbl,linux-user/sparc64/syscall.tbl \
14arch/sparc/kernel/syscalls/syscall.tbl,linux-user/sparc/syscall.tbl \
15arch/x86/entry/syscalls/syscall_32.tbl,linux-user/i386/syscall_32.tbl \
16arch/x86/entry/syscalls/syscall_64.tbl,linux-user/x86_64/syscall_64.tbl \
17arch/xtensa/kernel/syscalls/syscall.tbl,linux-user/xtensa/syscall.tbl\
18"
19
20linux="$1"
21output="$2"
22
23if [ -z "$linux" ] || ! [ -d "$linux" ]; then
24    cat << EOF
25usage: update-syscalltbl.sh LINUX_PATH [OUTPUT_PATH]
26
27LINUX_PATH      Linux kernel directory to obtain the syscall.tbl from
28OUTPUT_PATH     output directory, usually the qemu source tree (default: $PWD)
29EOF
30    exit 1
31fi
32
33if [ -z "$output" ]; then
34    output="$PWD"
35fi
36
37for entry in $TBL_LIST; do
38    OFS="$IFS"
39    IFS=,
40    set $entry
41    src=$1
42    dst=$2
43    IFS="$OFS"
44    if ! cp "$linux/$src" "$output/$dst" ; then
45        echo "Cannot copy $linux/$src to $output/$dst" 1>&2
46        exit 1
47    fi
48done
49
50