diff options
author | Benjamin Kosnik <bkoz@redhat.com> | 2004-02-27 00:49:50 +0000 |
---|---|---|
committer | Benjamin Kosnik <bkoz@gcc.gnu.org> | 2004-02-27 00:49:50 +0000 |
commit | 2c5d0ae842f692b1456cf53d2734457a8f43194f (patch) | |
tree | 886de6d6c6bb866d655ffbb36b4a11fba3620151 /libstdc++-v3/config/cpu/cris/atomicity.h | |
parent | 4d5fe28997dc77c3afeb47d400b6e62418705c34 (diff) | |
download | gcc-2c5d0ae842f692b1456cf53d2734457a8f43194f.zip gcc-2c5d0ae842f692b1456cf53d2734457a8f43194f.tar.gz gcc-2c5d0ae842f692b1456cf53d2734457a8f43194f.tar.bz2 |
atomicity.h: New, forward declarations for __atomic_add and __exchange_and_add.
2004-02-25 Benjamin Kosnik <bkoz@redhat.com>
* include/bits/atomicity.h: New, forward declarations for __atomic_add
and __exchange_and_add.
* config/cpu/generic/atomic_word.h: New, typdef for atomic word.
* config/cpu/cris/atomic_word.h: Same.
* config/cpu/sparc/atomic_word.h: Same.
* include/bits/ios_base.h (_Callback_list::_M_remove_reference):
Qualifiy with __gnu_cxx.
(_Callback_list::_M_add_reference): Same.
* include/bits/locale_classes.h (locale::facet::_M_add_reference): Add.
(locale::facet::_M_remove_reference): Same.
(locale::_Impl::_M_add_reference): Add.
(locale::_Impl::_M_remove_reference): Same.
* include/bits/basic_string.h (basic_string::_Rep::_M_refcopy): Same.
(basic_string::_Rep::_M_dispose): Same.
* src/ios.cc (ios_base::xalloc): Same.
* src/ios_init.cc (ios_base::Init::Init): Same.
(ios_base::Init::~Init): Same.
* src/locale.cc (locale::id::_M_id): Same.
* config/cpu/i486/atomicity.h: Use __gnu_cxx namespace. Remove
static, and inline keyworks.
* config/cpu/alpha/atomicity.h: Same.
* config/cpu/cris/atomicity.h: Same.
* config/cpu/generic/atomicity.h: Same.
* config/cpu/hppa/atomicity.h: Same.
* config/cpu/i386/atomicity.h: Same.
* config/cpu/ia64/atomicity.h: Same.
* config/cpu/m68k/atomicity.h: Same.
* config/cpu/mips/atomicity.h: Same.
* config/cpu/powerpc/atomicity.h: Same.
* config/cpu/s390/atomicity.h: Same.
* config/cpu/sparc/atomicity.h: Same.
* src/Makefile.am (host_sources): Add atomicity.cc.
(atomicity.cc): New rule.
* src/Makefile.in: Regenerate.
* include/Makefile.am (host_headers): Remove host atomicity.h.
(host_headers): Add atomic_word.h.
(bits_headers): Add bits atomicity.h.
Change ATOMICITY_INC_SRCDIR to ATOMICITY_SRCDIR.
* include/Makefile.in: Regenerate.
* configure.host (atomic_word_dir): Add.
* configure.ac: Substitute ATOMIC_WORD_SRCDIR. Change
ATOMICITY_INC_SRCDIR to ATOMICITY_SRCDIR.
* configure: Regenerate.
* config/linker-map.gnu: Export __exchange_and_add, and __atomic_add.
* testsuite/27_io/ios_base/cons/assign_neg.cc: Adjust line numbers.
* testsuite/27_io/ios_base/cons/copy_neg.cc: Same.
From-SVN: r78544
Diffstat (limited to 'libstdc++-v3/config/cpu/cris/atomicity.h')
-rw-r--r-- | libstdc++-v3/config/cpu/cris/atomicity.h | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/libstdc++-v3/config/cpu/cris/atomicity.h b/libstdc++-v3/config/cpu/cris/atomicity.h index fecb9dc..965e0da 100644 --- a/libstdc++-v3/config/cpu/cris/atomicity.h +++ b/libstdc++-v3/config/cpu/cris/atomicity.h @@ -1,6 +1,6 @@ // Low-level functions for atomic operations: CRIS version -*- C++ -*- -// Copyright (C) 2001, 2003 Free Software Foundation, Inc. +// Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -27,21 +27,19 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -#ifndef _GLIBCXX_ATOMICITY_H -#define _GLIBCXX_ATOMICITY_H 1 +#include <bits/atomicity.h> -// This entity must not cross a page boundary. -typedef int _Atomic_word __attribute__ ((__aligned__ (4))); - -static inline _Atomic_word -__attribute__ ((__unused__)) -__exchange_and_add(_Atomic_word* __mem, int __val) +namespace __gnu_cxx { - int __tmp; - _Atomic_word __result; + static inline _Atomic_word + __attribute__ ((__unused__)) + __exchange_and_add(_Atomic_word* __mem, int __val) + { + int __tmp; + _Atomic_word __result; #if (__CRIS_arch_version >= 10) - __asm__ __volatile__ (" clearf \n" + __asm__ __volatile__ (" clearf \n" "0: \n" " move.d %4,%2 \n" " move.d [%3],%0 \n" @@ -53,7 +51,7 @@ __exchange_and_add(_Atomic_word* __mem, int __val) : "=&r" (__result), "=m" (*__mem), "=&r" (__tmp) : "r" (__mem), "g" (__val), "m" (*__mem)); #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" @@ -65,14 +63,11 @@ __exchange_and_add(_Atomic_word* __mem, int __val) : "r9"); #endif - return __result; -} - -static inline void -__attribute__ ((__unused__)) -__atomic_add(_Atomic_word* __mem, int __val) -{ - __exchange_and_add(__mem, __val); -} + return __result; + } -#endif /* atomicity.h */ + void + __attribute__ ((__unused__)) + __atomic_add(_Atomic_word* __mem, int __val) + { __exchange_and_add(__mem, __val); } +} // namespace __gnu_cxx |