mirror of git://git.musl-libc.org/musl
fix inconsistency in a_and and a_or argument types on x86[_64]
conceptually, and on other archs, these functions take a pointer to int, but in the i386, x86_64, and x32 versions of atomic.h, they took a pointer to void instead.
This commit is contained in:
parent
390f93ef69
commit
c648cefb27
|
@ -50,16 +50,16 @@ static inline int a_cas(volatile int *p, int t, int s)
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void a_or(volatile void *p, int v)
|
static inline void a_or(volatile int *p, int v)
|
||||||
{
|
{
|
||||||
__asm__( "lock ; orl %1, %0"
|
__asm__( "lock ; orl %1, %0"
|
||||||
: "=m"(*(int *)p) : "r"(v) : "memory" );
|
: "=m"(*p) : "r"(v) : "memory" );
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void a_and(volatile void *p, int v)
|
static inline void a_and(volatile int *p, int v)
|
||||||
{
|
{
|
||||||
__asm__( "lock ; andl %1, %0"
|
__asm__( "lock ; andl %1, %0"
|
||||||
: "=m"(*(int *)p) : "r"(v) : "memory" );
|
: "=m"(*p) : "r"(v) : "memory" );
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int a_swap(volatile int *x, int v)
|
static inline int a_swap(volatile int *x, int v)
|
||||||
|
|
|
@ -47,16 +47,16 @@ static inline int a_cas(volatile int *p, int t, int s)
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void a_or(volatile void *p, int v)
|
static inline void a_or(volatile int *p, int v)
|
||||||
{
|
{
|
||||||
__asm__( "lock ; or %1, %0"
|
__asm__( "lock ; or %1, %0"
|
||||||
: "=m"(*(int *)p) : "r"(v) : "memory" );
|
: "=m"(*p) : "r"(v) : "memory" );
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void a_and(volatile void *p, int v)
|
static inline void a_and(volatile int *p, int v)
|
||||||
{
|
{
|
||||||
__asm__( "lock ; and %1, %0"
|
__asm__( "lock ; and %1, %0"
|
||||||
: "=m"(*(int *)p) : "r"(v) : "memory" );
|
: "=m"(*p) : "r"(v) : "memory" );
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int a_swap(volatile int *x, int v)
|
static inline int a_swap(volatile int *x, int v)
|
||||||
|
|
|
@ -47,16 +47,16 @@ static inline int a_cas(volatile int *p, int t, int s)
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void a_or(volatile void *p, int v)
|
static inline void a_or(volatile int *p, int v)
|
||||||
{
|
{
|
||||||
__asm__( "lock ; or %1, %0"
|
__asm__( "lock ; or %1, %0"
|
||||||
: "=m"(*(int *)p) : "r"(v) : "memory" );
|
: "=m"(*p) : "r"(v) : "memory" );
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void a_and(volatile void *p, int v)
|
static inline void a_and(volatile int *p, int v)
|
||||||
{
|
{
|
||||||
__asm__( "lock ; and %1, %0"
|
__asm__( "lock ; and %1, %0"
|
||||||
: "=m"(*(int *)p) : "r"(v) : "memory" );
|
: "=m"(*p) : "r"(v) : "memory" );
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int a_swap(volatile int *x, int v)
|
static inline int a_swap(volatile int *x, int v)
|
||||||
|
|
Loading…
Reference in New Issue