diff options
author | Rich Felker <dalias@aerifal.cx> | 2012-07-08 00:05:08 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2012-07-08 00:05:08 -0400 |
commit | a3bdcd93764ba514ca83ccbc5c85fefaf18d31d7 (patch) | |
tree | af9c9a4e316ab8e9d143607397f9f32f7671d1eb /arch/arm | |
parent | d93e028c6bbd491592313fc77e056f6424ea4668 (diff) | |
download | musl-a3bdcd93764ba514ca83ccbc5c85fefaf18d31d7.tar.gz musl-a3bdcd93764ba514ca83ccbc5c85fefaf18d31d7.tar.bz2 musl-a3bdcd93764ba514ca83ccbc5c85fefaf18d31d7.tar.xz musl-a3bdcd93764ba514ca83ccbc5c85fefaf18d31d7.zip |
remove little-endian assumption from arm atomic.h
this hidden endian dependency had left big endian arm badly broken.
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/atomic.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/arm/atomic.h b/arch/arm/atomic.h index 8dc31b2e..f434a0c6 100644 --- a/arch/arm/atomic.h +++ b/arch/arm/atomic.h @@ -99,14 +99,16 @@ static inline void a_or(volatile int *p, int v) static inline void a_and_64(volatile uint64_t *p, uint64_t v) { - a_and((int *)p, v); - a_and((int *)p+1, v>>32); + 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) { - a_or((int *)p, v); - a_or((int *)p+1, v>>32); + 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 |