From a74321dfa16d18201db31ad0c261ef1cfc039cc0 Mon Sep 17 00:00:00 2001 From: Nicolas Morey-Chaisemartin Date: Fri, 5 May 2017 10:15:07 +0200 Subject: [PATCH] opal: add support for s390 and s390x architectures Signed-off-by: Nicolas Morey-Chaisemartin --- config/opal_config_asm.m4 | 10 +++++++++- opal/include/opal/sys/architecture.h | 2 ++ opal/include/opal/sys/cma.h | 10 ++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/config/opal_config_asm.m4 b/config/opal_config_asm.m4 index e6137b86587..4de964e723f 100644 --- a/config/opal_config_asm.m4 +++ b/config/opal_config_asm.m4 @@ -1091,7 +1091,15 @@ AC_DEFUN([OPAL_CONFIG_ASM],[ fi OPAL_GCC_INLINE_ASSIGN='"1: li %0,0" : "=&r"(ret)' ;; - + # There is no current difference between s390 and s390x + # But use two different defines in case some come later + # as s390 is 31bits while s390x is 64bits + s390-*) + opal_cv_asm_arch="S390" + ;; + s390x-*) + opal_cv_asm_arch="S390X" + ;; sparc*-*) # SPARC v9 (and above) are the only ones with 64bit support # if compiling 32 bit, see if we are v9 (aka v8plus) or diff --git a/opal/include/opal/sys/architecture.h b/opal/include/opal/sys/architecture.h index 6341fc354fb..ff4fbc94281 100644 --- a/opal/include/opal/sys/architecture.h +++ b/opal/include/opal/sys/architecture.h @@ -42,6 +42,8 @@ #define OPAL_MIPS 0070 #define OPAL_ARM 0100 #define OPAL_ARM64 0101 +#define OPAL_S390 0110 +#define OPAL_S390X 0111 #define OPAL_BUILTIN_SYNC 0200 #define OPAL_BUILTIN_OSX 0201 #define OPAL_BUILTIN_GCC 0202 diff --git a/opal/include/opal/sys/cma.h b/opal/include/opal/sys/cma.h index 6304e749505..4211013a328 100644 --- a/opal/include/opal/sys/cma.h +++ b/opal/include/opal/sys/cma.h @@ -82,6 +82,16 @@ #endif +#elif OPAL_ASSEMBLY_ARCH == OPAL_S390 + +#define __NR_process_vm_readv 340 +#define __NR_process_vm_writev 341 + +#elif OPAL_ASSEMBLY_ARCH == OPAL_S390X + +#define __NR_process_vm_readv 340 +#define __NR_process_vm_writev 341 + #else #error "Unsupported architecture for process_vm_readv and process_vm_writev syscalls" #endif