From d60dd92a34c7e54db11c6d4813b634179087d397 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Sat, 2 Feb 2013 12:47:07 +0400 Subject: [PATCH] Adjust type of 'flag' and 'tmp' local variables in gcc/arm.h (code refactoring) * src/atomic_ops/sysdeps/gcc/arm.h (AO_store, AO_fetch_compare_and_swap): Change type of "flag" local variable from AO_t to int (only if AO_BROKEN_TASKSWITCH_CLREX). * src/atomic_ops/sysdeps/gcc/arm.h (AO_test_and_set, AO_fetch_and_add, AO_fetch_and_add1, AO_fetch_and_sub1): Change type of "flag" local variable from unsigned long to int. * src/atomic_ops/sysdeps/gcc/arm.h (AO_fetch_and_add, AO_fetch_and_add1, AO_fetch_and_sub1): Change type of "tmp" local variable from unsigned long to AO_t. --- src/atomic_ops/sysdeps/gcc/arm.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/atomic_ops/sysdeps/gcc/arm.h b/src/atomic_ops/sysdeps/gcc/arm.h index 6ea3d31..59e6058 100644 --- a/src/atomic_ops/sysdeps/gcc/arm.h +++ b/src/atomic_ops/sysdeps/gcc/arm.h @@ -155,7 +155,7 @@ # ifdef AO_BROKEN_TASKSWITCH_CLREX AO_INLINE void AO_store(volatile AO_t *addr, AO_t value) { - AO_t flag; + int flag; __asm__ __volatile__("@AO_store\n" AO_THUMB_GO_ARM @@ -195,7 +195,7 @@ AO_test_and_set(volatile AO_TS_t *addr) { AO_TS_VAL_t oldval; - unsigned long flag; + int flag; __asm__ __volatile__("@AO_test_and_set\n" AO_THUMB_GO_ARM @@ -215,8 +215,8 @@ AO_INLINE AO_t AO_fetch_and_add(volatile AO_t *p, AO_t incr) { - unsigned long flag, tmp; - AO_t result; + AO_t result, tmp; + int flag; __asm__ __volatile__("@AO_fetch_and_add\n" AO_THUMB_GO_ARM @@ -236,8 +236,8 @@ AO_fetch_and_add(volatile AO_t *p, AO_t incr) AO_INLINE AO_t AO_fetch_and_add1(volatile AO_t *p) { - unsigned long flag, tmp; - AO_t result; + AO_t result, tmp; + int flag; __asm__ __volatile__("@AO_fetch_and_add1\n" AO_THUMB_GO_ARM @@ -257,8 +257,8 @@ AO_fetch_and_add1(volatile AO_t *p) AO_INLINE AO_t AO_fetch_and_sub1(volatile AO_t *p) { - unsigned long flag, tmp; - AO_t result; + AO_t result, tmp; + int flag; __asm__ __volatile__("@AO_fetch_and_sub1\n" AO_THUMB_GO_ARM @@ -306,7 +306,8 @@ AO_fetch_and_sub1(volatile AO_t *p) AO_INLINE AO_t AO_fetch_compare_and_swap(volatile AO_t *addr, AO_t old_val, AO_t new_val) { - AO_t fetched_val, flag; + AO_t fetched_val; + int flag; __asm__ __volatile__("@AO_fetch_compare_and_swap\n" AO_THUMB_GO_ARM -- 2.40.0