summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm/atomic_compat.h8
-rw-r--r--include/sys/atomic.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/include/asm/atomic_compat.h b/include/asm/atomic_compat.h
index 2f7376925..c769d6248 100644
--- a/include/asm/atomic_compat.h
+++ b/include/asm/atomic_compat.h
@@ -55,5 +55,13 @@ static inline void atomic64_set(atomic64_t *v, __s64 i)
#endif /* HAVE_ATOMIC64_T */
+#ifndef HAVE_ATOMIC64_CMPXCHG
+#define atomic64_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n)))
+#endif
+
+#ifndef HAVE_ATOMIC64_XCHG
+#define atomic64_xchg(v, n) (xchg(&((v)->counter), n))
+#endif
+
#endif /* _SPL_ATOMIC_COMPAT_H */
diff --git a/include/sys/atomic.h b/include/sys/atomic.h
index 4f4a1e058..7a741de17 100644
--- a/include/sys/atomic.h
+++ b/include/sys/atomic.h
@@ -30,6 +30,7 @@
#include <linux/module.h>
#include <linux/spinlock.h>
#include <sys/types.h>
+#include <asm/atomic_compat.h>
/*
* Two approaches to atomic operations are implemented each with its