mirror of
https://github.com/reactos/reactos.git
synced 2025-07-04 13:11:33 +00:00
Cosmetic changes
svn path=/trunk/; revision=24258
This commit is contained in:
parent
2047460d02
commit
29b494be56
1 changed files with 73 additions and 73 deletions
|
@ -47,7 +47,7 @@
|
||||||
first, but they're only "as wrong" as they would be on Visual C++. Our
|
first, but they're only "as wrong" as they would be on Visual C++. Our
|
||||||
priority is compatibility
|
priority is compatibility
|
||||||
|
|
||||||
NOTE: unlike most people who write __inline__ asm for GCC, I didn't pull the
|
NOTE: unlike most people who write inline asm for GCC, I didn't pull the
|
||||||
constraints and the uses of __volatile__ out of my... hat. Do not touch
|
constraints and the uses of __volatile__ out of my... hat. Do not touch
|
||||||
them. I hate cargo cult programming
|
them. I hate cargo cult programming
|
||||||
|
|
||||||
|
@ -274,155 +274,155 @@ static __inline__ __attribute__((always_inline)) long _InterlockedExchangeAdd(vo
|
||||||
|
|
||||||
static __inline__ __attribute__((always_inline)) char _InterlockedAnd8(volatile char * const value, const char mask)
|
static __inline__ __attribute__((always_inline)) char _InterlockedAnd8(volatile char * const value, const char mask)
|
||||||
{
|
{
|
||||||
char x;
|
char x;
|
||||||
char y;
|
char y;
|
||||||
|
|
||||||
y = *value;
|
y = *value;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
x = y;
|
x = y;
|
||||||
y = _InterlockedCompareExchange8(value, x & mask, x);
|
y = _InterlockedCompareExchange8(value, x & mask, x);
|
||||||
}
|
}
|
||||||
while(y != x);
|
while(y != x);
|
||||||
|
|
||||||
return y;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline__ __attribute__((always_inline)) short _InterlockedAnd16(volatile short * const value, const short mask)
|
static __inline__ __attribute__((always_inline)) short _InterlockedAnd16(volatile short * const value, const short mask)
|
||||||
{
|
{
|
||||||
short x;
|
short x;
|
||||||
short y;
|
short y;
|
||||||
|
|
||||||
y = *value;
|
y = *value;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
x = y;
|
x = y;
|
||||||
y = _InterlockedCompareExchange16(value, x & mask, x);
|
y = _InterlockedCompareExchange16(value, x & mask, x);
|
||||||
}
|
}
|
||||||
while(y != x);
|
while(y != x);
|
||||||
|
|
||||||
return y;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline__ __attribute__((always_inline)) long _InterlockedAnd(volatile long * const value, const long mask)
|
static __inline__ __attribute__((always_inline)) long _InterlockedAnd(volatile long * const value, const long mask)
|
||||||
{
|
{
|
||||||
long x;
|
long x;
|
||||||
long y;
|
long y;
|
||||||
|
|
||||||
y = *value;
|
y = *value;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
x = y;
|
x = y;
|
||||||
y = _InterlockedCompareExchange(value, x & mask, x);
|
y = _InterlockedCompareExchange(value, x & mask, x);
|
||||||
}
|
}
|
||||||
while(y != x);
|
while(y != x);
|
||||||
|
|
||||||
return y;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline__ __attribute__((always_inline)) char _InterlockedOr8(volatile char * const value, const char mask)
|
static __inline__ __attribute__((always_inline)) char _InterlockedOr8(volatile char * const value, const char mask)
|
||||||
{
|
{
|
||||||
char x;
|
char x;
|
||||||
char y;
|
char y;
|
||||||
|
|
||||||
y = *value;
|
y = *value;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
x = y;
|
x = y;
|
||||||
y = _InterlockedCompareExchange8(value, x | mask, x);
|
y = _InterlockedCompareExchange8(value, x | mask, x);
|
||||||
}
|
}
|
||||||
while(y != x);
|
while(y != x);
|
||||||
|
|
||||||
return y;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline__ __attribute__((always_inline)) short _InterlockedOr16(volatile short * const value, const short mask)
|
static __inline__ __attribute__((always_inline)) short _InterlockedOr16(volatile short * const value, const short mask)
|
||||||
{
|
{
|
||||||
short x;
|
short x;
|
||||||
short y;
|
short y;
|
||||||
|
|
||||||
y = *value;
|
y = *value;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
x = y;
|
x = y;
|
||||||
y = _InterlockedCompareExchange16(value, x | mask, x);
|
y = _InterlockedCompareExchange16(value, x | mask, x);
|
||||||
}
|
}
|
||||||
while(y != x);
|
while(y != x);
|
||||||
|
|
||||||
return y;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline__ __attribute__((always_inline)) long _InterlockedOr(volatile long * const value, const long mask)
|
static __inline__ __attribute__((always_inline)) long _InterlockedOr(volatile long * const value, const long mask)
|
||||||
{
|
{
|
||||||
long x;
|
long x;
|
||||||
long y;
|
long y;
|
||||||
|
|
||||||
y = *value;
|
y = *value;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
x = y;
|
x = y;
|
||||||
y = _InterlockedCompareExchange(value, x | mask, x);
|
y = _InterlockedCompareExchange(value, x | mask, x);
|
||||||
}
|
}
|
||||||
while(y != x);
|
while(y != x);
|
||||||
|
|
||||||
return y;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline__ __attribute__((always_inline)) char _InterlockedXor8(volatile char * const value, const char mask)
|
static __inline__ __attribute__((always_inline)) char _InterlockedXor8(volatile char * const value, const char mask)
|
||||||
{
|
{
|
||||||
char x;
|
char x;
|
||||||
char y;
|
char y;
|
||||||
|
|
||||||
y = *value;
|
y = *value;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
x = y;
|
x = y;
|
||||||
y = _InterlockedCompareExchange8(value, x ^ mask, x);
|
y = _InterlockedCompareExchange8(value, x ^ mask, x);
|
||||||
}
|
}
|
||||||
while(y != x);
|
while(y != x);
|
||||||
|
|
||||||
return y;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline__ __attribute__((always_inline)) short _InterlockedXor16(volatile short * const value, const short mask)
|
static __inline__ __attribute__((always_inline)) short _InterlockedXor16(volatile short * const value, const short mask)
|
||||||
{
|
{
|
||||||
short x;
|
short x;
|
||||||
short y;
|
short y;
|
||||||
|
|
||||||
y = *value;
|
y = *value;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
x = y;
|
x = y;
|
||||||
y = _InterlockedCompareExchange16(value, x ^ mask, x);
|
y = _InterlockedCompareExchange16(value, x ^ mask, x);
|
||||||
}
|
}
|
||||||
while(y != x);
|
while(y != x);
|
||||||
|
|
||||||
return y;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline__ __attribute__((always_inline)) long _InterlockedXor(volatile long * const value, const long mask)
|
static __inline__ __attribute__((always_inline)) long _InterlockedXor(volatile long * const value, const long mask)
|
||||||
{
|
{
|
||||||
long x;
|
long x;
|
||||||
long y;
|
long y;
|
||||||
|
|
||||||
y = *value;
|
y = *value;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
x = y;
|
x = y;
|
||||||
y = _InterlockedCompareExchange(value, x ^ mask, x);
|
y = _InterlockedCompareExchange(value, x ^ mask, x);
|
||||||
}
|
}
|
||||||
while(y != x);
|
while(y != x);
|
||||||
|
|
||||||
return y;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue