Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/syscalls: Refactor syscalltbl.sh

This splits out the code to emit a syscall line.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1bfcbba991f5cfaa9291ff950a593daa972a205f.1454022279.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Andy Lutomirski and committed by
Ingo Molnar
fba32474 e21d50f3

+13 -5
+13 -5
arch/x86/entry/syscalls/syscalltbl.sh
··· 3 3 in="$1" 4 4 out="$2" 5 5 6 + emit() { 7 + abi="$1" 8 + nr="$2" 9 + entry="$3" 10 + compat="$4" 11 + if [ -n "$compat" ]; then 12 + echo "__SYSCALL_${abi}($nr, $entry, $compat)" 13 + elif [ -n "$entry" ]; then 14 + echo "__SYSCALL_${abi}($nr, $entry, $entry)" 15 + fi 16 + } 17 + 6 18 grep '^[0-9]' "$in" | sort -n | ( 7 19 while read nr abi name entry compat; do 8 20 abi=`echo "$abi" | tr '[a-z]' '[A-Z]'` 9 - if [ -n "$compat" ]; then 10 - echo "__SYSCALL_${abi}($nr, $entry, $compat)" 11 - elif [ -n "$entry" ]; then 12 - echo "__SYSCALL_${abi}($nr, $entry, $entry)" 13 - fi 21 + emit "$abi" "$nr" "$entry" "$compat" 14 22 done 15 23 ) > "$out"