From b4d9d5ee0f5ad663ae1a450355e38f0feb85be81 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 930c85823c..293a915e33 100644 --- a/config/opal_config_asm.m4 +++ b/config/opal_config_asm.m4 @@ -1083,7 +1083,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 efb38945b7..ee9aa96901 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_GCC 0202 #define OPAL_BUILTIN_NO 0203 diff --git a/opal/include/opal/sys/cma.h b/opal/include/opal/sys/cma.h index 6304e74950..4211013a32 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