summaryrefslogtreecommitdiff
path: root/src/arch-syscall-validate
diff options
context:
space:
mode:
authorPaul Moore <pmoore@redhat.com>2014-09-25 16:28:38 -0400
committerPaul Moore <pmoore@redhat.com>2015-02-06 17:50:10 -0500
commit6d7b7c8e27b0cb2ba0470ff02917d1faba9430ba (patch)
tree928c1d043f15f3d11429fb7efcc31fb3276a0167 /src/arch-syscall-validate
parentda7c08dd54e9403d0c5b62baf38c37db838b7013 (diff)
downloadlibseccomp-6d7b7c8e27b0cb2ba0470ff02917d1faba9430ba.tar.gz
arch: add a ppc64 syscall table
Signed-off-by: Paul Moore <pmoore@redhat.com>
Diffstat (limited to 'src/arch-syscall-validate')
-rwxr-xr-xsrc/arch-syscall-validate31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/arch-syscall-validate b/src/arch-syscall-validate
index 2cbf696..eeb4d8b 100755
--- a/src/arch-syscall-validate
+++ b/src/arch-syscall-validate
@@ -303,6 +303,29 @@ 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 $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 system syscall table
#
# Arguments:
@@ -337,6 +360,9 @@ function dump_sys() {
mips64n32)
dump_sys_mips64n32 "$2"
;;
+ ppc64)
+ dump_sys_ppc64 "$2"
+ ;;
*)
echo ""
;;
@@ -377,6 +403,9 @@ function dump_lib() {
mips64n32)
dump_lib_mips64n32 "$2"
;;
+ ppc64)
+ dump_lib_ppc64 "$2"
+ ;;
*)
echo ""
;;
@@ -413,7 +442,7 @@ shift $(($OPTIND - 1))
# defaults
if [[ $arches == "" ]]; then
- arches="x86 x86_64 x32 arm aarch64 mips mips64 mips64n32"
+ arches="x86 x86_64 x32 arm aarch64 mips mips64 mips64n32 ppc64"
fi
# sanity checks