Dmitry Gorbachev

- Fix a modifier flag in interlocked functions' inlined asm. See detailed explanation in bug 3772.
See issue #3772 for more details.

svn path=/trunk/; revision=36979
This commit is contained in:
Aleksey Bragin 2008-10-26 10:47:07 +00:00
parent 861ffcb4ce
commit a15056faf9
2 changed files with 6 additions and 6 deletions

View file

@ -499,7 +499,7 @@ static __inline__ __attribute__((always_inline)) long long _InterlockedIncrement
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 _interlockedbitte
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 _interlockedbitte
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 _interlockedbitte
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

View file

@ -4782,7 +4782,7 @@ InterlockedBitTestAndSet(IN LONG volatile *Base,
__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 @@ InterlockedBitTestAndReset(IN LONG volatile *Base,
__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;