Author: fireball
Date: Sun Oct 26 05:47:07 2008
New Revision: 36979
URL:
http://svn.reactos.org/svn/reactos?rev=36979&view=rev
Log:
Dmitry Gorbachev
- Fix a modifier flag in interlocked functions' inlined asm. See detailed explanation
in bug 3772.
See issue #3772 for more details.
Modified:
trunk/reactos/include/psdk/intrin_x86.h
trunk/reactos/include/psdk/winnt.h
Modified: trunk/reactos/include/psdk/intrin_x86.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/intrin_x86.h?…
==============================================================================
--- trunk/reactos/include/psdk/intrin_x86.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/intrin_x86.h [iso-8859-1] Sun Oct 26 05:47:07 2008
@@ -499,7 +499,7 @@
static __inline__ __attribute__((always_inline)) unsigned char
_interlockedbittestandreset(volatile long * a, const long b)
{
unsigned char retval;
- __asm__("lock; btrl %[b], %[a]; setb %b[retval]" : [retval] "=r"
(retval), [a] "=m" (*a) : [b] "Ir" (b) : "memory");
+ __asm__("lock; btrl %[b], %[a]; setb %b[retval]" : [retval] "=r"
(retval), [a] "+m" (*a) : [b] "Ir" (b) : "memory");
return retval;
}
@@ -507,7 +507,7 @@
static __inline__ __attribute__((always_inline)) unsigned char
_interlockedbittestandreset64(volatile long long * a, const long long b)
{
unsigned char retval;
- __asm__("lock; btrq %[b], %[a]; setb %b[retval]" : [retval] "=r"
(retval), [a] "=m" (*a) : [b] "Ir" (b) : "memory");
+ __asm__("lock; btrq %[b], %[a]; setb %b[retval]" : [retval] "=r"
(retval), [a] "+m" (*a) : [b] "Ir" (b) : "memory");
return retval;
}
#endif
@@ -515,7 +515,7 @@
static __inline__ __attribute__((always_inline)) unsigned char
_interlockedbittestandset(volatile long * a, const long b)
{
unsigned char retval;
- __asm__("lock; btsl %[b], %[a]; setc %b[retval]" : [retval] "=r"
(retval), [a] "=m" (*a) : [b] "Ir" (b) : "memory");
+ __asm__("lock; btsl %[b], %[a]; setc %b[retval]" : [retval] "=r"
(retval), [a] "+m" (*a) : [b] "Ir" (b) : "memory");
return retval;
}
@@ -523,7 +523,7 @@
static __inline__ __attribute__((always_inline)) unsigned char
_interlockedbittestandset64(volatile long long * a, const long long b)
{
unsigned char retval;
- __asm__("lock; btsq %[b], %[a]; setc %b[retval]" : [retval] "=r"
(retval), [a] "=m" (*a) : [b] "Ir" (b) : "memory");
+ __asm__("lock; btsq %[b], %[a]; setc %b[retval]" : [retval] "=r"
(retval), [a] "+m" (*a) : [b] "Ir" (b) : "memory");
return retval;
}
#endif
Modified: trunk/reactos/include/psdk/winnt.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winnt.h?rev=3…
==============================================================================
--- trunk/reactos/include/psdk/winnt.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/winnt.h [iso-8859-1] Sun Oct 26 05:47:07 2008
@@ -4782,7 +4782,7 @@
__asm__ __volatile__("lock "
"btsl %2,%1\n\t"
"sbbl %0,%0\n\t"
- :"=r" (OldBit),"=m" (*Base)
+ :"=r" (OldBit),"+m" (*Base)
:"Ir" (Bit)
: "memory");
return OldBit;
@@ -4800,7 +4800,7 @@
__asm__ __volatile__("lock "
"btrl %2,%1\n\t"
"sbbl %0,%0\n\t"
- :"=r" (OldBit),"=m" (*Base)
+ :"=r" (OldBit),"+m" (*Base)
:"Ir" (Bit)
: "memory");
return OldBit;