atomicity.h: Put the SH4A specific functions in the __gnu_cxx namespace.
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". From-SVN: r145613
This commit is contained in:
parent
d26014d24e
commit
8f2b104d09
|
@ -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>
|
2009-04-06 Paolo Carlini <paolo.carlini@oracle.com>
|
||||||
|
|
||||||
* include/bits/random.tcc (linear_congruential_engine<>::
|
* include/bits/random.tcc (linear_congruential_engine<>::
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Low-level functions for atomic operations: sh version -*- C++ -*-
|
// 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.
|
// Free Software Foundation, Inc.
|
||||||
//
|
//
|
||||||
// This file is part of the GNU ISO C++ Library. This library is free
|
// This file is part of the GNU ISO C++ Library. This library is free
|
||||||
|
@ -30,15 +30,16 @@
|
||||||
|
|
||||||
#ifdef __SH4A__
|
#ifdef __SH4A__
|
||||||
|
|
||||||
#ifndef _GLIBCXX_ATOMICITY_H
|
#include <ext/atomicity.h>
|
||||||
#define _GLIBCXX_ATOMICITY_H 1
|
|
||||||
|
|
||||||
typedef int _Atomic_word;
|
_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
|
||||||
|
|
||||||
static inline _Atomic_word
|
typedef int _Atomic_word;
|
||||||
__attribute__ ((__unused__))
|
|
||||||
__exchange_and_add (volatile _Atomic_word* __mem, int __val)
|
_Atomic_word
|
||||||
{
|
__attribute__ ((__unused__))
|
||||||
|
__exchange_and_add (volatile _Atomic_word* __mem, int __val)
|
||||||
|
{
|
||||||
_Atomic_word __result;
|
_Atomic_word __result;
|
||||||
|
|
||||||
__asm__ __volatile__
|
__asm__ __volatile__
|
||||||
|
@ -53,13 +54,13 @@ __exchange_and_add (volatile _Atomic_word* __mem, int __val)
|
||||||
: "r0");
|
: "r0");
|
||||||
|
|
||||||
return __result;
|
return __result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline void
|
void
|
||||||
__attribute__ ((__unused__))
|
__attribute__ ((__unused__))
|
||||||
__atomic_add (volatile _Atomic_word* __mem, int __val)
|
__atomic_add (volatile _Atomic_word* __mem, int __val)
|
||||||
{
|
{
|
||||||
asm("0:\n"
|
asm("0:\n"
|
||||||
"\tmovli.l\t@%1,r0\n"
|
"\tmovli.l\t@%1,r0\n"
|
||||||
"\tadd\t%2,r0\n"
|
"\tadd\t%2,r0\n"
|
||||||
|
@ -68,9 +69,9 @@ __atomic_add (volatile _Atomic_word* __mem, int __val)
|
||||||
: "+m" (*__mem)
|
: "+m" (*__mem)
|
||||||
: "r" (__mem), "rI08" (__val)
|
: "r" (__mem), "rI08" (__val)
|
||||||
: "r0");
|
: "r0");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
#else /* !__SH4A__ */
|
#else /* !__SH4A__ */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue