aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/config/cpu/cris
diff options
context:
space:
mode:
authorBenjamin Kosnik <bkoz@redhat.com>2004-02-27 00:49:50 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>2004-02-27 00:49:50 +0000
commit2c5d0ae842f692b1456cf53d2734457a8f43194f (patch)
tree886de6d6c6bb866d655ffbb36b4a11fba3620151 /libstdc++-v3/config/cpu/cris
parent4d5fe28997dc77c3afeb47d400b6e62418705c34 (diff)
downloadgcc-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')
-rw-r--r--libstdc++-v3/config/cpu/cris/atomic_word.h36
-rw-r--r--libstdc++-v3/config/cpu/cris/atomicity.h41
2 files changed, 54 insertions, 23 deletions
diff --git a/libstdc++-v3/config/cpu/cris/atomic_word.h b/libstdc++-v3/config/cpu/cris/atomic_word.h
new file mode 100644
index 0000000..dd2cf6b
--- /dev/null
+++ b/libstdc++-v3/config/cpu/cris/atomic_word.h
@@ -0,0 +1,36 @@
+// Low-level type for atomic operations -*- C++ -*-
+
+// Copyright (C) 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#ifndef _GLIBCXX_ATOMIC_WORD_H
+#define _GLIBCXX_ATOMIC_WORD_H 1
+
+// This entity must not cross a page boundary.
+typedef int _Atomic_word __attribute__ ((__aligned__ (4)));
+
+#endif
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