winbase.h (ilockexch)

Vaclav Haisman V.Haisman@sh.cvut.cz
Tue May 31 22:52:00 GMT 2005


I think that ilockexch() in winbase.h should look like what is in my patch.
Explicit lock prefix is not needed because xchg instruction sets LOCK# signal
implicitly.

VH.
-------------- next part --------------
Index: winbase.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/winbase.h,v
retrieving revision 1.12
diff -c -p -d -r1.12 winbase.h
*** winbase.h	4 Jun 2004 23:55:44 -0000	1.12
--- winbase.h	31 May 2005 22:40:01 -0000
*************** ilockexch (long *t, long v)
*** 40,48 ****
  {
    register int __res;
    __asm__ __volatile__ ("\n\
! 1:	lock	cmpxchgl %3,(%1)\n\
! 	jne 1b\n\
!  	": "=a" (__res), "=q" (t): "1" (t), "q" (v), "0" (*t): "cc");
    return __res;
  }
  
--- 40,47 ----
  {
    register int __res;
    __asm__ __volatile__ ("\n\
!         xchgl %3, %2\n\
!         ": "=r" (__res), "=m" (*t): "m" (*t), "0" (v));
    return __res;
  }
  


More information about the Cygwin-patches mailing list