]>
git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/syscalls/update-linux-from-src.sh
3 # Copyright (C) 2022-2024 Free Software Foundation, Inc.
5 # This file is part of GDB.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 # Used to generate .xml.in files, like so:
21 # $ ./update-linux-from-src.sh ~/linux-stable.git
24 echo "dir argument needed"
31 if [ ! -d "$d" ]; then
44 <!-- Copyright (C) $start_date-$year Free Software Foundation, Inc.
46 Copying and distribution of this file, with or without modification,
47 are permitted in any medium without royalty provided the copyright
48 notice and this notice are preserved. -->
50 <!DOCTYPE feature SYSTEM "gdb-syscalls.dtd">
52 <!-- This file was generated using the following file:
56 The file mentioned above belongs to the Linux Kernel. -->
61 echo '<syscalls_info>'
67 echo '</syscalls_info>'
77 pre
"$f" "$start_date"
79 grep -v "^#" "$d/$f" \
80 |
awk '{print $2, $3, $1}' \
82 |
grep -E -v " (reserved|unused)[0-9]+ " \
83 |
awk "{printf \" <syscall name=\\\"%s\\\" number=\\\"%s\\\"/>\n\", \$2, \$3 + $offset}"
94 t
="arch/x86/entry/syscalls/syscall_64.tbl"
98 t
="arch/x86/entry/syscalls/syscall_32.tbl"
102 t
="arch/powerpc/kernel/syscalls/syscall.tbl"
103 abi
="(common|64|nospu)"
106 t
="arch/powerpc/kernel/syscalls/syscall.tbl"
107 abi
="(common|32|nospu)"
110 t
="arch/s390/kernel/syscalls/syscall.tbl"
114 t
="arch/s390/kernel/syscalls/syscall.tbl"
117 sparc64-linux.xml.
in)
118 t
="arch/sparc/kernel/syscalls/syscall.tbl"
123 t
="arch/sparc/kernel/syscalls/syscall.tbl"
127 mips-n32-linux.xml.
in)
128 t
="arch/mips/kernel/syscalls/syscall_n32.tbl"
133 mips-n64-linux.xml.
in)
134 t
="arch/mips/kernel/syscalls/syscall_n64.tbl"
139 mips-o32-linux.xml.
in)
140 t
="arch/mips/kernel/syscalls/syscall_o32.tbl"
146 echo "Skipping $f, no longer supported"
149 aarch64-linux.xml.
in)
150 echo "Skipping $f, no syscall.tbl"
154 echo "Skipping $f, use arm-linux.py instead"
157 linux-defaults.xml.
in)
161 echo "Don't know how to generate $f"
167 one
"$t" "$abi" "$start_date" "$offset" > "$f"