mirror of
https://git.musl-libc.org/git/musl
synced 2025-01-10 16:42:59 +03:00
update ppc atomic code to match the endian-agnostic version on other archs
This commit is contained in:
parent
50cb6dbb0c
commit
574d01a696
@ -101,24 +101,16 @@ static inline void a_or(volatile int *p, int v)
|
||||
|
||||
static inline void a_and_64(volatile uint64_t *p, uint64_t v)
|
||||
{
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
a_and((int *)p, v);
|
||||
a_and((int *)p+1, v>>32);
|
||||
#else
|
||||
a_and((int *)p+1, v);
|
||||
a_and((int *)p, v>>32);
|
||||
#endif
|
||||
union { uint64_t v; uint32_t r[2]; } u = { v };
|
||||
a_and((int *)p, u.r[0]);
|
||||
a_and((int *)p+1, u.r[1]);
|
||||
}
|
||||
|
||||
static inline void a_or_64(volatile uint64_t *p, uint64_t v)
|
||||
{
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
a_or((int *)p, v);
|
||||
a_or((int *)p+1, v>>32);
|
||||
#else
|
||||
a_or((int *)p+1, v);
|
||||
a_or((int *)p, v>>32);
|
||||
#endif
|
||||
union { uint64_t v; uint32_t r[2]; } u = { v };
|
||||
a_or((int *)p, u.r[0]);
|
||||
a_or((int *)p+1, u.r[1]);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user