OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /openrisc/tags/gnu-src/gcc-4.5.1/gcc-4.5.1-or32-1.0rc4/libstdc++-v3/config/cpu
    from Rev 424 to Rev 519
    Reverse comparison

Rev 424 → Rev 519

/arm/cxxabi_tweaks.h
0,0 → 1,81
// Control various target specific ABI tweaks. ARM version.
 
// Copyright (C) 2004, 2006, 2008, 2009 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 3, 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.
 
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
 
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
 
/** @file cxxabi_tweaks.h
* The header provides an CPU-variable interface to the C++ ABI.
*/
 
#ifndef _CXXABI_TWEAKS_H
#define _CXXABI_TWEAKS_H 1
 
#ifdef __cplusplus
namespace __cxxabiv1
{
extern "C"
{
#endif
 
#ifdef __ARM_EABI__
// The ARM EABI uses the least significant bit of a 32-bit
// guard variable. */
#define _GLIBCXX_GUARD_TEST(x) ((*(x) & 1) != 0)
#define _GLIBCXX_GUARD_SET(x) *(x) = 1
#define _GLIBCXX_GUARD_BIT 1
#define _GLIBCXX_GUARD_PENDING_BIT __guard_test_bit (1, 1)
#define _GLIBCXX_GUARD_WAITING_BIT __guard_test_bit (2, 1)
typedef int __guard;
 
// We also want the element size in array cookies.
#define _GLIBCXX_ELTSIZE_IN_COOKIE 1
// __cxa_vec_ctor should return a pointer to the array.
typedef void * __cxa_vec_ctor_return_type;
#define _GLIBCXX_CXA_VEC_CTOR_RETURN(x) return x
// Constructors and destructors return the "this" pointer.
typedef void * __cxa_cdtor_return_type;
 
#else // __ARM_EABI__
 
// The generic ABI uses the first byte of a 64-bit guard variable.
#define _GLIBCXX_GUARD_TEST(x) (*(char *) (x) != 0)
#define _GLIBCXX_GUARD_SET(x) *(char *) (x) = 1
#define _GLIBCXX_GUARD_BIT __guard_test_bit (0, 1)
#define _GLIBCXX_GUARD_PENDING_BIT __guard_test_bit (1, 1)
#define _GLIBCXX_GUARD_WAITING_BIT __guard_test_bit (2, 1)
__extension__ typedef int __guard __attribute__((mode (__DI__)));
 
// __cxa_vec_ctor has void return type.
typedef void __cxa_vec_ctor_return_type;
#define _GLIBCXX_CXA_VEC_CTOR_RETURN(x) return
// Constructors and destructors do not return a value.
typedef void __cxa_cdtor_return_type;
 
#endif //!__ARM_EABI__
 
#ifdef __cplusplus
}
} // namespace __cxxabiv1
#endif
 
