diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2013-09-25 10:13:31 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2013-09-25 10:13:31 +0000 |
commit | d133037a4116d11b85ea4f43bbc13ab270e86fe0 (patch) | |
tree | 74956b22a1869503c7d6651f37da0a93439766ac /sys | |
parent | 9acd3e783da94fe32f4ceda5b184d4e30de8cfd0 (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')
-rw-r--r-- | sys/dev/pci/drm/drm_atomic.h | 11 |
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 |