summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2016-03-11 05:12:56 +0000
committerRich Felker <dalias@aerifal.cx>2016-03-11 05:12:56 +0000
commitde400b6609becbc6a5ae87fa8b155f02a860e257 (patch)
tree5c9c8ae6d6f85afe1a15ce1c17843f06fa0d90f0 /arch
parent27bf42cd9d85e242f1ffac8d99330da120c8dfdb (diff)
downloadmusl-de400b6609becbc6a5ae87fa8b155f02a860e257.tar.gz
correct pointer types for a_ll_p and a_sc_p primitives on mips64
these changes should not affect generated code, but they reflect that the underlying objects operated on by a_cas_p are supposed to have type volatile void *, not volatile long. in theory a compiler could treat the effective type mismatch in the "m" memory operands as undefined behavior.
Diffstat (limited to 'arch')
-rw-r--r--arch/mips64/atomic_arch.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/mips64/atomic_arch.h b/arch/mips64/atomic_arch.h
index 8664e11c..b468fd95 100644
--- a/arch/mips64/atomic_arch.h
+++ b/arch/mips64/atomic_arch.h
@@ -19,22 +19,22 @@ static inline int a_sc(volatile int *p, int v)
}
#define a_ll_p a_ll_p
-static inline void *a_ll_p(volatile long *p)
+static inline void *a_ll_p(volatile void *p)
{
void *v;
__asm__ __volatile__ (
"lld %0, %1"
- : "=r"(v) : "m"(*p));
+ : "=r"(v) : "m"(*(void *volatile *)p));
return v;
}
#define a_sc_p a_sc_p
-static inline int a_sc_p(volatile long *p, void *v)
+static inline int a_sc_p(volatile void *p, void *v)
{
long r;
__asm__ __volatile__ (
"scd %0, %1"
- : "=r"(r), "=m"(*p) : "0"(v) : "memory");
+ : "=r"(r), "=m"(*(void *volatile *)p) : "0"(v) : "memory");
return r;
}