linux/arch/arm/tools/syscalltbl.sh
Russell King 96a8fae0fe ARM: convert to generated system call tables
Convert ARM to use a similar mechanism to x86 to generate the unistd.h
system call numbers and the various kernel system call tables.  This
means that rather than having to edit three places (asm/unistd.h for
the total number of system calls, uapi/asm/unistd.h for the system call
numbers, and arch/arm/kernel/calls.S for the call table) we have only
one place to edit, making the process much more simple.

The scripts have knowledge of the table padding requirements, so there's
no need to worry about __NR_syscalls not fitting within the immediate
constant field of ALU instructions anymore.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2016-10-18 21:34:06 +01:00

22 lines
574 B
Bash

#!/bin/sh
in="$1"
out="$2"
my_abis=`echo "($3)" | tr ',' '|'`
grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
while read nr abi name entry compat; do
if [ "$abi" = "eabi" -a -n "$compat" ]; then
echo "$in: error: a compat entry for an EABI syscall ($name) makes no sense" >&2
exit 1
fi
if [ -n "$entry" ]; then
if [ -z "$compat" ]; then
echo "NATIVE($nr, $entry)"
else
echo "COMPAT($nr, $entry, $compat)"
fi
fi
done
) > "$out"