diff options
Diffstat (limited to 'tools/depends/target/boost/add-arm-mem-barrier.patch')
-rw-r--r-- | tools/depends/target/boost/add-arm-mem-barrier.patch | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/tools/depends/target/boost/add-arm-mem-barrier.patch b/tools/depends/target/boost/add-arm-mem-barrier.patch new file mode 100644 index 0000000000..86f8985ee2 --- /dev/null +++ b/tools/depends/target/boost/add-arm-mem-barrier.patch @@ -0,0 +1,73 @@ +From c87ad09331d239d6566e5eb409898ae38f04799a Mon Sep 17 00:00:00 2001 +From: Peter Dimov <pdimov@boostpro.com> +Date: Mon, 7 Nov 2011 17:50:31 +0000 +Subject: [PATCH] Add ARM memory barriers. Refs #5372. + +SVN-Revision: 75389 +--- + boost/smart_ptr/detail/spinlock_gcc_arm.hpp | 23 ++++++++++++++++++++--- + 1 file changed, 20 insertions(+), 3 deletions(-) + +diff --git a/boost/smart_ptr/detail/spinlock_gcc_arm.hpp b/boost/smart_ptr/detail/spinlock_gcc_arm.hpp +index ba6c511..f58ea44 100644 +--- a/boost/smart_ptr/detail/spinlock_gcc_arm.hpp ++++ b/boost/smart_ptr/detail/spinlock_gcc_arm.hpp +@@ -2,7 +2,7 @@ + #define BOOST_SMART_PTR_DETAIL_SPINLOCK_GCC_ARM_HPP_INCLUDED + + // +-// Copyright (c) 2008 Peter Dimov ++// Copyright (c) 2008, 2011 Peter Dimov + // + // Distributed under the Boost Software License, Version 1.0. + // See accompanying file LICENSE_1_0.txt or copy at +@@ -11,6 +11,20 @@ + + #include <boost/smart_ptr/detail/yield_k.hpp> + ++#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__) ++ ++# define BOOST_SP_ARM_BARRIER "dmb" ++ ++#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) ++ ++# define BOOST_SP_ARM_BARRIER "mcr p15, 0, r0, c7, c10, 5" ++ ++#else ++ ++# define BOOST_SP_ARM_BARRIER "" ++ ++#endif ++ + namespace boost + { + +@@ -30,7 +44,8 @@ class spinlock + int r; + + __asm__ __volatile__( +- "swp %0, %1, [%2]": ++ "swp %0, %1, [%2]\n\t" ++ BOOST_SP_ARM_BARRIER : + "=&r"( r ): // outputs + "r"( 1 ), "r"( &v_ ): // inputs + "memory", "cc" ); +@@ -48,7 +63,7 @@ class spinlock + + void unlock() + { +- __asm__ __volatile__( "" ::: "memory" ); ++ __asm__ __volatile__( BOOST_SP_ARM_BARRIER ::: "memory" ); + *const_cast< int volatile* >( &v_ ) = 0; + } + +@@ -82,4 +97,6 @@ class spinlock + + #define BOOST_DETAIL_SPINLOCK_INIT {0} + ++#undef BOOST_SP_ARM_BARRIER ++ + #endif // #ifndef BOOST_SMART_PTR_DETAIL_SPINLOCK_GCC_ARM_HPP_INCLUDED +-- +1.7.10 + |