mirror of
https://github.com/reactos/reactos.git
synced 2025-05-13 14:20:31 +00:00
Dmitry Gorbachev
- Fix an issue with choosing nonexistent x86 registers %sil/%dil, see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10153 for more details. - Add "memory" to _InterlockedAddLargeStatistic(). "In Visual C++ 2005, this function behaves as a read-write barrier." -- MSDN library. - Use "+m" instead of "=m". See issue #3772 for more details. svn path=/trunk/; revision=37543
This commit is contained in:
parent
5312b56416
commit
b7af90ae54
1 changed files with 5 additions and 4 deletions
|
@ -457,8 +457,9 @@ static __inline__ __attribute__((always_inline)) long _InterlockedAddLargeStatis
|
||||||
"jae LABEL%=;"
|
"jae LABEL%=;"
|
||||||
"lock; adc $0, %[Hi32];"
|
"lock; adc $0, %[Hi32];"
|
||||||
"LABEL%=:;" :
|
"LABEL%=:;" :
|
||||||
[Lo32] "=m" (*((volatile long *)(Addend) + 0)), [Hi32] "=m" (*((volatile long *)(Addend) + 1)) :
|
[Lo32] "+m" (*((volatile long *)(Addend) + 0)), [Hi32] "+m" (*((volatile long *)(Addend) + 1)) :
|
||||||
[Value] "ir" (Value)
|
[Value] "ir" (Value) :
|
||||||
|
"memory"
|
||||||
);
|
);
|
||||||
|
|
||||||
return Value;
|
return Value;
|
||||||
|
@ -499,7 +500,7 @@ static __inline__ __attribute__((always_inline)) long long _InterlockedIncrement
|
||||||
static __inline__ __attribute__((always_inline)) unsigned char _interlockedbittestandreset(volatile long * a, const long b)
|
static __inline__ __attribute__((always_inline)) unsigned char _interlockedbittestandreset(volatile long * a, const long b)
|
||||||
{
|
{
|
||||||
unsigned char retval;
|
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] "=q" (retval), [a] "+m" (*a) : [b] "Ir" (b) : "memory");
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -515,7 +516,7 @@ static __inline__ __attribute__((always_inline)) unsigned char _interlockedbitte
|
||||||
static __inline__ __attribute__((always_inline)) unsigned char _interlockedbittestandset(volatile long * a, const long b)
|
static __inline__ __attribute__((always_inline)) unsigned char _interlockedbittestandset(volatile long * a, const long b)
|
||||||
{
|
{
|
||||||
unsigned char retval;
|
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] "=q" (retval), [a] "+m" (*a) : [b] "Ir" (b) : "memory");
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue