update boost on linux

This commit is contained in:
Bassem Girgis
2019-08-10 16:06:25 -05:00
parent 76ad52be58
commit 861b918727
5363 changed files with 483306 additions and 116507 deletions

View File

@@ -37,13 +37,13 @@ template< typename Fn, typename Tpl, std::size_t ... I >
auto
apply_impl( Fn && fn, Tpl && tpl, index_sequence< I ... >)
#if defined(BOOST_NO_CXX17_STD_INVOKE)
-> decltype( invoke( std::forward< Fn >( fn), std::get< I >( std::forward< Tpl >( tpl) ) ... ) )
-> decltype( boost::context::detail::invoke( std::forward< Fn >( fn), std::get< I >( std::forward< Tpl >( tpl) ) ... ) )
#else
-> decltype( std::invoke( std::forward< Fn >( fn), std::get< I >( std::forward< Tpl >( tpl) ) ... ) )
#endif
{
#if defined(BOOST_NO_CXX17_STD_INVOKE)
return invoke( std::forward< Fn >( fn), std::get< I >( std::forward< Tpl >( tpl) ) ... );
return boost::context::detail::invoke( std::forward< Fn >( fn), std::get< I >( std::forward< Tpl >( tpl) ) ... );
#else
return std::invoke( std::forward< Fn >( fn), std::get< I >( std::forward< Tpl >( tpl) ) ... );
#endif

View File

@@ -104,4 +104,24 @@
# endif
#endif
#if ! defined(BOOST_NO_CXX11_CONSTEXPR)
// modern architectures have cachelines with 64byte length
// ARM Cortex-A15 32/64byte, Cortex-A9 16/32/64bytes
// MIPS 74K: 32byte, 4KEc: 16byte
// ist should be safe to use 64byte for all
static constexpr std::size_t cache_alignment{ 64 };
static constexpr std::size_t cacheline_length{ 64 };
// lookahead size for prefetching
static constexpr std::size_t prefetch_stride{ 4 * cacheline_length };
#endif
#if defined(__GLIBCPP__) || defined(__GLIBCXX__)
// GNU libstdc++ 3
# define BOOST_CONTEXT_HAS_CXXABI_H
#endif
#if defined( BOOST_CONTEXT_HAS_CXXABI_H )
# include <cxxabi.h>
#endif
#endif // BOOST_CONTEXT_DETAIL_CONFIG_H

View File

@@ -7,6 +7,7 @@
#ifndef BOOST_CONTEXT_DETAIL_EXCEPTION_H
#define BOOST_CONTEXT_DETAIL_EXCEPTION_H
#include <boost/assert.hpp>
#include <boost/config.hpp>
#include <boost/context/detail/fcontext.hpp>
@@ -20,11 +21,22 @@ namespace context {
namespace detail {
struct forced_unwind {
fcontext_t fctx;
fcontext_t fctx{ nullptr };
#ifndef BOOST_ASSERT_IS_VOID
bool caught{ false };
#endif
forced_unwind() = default;
forced_unwind( fcontext_t fctx_) :
fctx( fctx_) {
}
#ifndef BOOST_ASSERT_IS_VOID
~forced_unwind() {
BOOST_ASSERT( caught);
}
#endif
};
}}}

View File

@@ -0,0 +1,23 @@
// Copyright Oliver Kowalke 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#include <boost/config.hpp>
#include <boost/context/detail/config.hpp>
#if defined(BOOST_USE_ASAN)
extern "C" {
void __sanitizer_start_switch_fiber( void **, const void *, size_t);
void __sanitizer_finish_switch_fiber( void *, const void **, size_t *);
}
#endif
#if defined(BOOST_USE_SEGMENTED_STACKS)
extern "C" {
void __splitstack_getcontext( void * [BOOST_CONTEXT_SEGMENTS]);
void __splitstack_setcontext( void * [BOOST_CONTEXT_SEGMENTS]);
}
#endif

View File

@@ -1,68 +0,0 @@
// Copyright Oliver Kowalke 2009.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_CONTEXT_DETAIL_FCONTEXT_ARM_H
#define BOOST_CONTEXT_DETAIL_FCONTEXT_ARM_H
#include <cstddef>
#include <boost/config.hpp>
#include <boost/cstdint.hpp>
#include <boost/context/detail/config.hpp>
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
#endif
namespace boost {
namespace context {
extern "C" {
#define BOOST_CONTEXT_CALLDECL
struct stack_t
{
void * sp;
std::size_t size;
stack_t() :
sp( 0), size( 0)
{}
};
struct fp_t
{
boost::uint32_t fc_freg[16];
fp_t() :
fc_freg()
{}
};
struct fcontext_t
{
boost::uint32_t fc_greg[11];
stack_t fc_stack;
fp_t fc_fp;
fcontext_t() :
fc_greg(),
fc_stack(),
fc_fp()
{}
};
}
}}
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_SUFFIX
#endif
#endif // BOOST_CONTEXT_DETAIL_FCONTEXT_ARM_H

