openmpi/openmpi-4.0.1-riscv64.patch
David Abdurachmanov 5a1b8d12c7
Rebase riscv patch
Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2019-07-25 10:00:38 +03:00

47 lines
1.6 KiB
Diff

diff --git a/config/opal_config_asm.m4 b/config/opal_config_asm.m4
index 65675d1..7c77d65 100644
--- a/config/opal_config_asm.m4
+++ b/config/opal_config_asm.m4
@@ -1130,6 +1130,11 @@ AC_DEFUN([OPAL_CONFIG_ASM],[
fi
OPAL_GCC_INLINE_ASSIGN='"1: li %0,0" : "=&r"(ret)'
;;
+ riscv64*)
+ opal_cv_asm_arch="RISCV64"
+ OPAL_ASM_SUPPORT_64BIT=1
+ OPAL_GCC_INLINE_ASSIGN='"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
diff --git a/opal/include/opal/sys/architecture.h b/opal/include/opal/sys/architecture.h
index ee9aa96..8a9fc53 100644
--- a/opal/include/opal/sys/architecture.h
+++ b/opal/include/opal/sys/architecture.h
@@ -44,6 +44,7 @@
#define OPAL_ARM64 0101
#define OPAL_S390 0110
#define OPAL_S390X 0111
+#define OPAL_RISCV64 0120
#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 4211013..9e02f99 100644
--- a/opal/include/opal/sys/cma.h
+++ b/opal/include/opal/sys/cma.h
@@ -92,6 +92,13 @@
#define __NR_process_vm_readv 340
#define __NR_process_vm_writev 341
+#elif OPAL_ASSEMBLY_ARCH == OPAL_RISCV64
+
+/* RISCV64 uses the asm-generic syscall numbers */
+
+#define __NR_process_vm_readv 270
+#define __NR_process_vm_writev 271
+
#else
#error "Unsupported architecture for process_vm_readv and process_vm_writev syscalls"
#endif