Chris@102: /* Chris@102: * Distributed under the Boost Software License, Version 1.0. Chris@102: * (See accompanying file LICENSE_1_0.txt or copy at Chris@102: * http://www.boost.org/LICENSE_1_0.txt) Chris@102: * Chris@102: * Copyright (c) 2009 Helge Bahmann Chris@102: * Copyright (c) 2009 Phil Endecott Chris@102: * Copyright (c) 2013 Tim Blechmann Chris@102: * ARM Code by Phil Endecott, based on other architectures. Chris@102: * Copyright (c) 2014 Andrey Semashev Chris@102: */ Chris@102: /*! Chris@102: * \file atomic/detail/caps_gcc_arm.hpp Chris@102: * Chris@102: * This header defines feature capabilities macros Chris@102: */ Chris@102: Chris@102: #ifndef BOOST_ATOMIC_DETAIL_CAPS_GCC_ARM_HPP_INCLUDED_ Chris@102: #define BOOST_ATOMIC_DETAIL_CAPS_GCC_ARM_HPP_INCLUDED_ Chris@102: Chris@102: #include Chris@102: Chris@102: #ifdef BOOST_HAS_PRAGMA_ONCE Chris@102: #pragma once Chris@102: #endif Chris@102: Chris@102: #if !(defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6ZK__)) Chris@102: // ARMv7 and later have dmb instruction Chris@102: #define BOOST_ATOMIC_DETAIL_ARM_HAS_DMB 1 Chris@102: #endif Chris@102: Chris@102: #if !(defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6Z__)) Chris@102: // ARMv6k and ARMv7 have 8 and 16 ldrex/strex variants Chris@102: #define BOOST_ATOMIC_DETAIL_ARM_HAS_LDREXB_STREXB 1 Chris@102: #define BOOST_ATOMIC_DETAIL_ARM_HAS_LDREXH_STREXH 1 Chris@102: #if !(((defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6ZK__)) && defined(__thumb__)) || defined(__ARM_ARCH_7M__)) Chris@102: // ARMv6k and ARMv7 except ARMv7-M have 64-bit ldrex/strex variants. Chris@102: // Unfortunately, GCC (at least 4.7.3 on Ubuntu) does not allocate register pairs properly when targeting ARMv6k Thumb, Chris@102: // which is required for ldrexd/strexd instructions, so we disable 64-bit support. When targeting ARMv6k ARM Chris@102: // or ARMv7 (both ARM and Thumb 2) it works as expected. Chris@102: #define BOOST_ATOMIC_DETAIL_ARM_HAS_LDREXD_STREXD 1 Chris@102: #endif Chris@102: #endif Chris@102: Chris@102: #define BOOST_ATOMIC_INT8_LOCK_FREE 2 Chris@102: #define BOOST_ATOMIC_INT16_LOCK_FREE 2 Chris@102: #define BOOST_ATOMIC_INT32_LOCK_FREE 2 Chris@102: #if defined(BOOST_ATOMIC_DETAIL_ARM_HAS_LDREXD_STREXD) Chris@102: #define BOOST_ATOMIC_INT64_LOCK_FREE 2 Chris@102: #endif Chris@102: #define BOOST_ATOMIC_POINTER_LOCK_FREE 2 Chris@102: Chris@102: #define BOOST_ATOMIC_THREAD_FENCE 2 Chris@102: #define BOOST_ATOMIC_SIGNAL_FENCE 2 Chris@102: Chris@102: #endif // BOOST_ATOMIC_DETAIL_CAPS_GCC_ARM_HPP_INCLUDED_