From 5432e15521d5ce5a7d3f26bf78674cbaa9d73d1f Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Tue, 7 Jan 2020 14:51:19 +0100 Subject: arch: Add RISC-V 64-bit support Signed-off-by: Andreas Schwab [PM: minor macro shuffling in seccomp.h.in] Signed-off-by: Paul Moore --- include/seccomp-syscalls.h | 5 +++++ include/seccomp.h.in | 12 ++++++++++++ 2 files changed, 17 insertions(+) (limited to 'include') diff --git a/include/seccomp-syscalls.h b/include/seccomp-syscalls.h index 3c958df..d7eb383 100644 --- a/include/seccomp-syscalls.h +++ b/include/seccomp-syscalls.h @@ -273,6 +273,7 @@ #define __PNR_timerfd_settime64 -10239 #define __PNR_utimensat_time64 -10240 #define __PNR_ppoll -10241 +#define __PNR_renameat -10242 /* * libseccomp syscall definitions @@ -1494,7 +1495,11 @@ #define __SNR_rename __PNR_rename #endif +#ifdef __NR_renameat #define __SNR_renameat __NR_renameat +#else +#define __SNR_renameat __PNR_renameat +#endif #define __SNR_renameat2 __NR_renameat2 diff --git a/include/seccomp.h.in b/include/seccomp.h.in index 42f3a79..208b366 100644 --- a/include/seccomp.h.in +++ b/include/seccomp.h.in @@ -196,6 +196,18 @@ struct scmp_arg_cmp { #define SCMP_ARCH_PARISC AUDIT_ARCH_PARISC #define SCMP_ARCH_PARISC64 AUDIT_ARCH_PARISC64 +/** + * The RISC-V architecture tokens + */ +/* RISC-V support for audit was merged in 5.0-rc1 */ +#ifndef AUDIT_ARCH_RISCV64 +#ifndef EM_RISCV +#define EM_RISCV 243 +#endif /* EM_RISCV */ +#define AUDIT_ARCH_RISCV64 (EM_RISCV|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) +#endif /* AUDIT_ARCH_RISCV64 */ +#define SCMP_ARCH_RISCV64 AUDIT_ARCH_RISCV64 + /** * Convert a syscall name into the associated syscall number * @param x the syscall name -- cgit v1.2.1