summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2011-05-13 16:39:47 +0000
committerattilio <attilio@FreeBSD.org>2011-05-13 16:39:47 +0000
commita0db972f622c3a9dd2d45cdd27cc47dd31961dbb (patch)
tree93670fdb2f0be6a60d4607a4c9b619ef49445060
parentf85a68226d2be0976168e6991b49816dba73e975 (diff)
downloadFreeBSD-src-a0db972f622c3a9dd2d45cdd27cc47dd31961dbb.zip
FreeBSD-src-a0db972f622c3a9dd2d45cdd27cc47dd31961dbb.tar.gz
Fix the _long() rappresentation on mips by casting the long arguments
to u_int for all the functions. Reviewed by: art, imp
-rw-r--r--sys/mips/include/atomic.h61
1 files changed, 38 insertions, 23 deletions
diff --git a/sys/mips/include/atomic.h b/sys/mips/include/atomic.h
index 7b4a82c..9a0c557 100644
--- a/sys/mips/include/atomic.h
+++ b/sys/mips/include/atomic.h
@@ -581,32 +581,47 @@ atomic_fetchadd_64(__volatile uint64_t *p, uint64_t v)
#else /* !__mips_n64 */
/* Operations on longs. */
-#define atomic_set_long atomic_set_32
-#define atomic_set_acq_long atomic_set_acq_32
-#define atomic_set_rel_long atomic_set_rel_32
-#define atomic_clear_long atomic_clear_32
-#define atomic_clear_acq_long atomic_clear_acq_32
-#define atomic_clear_rel_long atomic_clear_rel_32
-#define atomic_add_long(p, v) \
+#define atomic_set_long(p, v) \
+ atomic_set_32((volatile u_int *)(p), (u_int)(v))
+#define atomic_set_acq_long(p, v) \
+ atomic_set_acq_32((volatile u_int *)(p), (u_int)(v))
+#define atomic_set_rel_long(p, v) \
+ atomic_set_rel_32((volatile u_int *)(p), (u_int)(v))
+#define atomic_clear_long(p, v) \
+ atomic_clear_32((volatile u_int *)(p), (u_int)(v))
+#define atomic_clear_acq_long(p, v) \
+ atomic_clear_acq_32((volatile u_int *)(p), (u_int)(v))
+#define atomic_clear_rel_long(p, v) \
+ atomic_clear_rel_32((volatile u_int *)(p), (u_int)(v))
+#define atomic_add_long(p, v) \
atomic_add_32((volatile u_int *)(p), (u_int)(v))
-#define atomic_add_acq_long atomic_add_acq_32
-#define atomic_add_rel_long atomic_add_rel_32
-#define atomic_subtract_long(p, v) \
+#define atomic_add_acq_long(p, v) \
+ atomic_add_32((volatile u_int *)(p), (u_int)(v))
+#define atomic_add_rel_long(p, v) \
+ atomic_add_32((volatile u_int *)(p), (u_int)(v))
+#define atomic_subtract_long(p, v) \
atomic_subtract_32((volatile u_int *)(p), (u_int)(v))
-#define atomic_subtract_acq_long atomic_subtract_acq_32
-#define atomic_subtract_rel_long atomic_subtract_rel_32
-#define atomic_cmpset_long atomic_cmpset_32
-#define atomic_cmpset_acq_long(p, cmpval, newval) \
- atomic_cmpset_acq_32((volatile u_int *)(p), \
- (u_int)(cmpval), (u_int)(newval))
-#define atomic_cmpset_rel_long(p, cmpval, newval) \
- atomic_cmpset_rel_32((volatile u_int *)(p), \
- (u_int)(cmpval), (u_int)(newval))
-#define atomic_load_acq_long atomic_load_acq_32
-#define atomic_store_rel_long atomic_store_rel_32
-#define atomic_fetchadd_long(p, v) \
+#define atomic_subtract_acq_long(p, v) \
+ atomic_subtract_acq_32((volatile u_int *)(p), (u_int)(v))
+#define atomic_subtract_rel_long(p, v) \
+ atomic_subtract_rel_32((volatile u_int *)(p), (u_int)(v))
+#define atomic_cmpset_long(p, cmpval, newval) \
+ atomic_cmpset_32((volatile u_int *)(p), (u_int)(cmpval), \
+ (u_int)(newval))
+#define atomic_cmpset_acq_long(p, cmpval, newval) \
+ atomic_cmpset_acq_32((volatile u_int *)(p), (u_int)(cmpval), \
+ (u_int)(newval))
+#define atomic_cmpset_rel_long(p, cmpval, newval) \
+ atomic_cmpset_rel_32((volatile u_int *)(p), (u_int)(cmpval), \
+ (u_int)(newval))
+#define atomic_load_acq_long(p) \
+ (u_long)atomic_load_acq_32((volatile u_int *)(p))
+#define atomic_store_rel_long(p, v) \
+ atomic_store_rel_32((volatile u_int *)(p), (u_int)(v))
+#define atomic_fetchadd_long(p, v) \
atomic_fetchadd_32((volatile u_int *)(p), (u_int)(v))
-#define atomic_readandclear_long atomic_readandclear_32
+#define atomic_readandclear_long(p) \
+ atomic_readandclear_32((volatile u_int *)(p))
#endif /* __mips_n64 */
OpenPOWER on IntegriCloud