From 02030ce9920181bc1058990ecaefaa754de9ad3a Mon Sep 17 00:00:00 2001 From: Jan Willeke Date: Mon, 1 Jun 2015 14:22:08 +0200 Subject: arch: add support for s390x This patch adds support for S390x (64-bit) architecture. Signed-off-by: Jan Willeke [PM: rewrote the subject line, style fixes] Signed-off-by: Paul Moore --- tools/scmp_arch_detect.c | 3 +++ tools/scmp_bpf_sim.c | 2 ++ tools/util.c | 2 ++ 3 files changed, 7 insertions(+) (limited to 'tools') diff --git a/tools/scmp_arch_detect.c b/tools/scmp_arch_detect.c index 5a87252..1382190 100644 --- a/tools/scmp_arch_detect.c +++ b/tools/scmp_arch_detect.c @@ -99,6 +99,9 @@ int main(int argc, char *argv[]) case SCMP_ARCH_MIPSEL64N32: printf("mipsel64n32\n"); break; + case SCMP_ARCH_S390X: + printf("s390x\n"); + break; default: printf("unknown\n"); } diff --git a/tools/scmp_bpf_sim.c b/tools/scmp_bpf_sim.c index bb3a2e7..b32c880 100644 --- a/tools/scmp_bpf_sim.c +++ b/tools/scmp_bpf_sim.c @@ -249,6 +249,8 @@ int main(int argc, char *argv[]) arch = AUDIT_ARCH_MIPS64N32; else if (strcmp(optarg, "mipsel64n32") == 0) arch = AUDIT_ARCH_MIPSEL64N32; + else if (strcmp(optarg, "s390x") == 0) + arch = AUDIT_ARCH_S390X; else exit_fault(EINVAL); break; diff --git a/tools/util.c b/tools/util.c index 9b58bbb..edafbd9 100644 --- a/tools/util.c +++ b/tools/util.c @@ -62,6 +62,8 @@ #elif __MIPSEL__ #define ARCH_NATIVE AUDIT_ARCH_MIPSEL64N32 #endif /* _MIPS_SIM_NABI32 */ +#elif __s390x__ +#define ARCH_NATIVE AUDIT_ARCH_S390X #else #error the simulator code needs to know about your machine type #endif -- cgit v1.2.1 From acc895703daf72d6c9a83db2b7a0f8ff73b37ad5 Mon Sep 17 00:00:00 2001 From: Jan Willeke Date: Mon, 1 Jun 2015 14:22:09 +0200 Subject: arch: add support for s390 This patch adds support for S390 (32-bit) architecture. Signed-off-by: Jan Willeke [PM: rewrote the subject line, style fixes, s390x/s390 typo bugfixes] Signed-off-by: Paul Moore --- tools/scmp_arch_detect.c | 3 +++ tools/scmp_bpf_sim.c | 2 ++ tools/util.c | 2 ++ 3 files changed, 7 insertions(+) (limited to 'tools') diff --git a/tools/scmp_arch_detect.c b/tools/scmp_arch_detect.c index 1382190..adf624f 100644 --- a/tools/scmp_arch_detect.c +++ b/tools/scmp_arch_detect.c @@ -99,6 +99,9 @@ int main(int argc, char *argv[]) case SCMP_ARCH_MIPSEL64N32: printf("mipsel64n32\n"); break; + case SCMP_ARCH_S390: + printf("s390\n"); + break; case SCMP_ARCH_S390X: printf("s390x\n"); break; diff --git a/tools/scmp_bpf_sim.c b/tools/scmp_bpf_sim.c index b32c880..c4334b1 100644 --- a/tools/scmp_bpf_sim.c +++ b/tools/scmp_bpf_sim.c @@ -249,6 +249,8 @@ int main(int argc, char *argv[]) arch = AUDIT_ARCH_MIPS64N32; else if (strcmp(optarg, "mipsel64n32") == 0) arch = AUDIT_ARCH_MIPSEL64N32; + else if (strcmp(optarg, "s390") == 0) + arch = AUDIT_ARCH_S390; else if (strcmp(optarg, "s390x") == 0) arch = AUDIT_ARCH_S390X; else diff --git a/tools/util.c b/tools/util.c index edafbd9..266e027 100644 --- a/tools/util.c +++ b/tools/util.c @@ -62,6 +62,8 @@ #elif __MIPSEL__ #define ARCH_NATIVE AUDIT_ARCH_MIPSEL64N32 #endif /* _MIPS_SIM_NABI32 */ +#elif __s390__ +#define ARCH_NATIVE AUDIT_ARCH_S390 #elif __s390x__ #define ARCH_NATIVE AUDIT_ARCH_S390X #else -- cgit v1.2.1 From d7ba987a20581f324a5197154db694c1fe46429f Mon Sep 17 00:00:00 2001 From: Jan Willeke Date: Mon, 13 Jul 2015 15:15:39 +0200 Subject: s390x: fix plattform detection Because on S390x both __s390x__ and __s390__ are defined, the check of __s390x__ must be before __s390__. Signed-off-by: Jan Willeke [PM: subject tweaks] Signed-off-by: Paul Moore --- tools/util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/util.c b/tools/util.c index 266e027..6c44d35 100644 --- a/tools/util.c +++ b/tools/util.c @@ -62,10 +62,10 @@ #elif __MIPSEL__ #define ARCH_NATIVE AUDIT_ARCH_MIPSEL64N32 #endif /* _MIPS_SIM_NABI32 */ +#elif __s390x__ /* s390x must be checked before s390 */ +#define ARCH_NATIVE AUDIT_ARCH_S390X #elif __s390__ #define ARCH_NATIVE AUDIT_ARCH_S390 -#elif __s390x__ -#define ARCH_NATIVE AUDIT_ARCH_S390X #else #error the simulator code needs to know about your machine type #endif -- cgit v1.2.1