summaryrefslogtreecommitdiff
path: root/x11/libdrm/patches
diff options
context:
space:
mode:
authorwiz <wiz>2014-07-20 08:29:27 +0000
committerwiz <wiz>2014-07-20 08:29:27 +0000
commit69f8c0efec3d8db592fd5e19c103896d8a1b8b21 (patch)
tree2d75e97931a9c6cc2e521b958666f94e05038954 /x11/libdrm/patches
parent2f647bd33f8d37f183990ed5dc3cb1010796954c (diff)
downloadpkgsrc-69f8c0efec3d8db592fd5e19c103896d8a1b8b21.tar.gz
Fix NetBSD and Solaris atomic_dec_and_test.
Based on similar patch for xsrc from Taylor R Campbell. Bump PKGREVISION.
Diffstat (limited to 'x11/libdrm/patches')
-rw-r--r--x11/libdrm/patches/patch-ad37
1 files changed, 21 insertions, 16 deletions
diff --git a/x11/libdrm/patches/patch-ad b/x11/libdrm/patches/patch-ad
index 8691bb26969..963028cf9a7 100644
--- a/x11/libdrm/patches/patch-ad
+++ b/x11/libdrm/patches/patch-ad
@@ -1,11 +1,22 @@
-$NetBSD: patch-ad,v 1.1 2010/04/19 18:46:15 tnn Exp $
+$NetBSD: patch-ad,v 1.2 2014/07/20 08:29:27 wiz Exp $
---- xf86atomic.h.orig 2010-03-22 20:39:27.000000000 +0000
+Fix Solaris atomic_dec_and_test.
+Add NetBSD atomic ops support.
+
+--- xf86atomic.h.orig 2010-05-18 17:00:43.000000000 +0000
+++ xf86atomic.h
-@@ -92,6 +92,23 @@ typedef struct { uint_t atomic; } atomic
-
- #endif
-
+@@ -85,7 +85,24 @@ typedef struct { uint_t atomic; } atomic
+ # define atomic_read(x) (int) ((x)->atomic)
+ # define atomic_set(x, val) ((x)->atomic = (uint_t)(val))
+ # define atomic_inc(x) (atomic_inc_uint (&(x)->atomic))
+-# define atomic_dec_and_test(x) (atomic_dec_uint_nv(&(x)->atomic) == 1)
++# define atomic_dec_and_test(x) (atomic_dec_uint_nv(&(x)->atomic) == 0)
++# define atomic_add(x, v) (atomic_add_int(&(x)->atomic, (v)))
++# define atomic_dec(x, v) (atomic_add_int(&(x)->atomic, -(v)))
++# define atomic_cmpxchg(x, oldv, newv) atomic_cas_uint (&(x)->atomic, oldv, newv)
++
++#endif
++
+#if defined(__NetBSD__) && !defined(HAS_ATOMIC_OPS) /* NetBSD */
+
+#include <sys/atomic.h>
@@ -16,13 +27,7 @@ $NetBSD: patch-ad,v 1.1 2010/04/19 18:46:15 tnn Exp $
+# define atomic_read(x) (int) ((x)->atomic)
+# define atomic_set(x, val) ((x)->atomic = (val))
+# define atomic_inc(x) (atomic_inc_uint (&(x)->atomic))
-+# define atomic_dec_and_test(x) (atomic_dec_uint_nv(&(x)->atomic) == 1)
-+# define atomic_add(x, v) (atomic_add_int(&(x)->atomic, (v)))
-+# define atomic_dec(x, v) (atomic_add_int(&(x)->atomic, -(v)))
-+# define atomic_cmpxchg(x, oldv, newv) atomic_cas_uint (&(x)->atomic, oldv, newv)
-+
-+#endif
-+
- #if ! HAS_ATOMIC_OPS
- #error libdrm requires atomic operations, please define them for your CPU/compiler.
- #endif
++# define atomic_dec_and_test(x) (atomic_dec_uint_nv(&(x)->atomic) == 0)
+ # define atomic_add(x, v) (atomic_add_int(&(x)->atomic, (v)))
+ # define atomic_dec(x, v) (atomic_add_int(&(x)->atomic, -(v)))
+ # define atomic_cmpxchg(x, oldv, newv) atomic_cas_uint (&(x)->atomic, oldv, newv)