Server IP : 13.213.54.232 / Your IP : 216.73.216.30 Web Server : Apache/2.4.52 (Ubuntu) System : Linux ip-172-31-17-110 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 User : www-data ( 33) PHP Version : 7.1.33-67+ubuntu22.04.1+deb.sury.org+1 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/modules/6.8.0-1029-aws/build/scripts/ |
Upload File : |
#!/bin/sh # SPDX-License-Identifier: GPL-2.0-only # # Generate a syscall table header. # # Each line of the syscall table should have the following format: # # NR ABI NAME [NATIVE] [COMPAT] # # NR syscall number # ABI ABI name # NAME syscall name # NATIVE native entry point (optional) # COMPAT compat entry point (optional) set -e usage() { echo >&2 "usage: $0 [--abis ABIS] INFILE OUTFILE" >&2 echo >&2 echo >&2 " INFILE input syscall table" echo >&2 " OUTFILE output header file" echo >&2 echo >&2 "options:" echo >&2 " --abis ABIS ABI(s) to handle (By default, all lines are handled)" exit 1 } # default unless specified by options abis= while [ $# -gt 0 ] do case $1 in --abis) abis=$(echo "($2)" | tr ',' '|') shift 2;; -*) echo "$1: unknown option" >&2 usage;; *) break;; esac done if [ $# -ne 2 ]; then usage fi infile="$1" outfile="$2" nxt=0 grep -E "^[0-9]+[[:space:]]+$abis" "$infile" | { while read nr abi name native compat noreturn; do if [ $nxt -gt $nr ]; then echo "error: $infile: syscall table is not sorted or duplicates the same syscall number" >&2 exit 1 fi while [ $nxt -lt $nr ]; do echo "__SYSCALL($nxt, sys_ni_syscall)" nxt=$((nxt + 1)) done if [ "$compat" = "-" ]; then unset compat fi if [ -n "$noreturn" ]; then if [ "$noreturn" != "noreturn" ]; then echo "error: $infile: invalid string \"$noreturn\" in 'noreturn' column" exit 1 fi if [ -n "$compat" ]; then echo "__SYSCALL_COMPAT_NORETURN($nr, $native, $compat)" else echo "__SYSCALL_NORETURN($nr, $native)" fi elif [ -n "$compat" ]; then echo "__SYSCALL_WITH_COMPAT($nr, $native, $compat)" elif [ -n "$native" ]; then echo "__SYSCALL($nr, $native)" else echo "__SYSCALL($nr, sys_ni_syscall)" fi nxt=$((nr + 1)) done } > "$outfile"