This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [parisc-linux] Re: [PATCH] Fix the atomic compare and swap function


On Sun, May 20, 2007 at 11:34:46AM -0400, John David Anglin wrote:
> > > -#define ASM_EAGAIN "11"
> > > +#define ASM_EAGAIN "-11"
> 
> If the check is wrong, I would change the compare instead of the
> define.  Error numbers are normally defined as positive values.
> 

Then, what about this patch?

--- ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h.orig	2007-05-20 23:15:37.000000000 +0200
+++ ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h	2007-05-20 23:15:59.000000000 +0200
@@ -71,10 +71,10 @@
 	"copy	%5, %%r24			\n\t"			\
 	"ble	" LWS "(%%sr2, %%r0)		\n\t"			\
 	"ldi	" LWS_CAS ", %%r20		\n\t"			\
+        "sub	%%r0, %%r21, %%r21		\n\t"			\
 	"cmpib,=,n " ASM_EAGAIN ",%%r21,0b	\n\t"			\
 	"nop					\n\t"			\
 	"stw	%%r28, %0			\n\t"			\
-        "sub	%%r0, %%r21, %%r21		\n\t"			\
 	"stw	%%r21, %1			\n\t"			\
 	: "=m" (lws_ret), "=m" (lws_errno), "=m" (*mem)			\
         : "r" (mem), "r" (oldval), "r" (newval)				\

-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]