From 27ca1b0f306cb99f14f863b22d490bb30c778300 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sun, 18 Feb 2018 00:47:44 -0500 Subject: [PATCH] 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). --- src/Makefile.am | 1 + src/atomic_ops.h | 3 +++ src/atomic_ops/sysdeps/gcc/riscv.h | 12 ++++++++++++ 3 files changed, 16 insertions(+) create mode 100644 src/atomic_ops/sysdeps/gcc/riscv.h 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" -- 2.40.0