Use AO_ prefix for internal functions in arm_v6.h
authorIvan Maidanski <ivmai@mail.ru>
Sun, 16 Dec 2012 16:07:02 +0000 (20:07 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 2 Jan 2013 08:41:16 +0000 (12:41 +0400)
(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.

src/atomic_ops/sysdeps/armcc/arm_v6.h

index 2ce31b1..fad43fc 100644 (file)
@@ -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;
         }
 }