summaryrefslogtreecommitdiff
path: root/src/arch-syscall-validate
diff options
context:
space:
mode:
authorPaul Moore <pmoore@redhat.com>2014-08-19 19:55:49 -0400
committerPaul Moore <pmoore@redhat.com>2014-08-20 00:06:56 -0400
commit263fd5d1f29e4eb54782c89a8d6f29554a592708 (patch)
tree8dad94ff4c4c41534a5bffd61679f5b775605ffe /src/arch-syscall-validate
parent9cd35f411eeb591e0a201063cb8cda5dee530953 (diff)
downloadlibseccomp-263fd5d1f29e4eb54782c89a8d6f29554a592708.tar.gz
arch: add mips64n32 support
Signed-off-by: Paul Moore <pmoore@redhat.com>
Diffstat (limited to 'src/arch-syscall-validate')
-rwxr-xr-xsrc/arch-syscall-validate39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/arch-syscall-validate b/src/arch-syscall-validate
index 279dd87..e765c35 100755
--- a/src/arch-syscall-validate
+++ b/src/arch-syscall-validate
@@ -232,6 +232,39 @@ function dump_lib_mips64() {
}
#
+# Dump the mips64n32 system syscall table
+#
+# Arguments:
+# 1 path to the kernel source
+#
+# Dump the architecture's syscall table to stdout.
+#
+function dump_sys_mips64n32() {
+ # _MIPS_SIM values:
+ # _MIPS_SIM_ABI32 == 1
+ # _MIPS_SIM_NABI32 == 2
+ # _MIPS_SIM_ABI64 == 3
+ gcc -E -dM -I$1/arch/mips/include/uapi -D_MIPS_SIM=2 $1/arch/mips/include/uapi/asm/unistd.h | \
+ grep "^#define __NR_" | sort | \
+ grep -v "^#define __NR_O32_" | \
+ grep -v "^#define __NR_N32_" | \
+ grep -v "^#define __NR_64_" | \
+ grep -v "^#define __NR_Linux" | \
+ grep -v "^#define __NR_unused" | \
+ grep -v "^#define __NR_reserved" | \
+ sed -e 's/#define[ \t]\+__NR_\([^ \t]\+\)[ \t]\+(__NR_Linux[ \t]*+[ \t]*\([0-9]\+\)).*/\1\t\2/'
+}
+
+#
+# Dump the mips64n32 library syscall table
+#
+# Dump the library's syscall table to stdout.
+#
+function dump_lib_mips64n32() {
+ $LIB_SYS_DUMP -a mips64n32 -o 6000 | sed -e '/[^\t]\+\t-[0-9]\+/d'
+}
+
+#
# Dump the system syscall table
#
# Arguments:
@@ -260,6 +293,9 @@ function dump_sys() {
mips64)
dump_sys_mips64 "$2"
;;
+ mips64n32)
+ dump_sys_mips64n32 "$2"
+ ;;
*)
echo ""
;;
@@ -294,6 +330,9 @@ function dump_lib() {
mips64)
dump_lib_mips64 "$2"
;;
+ mips64n32)
+ dump_lib_mips64n32 "$2"
+ ;;
*)
echo ""
;;