View File

@@ -1,70 +0,0 @@
// Copyright Oliver Kowalke 2009.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_CONTEXT_DETAIL_FCONTEXT_ARM_MAC_H
#define BOOST_CONTEXT_DETAIL_FCONTEXT_ARM_MAC_H
#include <cstddef>
#include <boost/config.hpp>
#include <boost/cstdint.hpp>
#include <boost/context/detail/config.hpp>
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
#endif
namespace boost {
namespace context {
extern "C" {
#define BOOST_CONTEXT_CALLDECL
struct stack_t
{
void * sp;
std::size_t size;
stack_t() :
sp( 0), size( 0)
{}
};
struct fp_t
{
boost::uint32_t fc_freg[16];
fp_t() :
fc_freg()
{}
};
struct fcontext_t
{
boost::uint32_t fc_greg[11];
stack_t fc_stack;
fp_t fc_fp;
void * fc_unwind_sjlj;
fcontext_t() :
fc_greg(),
fc_stack(),
fc_fp(),
fc_unwind_sjlj( 0)
{}
};
}
}}
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_SUFFIX
#endif
#endif // BOOST_CONTEXT_DETAIL_FCONTEXT_ARM_MAC_H

View File

@@ -1,71 +0,0 @@
// Copyright Oliver Kowalke 2009.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_CONTEXT_DETAIL_FCONTEXT_ARM_WIN_H
#define BOOST_CONTEXT_DETAIL_FCONTEXT_ARM_WIN_H
#include <cstddef>
#include <boost/config.hpp>
#include <boost/cstdint.hpp>
#include <boost/context/detail/config.hpp>
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
#endif
namespace boost {
namespace context {
extern "C" {
#define BOOST_CONTEXT_CALLDECL
struct stack_t
{
void * sp;
std::size_t size;
void * limit;
stack_t() :
sp( 0), size( 0), limit( 0)
{}
};
struct fp_t
{
boost::uint32_t fc_freg[16];
fp_t() :
fc_freg()
{}
};
struct fcontext_t
{
boost::uint32_t fc_greg[11];
stack_t fc_stack;
fp_t fc_fp;
boost::uint32_t fc_dealloc;
fcontext_t() :
fc_greg(),
fc_stack(),
fc_fp(),
fc_dealloc( 0)
{}
};
}
}}
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_SUFFIX
#endif
#endif // BOOST_CONTEXT_DETAIL_FCONTEXT_ARM_WIN_H

View File

@@ -1,59 +0,0 @@
// Copyright Oliver Kowalke 2009.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_CONTEXT_DETAIL_FCONTEXT_I386H
#define BOOST_CONTEXT_DETAIL_FCONTEXT_I386H
#include <cstddef>
#include <boost/config.hpp>
#include <boost/cstdint.hpp>
#include <boost/context/detail/config.hpp>
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
#endif
namespace boost {
namespace context {
extern "C" {
#define BOOST_CONTEXT_CALLDECL __attribute__((cdecl))
struct stack_t
{
void * sp;
std::size_t size;
stack_t() :
sp( 0), size( 0)
{}
};
struct fcontext_t
{
boost::uint32_t fc_greg[6];
stack_t fc_stack;
boost::uint32_t fc_freg[2];
fcontext_t() :
fc_greg(),
fc_stack(),
fc_freg()
{}
};
}
}}
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_SUFFIX
#endif
#endif // BOOST_CONTEXT_DETAIL_FCONTEXT_I386_H

View File

@@ -1,88 +0,0 @@
// Copyright Oliver Kowalke 2009.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_CONTEXT_DETAIL_FCONTEXT_I386H
#define BOOST_CONTEXT_DETAIL_FCONTEXT_I386H
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#include <cstddef>
#include <boost/config.hpp>
#include <boost/cstdint.hpp>
#include <boost/context/detail/config.hpp>
#if defined(BOOST_MSVC)
#pragma warning(push)
#pragma warning(disable:4351)
#endif
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
#endif
namespace boost {
namespace context {
extern "C" {
#define BOOST_CONTEXT_CALLDECL __cdecl
struct stack_t
{
void * sp;
std::size_t size;
void * limit;
stack_t() :
sp( 0), size( 0), limit( 0)
{}
};
struct fp_t
{
boost::uint32_t fc_freg[2];
fp_t() :
fc_freg()
{}
};
struct fcontext_t
{
boost::uint32_t fc_greg[6];
stack_t fc_stack;
void * fc_excpt_lst;
void * fc_local_storage;
fp_t fc_fp;
boost::uint32_t fc_dealloc;
fcontext_t() :
fc_greg(),
fc_stack(),
fc_excpt_lst( 0),
fc_local_storage( 0),
fc_fp(),
fc_dealloc( 0)
{}
};
}
}}
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_SUFFIX
#endif
#if defined(BOOST_MSVC)
#pragma warning(pop)
#endif
#endif // BOOST_CONTEXT_DETAIL_FCONTEXT_I386_H

