Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r77315 - trunk/boost/smart_ptr/detail
From: pdimov_at_[hidden]
Date: 2012-03-12 13:31:22


Author: pdimov
Date: 2012-03-12 13:31:21 EDT (Mon, 12 Mar 2012)
New Revision: 77315
URL: http://svn.boost.org/trac/boost/changeset/77315

Log:
Apply patch from #5331. Refs #5331.
Text files modified:
   trunk/boost/smart_ptr/detail/spinlock_gcc_arm.hpp | 29 +++++++++++++++++++++++++++--
   1 files changed, 27 insertions(+), 2 deletions(-)

Modified: trunk/boost/smart_ptr/detail/spinlock_gcc_arm.hpp
==============================================================================
--- trunk/boost/smart_ptr/detail/spinlock_gcc_arm.hpp (original)
+++ trunk/boost/smart_ptr/detail/spinlock_gcc_arm.hpp 2012-03-12 13:31:21 EDT (Mon, 12 Mar 2012)
@@ -43,13 +43,38 @@
     {
         int r;
 
+#if defined(__ARM_ARCH_6__) \
+ || defined(__ARM_ARCH_6J__) \
+ || defined(__ARM_ARCH_6K__) \
+ || defined(__ARM_ARCH_6Z__) \
+ || defined(__ARM_ARCH_6ZK__) \
+ || defined(__ARM_ARCH_6T2__) \
+ || defined(__ARM_ARCH_7__) \
+ || defined(__ARM_ARCH_7A__) \
+ || defined(__ARM_ARCH_7R__) \
+ || defined(__ARM_ARCH_7M__) \
+ || defined(__ARM_ARCH_7EM__)
+
+ __asm__ __volatile__(
+ "ldrex %0, [%2]; \n"
+ "cmp %0, %1; \n"
+ "strexne %0, %1, [%2]; \n"
+ BOOST_SP_ARM_BARRIER :
+ "=&r"( r ): // outputs
+ "r"( 1 ), "r"( &v_ ): // inputs
+ "memory", "cc" );
+
+#else
+
         __asm__ __volatile__(
- "swp %0, %1, [%2]\n\t"
- BOOST_SP_ARM_BARRIER :
+ "swp %0, %1, [%2];\n"
+ BOOST_SP_ARM_BARRIER :
             "=&r"( r ): // outputs
             "r"( 1 ), "r"( &v_ ): // inputs
             "memory", "cc" );
 
+#endif
+
         return r == 0;
     }
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk