summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2022-01-14 15:00:17 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2022-01-14 15:00:17 +0000
commitc68d538b84b6fac99d446d11a17fa8deaa26c2a6 (patch)
tree414f2391fc3b3d70fdf3ca67717df017a9c4d966 /sys/dev/pci/drm
parenta2bbcbb329e420a4b15b45ffbe2733c4bab398ed (diff)
We don't have 64-bit atomics on powerpc, but we don't really need them.
So don't provide atomic64_cmpxchg() on powerpc and on other architectures make its implementation similar to atomic64_xchg(). This makes the tree build again on macppc. suggested by & ok jsg@
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r--sys/dev/pci/drm/include/linux/atomic.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/dev/pci/drm/include/linux/atomic.h b/sys/dev/pci/drm/include/linux/atomic.h
index 64405197a74..4050fdf8fa9 100644
--- a/sys/dev/pci/drm/include/linux/atomic.h
+++ b/sys/dev/pci/drm/include/linux/atomic.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: atomic.h,v 1.17 2022/01/14 06:53:14 jsg Exp $ */
+/* $OpenBSD: atomic.h,v 1.18 2022/01/14 15:00:16 kettenis Exp $ */
/**
* \file drm_atomic.h
* Atomic operations used in the DRM which may or may not be provided by the OS.
@@ -139,6 +139,12 @@ atomic64_xchg(volatile int64_t *v, int64_t n)
return __sync_lock_test_and_set(v, n);
}
+static inline int64_t
+atomic64_cmpxchg(volatile int64_t *v, int64_t o, int64_t n)
+{
+ return __sync_val_compare_and_swap(v, o, n);
+}
+
#define atomic64_add(n, p) __sync_fetch_and_add_8(p, n)
#define atomic64_sub(n, p) __sync_fetch_and_sub_8(p, n)
#define atomic64_inc(p) __sync_fetch_and_add_8(p, 1)
@@ -222,12 +228,6 @@ atomic64_sub(int i, atomic64_t *v)
}
#endif
-static inline int64_t
-atomic64_cmpxchg(atomic64_t *p, int64_t o, int64_t n)
-{
- return atomic_cmpxchg(p, o, n);
-}
-
#ifdef __LP64__
typedef int64_t atomic_long_t;
#define atomic_long_set(p, v) atomic64_set(p, v)