View File

@@ -1,70 +0,0 @@
// Copyright Oliver Kowalke 2009.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_CONTEXT_DETAIL_FCONTEXT_MIPS_H
#define BOOST_CONTEXT_DETAIL_FCONTEXT_MIPS_H
#include <cstddef>
#include <boost/config.hpp>
#include <boost/cstdint.hpp>
#include <boost/context/detail/config.hpp>
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
#endif
namespace boost {
namespace context {
extern "C" {
#define BOOST_CONTEXT_CALLDECL
// on MIPS we assume 64bit regsiters - even for 32bit ABIs
struct stack_t
{
void * sp;
std::size_t size;
stack_t() :
sp( 0), size( 0)
{}
};
struct fp_t
{
boost::uint64_t fc_freg[6];
fp_t() :
fc_freg()
{}
};
struct fcontext_t
{
boost::uint32_t fc_greg[12];
stack_t fc_stack;
fp_t fc_fp;
fcontext_t() :
fc_greg(),
fc_stack(),
fc_fp()
{}
};
}
}}
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_SUFFIX
#endif
#endif // BOOST_CONTEXT_DETAIL_FCONTEXT_MIPS_H

View File

@@ -1,72 +0,0 @@
// Copyright Oliver Kowalke 2009.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_CONTEXT_DETAIL_FCONTEXT_PPC_H
#define BOOST_CONTEXT_DETAIL_FCONTEXT_PPC_H
#include <cstddef>
#include <boost/config.hpp>
#include <boost/cstdint.hpp>
#include <boost/context/detail/config.hpp>
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
#endif
namespace boost {
namespace context {
extern "C" {
#define BOOST_CONTEXT_CALLDECL
struct stack_t
{
void * sp;
std::size_t size;
stack_t() :
sp( 0), size( 0)
{}
};
struct fp_t
{
boost::uint64_t fc_freg[19];
fp_t() :
fc_freg()
{}
};
struct fcontext_t
{
# if defined(__powerpc64__)
boost::uint64_t fc_greg[23];
# else
boost::uint32_t fc_greg[23];
# endif
stack_t fc_stack;
fp_t fc_fp;
fcontext_t() :
fc_greg(),
fc_stack(),
fc_fp()
{}
};
}
}}
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_SUFFIX
#endif
#endif // BOOST_CONTEXT_DETAIL_FCONTEXT_PPC_H

View File

@@ -1,90 +0,0 @@
// Copyright Martin Husemann 2012
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_CTX_DETAIL_FCONTEXT_SPARC_H
#define BOOST_CTX_DETAIL_FCONTEXT_SPARC_H
#include <cstddef>
#include <boost/config.hpp>
#include <boost/cstdint.hpp>
#include <boost/context/detail/config.hpp>
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
#endif
namespace boost {
namespace context {
extern "C" {
#define BOOST_CONTEXT_CALLDECL
// if defined(_LP64) we are compiling for sparc64, otherwise it is 32 bit
// sparc.
struct stack_t
{
void * sp;
std::size_t size;
stack_t() :
sp( 0), size( 0)
{}
};
struct fp_t
{
#ifdef _LP64
boost::uint64_t fp_freg[32];
boost::uint64_t fp_fprs, fp_fsr;
#else
boost::uint64_t fp_freg[16];
boost::uint32_t fp_fsr;
#endif
fp_t() :
fp_freg(),
#ifdef _LP64
fp_fprs(),
#endif
fp_fsr()
{}
}
#ifdef _LP64
__attribute__((__aligned__(64))) // allow VIS instructions to be used
#endif
;
struct fcontext_t
{
fp_t fc_fp; // fpu stuff first, for easier alignement
#ifdef _LP64
boost::uint64_t
#else
boost::uint32_t
#endif
fc_greg[8];
stack_t fc_stack;
fcontext_t() :
fc_fp(),
fc_greg(),
fc_stack()
{}
};
}
}}
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_SUFFIX
#endif
#endif // BOOST_CTX_DETAIL_FCONTEXT_SPARC_H

View File

