summaryrefslogtreecommitdiffstats
path: root/contrib/libstdc++/config/cpu/i486/atomicity.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libstdc++/config/cpu/i486/atomicity.h')
-rw-r--r--contrib/libstdc++/config/cpu/i486/atomicity.h48
1 files changed, 22 insertions, 26 deletions
diff --git a/contrib/libstdc++/config/cpu/i486/atomicity.h b/contrib/libstdc++/config/cpu/i486/atomicity.h
index 7c65fab..5700bf3 100644
--- a/contrib/libstdc++/config/cpu/i486/atomicity.h
+++ b/contrib/libstdc++/config/cpu/i486/atomicity.h
@@ -1,6 +1,6 @@
// Low-level functions for atomic operations: x86, x >= 4 version -*- C++ -*-
-// Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+// Copyright (C) 1999, 2000, 2001, 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,31 +27,27 @@
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
-#ifndef _BITS_ATOMICITY_H
-#define _BITS_ATOMICITY_H 1
+#include <bits/atomicity.h>
-typedef int _Atomic_word;
-
-static inline _Atomic_word
-__attribute__ ((__unused__))
-__exchange_and_add (volatile _Atomic_word *__mem, int __val)
-{
- register _Atomic_word __result;
- __asm__ __volatile__ ("lock; xadd{l} {%0,%1|%1,%0}"
- : "=r" (__result), "+m" (*__mem)
- : "0" (__val)
- : "memory");
- return __result;
-}
-
-static inline void
-__attribute__ ((__unused__))
-__atomic_add (volatile _Atomic_word* __mem, int __val)
+namespace __gnu_cxx
{
- __asm__ __volatile__ ("lock; add{l} {%1,%0|%0,%1}"
- : "+m" (*__mem) : "ir" (__val) : "memory");
-}
-
-#endif /* atomicity.h */
-
+ _Atomic_word
+ __attribute__ ((__unused__))
+ __exchange_and_add(volatile _Atomic_word* __mem, int __val)
+ {
+ 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)
+ {
+ __asm__ __volatile__ ("lock; add{l} {%1,%0|%0,%1}"
+ : "=m" (*__mem) : "ir" (__val), "m" (*__mem));
+ }
+} // namespace __gnu_cxx
OpenPOWER on IntegriCloud