mirror of
https://github.com/torvalds/linux.git
synced 2024-11-16 00:52:01 +00:00
3f86886c72
Allow the specified syscall offset to be symbolic, e.g. a macro. For offset system calls, this if nothing else makes the generated code easier to read. Suggested-by: H. J. Lu <hjl.tools@gmail.com> Link: http://lkml.kernel.org/r/1321569446-20433-7-git-send-email-hpa@linux.intel.com Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
28 lines
644 B
Bash
28 lines
644 B
Bash
#!/bin/sh
|
|
|
|
in="$1"
|
|
out="$2"
|
|
my_abis=`echo "($3)" | tr ',' '|'`
|
|
prefix="$4"
|
|
offset="$5"
|
|
|
|
fileguard=_ASM_X86_`basename "$out" | sed \
|
|
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
|
|
-e 's/[^A-Z0-9_]/_/g' -e 's/__/_/g'`
|
|
grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
|
|
echo "#ifndef ${fileguard}"
|
|
echo "#define ${fileguard} 1"
|
|
echo ""
|
|
|
|
while read nr abi name entry ; do
|
|
if [ -z "$offset" ]; then
|
|
echo "#define __NR_${prefix}${name} $nr"
|
|
else
|
|
echo "#define __NR_${prefix}${name} ($offset + $nr)"
|
|
fi
|
|
done
|
|
|
|
echo ""
|
|
echo "#endif /* ${fileguard} */"
|
|
) > "$out"
|