Correct the Solaris definitions of atomic_add & atomic_dec
authorAlan Coopersmith <alan.coopersmith@oracle.com>
Sat, 17 Apr 2010 00:34:11 +0000 (17:34 -0700)
committerAlan Coopersmith <alan.coopersmith@oracle.com>
Sat, 17 Apr 2010 00:37:58 +0000 (17:37 -0700)
The #defines added in 966c9907c040b4fe4b288b4a9d82598797aee743 were
mapping these to functions that don't exist.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
xf86atomic.h

index 854187a08205eb3ec0177948d4322f1ad35b0f81..db2f6195fd40c1d167d77de9261cc9d88cfe455d 100644 (file)
@@ -86,8 +86,8 @@ typedef struct { uint_t atomic; } atomic_t;
 # 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_add(x, v) (atomic_add_uint(&(x)->atomic, (v)))
-# define atomic_dec(x, v) (atomic_dec_uint(&(x)->atomic, (v)))
+# 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