From: Ivan Maidanski Date: Sun, 16 Dec 2012 16:07:02 +0000 (+0400) Subject: Use AO_ prefix for internal functions in arm_v6.h X-Git-Tag: libatomic_ops-7_4_0~58 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b08c9bff9da4647b63918402cfedeb7fe0e6013d;p=libatomic_ops Use AO_ prefix for internal functions in arm_v6.h (code refactoring) * src/atomic_ops/sysdeps/armcc/arm_v6.h (AO_fetch_and_add, AO_fetch_and_add1, AO_fetch_and_sub1, AO_compare_and_swap): Remove useless comment. * src/atomic_ops/sysdeps/armcc/arm_v6.h (load_ex, store_ex): Add "AO_" prefix. --- diff --git a/src/atomic_ops/sysdeps/armcc/arm_v6.h b/src/atomic_ops/sysdeps/armcc/arm_v6.h index 2ce31b1..fad43fc 100644 --- a/src/atomic_ops/sysdeps/armcc/arm_v6.h +++ b/src/atomic_ops/sysdeps/armcc/arm_v6.h @@ -115,7 +115,6 @@ __asm { } #define AO_HAVE_test_and_set -/* NEC LE-IT: fetch and add for ARMv6 */ AO_INLINE AO_t AO_fetch_and_add(volatile AO_t *p, AO_t incr) { @@ -135,7 +134,6 @@ __asm { } #define AO_HAVE_fetch_and_add -/* NEC LE-IT: fetch and add1 for ARMv6 */ AO_INLINE AO_t AO_fetch_and_add1(volatile AO_t *p) { @@ -155,7 +153,6 @@ __asm { } #define AO_HAVE_fetch_and_add1 -/* NEC LE-IT: fetch and sub for ARMv6 */ AO_INLINE AO_t AO_fetch_and_sub1(volatile AO_t *p) { @@ -176,7 +173,6 @@ __asm { #define AO_HAVE_fetch_and_sub1 #endif /* !AO_PREFER_GENERALIZED */ -/* NEC LE-IT: compare and swap */ #ifndef AO_GENERALIZE_ASM_BOOL_CAS /* Returns nonzero if the comparison succeeded. */ AO_INLINE int @@ -225,11 +221,11 @@ __asm__ { /* helper functions for the Realview compiler: LDREXD is not usable * with inline assembler, so use the "embedded" assembler as * suggested by ARM Dev. support (June 2008). */ -__asm inline double_ptr_storage load_ex(volatile AO_double_t *addr) { +__asm inline double_ptr_storage AO_load_ex(volatile AO_double_t *addr) { LDREXD r0,r1,[r0] } -__asm inline int store_ex(AO_t val1, AO_t val2, volatile AO_double_t *addr) { +__asm inline int AO_store_ex(AO_t val1, AO_t val2, volatile AO_double_t *addr) { STREXD r3,r0,r1,[r2] MOV r0,r3 } @@ -245,9 +241,9 @@ AO_compare_double_and_swap_double(volatile AO_double_t *addr, int result; while(1) { - tmp = load_ex(addr); + tmp = AO_load_ex(addr); if(tmp != old_val) return 0; - result = store_ex(new_val1, new_val2, addr); + result = AO_store_ex(new_val1, new_val2, addr); if(!result) return 1; } }