summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2013-09-25 10:13:31 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2013-09-25 10:13:31 +0000
commitd133037a4116d11b85ea4f43bbc13ab270e86fe0 (patch)
tree74956b22a1869503c7d6651f37da0a93439766ac /sys/dev
parent9acd3e783da94fe32f4ceda5b184d4e30de8cfd0 (diff)
Unbreak the tree; no 64-bit atomic operations on 32-bit architectures for now.
found out the hard way by chris@ and mpi@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/drm/drm_atomic.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/drm_atomic.h b/sys/dev/pci/drm/drm_atomic.h
index 6138144a04f..fee003e1b78 100644
--- a/sys/dev/pci/drm/drm_atomic.h
+++ b/sys/dev/pci/drm/drm_atomic.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_atomic.h,v 1.9 2013/09/24 21:18:57 kettenis Exp $ */
+/* $OpenBSD: drm_atomic.h,v 1.10 2013/09/25 10:13:30 kettenis Exp $ */
/**
* \file drm_atomic.h
* Atomic operations used in the DRM which may or may not be provided by the OS.
@@ -64,8 +64,17 @@ atomic_xchg(volatile int *v, int n)
static __inline int64_t
atomic64_xchg(volatile int64_t *v, int64_t n)
{
+#if defined(__i386__) || defined(__powerpc__)
+ int64_t o;
+
+ o = *v;
+ *v = n;
+
+ return (o);
+#else
__sync_synchronize();
return __sync_lock_test_and_set(v, n);
+#endif
}
static inline int