summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2018-02-18 00:47:44 -0500
committerIvan Maidanski <ivmai@mail.ru>2018-03-06 00:38:13 +0300
commit137643f1417ded071c56e05401ca6a3c16492d96 (patch)
tree4c5cc3f8bd50109cc8d99b3821113306e6707ae7
parent372e9890ddc05b6fa9f7a358a448617652508c96 (diff)
downloadlibatomic_ops-137643f1417ded071c56e05401ca6a3c16492d96.tar.gz
Add RISC-V support
Issue #31 (libatomic_ops). * src/Makefile.am (nobase_private_HEADERS): Add riscv.h entry. * src/atomic_ops.h [__riscv]: Include riscv.h file. * src/atomic_ops/sysdeps/gcc/riscv.h: New file (just include generic.h).
-rw-r--r--src/Makefile.am1
-rw-r--r--src/atomic_ops.h3
-rw-r--r--src/atomic_ops/sysdeps/gcc/riscv.h12
3 files changed, 16 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index dadc932..084dd3c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -92,6 +92,7 @@ nobase_private_HEADERS = atomic_ops/ao_version.h \
atomic_ops/sysdeps/gcc/mips.h \
atomic_ops/sysdeps/gcc/nios2.h \
atomic_ops/sysdeps/gcc/powerpc.h \
+ atomic_ops/sysdeps/gcc/riscv.h \
atomic_ops/sysdeps/gcc/s390.h \
atomic_ops/sysdeps/gcc/sh.h \
atomic_ops/sysdeps/gcc/sparc.h \
diff --git a/src/atomic_ops.h b/src/atomic_ops.h
index 187e1f9..22e516f 100644
--- a/src/atomic_ops.h
+++ b/src/atomic_ops.h
@@ -352,6 +352,9 @@
# if defined(__tile__)
# include "atomic_ops/sysdeps/gcc/tile.h"
# endif
+# if defined(__riscv)
+# include "atomic_ops/sysdeps/gcc/riscv.h"
+# endif
#endif /* __GNUC__ && !AO_USE_PTHREAD_DEFS */
#if (defined(__IBMC__) || defined(__IBMCPP__)) && !defined(__GNUC__) \
diff --git a/src/atomic_ops/sysdeps/gcc/riscv.h b/src/atomic_ops/sysdeps/gcc/riscv.h
new file mode 100644
index 0000000..412c395
--- /dev/null
+++ b/src/atomic_ops/sysdeps/gcc/riscv.h
@@ -0,0 +1,12 @@
+/*
+ * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
+ * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
+ *
+ * Permission is hereby granted to use or copy this program
+ * for any purpose, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ */
+
+#include "generic.h"