Module Name:    xsrc
Committed By:   msaitoh
Date:           Mon Nov  3 15:01:41 UTC 2014

Modified Files:
        xsrc/external/mit/libdrm/dist [netbsd-6]: xf86atomic.h

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1116):
        external/mit/libdrm/dist/xf86atomic.h: revision 1.4
Fix libdrm's atomic_dec_and_test on NetBSD (and Solaris, while here).
_nv means new value, not old value!  This may help to fix various
instability in userland graphics, now that we aren't freeing stuff
with a reference count of 1 any more.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.2.1 xsrc/external/mit/libdrm/dist/xf86atomic.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/libdrm/dist/xf86atomic.h
diff -u xsrc/external/mit/libdrm/dist/xf86atomic.h:1.3 xsrc/external/mit/libdrm/dist/xf86atomic.h:1.3.2.1
--- xsrc/external/mit/libdrm/dist/xf86atomic.h:1.3	Sat Aug 14 10:19:31 2010
+++ xsrc/external/mit/libdrm/dist/xf86atomic.h	Mon Nov  3 15:01:41 2014
@@ -85,7 +85,7 @@ 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)
@@ -102,7 +102,7 @@ typedef struct { int atomic; } atomic_t;
 # 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_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)

Reply via email to