2011-11-12 06:55:49 +07:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
in="$1"
|
|
|
|
out="$2"
|
2011-11-19 07:03:27 +07:00
|
|
|
my_abis=`echo "($3)" | tr ',' '|'`
|
2011-11-12 06:55:49 +07:00
|
|
|
prefix="$4"
|
|
|
|
offset="$5"
|
|
|
|
|
|
|
|
fileguard=_ASM_X86_`basename "$out" | sed \
|
|
|
|
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
|
|
|
|
-e 's/[^A-Z0-9_]/_/g' -e 's/__/_/g'`
|
2011-11-19 07:03:27 +07:00
|
|
|
grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
|
2011-11-12 06:55:49 +07:00
|
|
|
echo "#ifndef ${fileguard}"
|
|
|
|
echo "#define ${fileguard} 1"
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
while read nr abi name entry ; do
|
2011-11-19 08:01:19 +07:00
|
|
|
if [ -z "$offset" ]; then
|
|
|
|
echo "#define __NR_${prefix}${name} $nr"
|
|
|
|
else
|
|
|
|
echo "#define __NR_${prefix}${name} ($offset + $nr)"
|
|
|
|
fi
|
2011-11-12 06:55:49 +07:00
|
|
|
done
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "#endif /* ${fileguard} */"
|
|
|
|
) > "$out"
|