@@ -1,68 +0,0 @@
// Copyright Oliver Kowalke 2009.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_CONTEXT_DETAIL_FCONTEXT_X86_64_H
#define BOOST_CONTEXT_DETAIL_FCONTEXT_X86_64_H
#include <cstddef>
#include <boost/config.hpp>
#include <boost/cstdint.hpp>
#include <boost/context/detail/config.hpp>
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
#endif
namespace boost {
namespace context {
extern "C" {
#define BOOST_CONTEXT_CALLDECL
struct stack_t
{
void * sp;
std::size_t size;
stack_t() :
sp( 0), size( 0)
{}
};
struct fp_t
{
boost::uint32_t fc_freg[2];
fp_t() :
fc_freg()
{}
};
struct fcontext_t
{
boost::uint64_t fc_greg[8];
stack_t fc_stack;
fp_t fc_fp;
fcontext_t() :
fc_greg(),
fc_stack(),
fc_fp()
{}
};
}
}}
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_SUFFIX
#endif
#endif // BOOST_CONTEXT_DETAIL_FCONTEXT_X86_64_H

View File

@@ -1,77 +0,0 @@
// Copyright Oliver Kowalke 2009.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_CONTEXT_DETAIL_FCONTEXT_X86_64_H
#define BOOST_CONTEXT_DETAIL_FCONTEXT_X86_64_H
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#include <cstddef>
#include <boost/config.hpp>
#include <boost/cstdint.hpp>
#include <boost/context/detail/config.hpp>
#if defined(BOOST_MSVC)
#pragma warning(push)
#pragma warning(disable:4351)
#endif
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
#endif
namespace boost {
namespace context {
extern "C" {
#define BOOST_CONTEXT_CALLDECL
struct stack_t
{
void * sp;
std::size_t size;
void * limit;
stack_t() :
sp( 0), size( 0), limit( 0)
{}
};
struct fcontext_t
{
boost::uint64_t fc_greg[10];
stack_t fc_stack;
void * fc_local_storage;
boost::uint64_t fc_fp[24];
boost::uint64_t fc_dealloc;
fcontext_t() :
fc_greg(),
fc_stack(),
fc_local_storage( 0),
fc_fp(),
fc_dealloc()
{}
};
}
}}
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_SUFFIX
#endif
#if defined(BOOST_MSVC)
#pragma warning(pop)
#endif
#endif // BOOST_CONTEXT_DETAIL_FCONTEXT_X86_64_H

View File

@@ -0,0 +1,78 @@
// Copyright Oliver Kowalke 2017.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_CONTEXT_DETAIL_PREFETCH_H
#define BOOST_CONTEXT_DETAIL_PREFETCH_H
#include <cstddef>
#include <cstdint>
#include <boost/config.hpp>
#include <boost/predef.h>
#include <boost/context/detail/config.hpp>
#if BOOST_COMP_INTEL || BOOST_COMP_INTEL_EMULATED
#include <immintrin.h>
#endif
#if BOOST_COMP_MSVC
#include <mmintrin.h>
#endif
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
#endif
namespace boost {
namespace context {
namespace detail {
#if BOOST_COMP_GNUC || BOOST_COMP_CLANG
#define BOOST_HAS_PREFETCH 1
BOOST_FORCEINLINE
void prefetch( void * addr) {
// L1 cache : hint == 1
__builtin_prefetch( addr, 1, 1);
}
#elif BOOST_COMP_INTEL || BOOST_COMP_INTEL_EMULATED
#define BOOST_HAS_PREFETCH 1
BOOST_FORCEINLINE
void prefetch( void * addr) {
// L1 cache : hint == _MM_HINT_T0
_mm_prefetch( (const char *)addr, _MM_HINT_T0);
}
#elif BOOST_COMP_MSVC
#define BOOST_HAS_PREFETCH 1
BOOST_FORCEINLINE
void prefetch( void * addr) {
// L1 cache : hint == _MM_HINT_T0
_mm_prefetch( (const char *)addr, _MM_HINT_T0);
}
#endif
inline
void prefetch_range( void * addr, std::size_t len) {
#if defined(BOOST_HAS_PREFETCH)
void * vp = addr;
void * end = reinterpret_cast< void * >(
reinterpret_cast< uintptr_t >( addr) + static_cast< uintptr_t >( len) );
while ( vp < end) {
prefetch( vp);
vp = reinterpret_cast< void * >(
reinterpret_cast< uintptr_t >( vp) + static_cast< uintptr_t >( prefetch_stride) );
}
#endif
}
#undef BOOST_HAS_PREFETCH
}}}
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_SUFFIX
#endif
#endif // BOOST_CONTEXT_DETAIL_PREFETCH_H