aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/config/cpu/cris
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2004-03-22 01:37:04 +0000
committerHans-Peter Nilsson <hp@gcc.gnu.org>2004-03-22 01:37:04 +0000
commitfea41ef9115fcf4bc499830d04f0c4160e01839f (patch)
treeaf1025fd9363312dfa900997a9329ea8cbb639b0 /libstdc++-v3/config/cpu/cris
parent7090f4b3b1809002684711eba61be9eec3d4df03 (diff)
downloadgcc-fea41ef9115fcf4bc499830d04f0c4160e01839f.zip
gcc-fea41ef9115fcf4bc499830d04f0c4160e01839f.tar.gz
gcc-fea41ef9115fcf4bc499830d04f0c4160e01839f.tar.bz2
atomicity.h (__atomic_add): Remove "static inline" and attribute-unused.
* config/cpu/cris/atomicity.h (__atomic_add): Remove "static inline" and attribute-unused. Qualify parameter __mem with "volatile". (__exchange_and_add): Ditto. Add back memory clobber to asm. From-SVN: r79804
Diffstat (limited to 'libstdc++-v3/config/cpu/cris')
-rw-r--r--libstdc++-v3/config/cpu/cris/atomicity.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/libstdc++-v3/config/cpu/cris/atomicity.h b/libstdc++-v3/config/cpu/cris/atomicity.h
index 965e0da..3162f6a 100644
--- a/libstdc++-v3/config/cpu/cris/atomicity.h
+++ b/libstdc++-v3/config/cpu/cris/atomicity.h
@@ -31,9 +31,8 @@
namespace __gnu_cxx
{
- static inline _Atomic_word
- __attribute__ ((__unused__))
- __exchange_and_add(_Atomic_word* __mem, int __val)
+ _Atomic_word
+ __exchange_and_add(volatile _Atomic_word* __mem, int __val)
{
int __tmp;
_Atomic_word __result;
@@ -49,9 +48,12 @@ namespace __gnu_cxx
" bwf 0b \n"
" clearf \n"
: "=&r" (__result), "=m" (*__mem), "=&r" (__tmp)
- : "r" (__mem), "g" (__val), "m" (*__mem));
+ : "r" (__mem), "g" (__val), "m" (*__mem)
+ /* The memory clobber must stay, regardless of
+ current uses of this function. */
+ : "memory");
#else
- __asm__ __volatile__ (" move $ccr,$r9 \n"
+ __asm__ __volatile__ (" move $ccr,$r9 \n"
" di \n"
" move.d %4,%2 \n"
" move.d [%3],%0 \n"
@@ -60,14 +62,16 @@ namespace __gnu_cxx
" move $r9,$ccr \n"
: "=&r" (__result), "=m" (*__mem), "=&r" (__tmp)
: "r" (__mem), "g" (__val), "m" (*__mem)
- : "r9");
+ : "r9",
+ /* The memory clobber must stay, regardless of
+ current uses of this function. */
+ "memory");
#endif
return __result;
}
void
- __attribute__ ((__unused__))
- __atomic_add(_Atomic_word* __mem, int __val)
+ __atomic_add(volatile _Atomic_word* __mem, int __val)
{ __exchange_and_add(__mem, __val); }
} // namespace __gnu_cxx