summaryrefslogtreecommitdiff
path: root/src/arch.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2020-01-07 14:51:19 +0100
committerPaul Moore <paul@paul-moore.com>2020-02-23 10:27:58 -0500
commit5432e15521d5ce5a7d3f26bf78674cbaa9d73d1f (patch)
treef0bf4ab2fcb55620c15aae9f4c6169bea6d73285 /src/arch.c
parent0a4c0300ebcc982cf419a4f7382ffc28e4792d2a (diff)
downloadlibseccomp-5432e15521d5ce5a7d3f26bf78674cbaa9d73d1f.tar.gz
arch: Add RISC-V 64-bit support
Signed-off-by: Andreas Schwab <schwab@suse.de> [PM: minor macro shuffling in seccomp.h.in] Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'src/arch.c')
-rw-r--r--src/arch.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/arch.c b/src/arch.c
index bfa664f..83c2c9b 100644
--- a/src/arch.c
+++ b/src/arch.c
@@ -41,6 +41,7 @@
#include "arch-parisc.h"
#include "arch-ppc.h"
#include "arch-ppc64.h"
+#include "arch-riscv64.h"
#include "arch-s390.h"
#include "arch-s390x.h"
#include "db.h"
@@ -94,6 +95,8 @@ const struct arch_def *arch_def_native = &arch_def_ppc;
const struct arch_def *arch_def_native = &arch_def_s390x;
#elif __s390__
const struct arch_def *arch_def_native = &arch_def_s390;
+#elif __riscv && __riscv_xlen == 64
+const struct arch_def *arch_def_native = &arch_def_riscv64;
#else
#error the arch code needs to know about your machine type
#endif /* machine type guess */
@@ -156,6 +159,8 @@ const struct arch_def *arch_def_lookup(uint32_t token)
return &arch_def_s390;
case SCMP_ARCH_S390X:
return &arch_def_s390x;
+ case SCMP_ARCH_RISCV64:
+ return &arch_def_riscv64;
}
return NULL;
@@ -206,6 +211,8 @@ const struct arch_def *arch_def_lookup_name(const char *arch_name)
return &arch_def_s390;
else if (strcmp(arch_name, "s390x") == 0)
return &arch_def_s390x;
+ else if (strcmp(arch_name, "riscv64") == 0)
+ return &arch_def_riscv64;
return NULL;
}