summaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorams <ams@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-06 16:47:32 +0000
committerams <ams@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-06 16:47:32 +0000
commit8b2186097b4d17c2e3480fe599b66aa95b896e8c (patch)
tree11a4f827dd5771a97461f63a4b07efc28ed1a9ff /libstdc++-v3
parentafd927a4b087f19627e0cf87a092fb3a859eb922 (diff)
downloadgcc-8b2186097b4d17c2e3480fe599b66aa95b896e8c.tar.gz
2009-04-06 Andrew Stubbs <ams@codesourcery.com>
* config/cpu/sh/atomicity.h: Put the SH4A specific functions in the __gnu_cxx namespace. Remove "static inline". git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145613 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog5
-rw-r--r--libstdc++-v3/config/cpu/sh/atomicity.h81
2 files changed, 46 insertions, 40 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index d2b1cd656c5..2ed825ad91f 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,8 @@
+2009-04-06 Andrew Stubbs <ams@codesourcery.com>
+
+ * config/cpu/sh/atomicity.h: Put the SH4A specific functions in the
+ __gnu_cxx namespace. Remove "static inline".
+
2009-04-06 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/random.tcc (linear_congruential_engine<>::
diff --git a/libstdc++-v3/config/cpu/sh/atomicity.h b/libstdc++-v3/config/cpu/sh/atomicity.h
index f4bfb12f580..459cfddb30f 100644
--- a/libstdc++-v3/config/cpu/sh/atomicity.h
+++ b/libstdc++-v3/config/cpu/sh/atomicity.h
@@ -1,6 +1,6 @@
// Low-level functions for atomic operations: sh version -*- C++ -*-
-// Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005, 2006
+// Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2009
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -30,47 +30,48 @@
#ifdef __SH4A__
-#ifndef _GLIBCXX_ATOMICITY_H
-#define _GLIBCXX_ATOMICITY_H 1
+#include <ext/atomicity.h>
-typedef int _Atomic_word;
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
-static inline _Atomic_word
-__attribute__ ((__unused__))
-__exchange_and_add (volatile _Atomic_word* __mem, int __val)
-{
- _Atomic_word __result;
-
- __asm__ __volatile__
- ("0:\n"
- "\tmovli.l\t@%2,r0\n"
- "\tmov\tr0,%1\n"
- "\tadd\t%3,r0\n"
- "\tmovco.l\tr0,@%2\n"
- "\tbf\t0b"
- : "+m" (*__mem), "=r" (__result)
- : "r" (__mem), "rI08" (__val)
- : "r0");
-
- return __result;
-}
-
-
-static inline void
-__attribute__ ((__unused__))
-__atomic_add (volatile _Atomic_word* __mem, int __val)
-{
- asm("0:\n"
- "\tmovli.l\t@%1,r0\n"
- "\tadd\t%2,r0\n"
- "\tmovco.l\tr0,@%1\n"
- "\tbf\t0b"
- : "+m" (*__mem)
- : "r" (__mem), "rI08" (__val)
- : "r0");
-}
-
-#endif
+ typedef int _Atomic_word;
+
+ _Atomic_word
+ __attribute__ ((__unused__))
+ __exchange_and_add (volatile _Atomic_word* __mem, int __val)
+ {
+ _Atomic_word __result;
+
+ __asm__ __volatile__
+ ("0:\n"
+ "\tmovli.l\t@%2,r0\n"
+ "\tmov\tr0,%1\n"
+ "\tadd\t%3,r0\n"
+ "\tmovco.l\tr0,@%2\n"
+ "\tbf\t0b"
+ : "+m" (*__mem), "=r" (__result)
+ : "r" (__mem), "rI08" (__val)
+ : "r0");
+
+ return __result;
+ }
+
+
+ void
+ __attribute__ ((__unused__))
+ __atomic_add (volatile _Atomic_word* __mem, int __val)
+ {
+ asm("0:\n"
+ "\tmovli.l\t@%1,r0\n"
+ "\tadd\t%2,r0\n"
+ "\tmovco.l\tr0,@%1\n"
+ "\tbf\t0b"
+ : "+m" (*__mem)
+ : "r" (__mem), "rI08" (__val)
+ : "r0");
+ }
+
+_GLIBCXX_END_NAMESPACE
#else /* !__SH4A__ */