Fix AO_compare_and_swap() return type for s390 and PowerPC
authorIvan Maidanski <ivmai@mail.ru>
Sat, 15 Oct 2011 11:35:22 +0000 (15:35 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Sat, 15 Oct 2011 11:35:22 +0000 (15:35 +0400)
* src/atomic_ops/sysdeps/gcc/s390.h (AO_compare_and_swap_full):
Change return from AO_t to int.
* src/atomic_ops/sysdeps/ibmc/powerpc.h (AO_compare_and_swap_acquire,
AO_compare_and_swap_release, AO_compare_and_swap_full): Likewise.

src/atomic_ops/sysdeps/gcc/s390.h
src/atomic_ops/sysdeps/ibmc/powerpc.h

index b8563e6..c05dc85 100644 (file)
@@ -40,8 +40,8 @@
 /* It appears that certain BCR instructions have that effect.   */
 /* Presumably they're cheaper than CS?                          */
 
-AO_INLINE AO_t AO_compare_and_swap_full(volatile AO_t *addr,
-                                        AO_t old, AO_t new_val)
+AO_INLINE int AO_compare_and_swap_full(volatile AO_t *addr,
+                                       AO_t old, AO_t new_val)
 {
   int retval;
   __asm__ __volatile__ (
index 3e4f539..4378dca 100644 (file)
@@ -85,30 +85,34 @@ AO_test_and_set_full(volatile AO_TS_t *addr) {
 }
 #define AO_HAVE_test_and_set_full
 
-/*AO_INLINE AO_t
-AO_compare_and_swap(volatile AO_t *addr, AO_t old, AO_t new_val) {
+/*AO_INLINE int
+AO_compare_and_swap(volatile AO_t *addr, AO_t old, AO_t new_val)
+{
 # error FIXME Implement me
 }
 #define AO_HAVE_compare_and_swap*/
 
-AO_INLINE AO_t
-AO_compare_and_swap_acquire(volatile AO_t *addr, AO_t old, AO_t new_val) {
-  AO_t result = AO_compare_and_swap(addr, old, new_val);
+AO_INLINE int
+AO_compare_and_swap_acquire(volatile AO_t *addr, AO_t old, AO_t new_val)
+{
+  int result = AO_compare_and_swap(addr, old, new_val);
   AO_lwsync();
   return result;
 }
 #define AO_HAVE_compare_and_swap_acquire
 
-AO_INLINE AO_t
-AO_compare_and_swap_release(volatile AO_t *addr, AO_t old, AO_t new_val) {
+AO_INLINE int
+AO_compare_and_swap_release(volatile AO_t *addr, AO_t old, AO_t new_val)
+{
   AO_lwsync();
   return AO_compare_and_swap(addr, old, new_val);
 }
 #define AO_HAVE_compare_and_swap_release
 
-AO_INLINE AO_t
-AO_compare_and_swap_full(volatile AO_t *addr, AO_t old, AO_t new_val) {
-  AO_t result;
+AO_INLINE int
+AO_compare_and_swap_full(volatile AO_t *addr, AO_t old, AO_t new_val)
+{
+  int result;
   AO_lwsync();
   result = AO_compare_and_swap(addr, old, new_val);
   AO_lwsync();