summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>2020-08-17 13:12:14 +0200
committerPaul Moore <paul@paul-moore.com>2021-03-08 19:55:32 -0500
commitc12945db0b7e32f409ba3a68d18c6d6f6dd22b19 (patch)
treed87fc7447552cc09a1fe385a2a27a604c7717419 /tools
parent83d7b022fa7ef8c24516cc668efc879e5398403f (diff)
downloadlibseccomp-c12945db0b7e32f409ba3a68d18c6d6f6dd22b19.tar.gz
arch: Add SuperH 32-bit support
Initial support for seccomp for SuperH in Linux was added in 2.6.27-rc2, support for SECCOMP_FILTER was added for Linux 5.9. This adds support for SuperH in libseccomp, both for little-endian and big-endian mode. Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> Acked-by: Tom Hromatka <tom.hromatka@oracle.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/scmp_arch_detect.c6
-rw-r--r--tools/scmp_bpf_sim.c4
-rw-r--r--tools/util.c6
3 files changed, 16 insertions, 0 deletions
diff --git a/tools/scmp_arch_detect.c b/tools/scmp_arch_detect.c
index b844a68..b6bd2bb 100644
--- a/tools/scmp_arch_detect.c
+++ b/tools/scmp_arch_detect.c
@@ -123,6 +123,12 @@ int main(int argc, char *argv[])
case SCMP_ARCH_RISCV64:
printf("riscv64\n");
break;
+ case SCMP_ARCH_SHEB:
+ printf("sheb\n");
+ break;
+ case SCMP_ARCH_SH:
+ printf("sh\n");
+ break;
default:
printf("unknown\n");
}
diff --git a/tools/scmp_bpf_sim.c b/tools/scmp_bpf_sim.c
index 3b581c6..04edfbc 100644
--- a/tools/scmp_bpf_sim.c
+++ b/tools/scmp_bpf_sim.c
@@ -287,6 +287,10 @@ int main(int argc, char *argv[])
arch = AUDIT_ARCH_S390X;
else if (strcmp(optarg, "riscv64") == 0)
arch = AUDIT_ARCH_RISCV64;
+ else if (strcmp(optarg, "sheb") == 0)
+ arch = AUDIT_ARCH_SH;
+ else if (strcmp(optarg, "sh") == 0)
+ arch = AUDIT_ARCH_SHEL;
else
exit_fault(EINVAL);
break;
diff --git a/tools/util.c b/tools/util.c
index 7da22f4..afea6c9 100644
--- a/tools/util.c
+++ b/tools/util.c
@@ -80,6 +80,12 @@
#define ARCH_NATIVE AUDIT_ARCH_S390
#elif __riscv && __riscv_xlen == 64
#define ARCH_NATIVE AUDIT_ARCH_RISCV64
+#elif __sh__
+#ifdef __BIG_ENDIAN__
+#define ARCH_NATIVE AUDIT_ARCH_SH
+#else
+#define ARCH_NATIVE AUDIT_ARCH_SHEL
+#endif
#else
#error the simulator code needs to know about your machine type
#endif