1 #!/bin/sh 2 # SPDX-License-Identifier: GPL-2.0 3 in="$1" 4 out="$2" 5 align=1 6 7 fileguard=_ASM_ARM_`basename "$out" | sed \ 8 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHI 9 -e 's/[^A-Z0-9_]/_/g' -e 's/__/_/g'` 10 11 grep -E "^[0-9A-Fa-fXx]+[[:space:]]+" "$in" | 12 echo "#ifndef ${fileguard} 13 #define ${fileguard} 1 14 15 /* 16 * This needs to be greater than __NR_last_sys 17 * for the padding in the syscall table. 18 */ 19 " 20 21 while read nr abi name entry; do 22 nr=$(($nr + 1)) 23 while [ "$(($nr / (256 * $align) ))" - 24 align=$(( $align * 4 )) 25 done 26 nr=$(( ($nr + $align - 1) & ~($align - 27 echo "/* aligned to $align */" 28 echo "#define __NR_syscalls $nr" 29 done 30 31 echo "" 32 echo "#endif /* ${fileguard} */" 33 ) > "$out"
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.