about summary refs log tree commit diff
path: root/sysdeps/powerpc/bits
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2003-03-28 07:17:02 +0000
committerRoland McGrath <roland@gnu.org>2003-03-28 07:17:02 +0000
commit448163bae27b57b6e4b7c51e7b5974a613547db0 (patch)
tree7e2edc66ca4ca22e770cdff00da2d0dacd770f33 /sysdeps/powerpc/bits
parent3e60b5f2346c59715a62e225eb4b9c64c285852c (diff)
downloadglibc-448163bae27b57b6e4b7c51e7b5974a613547db0.tar.gz
glibc-448163bae27b57b6e4b7c51e7b5974a613547db0.tar.xz
glibc-448163bae27b57b6e4b7c51e7b5974a613547db0.zip
2003-03-27 Roland McGrath <roland@redhat.com>
	* sysdeps/powerpc/bits/atomic.h [! __powerpc64__]
	(__arch_atomic_decrement_if_positive_64): Fix bogus definition.
Diffstat (limited to 'sysdeps/powerpc/bits')
-rw-r--r--sysdeps/powerpc/bits/atomic.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/sysdeps/powerpc/bits/atomic.h b/sysdeps/powerpc/bits/atomic.h
index 7028d73135..721627659b 100644
--- a/sysdeps/powerpc/bits/atomic.h
+++ b/sysdeps/powerpc/bits/atomic.h
@@ -68,13 +68,13 @@ typedef uintmax_t uatomic_max_t;
 #ifdef __powerpc64__
 
 /*
- * The 32-bit exchange_bool is different on powerpc64 because the subf 
- * does signed 64-bit arthmatic while the lwarx is 32-bit unsigned 
+ * The 32-bit exchange_bool is different on powerpc64 because the subf
+ * does signed 64-bit arthmatic while the lwarx is 32-bit unsigned
  * (a load word and zero (high 32) form).
  * In powerpc64 register values are 64-bit by default,  including oldval.
  * Net we need to extend sign word the result of lwarx to 64-bit so the
  * 64-bit subtract from gives the expected result and sets the condition
- * correctly. 
+ * correctly.
  */
 # define __arch_compare_and_exchange_bool_32_acq(mem, newval, oldval) \
 ({									      \
@@ -134,7 +134,7 @@ typedef uintmax_t uatomic_max_t;
 			: "cr0");					      \
       __val;								      \
     })
-      
+
 # define __arch_atomic_decrement_if_positive_64(mem) \
   ({ int __val, __tmp;							      \
      __asm __volatile ("1:	ldarx	%0,0,%3\n"			      \
@@ -175,7 +175,7 @@ typedef uintmax_t uatomic_max_t;
 # define __arch_atomic_exchange_and_add_64(mem, value) \
     ({ abort (); (*mem) = (value); })
 # define __arch_atomic_decrement_if_positive_64(mem) \
-    ({ abort (); (*mem) = (value); })
+    ({ abort (); (*mem)--; })
 #endif
 
 #define __arch_atomic_exchange_32(mem, value)				      \
@@ -203,8 +203,8 @@ typedef uintmax_t uatomic_max_t;
 		      : "cr0");						      \
     __val;								      \
   })
-  
-#define __arch_atomic_decrement_if_positive_32(mem) \
+
+#define __arch_atomic_decrement_if_positive_32(mem)			      \
   ({ int __val, __tmp;							      \
      __asm __volatile ("1:	lwarx	%0,0,%3\n"			      \
 		       "	cmpwi	0,%0,0\n"			      \
@@ -246,13 +246,13 @@ typedef uintmax_t uatomic_max_t;
 
 
 /* Decrement *MEM if it is > 0, and return the old value.  */
-#define atomic_decrement_if_positive(mem) \
-  ({ __typeof (*(mem)) __result;						      \
+#define atomic_decrement_if_positive(mem)				      \
+  ({ __typeof (*(mem)) __result;					      \
     if (sizeof (*mem) == 4)						      \
-      __result = __arch_atomic_decrement_if_positive_32 (mem);	      \
+      __result = __arch_atomic_decrement_if_positive_32 (mem);		      \
     else if (sizeof (*mem) == 8)					      \
-      __result = __arch_atomic_decrement_if_positive_64 (mem);	      \
-    else 								      \
+      __result = __arch_atomic_decrement_if_positive_64 (mem);		      \
+    else								      \
        abort ();							      \
     __result;								      \
   })