summaryrefslogtreecommitdiff
path: root/src/arch-syscall-validate
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch-syscall-validate')
-rwxr-xr-xsrc/arch-syscall-validate27
1 files changed, 10 insertions, 17 deletions
diff --git a/src/arch-syscall-validate b/src/arch-syscall-validate
index 17f63fe..97c3378 100755
--- a/src/arch-syscall-validate
+++ b/src/arch-syscall-validate
@@ -166,22 +166,13 @@ function dump_lib_x32() {
# Dump the architecture's syscall table to stdout.
#
function dump_sys_arm() {
- # NOTE: arm_sync_file_range() and sync_file_range2() share values
- gcc -E -dM -D__ARM_EABI__ $1/arch/arm/include/uapi/asm/unistd.h | \
- grep "^#define __\(ARM_\)*NR_" | \
- grep -v "^#define __NR_OABI_SYSCALL_BASE" | \
- grep -v "^#define __NR_SYSCALL_BASE" | \
- grep -v "^#define __ARM_NR_BASE" | \
- sed -e 's/#define[ \t]\+__NR_\([^ \t]\+\)[ \t]\+(__NR_SYSCALL_BASE[ \t]*+[ \t]*\([0-9]\+\)).*/\1\t\2/;s/#define[ \t]\+__ARM_NR_\([^ \t]\+\)[ \t]\+(__ARM_NR_BASE[ \t]*+[ \t]*\([0-9]\+\)).*/\1\t983040 + \2/' | \
- while read line; do \
- if echo "$line" | grep -q "+"; then \
- echo "$line" | awk '{ print $1"\t"$2+$4 }'; \
- else \
- echo "$line"; \
- fi; \
- done | \
- sed -e '/#define __NR_sync_file_range2[ \t]\+__NR_arm_sync_file_range/d' | \
- sort
+ cat $1/arch/arm/tools/syscall.tbl | grep -v "^#" | \
+ sed -ne "/[0-9]\+[ \t]\+\(common\|eabi\)/p" | \
+ awk '{ print $3"\t"$1 }' | sort | (cat -; \
+ (cat $1/arch/arm/include/uapi/asm/unistd.h | \
+ grep "^#define __ARM_NR_" | grep -v "^#define __ARM_NR_BASE" | \
+ sed -e 's/#define __ARM_NR_\([a-z0-9_]*\)[ \t]\+(__ARM_NR_BASE+\(.*\))/\1 983040 + \2/' | \
+ awk '{ print $1"\t"$2+$4 }')) | sort
}
#
@@ -203,7 +194,9 @@ function dump_lib_arm() {
# Dump the architecture's syscall table to stdout.
#
function dump_sys_aarch64() {
- gcc -E -dM -I$1/include/uapi -D__BITS_PER_LONG=64 $1/include/uapi/asm-generic/unistd.h | \
+ gcc -E -dM -I$1/include/uapi \
+ -D__BITS_PER_LONG=64 -D__ARCH_WANT_RENAMEAT \
+ $1/include/uapi/asm-generic/unistd.h | \
grep "^#define __NR_" | \
sed -e '/__NR_syscalls/d' | \
sed -e '/__NR_arch_specific_syscall/d' | \