Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:33:57

0001 /*
0002  * Distributed under the Boost Software License, Version 1.0.
0003  * (See accompanying file LICENSE_1_0.txt or copy at
0004  * http://www.boost.org/LICENSE_1_0.txt)
0005  *
0006  * Copyright (c) 2009 Helge Bahmann
0007  * Copyright (c) 2013 Tim Blechmann
0008  * Copyright (c) 2014 Andrey Semashev
0009  */
0010 /*!
0011  * \file   atomic/detail/ops_gcc_arm_common.hpp
0012  *
0013  * This header contains basic utilities for gcc ARM backend.
0014  */
0015 
0016 #ifndef BOOST_ATOMIC_DETAIL_OPS_GCC_ARM_COMMON_HPP_INCLUDED_
0017 #define BOOST_ATOMIC_DETAIL_OPS_GCC_ARM_COMMON_HPP_INCLUDED_
0018 
0019 #include <boost/cstdint.hpp>
0020 #include <boost/memory_order.hpp>
0021 #include <boost/atomic/detail/config.hpp>
0022 #include <boost/atomic/detail/fence_arch_operations.hpp>
0023 #include <boost/atomic/detail/header.hpp>
0024 
0025 #ifdef BOOST_HAS_PRAGMA_ONCE
0026 #pragma once
0027 #endif
0028 
0029 namespace boost {
0030 namespace atomics {
0031 namespace detail {
0032 
0033 struct core_arch_operations_gcc_arm_base
0034 {
0035     static BOOST_CONSTEXPR_OR_CONST bool full_cas_based = false;
0036     static BOOST_CONSTEXPR_OR_CONST bool is_always_lock_free = true;
0037 
0038     static BOOST_FORCEINLINE void fence_before(memory_order order) BOOST_NOEXCEPT
0039     {
0040         if ((static_cast< unsigned int >(order) & static_cast< unsigned int >(memory_order_release)) != 0u)
0041             fence_arch_operations::hardware_full_fence();
0042     }
0043 
0044     static BOOST_FORCEINLINE void fence_after(memory_order order) BOOST_NOEXCEPT
0045     {
0046         if ((static_cast< unsigned int >(order) & (static_cast< unsigned int >(memory_order_consume) | static_cast< unsigned int >(memory_order_acquire))) != 0u)
0047             fence_arch_operations::hardware_full_fence();
0048     }
0049 
0050     static BOOST_FORCEINLINE void fence_after_store(memory_order order) BOOST_NOEXCEPT
0051     {
0052         if (order == memory_order_seq_cst)
0053             fence_arch_operations::hardware_full_fence();
0054     }
0055 };
0056 
0057 } // namespace detail
0058 } // namespace atomics
0059 } // namespace boost
0060 
0061 #include <boost/atomic/detail/footer.hpp>
0062 
0063 #endif // BOOST_ATOMIC_DETAIL_OPS_GCC_ARM_COMMON_HPP_INCLUDED_