#endif
arm/cxxabi_tweaks.h Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: powerpc/cpu_defines.h =================================================================== --- powerpc/cpu_defines.h (nonexistent) +++ powerpc/cpu_defines.h (revision 519) @@ -0,0 +1,36 @@ +// Specific definitions for generic platforms -*- C++ -*- + +// Copyright (C) 2005, 2009 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 3, 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. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file cpu_defines.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. + */ + +#ifndef _GLIBCXX_CPU_DEFINES +#define _GLIBCXX_CPU_DEFINES 1 + +// Integer divide instructions don't trap on PowerPC. +#define __glibcxx_integral_traps false + +#endif
powerpc/cpu_defines.h Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: powerpc/atomic_word.h =================================================================== --- powerpc/atomic_word.h (nonexistent) +++ powerpc/atomic_word.h (revision 519) @@ -0,0 +1,37 @@ +// Low-level type for atomic operations -*- C++ -*- + +// Copyright (C) 2004, 2009 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 3, 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. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +#ifndef _GLIBCXX_ATOMIC_WORD_H +#define _GLIBCXX_ATOMIC_WORD_H 1 + +typedef int _Atomic_word; + +#define _GLIBCXX_READ_MEM_BARRIER __asm __volatile ("isync":::"memory") +#ifdef __NO_LWSYNC__ +#define _GLIBCXX_WRITE_MEM_BARRIER __asm __volatile ("sync":::"memory") +#else +#define _GLIBCXX_WRITE_MEM_BARRIER __asm __volatile ("lwsync":::"memory") +#endif + +#endif
powerpc/atomic_word.h Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cris/atomicity.h =================================================================== --- cris/atomicity.h (nonexistent) +++ cris/atomicity.h (revision 519) @@ -0,0 +1,86 @@ +// Low-level functions for atomic operations: CRIS version -*- C++ -*- + +// Copyright (C) 2001, 2003, 2004, 2005, 2009 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 3, 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. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +#include + +_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) + + _Atomic_word + __exchange_and_add(volatile _Atomic_word* __mem, int __val) throw () + { + int __tmp; + _Atomic_word __result; + +#if (__CRIS_arch_version >= 32) + __asm__ __volatile__ (" clearf p \n" + "0: \n" + " move.d %4,%2 \n" + " move.d [%3],%0 \n" + " add.d %0,%2 \n" + " ax \n" + " move.d %2,[%3] \n" + " bcs 0b \n" + " clearf p \n" + : "=&r" (__result), "=Q" (*__mem), "=&r" (__tmp) + : "r" (__mem), "g" (__val), "Q" (*__mem) + : "memory"); +#elif (__CRIS_arch_version >= 10) + __asm__ __volatile__ (" clearf \n" + "0: \n" + " move.d %4,%2 \n" + " move.d [%3],%0 \n" + " add.d %0,%2 \n" + " ax \n" + " move.d %2,[%3] \n" + " bwf 0b \n" + " clearf \n" + : "=&r" (__result), "=Q" (*__mem), "=&r" (__tmp) + : "r" (__mem), "g" (__val), "Q" (*__mem) + /* The memory clobber must stay, regardless of + current uses of this function. */ + : "memory"); +#else + __asm__ __volatile__ (" move $ccr,$r9 \n" + " di \n" + " move.d %4,%2 \n" + " move.d [%3],%0 \n" + " add.d %0,%2 \n" + " move.d %2,[%3] \n" + " move $r9,$ccr \n" + : "=&r" (__result), "=Q" (*__mem), "=&r" (__tmp) + : "r" (__mem), "g" (__val), "Q" (*__mem) + : "r9", + /* The memory clobber must stay, regardless of + current uses of this function. */ + "memory"); +#endif + + return __result; + } + + void + __atomic_add(volatile _Atomic_word* __mem, int __val) throw () + { __exchange_and_add(__mem, __val); } + +_GLIBCXX_END_NAMESPACE
cris/atomicity.h Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cris/atomic_word.h =================================================================== --- cris/atomic_word.h (nonexistent) +++ cris/atomic_word.h (revision 519) @@ -0,0 +1,31 @@ +// Low-level type for atomic operations -*- C++ -*- + +// Copyright (C) 2004, 2009 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 3, 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. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +#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
cris/atomic_word.h Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ia64/atomic_word.h =================================================================== --- ia64/atomic_word.h (nonexistent) +++ ia64/atomic_word.h (revision 519) @@ -0,0 +1,64 @@ +// Low-level type for atomic operations -*- C++ -*- + +// Copyright (C) 2004, 2005, 2006, 2007, 2009 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 3, 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. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +#ifndef _GLIBCXX_ATOMIC_WORD_H +#define _GLIBCXX_ATOMIC_WORD_H 1 + +#include + +typedef int _Atomic_word; + +namespace __gnu_cxx +{ + // Test the first byte of __g and ensure that no loads are hoisted across + // the test. + inline bool + __test_and_acquire (__cxxabiv1::__guard *__g) + { + unsigned char __c; + unsigned char *__p = reinterpret_cast(__g); + // ldN.acq is a load with an implied hoist barrier. + // would ld8+mask be faster than just doing an ld1? + __asm __volatile ("ld1.acq %0 = %1" : "=r"(__c) : "m"(*__p) : "memory"); + return __c != 0; + } + + // Set the first byte of __g to 1 and ensure that no stores are sunk + // across the store. + inline void + __set_and_release (__cxxabiv1::__guard *__g) + { + unsigned char *__p = reinterpret_cast(__g); + // stN.rel is a store with an implied sink barrier. + // could load word, set flag, and CAS it back + __asm __volatile ("st1.rel %0 = %1" : "=m"(*__p) : "r"(1) : "memory"); + } + + // We don't define the _BARRIER macros on ia64 because the barriers are + // included in the test and set, above. +#define _GLIBCXX_GUARD_TEST_AND_ACQUIRE(G) __gnu_cxx::__test_and_acquire (G) +#define _GLIBCXX_GUARD_SET_AND_RELEASE(G) __gnu_cxx::__set_and_release (G) +} + +#endif
ia64/atomic_word.h Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: alpha/atomic_word.h =================================================================== --- alpha/atomic_word.h (nonexistent) +++ alpha/atomic_word.h (revision 519) @@ -0,0 +1,33 @@ +// Low-level type for atomic operations -*- C++ -*- + +// Copyright (C) 2004, 2009 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 3, 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. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +#ifndef _GLIBCXX_ATOMIC_WORD_H +#define _GLIBCXX_ATOMIC_WORD_H 1 + +typedef int _Atomic_word; + +#define _GLIBCXX_READ_MEM_BARRIER __asm __volatile ("mb":::"memory") +#define _GLIBCXX_WRITE_MEM_BARRIER __asm __volatile ("wmb":::"memory") + +#endif
alpha/atomic_word.h Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: m68k/atomicity.h =================================================================== --- m68k/atomicity.h (nonexistent) +++ m68k/atomicity.h (revision 519) @@ -0,0 +1,129 @@ +// Low-level functions for atomic operations: m68k version -*- C++ -*- + +// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2009 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 3, 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. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +#include + +_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) + +#if ( defined(__mc68020__) || defined(__mc68030__) \ + || defined(__mc68040__) || defined(__mc68060__) ) \ + && !defined(__mcpu32__) + // These variants support compare-and-swap. + _Atomic_word + __attribute__ ((__unused__)) + __exchange_and_add(volatile _Atomic_word* __mem, int __val) throw () + { + register _Atomic_word __result = *__mem; + register _Atomic_word __temp; + __asm__ __volatile__ ("1: move%.l %0,%1\n\t" + "add%.l %3,%1\n\t" + "cas%.l %0,%1,%2\n\t" + "jne 1b" + : "=d" (__result), "=&d" (__temp), "=m" (*__mem) + : "d" (__val), "0" (__result), "m" (*__mem)); + return __result; + } + +#elif defined(__rtems__) + // TAS/JBNE is unsafe on systems with strict priority-based scheduling. + // Disable interrupts, which we can do only from supervisor mode. + _Atomic_word + __attribute__ ((__unused__)) + __exchange_and_add(volatile _Atomic_word* __mem, int __val) throw () + { + _Atomic_word __result; + short __level, __tmpsr; + __asm__ __volatile__ ("move%.w %%sr,%0\n\tor%.l %0,%1\n\tmove%.w %1,%%sr" + : "=d"(__level), "=d"(__tmpsr) : "1"(0x700)); + + __result = *__mem; + *__mem = __result + __val; + __asm__ __volatile__ ("move%.w %0,%%sr" : : "d"(__level)); + + return __result; + } + +#else + + template + struct _Atomicity_lock + { + static volatile unsigned char _S_atomicity_lock; + }; + + template + volatile unsigned char _Atomicity_lock<__inst>::_S_atomicity_lock = 0; + + template volatile unsigned char _Atomicity_lock<0>::_S_atomicity_lock; + + _Atomic_word + __attribute__ ((__unused__)) + __exchange_and_add(volatile _Atomic_word* __mem, int __val) throw () + { + _Atomic_word __result; + + // bset with no immediate addressing (not SMP-safe) +#if defined(__mcfisaa__) || defined(__mcfisaaplus__) + __asm__ __volatile__("1: bset.b #7,%0@\n\tjbne 1b" + : /* no outputs */ + : "a"(&_Atomicity_lock<0>::_S_atomicity_lock) + : "cc", "memory"); + + // CPU32 and CF ISAs B & C support test-and-set (SMP-safe). +#elif defined(__mcpu32__) || defined(__mcfisab__) || defined (__mcfisac__) + __asm__ __volatile__("1: tas %0\n\tjbne 1b" + : "+m"(_Atomicity_lock<0>::_S_atomicity_lock) + : /* none */ + : "cc"); + + // Use bset with immediate addressing for 68000/68010 (not SMP-safe) + // NOTE: TAS is available on the 68000, but unsupported by some Amiga + // memory controllers. +#else + __asm__ __volatile__("1: bset.b #7,%0\n\tjbne 1b" + : "+m"(_Atomicity_lock<0>::_S_atomicity_lock) + : /* none */ + : "cc"); +#endif + + __result = *__mem; + *__mem = __result + __val; + + _Atomicity_lock<0>::_S_atomicity_lock = 0; + + return __result; + } + +#endif /* TAS / BSET */ + + void + __attribute__ ((__unused__)) + __atomic_add(volatile _Atomic_word* __mem, int __val) throw () + { + // Careful: using add.l with a memory destination is not + // architecturally guaranteed to be atomic. + __exchange_and_add(__mem, __val); + } + +_GLIBCXX_END_NAMESPACE
m68k/atomicity.h Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: hppa/atomicity.h =================================================================== --- hppa/atomicity.h (nonexistent) +++ hppa/atomicity.h (revision 519) @@ -0,0 +1,91 @@ +// Low-level functions for atomic operations: PA-RISC version -*- C++ -*- + +// Copyright (C) 2002, 2004, 2005, 2009 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 3, 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. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +#include +#include + +_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) + + template + struct _Atomicity_lock + { + static volatile int _S_atomicity_lock; + }; + + template + volatile int + _Atomicity_lock<_Inst>::_S_atomicity_lock __attribute__ ((aligned (16))) = 1; + + // Because of the lack of weak support when using the hpux som + // linker, we explicitly instantiate the atomicity lock. + template volatile int _Atomicity_lock<0>::_S_atomicity_lock; + + int + __attribute__ ((__unused__)) + __exchange_and_add(volatile _Atomic_word* __mem, int __val) throw () + { + _Atomic_word result; + int tmp; + volatile int& lock = _Atomicity_lock<0>::_S_atomicity_lock; + + __asm__ __volatile__ ("ldcw 0(%1),%0\n\t" + "cmpib,<>,n 0,%0,.+20\n\t" + "ldw 0(%1),%0\n\t" + "cmpib,= 0,%0,.-4\n\t" + "nop\n\t" + "b,n .-20" + : "=&r" (tmp) + : "r" (&lock) + : "memory"); + + result = *__mem; + *__mem = result + __val; + __asm__ __volatile__ ("stw %1,0(%0)" + : : "r" (&lock), "r" (tmp) : "memory"); + return result; + } + + void + __attribute__ ((__unused__)) + __atomic_add(volatile _Atomic_word* __mem, int __val) throw () + { + int tmp; + volatile int& lock = _Atomicity_lock<0>::_S_atomicity_lock; + + __asm__ __volatile__ ("ldcw 0(%1),%0\n\t" + "cmpib,<>,n 0,%0,.+20\n\t" + "ldw 0(%1),%0\n\t" + "cmpib,= 0,%0,.-4\n\t" + "nop\n\t" + "b,n .-20" + : "=&r" (tmp) + : "r" (&lock) + : "memory"); + + *__mem += __val; + __asm__ __volatile__ ("stw %1,0(%0)" + : : "r" (&lock), "r" (tmp) : "memory"); + } + +_GLIBCXX_END_NAMESPACE
hppa/atomicity.h Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: sparc/atomicity.h =================================================================== --- sparc/atomicity.h (nonexistent) +++ sparc/atomicity.h (revision 519) @@ -0,0 +1,122 @@ +// Low-level functions for atomic operations: Sparc version -*- C++ -*- + +// Copyright (C) 1999, 2000, 2001, 2002, 2004, 2005, 2009 +// 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 3, 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. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +#include + +_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) + +#ifdef __arch64__ + _Atomic_word + __attribute__ ((__unused__)) + __exchange_and_add(volatile _Atomic_word* __mem, int __val) throw () + { + _Atomic_word __tmp1, __tmp2; + _Atomic_word __val_extended = __val; + + __asm__ __volatile__("1: ldx [%3], %0\n\t" + " add %0, %4, %1\n\t" + " casx [%3], %0, %1\n\t" + " sub %0, %1, %0\n\t" + " brnz,pn %0, 1b\n\t" + " nop" + : "=&r" (__tmp1), "=&r" (__tmp2), "=m" (*__mem) + : "r" (__mem), "r" (__val_extended), "m" (*__mem)); + return __tmp2; + } + + void + __attribute__ ((__unused__)) + __atomic_add(volatile _Atomic_word* __mem, int __val) throw () + { + _Atomic_word __tmp1, __tmp2; + _Atomic_word __val_extended = __val; + + __asm__ __volatile__("1: ldx [%3], %0\n\t" + " add %0, %4, %1\n\t" + " casx [%3], %0, %1\n\t" + " sub %0, %1, %0\n\t" + " brnz,pn %0, 1b\n\t" + " nop" + : "=&r" (__tmp1), "=&r" (__tmp2), "=m" (*__mem) + : "r" (__mem), "r" (__val_extended), "m" (*__mem)); + } + +#else /* __arch32__ */ + + template + struct _Atomicity_lock + { + static unsigned char _S_atomicity_lock; + }; + + template + unsigned char _Atomicity_lock<__inst>::_S_atomicity_lock = 0; + + template unsigned char _Atomicity_lock<0>::_S_atomicity_lock; + + _Atomic_word + __attribute__ ((__unused__)) + __exchange_and_add(volatile _Atomic_word* __mem, int __val) throw () + { + _Atomic_word __result, __tmp; + + __asm__ __volatile__("1: ldstub [%1], %0\n\t" + " cmp %0, 0\n\t" + " bne 1b\n\t" + " nop" + : "=&r" (__tmp) + : "r" (&_Atomicity_lock<0>::_S_atomicity_lock) + : "memory"); + __result = *__mem; + *__mem += __val; + __asm__ __volatile__("stb %%g0, [%0]" + : /* no outputs */ + : "r" (&_Atomicity_lock<0>::_S_atomicity_lock) + : "memory"); + return __result; + } + + void + __attribute__ ((__unused__)) + __atomic_add(volatile _Atomic_word* __mem, int __val) throw () + { + _Atomic_word __tmp; + + __asm__ __volatile__("1: ldstub [%1], %0\n\t" + " cmp %0, 0\n\t" + " bne 1b\n\t" + " nop" + : "=&r" (__tmp) + : "r" (&_Atomicity_lock<0>::_S_atomicity_lock) + : "memory"); + *__mem += __val; + __asm__ __volatile__("stb %%g0, [%0]" + : /* no outputs */ + : "r" (&_Atomicity_lock<0>::_S_atomicity_lock) + : "memory"); + } +#endif /* __arch32__ */ + +_GLIBCXX_END_NAMESPACE
sparc/atomicity.h Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: sparc/atomic_word.h =================================================================== --- sparc/atomic_word.h (nonexistent) +++ sparc/atomic_word.h (revision 519) @@ -0,0 +1,48 @@ +// Low-level type for atomic operations -*- C++ -*- + +// Copyright (C) 2004, 2009 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 3, 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. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +#ifndef _GLIBCXX_ATOMIC_WORD_H +#define _GLIBCXX_ATOMIC_WORD_H 1 + +#ifdef __arch64__ + typedef long _Atomic_word; +#else + typedef int _Atomic_word; +#endif + +#if defined(__sparc_v9__) +// These are necessary under the V9 RMO model, though it is almost never +// used in userspace. +#define _GLIBCXX_READ_MEM_BARRIER \ + __asm __volatile ("membar #LoadLoad":::"memory") +#define _GLIBCXX_WRITE_MEM_BARRIER \ + __asm __volatile ("membar #StoreStore":::"memory") + +#elif defined(__sparc_v8__) +// This is necessary under the PSO model. +#define _GLIBCXX_WRITE_MEM_BARRIER __asm __volatile ("stbar":::"memory") + +#endif + +#endif
sparc/atomic_word.h Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: i386/atomicity.h =================================================================== --- i386/atomicity.h (nonexistent) +++ i386/atomicity.h (revision 519) @@ -0,0 +1,70 @@ +// Low-level functions for atomic operations: x86, x >= 3 version -*- C++ -*- + +// Copyright (C) 2003, 2004, 2005, 2009 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 3, 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. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +#include + +_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) + + template + struct _Atomicity_lock + { + static volatile _Atomic_word _S_atomicity_lock; + }; + + template + volatile _Atomic_word _Atomicity_lock<__inst>::_S_atomicity_lock = 0; + + template volatile _Atomic_word _Atomicity_lock<0>::_S_atomicity_lock; + + _Atomic_word + __attribute__ ((__unused__)) + __exchange_and_add(volatile _Atomic_word* __mem, int __val) throw () + { + register _Atomic_word __result, __tmp = 1; + + // Obtain the atomic exchange/add spin lock. + do + { + __asm__ __volatile__ ("xchg{l} {%0,%1|%1,%0}" + : "=m" (_Atomicity_lock<0>::_S_atomicity_lock), + "+r" (__tmp) + : "m" (_Atomicity_lock<0>::_S_atomicity_lock)); + } + while (__tmp); + + __result = *__mem; + *__mem += __val; + + // Release spin lock. + _Atomicity_lock<0>::_S_atomicity_lock = 0; + + return __result; + } + + void + __attribute__ ((__unused__)) + __atomic_add(volatile _Atomic_word* __mem, int __val) throw () + { __exchange_and_add(__mem, __val); } + +_GLIBCXX_END_NAMESPACE
i386/atomicity.h Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: i486/atomicity.h =================================================================== --- i486/atomicity.h (nonexistent) +++ i486/atomicity.h (revision 519) @@ -0,0 +1,49 @@ +// Low-level functions for atomic operations: x86, x >= 4 version -*- C++ -*- + +// Copyright (C) 1999, 2000, 2001, 2004, 2005, 2009 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 3, 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. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +#include + +_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) + + _Atomic_word + __attribute__ ((__unused__)) + __exchange_and_add(volatile _Atomic_word* __mem, int __val) throw () + { + register _Atomic_word __result; + __asm__ __volatile__ ("lock; xadd{l} {%0,%1|%1,%0}" + : "=r" (__result), "=m" (*__mem) + : "0" (__val), "m" (*__mem)); + return __result; + } + + void + __attribute__ ((__unused__)) + __atomic_add(volatile _Atomic_word* __mem, int __val) throw () + { + __asm__ __volatile__ ("lock; add{l} {%1,%0|%0,%1}" + : "=m" (*__mem) : "ir" (__val), "m" (*__mem)); + } + +_GLIBCXX_END_NAMESPACE +
i486/atomicity.h Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: sh/atomicity.h =================================================================== --- sh/atomicity.h (nonexistent) +++ sh/atomicity.h (revision 519) @@ -0,0 +1,103 @@ +// Low-level functions for atomic operations: sh version -*- C++ -*- + +// 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 +// 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 3, 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. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +#ifdef __SH4A__ + +#include + +_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) + + typedef int _Atomic_word; + + _Atomic_word + __attribute__ ((__unused__)) + __exchange_and_add (volatile _Atomic_word* __mem, int __val) throw () + { + _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) throw () + { + 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__ */ + +/* This is generic/atomicity.h */ + +#include +#include + +namespace +{ + __gnu_cxx::__mutex atomic_mutex; +} // anonymous namespace + +_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) + + _Atomic_word + __attribute__ ((__unused__)) + __exchange_and_add(volatile _Atomic_word* __mem, int __val) throw () + { + __gnu_cxx::__scoped_lock sentry(atomic_mutex); + _Atomic_word __result; + __result = *__mem; + *__mem += __val; + return __result; + } + + void + __attribute__ ((__unused__)) + __atomic_add(volatile _Atomic_word* __mem, int __val) throw () + { __exchange_and_add(__mem, __val); } + +_GLIBCXX_END_NAMESPACE + +#endif /* !__SH4A__ */
sh/atomicity.h Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: generic/cxxabi_tweaks.h =================================================================== --- generic/cxxabi_tweaks.h (nonexistent) +++ generic/cxxabi_tweaks.h (revision 519) @@ -0,0 +1,58 @@ +// Control various target specific ABI tweaks. Generic version. + +// Copyright (C) 2004, 2006, 2008, 2009 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 3, 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. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file cxxabi_tweaks.h + * The header provides an CPU-variable interface to the C++ ABI. + */ + +#ifndef _CXXABI_TWEAKS_H +#define _CXXABI_TWEAKS_H 1 + +#ifdef __cplusplus +namespace __cxxabiv1 +{ + extern "C" + { +#endif + + // The generic ABI uses the first byte of a 64-bit guard variable. +#define _GLIBCXX_GUARD_TEST(x) (*(char *) (x) != 0) +#define _GLIBCXX_GUARD_SET(x) *(char *) (x) = 1 +#define _GLIBCXX_GUARD_BIT __guard_test_bit (0, 1) +#define _GLIBCXX_GUARD_PENDING_BIT __guard_test_bit (1, 1) +#define _GLIBCXX_GUARD_WAITING_BIT __guard_test_bit (2, 1) + __extension__ typedef int __guard __attribute__((mode (__DI__))); + + // __cxa_vec_ctor has void return type. + typedef void __cxa_vec_ctor_return_type; +#define _GLIBCXX_CXA_VEC_CTOR_RETURN(x) return + // Constructors and destructors do not return a value. + typedef void __cxa_cdtor_return_type; + +#ifdef __cplusplus + } +} // namespace __cxxabiv1 +#endif + +#endif
generic/cxxabi_tweaks.h Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: generic/atomicity_mutex/atomicity.h =================================================================== --- generic/atomicity_mutex/atomicity.h (nonexistent) +++ generic/atomicity_mutex/atomicity.h (revision 519) @@ -0,0 +1,61 @@ +// Low-level functions for atomic operations: Generic version -*- C++ -*- + +// 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 +// 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 3, 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. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file ext/atomicity.h + * This file is a GNU extension to the Standard C++ Library. + */ + +#include +#include + +namespace +{ + __gnu_cxx::__mutex& + get_atomic_mutex() + { + static __gnu_cxx::__mutex atomic_mutex; + return atomic_mutex; + } +} // anonymous namespace + +_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) + + _Atomic_word + __attribute__ ((__unused__)) + __exchange_and_add(volatile _Atomic_word* __mem, int __val) throw () + { + __gnu_cxx::__scoped_lock sentry(get_atomic_mutex()); + _Atomic_word __result; + __result = *__mem; + *__mem += __val; + return __result; + } + + void + __attribute__ ((__unused__)) + __atomic_add(volatile _Atomic_word* __mem, int __val) throw () + { __exchange_and_add(__mem, __val); } + +_GLIBCXX_END_NAMESPACE
generic/atomicity_mutex/atomicity.h Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: generic/cpu_defines.h =================================================================== --- generic/cpu_defines.h (nonexistent) +++ generic/cpu_defines.h (revision 519) @@ -0,0 +1,33 @@ +// Specific definitions for generic platforms -*- C++ -*- + +// Copyright (C) 2005, 2009 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 3, 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. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file cpu_defines.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. + */ + +#ifndef _GLIBCXX_CPU_DEFINES +#define _GLIBCXX_CPU_DEFINES 1 + +#endif
generic/cpu_defines.h Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: generic/atomicity_builtins/atomicity.h =================================================================== --- generic/atomicity_builtins/atomicity.h (nonexistent) +++ generic/atomicity_builtins/atomicity.h (revision 519) @@ -0,0 +1,45 @@ +// Low-level functions for atomic operations: version for CPUs providing +// atomic builtins -*- C++ -*- + +// Copyright (C) 2006, 2009 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 3, 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. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file ext/atomicity.h + * This file is a GNU extension to the Standard C++ Library. + */ + +#include +#include + +_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) + + _Atomic_word + __attribute__ ((__unused__)) + __exchange_and_add(volatile _Atomic_word* __mem, int __val) throw () + { return __sync_fetch_and_add(__mem, __val); } + + void + __attribute__ ((__unused__)) + __atomic_add(volatile _Atomic_word* __mem, int __val) throw () + { __sync_fetch_and_add(__mem, __val); } + +_GLIBCXX_END_NAMESPACE
generic/atomicity_builtins/atomicity.h Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: generic/atomic_word.h =================================================================== --- generic/atomic_word.h (nonexistent) +++ generic/atomic_word.h (revision 519) @@ -0,0 +1,47 @@ +// Low-level type for atomic operations -*- C++ -*- + +// Copyright (C) 2004, 2009 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 3, 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. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file atomic_word.h + * This file is a GNU extension to the Standard C++ Library. + */ + +#ifndef _GLIBCXX_ATOMIC_WORD_H +#define _GLIBCXX_ATOMIC_WORD_H 1 + +typedef int _Atomic_word; + +// Define these two macros using the appropriate memory barrier for the target. +// The commented out versions below are the defaults. +// See ia64/atomic_word.h for an alternative approach. + +// This one prevents loads from being hoisted across the barrier; +// in other words, this is a Load-Load acquire barrier. +// This is necessary iff TARGET_RELAXED_ORDERING is defined in tm.h. +// #define _GLIBCXX_READ_MEM_BARRIER __asm __volatile ("":::"memory") + +// This one prevents stores from being sunk across the barrier; in other +// words, a Store-Store release barrier. +// #define _GLIBCXX_WRITE_MEM_BARRIER __asm __volatile ("":::"memory") + +#endif
generic/atomic_word.h Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.