Discussion:
[libseccomp-discuss] [PATCH] arch: ensure we have definitions for the MIPS N32 ABI
Paul Moore
2014-08-26 18:29:30 UTC
Permalink
Signed-off-by: Paul Moore <***@redhat.com>
---
include/seccomp.h.in | 10 ++++++++++
tools/util.h | 12 ++++++++++++
2 files changed, 22 insertions(+)

diff --git a/include/seccomp.h.in b/include/seccomp.h.in
index 72c61bf..2a9d4a9 100644
--- a/include/seccomp.h.in
+++ b/include/seccomp.h.in
@@ -127,9 +127,19 @@ struct scmp_arg_cmp {
*/
#define SCMP_ARCH_MIPS AUDIT_ARCH_MIPS
#define SCMP_ARCH_MIPS64 AUDIT_ARCH_MIPS64
+#ifndef AUDIT_ARCH_MIPS64N32
+/* MIPS64N32 support was merged in 3.15 */
+#define AUDIT_ARCH_MIPS64N32 (EM_MIPS|__AUDIT_ARCH_64BIT|\
+ __AUDIT_ARCH_CONVENTION_MIPS64_N32)
+#endif
#define SCMP_ARCH_MIPS64N32 AUDIT_ARCH_MIPS64N32
#define SCMP_ARCH_MIPSEL AUDIT_ARCH_MIPSEL
#define SCMP_ARCH_MIPSEL64 AUDIT_ARCH_MIPSEL64
+#ifndef AUDIT_ARCH_MIPSEL64N32
+/* MIPSEL64N32 support was merged in 3.15 */
+#define AUDIT_ARCH_MIPSEL64N32 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE|\
+ __AUDIT_ARCH_CONVENTION_MIPS64_N32)
+#endif
#define SCMP_ARCH_MIPSEL64N32 AUDIT_ARCH_MIPSEL64N32

/**
diff --git a/tools/util.h b/tools/util.h
index 72c4cce..2903769 100644
--- a/tools/util.h
+++ b/tools/util.h
@@ -24,6 +24,18 @@

#include <inttypes.h>

+#ifndef AUDIT_ARCH_MIPS64N32
+/* MIPS64N32 support was merged in 3.15 */
+#define AUDIT_ARCH_MIPS64N32 (EM_MIPS|__AUDIT_ARCH_64BIT|\
+ __AUDIT_ARCH_CONVENTION_MIPS64_N32)
+#endif
+
+#ifndef AUDIT_ARCH_MIPSEL64N32
+/* MIPSEL64N32 support was merged in 3.15 */
+#define AUDIT_ARCH_MIPSEL64N32 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE|\
+ __AUDIT_ARCH_CONVENTION_MIPS64_N32)
+#endif
+
extern uint32_t arch;

void exit_usage(const char *program);

Loading...