about summary refs log tree commit diff
path: root/sysdeps/alpha/bits
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2003-06-30 23:21:38 +0000
committerRichard Henderson <rth@redhat.com>2003-06-30 23:21:38 +0000
commitbbf1f957c7578ac8d8c72f413cd412d5a27627b8 (patch)
tree2e2f6c9962bbc8812b960e3455bfeddbd73ac547 /sysdeps/alpha/bits
parentcbdce766068d938cfb7d98621aece034d9981b7f (diff)
downloadglibc-bbf1f957c7578ac8d8c72f413cd412d5a27627b8.tar.gz
glibc-bbf1f957c7578ac8d8c72f413cd412d5a27627b8.tar.xz
glibc-bbf1f957c7578ac8d8c72f413cd412d5a27627b8.zip
* sysdeps/alpha/bits/atomic.h (__arch_compare_and_exchange_bool_*_int): Invert the sense of the return value. (__arch_exchange_16_int): Fix paste-o. (__arch_exchange_{32,64}_int): Fix think-o.
	* sysdeps/alpha/bits/atomic.h (__arch_compare_and_exchange_bool_*_int):
	Invert the sense of the return value.
	(__arch_exchange_16_int): Fix paste-o.
	(__arch_exchange_{32,64}_int): Fix think-o.

	* sysdeps/unix/sysv/linux/alpha/clone.S: Load child_tid properly.

2003-06-30  Richard Henderson  <rth@redhat.com>
Diffstat (limited to 'sysdeps/alpha/bits')
-rw-r--r--sysdeps/alpha/bits/atomic.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/sysdeps/alpha/bits/atomic.h b/sysdeps/alpha/bits/atomic.h
index ead76a75aa..073e6508fc 100644
--- a/sysdeps/alpha/bits/atomic.h
+++ b/sysdeps/alpha/bits/atomic.h
@@ -151,27 +151,27 @@ typedef uintmax_t uatomic_max_t;
 	: "memory");							\
 })
 
-/* For all "bool" routines, we return true if exchange succesful.  */
+/* For all "bool" routines, we return FALSE if exchange succesful.  */
 
 #define __arch_compare_and_exchange_bool_8_int(mem, new, old, mb1, mb2)	\
 ({ unsigned long __prev; int __cmp;					\
    __arch_compare_and_exchange_xxx_8_int(mem, new, old, mb1, mb2);	\
-   __cmp; })
+   !__cmp; })
 
 #define __arch_compare_and_exchange_bool_16_int(mem, new, old, mb1, mb2) \
 ({ unsigned long __prev; int __cmp;					\
    __arch_compare_and_exchange_xxx_16_int(mem, new, old, mb1, mb2);	\
-   __cmp; })
+   !__cmp; })
 
 #define __arch_compare_and_exchange_bool_32_int(mem, new, old, mb1, mb2) \
 ({ unsigned long __prev; int __cmp;					\
    __arch_compare_and_exchange_xxx_32_int(mem, new, old, mb1, mb2);	\
-   __cmp; })
+   !__cmp; })
 
 #define __arch_compare_and_exchange_bool_64_int(mem, new, old, mb1, mb2) \
 ({ unsigned long __prev; int __cmp;					\
    __arch_compare_and_exchange_xxx_64_int(mem, new, old, mb1, mb2);	\
-   __cmp; })
+   !__cmp; })
 
 /* For all "val" routines, return the old value whether exchange
    successful or not.  */
@@ -247,7 +247,7 @@ typedef uintmax_t uatomic_max_t;
   unsigned long __ret, __tmp, __addr64, __sval;				\
   __asm__ __volatile__ (						\
 		mb1							\
-	"	andnot	%[__addr8],7,%[__addr64]\n"			\
+	"	andnot	%[__addr16],7,%[__addr64]\n"			\
 	"	inswl	%[__value],%[__addr16],%[__sval]\n"		\
 	"1:	ldq_l	%[__tmp],0(%[__addr64])\n"			\
 	"	extwl	%[__tmp],%[__addr16],%[__ret]\n"		\
@@ -271,13 +271,14 @@ typedef uintmax_t uatomic_max_t;
   __asm__ __volatile__ (						\
 		mb1							\
 	"1:	ldl_l	%[__ret],%[__mem]\n"				\
-	"	mov	%[__ret],%[__tmp]\n"				\
+	"	mov	%[__val],%[__tmp]\n"				\
 	"	stl_c	%[__tmp],%[__mem]\n"				\
 	"	beq	%[__tmp],1b\n"					\
 		mb2							\
 	: [__ret] "=&r" (__ret),					\
 	  [__tmp] "=&r" (__tmp)						\
-	: [__mem] "m" (*(mem))						\
+	: [__mem] "m" (*(mem)),						\
+	  [__val] "Ir" (value)						\
 	: "memory");							\
   __ret; })
 
@@ -287,13 +288,14 @@ typedef uintmax_t uatomic_max_t;
   __asm__ __volatile__ (						\
 		mb1							\
 	"1:	ldq_l	%[__ret],%[__mem]\n"				\
-	"	mov	%[__ret],%[__tmp]\n"				\
+	"	mov	%[__val],%[__tmp]\n"				\
 	"	stq_c	%[__tmp],%[__mem]\n"				\
 	"	beq	%[__tmp],1b\n"					\
 		mb2							\
 	: [__ret] "=&r" (__ret),					\
 	  [__tmp] "=&r" (__tmp)						\
-	: [__mem] "m" (*(mem))						\
+	: [__mem] "m" (*(mem)),						\
+	  [__val] "Ir" (value)						\
 	: "memory");							\
   __ret; })