diff options
Diffstat (limited to 'src/arch-syscall-validate')
-rwxr-xr-x | src/arch-syscall-validate | 60 |
1 files changed, 59 insertions, 1 deletions
diff --git a/src/arch-syscall-validate b/src/arch-syscall-validate index 7cf7b8b..ba5cd89 100755 --- a/src/arch-syscall-validate +++ b/src/arch-syscall-validate @@ -319,6 +319,52 @@ function dump_lib_mips64n32() { } # +# Dump the ppc64 system syscall table +# +# Arguments: +# 1 path to the kernel source +# +# Dump the architecture's syscall table to stdout. +# +function dump_sys_ppc64() { + gcc -E -dM -D__powerpc64__ $1/arch/powerpc/include/uapi/asm/unistd.h | \ + grep "^#define __NR_" | sort | \ + sed -e 's/#define[ \t]\+__NR_\([a-z0-9_]\+\)[ \t]\+\([0-9]\+\)/\1\t\2/' +} + +# +# Dump the ppc64 library syscall table +# +# Dump the library's syscall table to stdout. +# +function dump_lib_ppc64() { + $LIB_SYS_DUMP -a ppc64 | sed -e '/[^\t]\+\t-[0-9]\+/d' +} + +# +# Dump the ppc system syscall table +# +# Arguments: +# 1 path to the kernel source +# +# Dump the architecture's syscall table to stdout. +# +function dump_sys_ppc() { + gcc -E -dM $1/arch/powerpc/include/uapi/asm/unistd.h | \ + grep "^#define __NR_" | sort | \ + sed -e 's/#define[ \t]\+__NR_\([a-z0-9_]\+\)[ \t]\+\([0-9]\+\)/\1\t\2/' +} + +# +# Dump the ppc library syscall table +# +# Dump the library's syscall table to stdout. +# +function dump_lib_ppc() { + $LIB_SYS_DUMP -a ppc | sed -e '/[^\t]\+\t-[0-9]\+/d' +} + +# # Dump the system syscall table # # Arguments: @@ -353,6 +399,12 @@ function dump_sys() { mips64n32) dump_sys_mips64n32 "$2" ;; + ppc64) + dump_sys_ppc64 "$2" + ;; + ppc) + dump_sys_ppc "$2" + ;; *) echo "" ;; @@ -393,6 +445,12 @@ function dump_lib() { mips64n32) dump_lib_mips64n32 ;; + ppc64) + dump_lib_ppc64 "$2" + ;; + ppc) + dump_lib_ppc "$2" + ;; *) echo "" ;; @@ -439,7 +497,7 @@ shift $(($OPTIND - 1)) # defaults if [[ $opt_arches == "" ]]; then - opt_arches="x86 x86_64 x32 arm aarch64 mips mips64 mips64n32" + opt_arches="x86 x86_64 x32 arm aarch64 mips mips64 mips64n32 ppc pcc64" fi # sanity checks |